polotno-node 2.12.19 → 2.12.21

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.
@@ -1,609 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var xh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function J8(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var D0={exports:{}},Er={};/**
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 Fm;function e7(){if(Fm)return Er;Fm=1;var e=Symbol.for("react.element"),t=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"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),v=Symbol.iterator;function p(D){return D===null||typeof D!="object"?null:(D=v&&D[v]||D["@@iterator"],typeof D=="function"?D:null)}var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,_={};function S(D,F,q){this.props=D,this.context=F,this.refs=_,this.updater=q||f}S.prototype.isReactComponent={},S.prototype.setState=function(D,F){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,F,"setState")},S.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function x(){}x.prototype=S.prototype;function m(D,F,q){this.props=D,this.context=F,this.refs=_,this.updater=q||f}var w=m.prototype=new x;w.constructor=m,b(w,S.prototype),w.isPureReactComponent=!0;var E=Array.isArray,P=Object.prototype.hasOwnProperty,R={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function N(D,F,q){var Q,re={},Y=null,ee=null;if(F!=null)for(Q in F.ref!==void 0&&(ee=F.ref),F.key!==void 0&&(Y=""+F.key),F)P.call(F,Q)&&!k.hasOwnProperty(Q)&&(re[Q]=F[Q]);var ae=arguments.length-2;if(ae===1)re.children=q;else if(1<ae){for(var ue=Array(ae),ce=0;ce<ae;ce++)ue[ce]=arguments[ce+2];re.children=ue}if(D&&D.defaultProps)for(Q in ae=D.defaultProps,ae)re[Q]===void 0&&(re[Q]=ae[Q]);return{$$typeof:e,type:D,key:Y,ref:ee,props:re,_owner:R.current}}function M(D,F){return{$$typeof:e,type:D.type,key:F,ref:D.ref,props:D.props,_owner:D._owner}}function T(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function C(D){var F={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(q){return F[q]})}var L=/\/+/g;function H(D,F){return typeof D=="object"&&D!==null&&D.key!=null?C(""+D.key):F.toString(36)}function G(D,F,q,Q,re){var Y=typeof D;(Y==="undefined"||Y==="boolean")&&(D=null);var ee=!1;if(D===null)ee=!0;else switch(Y){case"string":case"number":ee=!0;break;case"object":switch(D.$$typeof){case e:case t:ee=!0}}if(ee)return ee=D,re=re(ee),D=Q===""?"."+H(ee,0):Q,E(re)?(q="",D!=null&&(q=D.replace(L,"$&/")+"/"),G(re,F,q,"",function(ce){return ce})):re!=null&&(T(re)&&(re=M(re,q+(!re.key||ee&&ee.key===re.key?"":(""+re.key).replace(L,"$&/")+"/")+D)),F.push(re)),1;if(ee=0,Q=Q===""?".":Q+":",E(D))for(var ae=0;ae<D.length;ae++){Y=D[ae];var ue=Q+H(Y,ae);ee+=G(Y,F,q,ue,re)}else if(ue=p(D),typeof ue=="function")for(D=ue.call(D),ae=0;!(Y=D.next()).done;)Y=Y.value,ue=Q+H(Y,ae++),ee+=G(Y,F,q,ue,re);else if(Y==="object")throw F=String(D),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.");return ee}function J(D,F,q){if(D==null)return D;var Q=[],re=0;return G(D,Q,"","",function(Y){return F.call(q,Y,re++)}),Q}function se(D){if(D._status===-1){var F=D._result;F=F(),F.then(function(q){(D._status===0||D._status===-1)&&(D._status=1,D._result=q)},function(q){(D._status===0||D._status===-1)&&(D._status=2,D._result=q)}),D._status===-1&&(D._status=0,D._result=F)}if(D._status===1)return D._result.default;throw D._result}var U={current:null},V={transition:null},X={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:R};function z(){throw Error("act(...) is not supported in production builds of React.")}return Er.Children={map:J,forEach:function(D,F,q){J(D,function(){F.apply(this,arguments)},q)},count:function(D){var F=0;return J(D,function(){F++}),F},toArray:function(D){return J(D,function(F){return F})||[]},only:function(D){if(!T(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},Er.Component=S,Er.Fragment=r,Er.Profiler=i,Er.PureComponent=m,Er.StrictMode=n,Er.Suspense=u,Er.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X,Er.act=z,Er.cloneElement=function(D,F,q){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var Q=b({},D.props),re=D.key,Y=D.ref,ee=D._owner;if(F!=null){if(F.ref!==void 0&&(Y=F.ref,ee=R.current),F.key!==void 0&&(re=""+F.key),D.type&&D.type.defaultProps)var ae=D.type.defaultProps;for(ue in F)P.call(F,ue)&&!k.hasOwnProperty(ue)&&(Q[ue]=F[ue]===void 0&&ae!==void 0?ae[ue]:F[ue])}var ue=arguments.length-2;if(ue===1)Q.children=q;else if(1<ue){ae=Array(ue);for(var ce=0;ce<ue;ce++)ae[ce]=arguments[ce+2];Q.children=ae}return{$$typeof:e,type:D.type,key:re,ref:Y,props:Q,_owner:ee}},Er.createContext=function(D){return D={$$typeof:o,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:a,_context:D},D.Consumer=D},Er.createElement=N,Er.createFactory=function(D){var F=N.bind(null,D);return F.type=D,F},Er.createRef=function(){return{current:null}},Er.forwardRef=function(D){return{$$typeof:l,render:D}},Er.isValidElement=T,Er.lazy=function(D){return{$$typeof:h,_payload:{_status:-1,_result:D},_init:se}},Er.memo=function(D,F){return{$$typeof:d,type:D,compare:F===void 0?null:F}},Er.startTransition=function(D){var F=V.transition;V.transition={};try{D()}finally{V.transition=F}},Er.unstable_act=z,Er.useCallback=function(D,F){return U.current.useCallback(D,F)},Er.useContext=function(D){return U.current.useContext(D)},Er.useDebugValue=function(){},Er.useDeferredValue=function(D){return U.current.useDeferredValue(D)},Er.useEffect=function(D,F){return U.current.useEffect(D,F)},Er.useId=function(){return U.current.useId()},Er.useImperativeHandle=function(D,F,q){return U.current.useImperativeHandle(D,F,q)},Er.useInsertionEffect=function(D,F){return U.current.useInsertionEffect(D,F)},Er.useLayoutEffect=function(D,F){return U.current.useLayoutEffect(D,F)},Er.useMemo=function(D,F){return U.current.useMemo(D,F)},Er.useReducer=function(D,F,q){return U.current.useReducer(D,F,q)},Er.useRef=function(D){return U.current.useRef(D)},Er.useState=function(D){return U.current.useState(D)},Er.useSyncExternalStore=function(D,F,q){return U.current.useSyncExternalStore(D,F,q)},Er.useTransition=function(){return U.current.useTransition()},Er.version="18.3.1",Er}var Dm;function op(){return Dm||(Dm=1,D0.exports=e7()),D0.exports}var wi=op();const fe=dc(wi);var Vp={},B0={exports:{}},ms={},z0={exports:{}},q0={};/**
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 Bm;function t7(){return Bm||(Bm=1,function(e){function t(V,X){var z=V.length;V.push(X);e:for(;0<z;){var D=z-1>>>1,F=V[D];if(0<i(F,X))V[D]=X,V[z]=F,z=D;else break e}}function r(V){return V.length===0?null:V[0]}function n(V){if(V.length===0)return null;var X=V[0],z=V.pop();if(z!==X){V[0]=z;e:for(var D=0,F=V.length,q=F>>>1;D<q;){var Q=2*(D+1)-1,re=V[Q],Y=Q+1,ee=V[Y];if(0>i(re,z))Y<F&&0>i(ee,re)?(V[D]=ee,V[Y]=z,D=Y):(V[D]=re,V[Q]=z,D=Q);else if(Y<F&&0>i(ee,z))V[D]=ee,V[Y]=z,D=Y;else break e}}return X}function i(V,X){var z=V.sortIndex-X.sortIndex;return z!==0?z:V.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],d=[],h=1,v=null,p=3,f=!1,b=!1,_=!1,S=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(V){for(var X=r(d);X!==null;){if(X.callback===null)n(d);else if(X.startTime<=V)n(d),X.sortIndex=X.expirationTime,t(u,X);else break;X=r(d)}}function E(V){if(_=!1,w(V),!b)if(r(u)!==null)b=!0,se(P);else{var X=r(d);X!==null&&U(E,X.startTime-V)}}function P(V,X){b=!1,_&&(_=!1,x(N),N=-1),f=!0;var z=p;try{for(w(X),v=r(u);v!==null&&(!(v.expirationTime>X)||V&&!C());){var D=v.callback;if(typeof D=="function"){v.callback=null,p=v.priorityLevel;var F=D(v.expirationTime<=X);X=e.unstable_now(),typeof F=="function"?v.callback=F:v===r(u)&&n(u),w(X)}else n(u);v=r(u)}if(v!==null)var q=!0;else{var Q=r(d);Q!==null&&U(E,Q.startTime-X),q=!1}return q}finally{v=null,p=z,f=!1}}var R=!1,k=null,N=-1,M=5,T=-1;function C(){return!(e.unstable_now()-T<M)}function L(){if(k!==null){var V=e.unstable_now();T=V;var X=!0;try{X=k(!0,V)}finally{X?H():(R=!1,k=null)}}else R=!1}var H;if(typeof m=="function")H=function(){m(L)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,J=G.port2;G.port1.onmessage=L,H=function(){J.postMessage(null)}}else H=function(){S(L,0)};function se(V){k=V,R||(R=!0,H())}function U(V,X){N=S(function(){V(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_continueExecution=function(){b||f||(b=!0,se(P))},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(V){switch(p){case 1:case 2:case 3:var X=3;break;default:X=p}var z=p;p=X;try{return V()}finally{p=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(V,X){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var z=p;p=V;try{return X()}finally{p=z}},e.unstable_scheduleCallback=function(V,X,z){var D=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?D+z:D):z=D,V){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=z+F,V={id:h++,callback:X,priorityLevel:V,startTime:z,expirationTime:F,sortIndex:-1},z>D?(V.sortIndex=z,t(d,V),r(u)===null&&V===r(d)&&(_?(x(N),N=-1):_=!0,U(E,z-D))):(V.sortIndex=F,t(u,V),b||f||(b=!0,se(P))),V},e.unstable_shouldYield=C,e.unstable_wrapCallback=function(V){var X=p;return function(){var z=p;p=X;try{return V.apply(this,arguments)}finally{p=z}}}}(q0)),q0}var zm;function xv(){return zm||(zm=1,z0.exports=t7()),z0.exports}/**
18
- * @license React
19
- * react-dom.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var qm;function r7(){if(qm)return ms;qm=1;var e=op(),t=xv();function r(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,A=1;A<arguments.length;A++)c+="&args[]="+encodeURIComponent(arguments[A]);return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function a(s,c){o(s,c),o(s+"Capture",c)}function o(s,c){for(i[s]=c,s=0;s<c.length;s++)n.add(c[s])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[: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]*$/,h={},v={};function p(s){return u.call(v,s)?!0:u.call(h,s)?!1:d.test(s)?v[s]=!0:(h[s]=!0,!1)}function f(s,c,A,j){if(A!==null&&A.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return j?!1:A!==null?!A.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function b(s,c,A,j){if(c===null||typeof c>"u"||f(s,c,A,j))return!0;if(j)return!1;if(A!==null)switch(A.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 _(s,c,A,j,K,ne,me){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=j,this.attributeNamespace=K,this.mustUseProperty=A,this.propertyName=s,this.type=c,this.sanitizeURL=ne,this.removeEmptyString=me}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){S[s]=new _(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var c=s[0];S[c]=new _(c,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){S[s]=new _(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){S[s]=new _(s,2,!1,s,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(s){S[s]=new _(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){S[s]=new _(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){S[s]=new _(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){S[s]=new _(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){S[s]=new _(s,5,!1,s.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function m(s){return s[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(s){var c=s.replace(x,m);S[c]=new _(c,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var c=s.replace(x,m);S[c]=new _(c,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var c=s.replace(x,m);S[c]=new _(c,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){S[s]=new _(s,1,!1,s.toLowerCase(),null,!1,!1)}),S.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){S[s]=new _(s,1,!1,s.toLowerCase(),null,!0,!0)});function w(s,c,A,j){var K=S.hasOwnProperty(c)?S[c]:null;(K!==null?K.type!==0:j||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(b(c,A,K,j)&&(A=null),j||K===null?p(c)&&(A===null?s.removeAttribute(c):s.setAttribute(c,""+A)):K.mustUseProperty?s[K.propertyName]=A===null?K.type===3?!1:"":A:(c=K.attributeName,j=K.attributeNamespace,A===null?s.removeAttribute(c):(K=K.type,A=K===3||K===4&&A===!0?"":""+A,j?s.setAttributeNS(j,c,A):s.setAttribute(c,A))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),R=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),C=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),se=Symbol.for("react.lazy"),U=Symbol.for("react.offscreen"),V=Symbol.iterator;function X(s){return s===null||typeof s!="object"?null:(s=V&&s[V]||s["@@iterator"],typeof s=="function"?s:null)}var z=Object.assign,D;function F(s){if(D===void 0)try{throw Error()}catch(A){var c=A.stack.trim().match(/\n( *(at )?)/);D=c&&c[1]||""}return`
26
- `+D+s}var q=!1;function Q(s,c){if(!s||q)return"";q=!0;var A=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(tt){var j=tt}Reflect.construct(s,[],c)}else{try{c.call()}catch(tt){j=tt}s.call(c.prototype)}else{try{throw Error()}catch(tt){j=tt}s()}}catch(tt){if(tt&&j&&typeof tt.stack=="string"){for(var K=tt.stack.split(`
27
- `),ne=j.stack.split(`
28
- `),me=K.length-1,Me=ne.length-1;1<=me&&0<=Me&&K[me]!==ne[Me];)Me--;for(;1<=me&&0<=Me;me--,Me--)if(K[me]!==ne[Me]){if(me!==1||Me!==1)do if(me--,Me--,0>Me||K[me]!==ne[Me]){var De=`
29
- `+K[me].replace(" at new "," at ");return s.displayName&&De.includes("<anonymous>")&&(De=De.replace("<anonymous>",s.displayName)),De}while(1<=me&&0<=Me);break}}}finally{q=!1,Error.prepareStackTrace=A}return(s=s?s.displayName||s.name:"")?F(s):""}function re(s){switch(s.tag){case 5:return F(s.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return s=Q(s.type,!1),s;case 11:return s=Q(s.type.render,!1),s;case 1:return s=Q(s.type,!0),s;default:return""}}function Y(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case k:return"Fragment";case R:return"Portal";case M:return"Profiler";case N:return"StrictMode";case H:return"Suspense";case G:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case C:return(s.displayName||"Context")+".Consumer";case T:return(s._context.displayName||"Context")+".Provider";case L:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case J:return c=s.displayName||null,c!==null?c:Y(s.type)||"Memo";case se:c=s._payload,s=s._init;try{return Y(s(c))}catch{}}return null}function ee(s){var c=s.type;switch(s.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=c.render,s=s.displayName||s.name||"",c.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Y(c);case 8:return c===N?"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 ae(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function ue(s){var c=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function ce(s){var c=ue(s)?"checked":"value",A=Object.getOwnPropertyDescriptor(s.constructor.prototype,c),j=""+s[c];if(!s.hasOwnProperty(c)&&typeof A<"u"&&typeof A.get=="function"&&typeof A.set=="function"){var K=A.get,ne=A.set;return Object.defineProperty(s,c,{configurable:!0,get:function(){return K.call(this)},set:function(me){j=""+me,ne.call(this,me)}}),Object.defineProperty(s,c,{enumerable:A.enumerable}),{getValue:function(){return j},setValue:function(me){j=""+me},stopTracking:function(){s._valueTracker=null,delete s[c]}}}}function pe(s){s._valueTracker||(s._valueTracker=ce(s))}function Ae(s){if(!s)return!1;var c=s._valueTracker;if(!c)return!0;var A=c.getValue(),j="";return s&&(j=ue(s)?s.checked?"true":"false":s.value),s=j,s!==A?(c.setValue(s),!0):!1}function Ce(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function ke(s,c){var A=c.checked;return z({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:A??s._wrapperState.initialChecked})}function Se(s,c){var A=c.defaultValue==null?"":c.defaultValue,j=c.checked!=null?c.checked:c.defaultChecked;A=ae(c.value!=null?c.value:A),s._wrapperState={initialChecked:j,initialValue:A,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function le(s,c){c=c.checked,c!=null&&w(s,"checked",c,!1)}function Ee(s,c){le(s,c);var A=ae(c.value),j=c.type;if(A!=null)j==="number"?(A===0&&s.value===""||s.value!=A)&&(s.value=""+A):s.value!==""+A&&(s.value=""+A);else if(j==="submit"||j==="reset"){s.removeAttribute("value");return}c.hasOwnProperty("value")?ye(s,c.type,A):c.hasOwnProperty("defaultValue")&&ye(s,c.type,ae(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(s.defaultChecked=!!c.defaultChecked)}function xe(s,c,A){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var j=c.type;if(!(j!=="submit"&&j!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+s._wrapperState.initialValue,A||c===s.value||(s.value=c),s.defaultValue=c}A=s.name,A!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,A!==""&&(s.name=A)}function ye(s,c,A){(c!=="number"||Ce(s.ownerDocument)!==s)&&(A==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+A&&(s.defaultValue=""+A))}var Ne=Array.isArray;function Te(s,c,A,j){if(s=s.options,c){c={};for(var K=0;K<A.length;K++)c["$"+A[K]]=!0;for(A=0;A<s.length;A++)K=c.hasOwnProperty("$"+s[A].value),s[A].selected!==K&&(s[A].selected=K),K&&j&&(s[A].defaultSelected=!0)}else{for(A=""+ae(A),c=null,K=0;K<s.length;K++){if(s[K].value===A){s[K].selected=!0,j&&(s[K].defaultSelected=!0);return}c!==null||s[K].disabled||(c=s[K])}c!==null&&(c.selected=!0)}}function ge(s,c){if(c.dangerouslySetInnerHTML!=null)throw Error(r(91));return z({},c,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function Re(s,c){var A=c.value;if(A==null){if(A=c.children,c=c.defaultValue,A!=null){if(c!=null)throw Error(r(92));if(Ne(A)){if(1<A.length)throw Error(r(93));A=A[0]}c=A}c==null&&(c=""),A=c}s._wrapperState={initialValue:ae(A)}}function Be(s,c){var A=ae(c.value),j=ae(c.defaultValue);A!=null&&(A=""+A,A!==s.value&&(s.value=A),c.defaultValue==null&&s.defaultValue!==A&&(s.defaultValue=A)),j!=null&&(s.defaultValue=""+j)}function Qe(s){var c=s.textContent;c===s._wrapperState.initialValue&&c!==""&&c!==null&&(s.value=c)}function ct(s){switch(s){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 mt(s,c){return s==null||s==="http://www.w3.org/1999/xhtml"?ct(c):s==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var gt,St=function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,A,j,K){MSApp.execUnsafeLocalFunction(function(){return s(c,A,j,K)})}:s}(function(s,c){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=c;else{for(gt=gt||document.createElement("div"),gt.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=gt.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;c.firstChild;)s.appendChild(c.firstChild)}});function pt(s,c){if(c){var A=s.firstChild;if(A&&A===s.lastChild&&A.nodeType===3){A.nodeValue=c;return}}s.textContent=c}var ut={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(ut).forEach(function(s){Br.forEach(function(c){c=c+s.charAt(0).toUpperCase()+s.substring(1),ut[c]=ut[s]})});function rr(s,c,A){return c==null||typeof c=="boolean"||c===""?"":A||typeof c!="number"||c===0||ut.hasOwnProperty(s)&&ut[s]?(""+c).trim():c+"px"}function Nr(s,c){s=s.style;for(var A in c)if(c.hasOwnProperty(A)){var j=A.indexOf("--")===0,K=rr(A,c[A],j);A==="float"&&(A="cssFloat"),j?s.setProperty(A,K):s[A]=K}}var ur=z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ge(s,c){if(c){if(ur[s]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(r(137,s));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 Ze(s,c){if(s.indexOf("-")===-1)return typeof c.is=="string";switch(s){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 Lt=null;function gr(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Wt=null,Ut=null,kn=null;function Rr(s){if(s=hu(s)){if(typeof Wt!="function")throw Error(r(280));var c=s.stateNode;c&&(c=mi(c),Wt(s.stateNode,s.type,c))}}function It(s){Ut?kn?kn.push(s):kn=[s]:Ut=s}function lr(){if(Ut){var s=Ut,c=kn;if(kn=Ut=null,Rr(s),c)for(s=0;s<c.length;s++)Rr(c[s])}}function so(s,c){return s(c)}function on(){}var pn=!1;function ca(s,c,A){if(pn)return s(c,A);pn=!0;try{return so(s,c,A)}finally{pn=!1,(Ut!==null||kn!==null)&&(on(),lr())}}function qt(s,c){var A=s.stateNode;if(A===null)return null;var j=mi(A);if(j===null)return null;A=j[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":(j=!j.disabled)||(s=s.type,j=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!j;break e;default:s=!1}if(s)return null;if(A&&typeof A!="function")throw Error(r(231,c,typeof A));return A}var Ji=!1;if(l)try{var Jn={};Object.defineProperty(Jn,"passive",{get:function(){Ji=!0}}),window.addEventListener("test",Jn,Jn),window.removeEventListener("test",Jn,Jn)}catch{Ji=!1}function ci(s,c,A,j,K,ne,me,Me,De){var tt=Array.prototype.slice.call(arguments,3);try{c.apply(A,tt)}catch(dt){this.onError(dt)}}var zr=!1,sn=null,ei=!1,xa=null,lo={onError:function(s){zr=!0,sn=s}};function fa(s,c,A,j,K,ne,me,Me,De){zr=!1,sn=null,ci.apply(lo,arguments)}function Sa(s,c,A,j,K,ne,me,Me,De){if(fa.apply(this,arguments),zr){if(zr){var tt=sn;zr=!1,sn=null}else throw Error(r(198));ei||(ei=!0,xa=tt)}}function Yn(s){var c=s,A=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,(c.flags&4098)!==0&&(A=c.return),s=c.return;while(s)}return c.tag===3?A:null}function Ea(s){if(s.tag===13){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function ha(s){if(Yn(s)!==s)throw Error(r(188))}function Pa(s){var c=s.alternate;if(!c){if(c=Yn(s),c===null)throw Error(r(188));return c!==s?null:s}for(var A=s,j=c;;){var K=A.return;if(K===null)break;var ne=K.alternate;if(ne===null){if(j=K.return,j!==null){A=j;continue}break}if(K.child===ne.child){for(ne=K.child;ne;){if(ne===A)return ha(K),s;if(ne===j)return ha(K),c;ne=ne.sibling}throw Error(r(188))}if(A.return!==j.return)A=K,j=ne;else{for(var me=!1,Me=K.child;Me;){if(Me===A){me=!0,A=K,j=ne;break}if(Me===j){me=!0,j=K,A=ne;break}Me=Me.sibling}if(!me){for(Me=ne.child;Me;){if(Me===A){me=!0,A=ne,j=K;break}if(Me===j){me=!0,j=ne,A=K;break}Me=Me.sibling}if(!me)throw Error(r(189))}}if(A.alternate!==j)throw Error(r(190))}if(A.tag!==3)throw Error(r(188));return A.stateNode.current===A?s:c}function da(s){return s=Pa(s),s!==null?uo(s):null}function uo(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var c=uo(s);if(c!==null)return c;s=s.sibling}return null}var As=t.unstable_scheduleCallback,Ko=t.unstable_cancelCallback,Zl=t.unstable_shouldYield,gc=t.unstable_requestPaint,Nn=t.unstable_now,Bu=t.unstable_getCurrentPriorityLevel,co=t.unstable_ImmediatePriority,ml=t.unstable_UserBlockingPriority,Ws=t.unstable_NormalPriority,zu=t.unstable_LowPriority,Ql=t.unstable_IdlePriority,fo=null,fi=null;function qr(s){if(fi&&typeof fi.onCommitFiberRoot=="function")try{fi.onCommitFiberRoot(fo,s,void 0,(s.current.flags&128)===128)}catch{}}var dr=Math.clz32?Math.clz32:Li,Qr=Math.log,hi=Math.LN2;function Li(s){return s>>>=0,s===0?32:31-(Qr(s)/hi|0)|0}var Fa=64,Da=4194304;function ti(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function Ti(s,c){var A=s.pendingLanes;if(A===0)return 0;var j=0,K=s.suspendedLanes,ne=s.pingedLanes,me=A&268435455;if(me!==0){var Me=me&~K;Me!==0?j=ti(Me):(ne&=me,ne!==0&&(j=ti(ne)))}else me=A&~K,me!==0?j=ti(me):ne!==0&&(j=ti(ne));if(j===0)return 0;if(c!==0&&c!==j&&(c&K)===0&&(K=j&-j,ne=c&-c,K>=ne||K===16&&(ne&4194240)!==0))return c;if((j&4)!==0&&(j|=A&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=j;0<c;)A=31-dr(c),K=1<<A,j|=s[A],c&=~K;return j}function yl(s,c){switch(s){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pa(s,c){for(var A=s.suspendedLanes,j=s.pingedLanes,K=s.expirationTimes,ne=s.pendingLanes;0<ne;){var me=31-dr(ne),Me=1<<me,De=K[me];De===-1?((Me&A)===0||(Me&j)!==0)&&(K[me]=yl(Me,c)):De<=c&&(s.expiredLanes|=Me),ne&=~Me}}function Zo(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function Jl(){var s=Fa;return Fa<<=1,(Fa&4194240)===0&&(Fa=64),s}function ga(s){for(var c=[],A=0;31>A;A++)c.push(s);return c}function Ys(s,c,A){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-dr(c),s[c]=A}function sf(s,c){var A=s.pendingLanes&~c;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=c,s.mutableReadLanes&=c,s.entangledLanes&=c,c=s.entanglements;var j=s.eventTimes;for(s=s.expirationTimes;0<A;){var K=31-dr(A),ne=1<<K;c[K]=0,j[K]=-1,s[K]=-1,A&=~ne}}function eu(s,c){var A=s.entangledLanes|=c;for(s=s.entanglements;A;){var j=31-dr(A),K=1<<j;K&c|s[j]&c&&(s[j]|=c),A&=~K}}var wr=0;function Os(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var Xs,Ks,vc,Qo,Cs,ks=!1,Ns=[],ln=null,Jo=null,Ba=null,_t=new Map,Zs=new Map,ho=[],No="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 qu(s,c){switch(s){case"focusin":case"focusout":ln=null;break;case"dragenter":case"dragleave":Jo=null;break;case"mouseover":case"mouseout":Ba=null;break;case"pointerover":case"pointerout":_t.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zs.delete(c.pointerId)}}function Qs(s,c,A,j,K,ne){return s===null||s.nativeEvent!==ne?(s={blockedOn:c,domEventName:A,eventSystemFlags:j,nativeEvent:ne,targetContainers:[K]},c!==null&&(c=hu(c),c!==null&&Ks(c)),s):(s.eventSystemFlags|=j,c=s.targetContainers,K!==null&&c.indexOf(K)===-1&&c.push(K),s)}function Ln(s,c,A,j,K){switch(c){case"focusin":return ln=Qs(ln,s,c,A,j,K),!0;case"dragenter":return Jo=Qs(Jo,s,c,A,j,K),!0;case"mouseover":return Ba=Qs(Ba,s,c,A,j,K),!0;case"pointerover":var ne=K.pointerId;return _t.set(ne,Qs(_t.get(ne)||null,s,c,A,j,K)),!0;case"gotpointercapture":return ne=K.pointerId,Zs.set(ne,Qs(Zs.get(ne)||null,s,c,A,j,K)),!0}return!1}function Js(s){var c=js(s.target);if(c!==null){var A=Yn(c);if(A!==null){if(c=A.tag,c===13){if(c=Ea(A),c!==null){s.blockedOn=c,Cs(s.priority,function(){vc(A)});return}}else if(c===3&&A.stateNode.current.memoizedState.isDehydrated){s.blockedOn=A.tag===3?A.stateNode.containerInfo:null;return}}}s.blockedOn=null}function tu(s){if(s.blockedOn!==null)return!1;for(var c=s.targetContainers;0<c.length;){var A=bl(s.domEventName,s.eventSystemFlags,c[0],s.nativeEvent);if(A===null){A=s.nativeEvent;var j=new A.constructor(A.type,A);Lt=j,A.target.dispatchEvent(j),Lt=null}else return c=hu(A),c!==null&&Ks(c),s.blockedOn=A,!1;c.shift()}return!0}function ru(s,c,A){tu(s)&&A.delete(c)}function lf(){ks=!1,ln!==null&&tu(ln)&&(ln=null),Jo!==null&&tu(Jo)&&(Jo=null),Ba!==null&&tu(Ba)&&(Ba=null),_t.forEach(ru),Zs.forEach(ru)}function po(s,c){s.blockedOn===c&&(s.blockedOn=null,ks||(ks=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,lf)))}function ri(s){function c(K){return po(K,s)}if(0<Ns.length){po(Ns[0],s);for(var A=1;A<Ns.length;A++){var j=Ns[A];j.blockedOn===s&&(j.blockedOn=null)}}for(ln!==null&&po(ln,s),Jo!==null&&po(Jo,s),Ba!==null&&po(Ba,s),_t.forEach(c),Zs.forEach(c),A=0;A<ho.length;A++)j=ho[A],j.blockedOn===s&&(j.blockedOn=null);for(;0<ho.length&&(A=ho[0],A.blockedOn===null);)Js(A),A.blockedOn===null&&ho.shift()}var za=E.ReactCurrentBatchConfig,nu=!0;function Ri(s,c,A,j){var K=wr,ne=za.transition;za.transition=null;try{wr=1,Lo(s,c,A,j)}finally{wr=K,za.transition=ne}}function qa(s,c,A,j){var K=wr,ne=za.transition;za.transition=null;try{wr=4,Lo(s,c,A,j)}finally{wr=K,za.transition=ne}}function Lo(s,c,A,j){if(nu){var K=bl(s,c,A,j);if(K===null)uu(s,c,j,Ls,A),qu(s,j);else if(Ln(K,s,c,A,j))j.stopPropagation();else if(qu(s,j),c&4&&-1<No.indexOf(s)){for(;K!==null;){var ne=hu(K);if(ne!==null&&Xs(ne),ne=bl(s,c,A,j),ne===null&&uu(s,c,j,Ls,A),ne===K)break;K=ne}K!==null&&j.stopPropagation()}else uu(s,c,j,null,A)}}var Ls=null;function bl(s,c,A,j){if(Ls=null,s=gr(j),s=js(s),s!==null)if(c=Yn(s),c===null)s=null;else if(A=c.tag,A===13){if(s=Ea(c),s!==null)return s;s=null}else if(A===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;s=null}else c!==s&&(s=null);return Ls=s,null}function Uu(s){switch(s){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Bu()){case co:return 1;case ml:return 4;case Ws:case zu:return 16;case Ql:return 536870912;default:return 16}default:return 16}}var ni=null,Mi=null,Ii=null;function wl(){if(Ii)return Ii;var s,c=Mi,A=c.length,j,K="value"in ni?ni.value:ni.textContent,ne=K.length;for(s=0;s<A&&c[s]===K[s];s++);var me=A-s;for(j=1;j<=me&&c[A-j]===K[ne-j];j++);return Ii=K.slice(s,1<j?1-j:void 0)}function Aa(s){var c=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&c===13&&(s=13)):s=c,s===10&&(s=13),32<=s||s===13?s:0}function gn(){return!0}function ji(){return!1}function vn(s){function c(A,j,K,ne,me){this._reactName=A,this._targetInst=K,this.type=j,this.nativeEvent=ne,this.target=me,this.currentTarget=null;for(var Me in s)s.hasOwnProperty(Me)&&(A=s[Me],this[Me]=A?A(ne):ne[Me]);return this.isDefaultPrevented=(ne.defaultPrevented!=null?ne.defaultPrevented:ne.returnValue===!1)?gn:ji,this.isPropagationStopped=ji,this}return z(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var A=this.nativeEvent;A&&(A.preventDefault?A.preventDefault():typeof A.returnValue!="unknown"&&(A.returnValue=!1),this.isDefaultPrevented=gn)},stopPropagation:function(){var A=this.nativeEvent;A&&(A.stopPropagation?A.stopPropagation():typeof A.cancelBubble!="unknown"&&(A.cancelBubble=!0),this.isPropagationStopped=gn)},persist:function(){},isPersistent:gn}),c}var ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ta=vn(ea),Ua=z({},ea,{view:0,detail:0}),iu=vn(Ua),Ts,el,Un,di=z({},Ua,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Et,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Un&&(Un&&s.type==="mousemove"?(Ts=s.screenX-Un.screenX,el=s.screenY-Un.screenY):el=Ts=0,Un=s),Ts)},movementY:function(s){return"movementY"in s?s.movementY:el}}),$r=vn(di),tl=z({},di,{dataTransfer:0}),Ha=vn(tl),_l=z({},Ua,{relatedTarget:0}),es=vn(_l),xl=z({},ea,{animationName:0,elapsedTime:0,pseudoElement:0}),ts=vn(xl),au=z({},ea,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),$=vn(au),de=z({},ea,{data:0}),Le=vn(de),je={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xe={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"},at={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ft(s){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(s):(s=at[s])?!!c[s]:!1}function Et(){return ft}var Dt=z({},Ua,{key:function(s){if(s.key){var c=je[s.key]||s.key;if(c!=="Unidentified")return c}return s.type==="keypress"?(s=Aa(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?Xe[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Et,charCode:function(s){return s.type==="keypress"?Aa(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Aa(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),tr=vn(Dt),Jt=z({},di,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cr=vn(Jt),En=z({},Ua,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Et}),mn=vn(En),Tn=z({},ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xn=vn(Tn),ii=z({},di,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),Va=vn(ii),Oa=[9,13,27,32],Ca=l&&"CompositionEvent"in window,rs=null;l&&"documentMode"in document&&(rs=document.documentMode);var ns=l&&"TextEvent"in window&&!rs,Fi=l&&(!Ca||rs&&8<rs&&11>=rs),Ga=" ",rl=!1;function Sl(s,c){switch(s){case"keyup":return Oa.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ra(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Wr=!1;function nl(s,c){switch(s){case"compositionend":return ra(c);case"keypress":return c.which!==32?null:(rl=!0,Ga);case"textInput":return s=c.data,s===Ga&&rl?null:s;default:return null}}function El(s,c){if(Wr)return s==="compositionend"||!Ca&&Sl(s,c)?(s=wl(),Ii=Mi=ni=null,Wr=!1,s):null;switch(s){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 Fi&&c.locale!=="ko"?null:c.data;default:return null}}var ka={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 $a(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c==="input"?!!ka[s.type]:c==="textarea"}function xi(s,c,A,j){It(j),c=mc(c,"onChange"),0<c.length&&(A=new ta("onChange","change",null,A,j),s.push({event:A,listeners:c}))}var il=null,go=null;function Hu(s){su(s,0)}function pi(s){var c=oi(s);if(Ae(c))return s}function Di(s,c){if(s==="change")return c}var Rs=!1;if(l){var To;if(l){var gi="oninput"in document;if(!gi){var is=document.createElement("div");is.setAttribute("oninput","return;"),gi=typeof is.oninput=="function"}To=gi}else To=!1;Rs=To&&(!document.documentMode||9<document.documentMode)}function ai(){il&&(il.detachEvent("onpropertychange",Bi),go=il=null)}function Bi(s){if(s.propertyName==="value"&&pi(go)){var c=[];xi(c,go,s,gr(s)),ca(Hu,c)}}function as(s,c,A){s==="focusin"?(ai(),il=c,go=A,il.attachEvent("onpropertychange",Bi)):s==="focusout"&&ai()}function Mr(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return pi(go)}function vo(s,c){if(s==="click")return pi(c)}function al(s,c){if(s==="input"||s==="change")return pi(c)}function Ro(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var _r=typeof Object.is=="function"?Object.is:Ro;function Mo(s,c){if(_r(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var A=Object.keys(s),j=Object.keys(c);if(A.length!==j.length)return!1;for(j=0;j<A.length;j++){var K=A[j];if(!u.call(c,K)||!_r(s[K],c[K]))return!1}return!0}function Hn(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function vr(s,c){var A=Hn(s);s=0;for(var j;A;){if(A.nodeType===3){if(j=s+A.textContent.length,s<=c&&j>=c)return{node:A,offset:c-s};s=j}e:{for(;A;){if(A.nextSibling){A=A.nextSibling;break e}A=A.parentNode}A=void 0}A=Hn(A)}}function yn(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?yn(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function Vn(){for(var s=window,c=Ce();c instanceof s.HTMLIFrameElement;){try{var A=typeof c.contentWindow.location.href=="string"}catch{A=!1}if(A)s=c.contentWindow;else break;c=Ce(s.document)}return c}function os(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}function Io(s){var c=Vn(),A=s.focusedElem,j=s.selectionRange;if(c!==A&&A&&A.ownerDocument&&yn(A.ownerDocument.documentElement,A)){if(j!==null&&os(A)){if(c=j.start,s=j.end,s===void 0&&(s=c),"selectionStart"in A)A.selectionStart=c,A.selectionEnd=Math.min(s,A.value.length);else if(s=(c=A.ownerDocument||document)&&c.defaultView||window,s.getSelection){s=s.getSelection();var K=A.textContent.length,ne=Math.min(j.start,K);j=j.end===void 0?ne:Math.min(j.end,K),!s.extend&&ne>j&&(K=j,j=ne,ne=K),K=vr(A,ne);var me=vr(A,j);K&&me&&(s.rangeCount!==1||s.anchorNode!==K.node||s.anchorOffset!==K.offset||s.focusNode!==me.node||s.focusOffset!==me.offset)&&(c=c.createRange(),c.setStart(K.node,K.offset),s.removeAllRanges(),ne>j?(s.addRange(c),s.extend(me.node,me.offset)):(c.setEnd(me.node,me.offset),s.addRange(c)))}}for(c=[],s=A;s=s.parentNode;)s.nodeType===1&&c.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<c.length;A++)s=c[A],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var jo=l&&"documentMode"in document&&11>=document.documentMode,Wa=null,Pn=null,mo=null,Fo=!1;function Do(s,c,A){var j=A.window===A?A.document:A.nodeType===9?A:A.ownerDocument;Fo||Wa==null||Wa!==Ce(j)||(j=Wa,"selectionStart"in j&&os(j)?j={start:j.selectionStart,end:j.selectionEnd}:(j=(j.ownerDocument&&j.ownerDocument.defaultView||window).getSelection(),j={anchorNode:j.anchorNode,anchorOffset:j.anchorOffset,focusNode:j.focusNode,focusOffset:j.focusOffset}),mo&&Mo(mo,j)||(mo=j,j=mc(Pn,"onSelect"),0<j.length&&(c=new ta("onSelect","select",null,c,A),s.push({event:c,listeners:j}),c.target=Wa)))}function zi(s,c){var A={};return A[s.toLowerCase()]=c.toLowerCase(),A["Webkit"+s]="webkit"+c,A["Moz"+s]="moz"+c,A}var Jr={animationend:zi("Animation","AnimationEnd"),animationiteration:zi("Animation","AnimationIteration"),animationstart:zi("Animation","AnimationStart"),transitionend:zi("Transition","TransitionEnd")},Si={},Yr={};l&&(Yr=document.createElement("div").style,"AnimationEvent"in window||(delete Jr.animationend.animation,delete Jr.animationiteration.animation,delete Jr.animationstart.animation),"TransitionEvent"in window||delete Jr.transitionend.transition);function Ir(s){if(Si[s])return Si[s];if(!Jr[s])return s;var c=Jr[s],A;for(A in c)if(c.hasOwnProperty(A)&&A in Yr)return Si[s]=c[A];return s}var Rn=Ir("animationend"),Kn=Ir("animationiteration"),Bo=Ir("animationstart"),Pl=Ir("transitionend"),ol=new Map,ou="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 zo(s,c){ol.set(s,c),a(c,[s])}for(var Al=0;Al<ou.length;Al++){var vi=ou[Al],Ya=vi.toLowerCase(),Ol=vi[0].toUpperCase()+vi.slice(1);zo(Ya,"on"+Ol)}zo(Rn,"onAnimationEnd"),zo(Kn,"onAnimationIteration"),zo(Bo,"onAnimationStart"),zo("dblclick","onDoubleClick"),zo("focusin","onFocus"),zo("focusout","onBlur"),zo(Pl,"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 qo="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(" "),uf=new Set("cancel close invalid load scroll toggle".split(" ").concat(qo));function Cl(s,c,A){var j=s.type||"unknown-event";s.currentTarget=A,Sa(j,c,void 0,s),s.currentTarget=null}function su(s,c){c=(c&4)!==0;for(var A=0;A<s.length;A++){var j=s[A],K=j.event;j=j.listeners;e:{var ne=void 0;if(c)for(var me=j.length-1;0<=me;me--){var Me=j[me],De=Me.instance,tt=Me.currentTarget;if(Me=Me.listener,De!==ne&&K.isPropagationStopped())break e;Cl(K,Me,tt),ne=De}else for(me=0;me<j.length;me++){if(Me=j[me],De=Me.instance,tt=Me.currentTarget,Me=Me.listener,De!==ne&&K.isPropagationStopped())break e;Cl(K,Me,tt),ne=De}}}if(ei)throw s=xa,ei=!1,xa=null,s}function en(s,c){var A=c[va];A===void 0&&(A=c[va]=new Set);var j=s+"__bubble";A.has(j)||(lu(c,s,2,!1),A.add(j))}function Vu(s,c,A){var j=0;c&&(j|=4),lu(A,s,j,c)}var kl="_reactListening"+Math.random().toString(36).slice(2);function Ms(s){if(!s[kl]){s[kl]=!0,n.forEach(function(A){A!=="selectionchange"&&(uf.has(A)||Vu(A,!1,s),Vu(A,!0,s))});var c=s.nodeType===9?s:s.ownerDocument;c===null||c[kl]||(c[kl]=!0,Vu("selectionchange",!1,c))}}function lu(s,c,A,j){switch(Uu(c)){case 1:var K=Ri;break;case 4:K=qa;break;default:K=Lo}A=K.bind(null,c,A,s),K=void 0,!Ji||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(K=!0),j?K!==void 0?s.addEventListener(c,A,{capture:!0,passive:K}):s.addEventListener(c,A,!0):K!==void 0?s.addEventListener(c,A,{passive:K}):s.addEventListener(c,A,!1)}function uu(s,c,A,j,K){var ne=j;if((c&1)===0&&(c&2)===0&&j!==null)e:for(;;){if(j===null)return;var me=j.tag;if(me===3||me===4){var Me=j.stateNode.containerInfo;if(Me===K||Me.nodeType===8&&Me.parentNode===K)break;if(me===4)for(me=j.return;me!==null;){var De=me.tag;if((De===3||De===4)&&(De=me.stateNode.containerInfo,De===K||De.nodeType===8&&De.parentNode===K))return;me=me.return}for(;Me!==null;){if(me=js(Me),me===null)return;if(De=me.tag,De===5||De===6){j=ne=me;continue e}Me=Me.parentNode}}j=j.return}ca(function(){var tt=ne,dt=gr(A),vt=[];e:{var ht=ol.get(s);if(ht!==void 0){var Nt=ta,jt=s;switch(s){case"keypress":if(Aa(A)===0)break e;case"keydown":case"keyup":Nt=tr;break;case"focusin":jt="focus",Nt=es;break;case"focusout":jt="blur",Nt=es;break;case"beforeblur":case"afterblur":Nt=es;break;case"click":if(A.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Nt=$r;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Nt=Ha;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Nt=mn;break;case Rn:case Kn:case Bo:Nt=ts;break;case Pl:Nt=Xn;break;case"scroll":Nt=iu;break;case"wheel":Nt=Va;break;case"copy":case"cut":case"paste":Nt=$;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Nt=cr}var zt=(c&4)!==0,Wi=!zt&&s==="scroll",Ke=zt?ht!==null?ht+"Capture":null:ht;zt=[];for(var Ue=tt,Je;Ue!==null;){Je=Ue;var bt=Je.stateNode;if(Je.tag===5&&bt!==null&&(Je=bt,Ke!==null&&(bt=qt(Ue,Ke),bt!=null&&zt.push(cu(Ue,bt,Je)))),Wi)break;Ue=Ue.return}0<zt.length&&(ht=new Nt(ht,jt,null,A,dt),vt.push({event:ht,listeners:zt}))}}if((c&7)===0){e:{if(ht=s==="mouseover"||s==="pointerover",Nt=s==="mouseout"||s==="pointerout",ht&&A!==Lt&&(jt=A.relatedTarget||A.fromElement)&&(js(jt)||jt[Hi]))break e;if((Nt||ht)&&(ht=dt.window===dt?dt:(ht=dt.ownerDocument)?ht.defaultView||ht.parentWindow:window,Nt?(jt=A.relatedTarget||A.toElement,Nt=tt,jt=jt?js(jt):null,jt!==null&&(Wi=Yn(jt),jt!==Wi||jt.tag!==5&&jt.tag!==6)&&(jt=null)):(Nt=null,jt=tt),Nt!==jt)){if(zt=$r,bt="onMouseLeave",Ke="onMouseEnter",Ue="mouse",(s==="pointerout"||s==="pointerover")&&(zt=cr,bt="onPointerLeave",Ke="onPointerEnter",Ue="pointer"),Wi=Nt==null?ht:oi(Nt),Je=jt==null?ht:oi(jt),ht=new zt(bt,Ue+"leave",Nt,A,dt),ht.target=Wi,ht.relatedTarget=Je,bt=null,js(dt)===tt&&(zt=new zt(Ke,Ue+"enter",jt,A,dt),zt.target=Je,zt.relatedTarget=Wi,bt=zt),Wi=bt,Nt&&jt)t:{for(zt=Nt,Ke=jt,Ue=0,Je=zt;Je;Je=sl(Je))Ue++;for(Je=0,bt=Ke;bt;bt=sl(bt))Je++;for(;0<Ue-Je;)zt=sl(zt),Ue--;for(;0<Je-Ue;)Ke=sl(Ke),Je--;for(;Ue--;){if(zt===Ke||Ke!==null&&zt===Ke.alternate)break t;zt=sl(zt),Ke=sl(Ke)}zt=null}else zt=null;Nt!==null&&Vf(vt,ht,Nt,zt,!1),jt!==null&&Wi!==null&&Vf(vt,Wi,jt,zt,!0)}}e:{if(ht=tt?oi(tt):window,Nt=ht.nodeName&&ht.nodeName.toLowerCase(),Nt==="select"||Nt==="input"&&ht.type==="file")var Ht=Di;else if($a(ht))if(Rs)Ht=al;else{Ht=Mr;var Yt=as}else(Nt=ht.nodeName)&&Nt.toLowerCase()==="input"&&(ht.type==="checkbox"||ht.type==="radio")&&(Ht=vo);if(Ht&&(Ht=Ht(s,tt))){xi(vt,Ht,A,dt);break e}Yt&&Yt(s,ht,tt),s==="focusout"&&(Yt=ht._wrapperState)&&Yt.controlled&&ht.type==="number"&&ye(ht,"number",ht.value)}switch(Yt=tt?oi(tt):window,s){case"focusin":($a(Yt)||Yt.contentEditable==="true")&&(Wa=Yt,Pn=tt,mo=null);break;case"focusout":mo=Pn=Wa=null;break;case"mousedown":Fo=!0;break;case"contextmenu":case"mouseup":case"dragend":Fo=!1,Do(vt,A,dt);break;case"selectionchange":if(jo)break;case"keydown":case"keyup":Do(vt,A,dt)}var Xt;if(Ca)e:{switch(s){case"compositionstart":var ir="onCompositionStart";break e;case"compositionend":ir="onCompositionEnd";break e;case"compositionupdate":ir="onCompositionUpdate";break e}ir=void 0}else Wr?Sl(s,A)&&(ir="onCompositionEnd"):s==="keydown"&&A.keyCode===229&&(ir="onCompositionStart");ir&&(Fi&&A.locale!=="ko"&&(Wr||ir!=="onCompositionStart"?ir==="onCompositionEnd"&&Wr&&(Xt=wl()):(ni=dt,Mi="value"in ni?ni.value:ni.textContent,Wr=!0)),Yt=mc(tt,ir),0<Yt.length&&(ir=new Le(ir,s,null,A,dt),vt.push({event:ir,listeners:Yt}),Xt?ir.data=Xt:(Xt=ra(A),Xt!==null&&(ir.data=Xt)))),(Xt=ns?nl(s,A):El(s,A))&&(tt=mc(tt,"onBeforeInput"),0<tt.length&&(dt=new Le("onBeforeInput","beforeinput",null,A,dt),vt.push({event:dt,listeners:tt}),dt.data=Xt))}su(vt,c)})}function cu(s,c,A){return{instance:s,listener:c,currentTarget:A}}function mc(s,c){for(var A=c+"Capture",j=[];s!==null;){var K=s,ne=K.stateNode;K.tag===5&&ne!==null&&(K=ne,ne=qt(s,A),ne!=null&&j.unshift(cu(s,ne,K)),ne=qt(s,c),ne!=null&&j.push(cu(s,ne,K))),s=s.return}return j}function sl(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function Vf(s,c,A,j,K){for(var ne=c._reactName,me=[];A!==null&&A!==j;){var Me=A,De=Me.alternate,tt=Me.stateNode;if(De!==null&&De===j)break;Me.tag===5&&tt!==null&&(Me=tt,K?(De=qt(A,ne),De!=null&&me.unshift(cu(A,De,Me))):K||(De=qt(A,ne),De!=null&&me.push(cu(A,De,Me)))),A=A.return}me.length!==0&&s.push({event:c,listeners:me})}var Ih=/\r\n?/g,Gf=/\u0000|\uFFFD/g;function cf(s){return(typeof s=="string"?s:""+s).replace(Ih,`
30
- `).replace(Gf,"")}function Gu(s,c,A){if(c=cf(c),cf(s)!==c&&A)throw Error(r(425))}function Is(){}var $u=null,Nl=null;function ff(s,c){return s==="textarea"||s==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Xa=typeof setTimeout=="function"?setTimeout:void 0,yc=typeof clearTimeout=="function"?clearTimeout:void 0,Wu=typeof Promise=="function"?Promise:void 0,$f=typeof queueMicrotask=="function"?queueMicrotask:typeof Wu<"u"?function(s){return Wu.resolve(null).then(s).catch(Wf)}:Xa;function Wf(s){setTimeout(function(){throw s})}function bc(s,c){var A=c,j=0;do{var K=A.nextSibling;if(s.removeChild(A),K&&K.nodeType===8)if(A=K.data,A==="/$"){if(j===0){s.removeChild(K),ri(c);return}j--}else A!=="$"&&A!=="$?"&&A!=="$!"||j++;A=K}while(A);ri(c)}function qi(s){for(;s!=null;s=s.nextSibling){var c=s.nodeType;if(c===1||c===3)break;if(c===8){if(c=s.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return s}function Ui(s){s=s.previousSibling;for(var c=0;s;){if(s.nodeType===8){var A=s.data;if(A==="$"||A==="$!"||A==="$?"){if(c===0)return s;c--}else A==="/$"&&c++}s=s.previousSibling}return null}var na=Math.random().toString(36).slice(2),yo="__reactFiber$"+na,fu="__reactProps$"+na,Hi="__reactContainer$"+na,va="__reactEvents$"+na,Yf="__reactListeners$"+na,Xf="__reactHandles$"+na;function js(s){var c=s[yo];if(c)return c;for(var A=s.parentNode;A;){if(c=A[Hi]||A[yo]){if(A=c.alternate,c.child!==null||A!==null&&A.child!==null)for(s=Ui(s);s!==null;){if(A=s[yo])return A;s=Ui(s)}return c}s=A,A=s.parentNode}return null}function hu(s){return s=s[yo]||s[Hi],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function oi(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(r(33))}function mi(s){return s[fu]||null}var wc=[],ss=-1;function bo(s){return{current:s}}function Ur(s){0>ss||(s.current=wc[ss],wc[ss]=null,ss--)}function Xr(s,c){ss++,wc[ss]=s.current,s.current=c}var ls={},Ei=bo(ls),ia=bo(!1),ll=ls;function Ll(s,c){var A=s.type.contextTypes;if(!A)return ls;var j=s.stateNode;if(j&&j.__reactInternalMemoizedUnmaskedChildContext===c)return j.__reactInternalMemoizedMaskedChildContext;var K={},ne;for(ne in A)K[ne]=c[ne];return j&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=K),K}function aa(s){return s=s.childContextTypes,s!=null}function du(){Ur(ia),Ur(Ei)}function hf(s,c,A){if(Ei.current!==ls)throw Error(r(168));Xr(Ei,c),Xr(ia,A)}function Yu(s,c,A){var j=s.stateNode;if(c=c.childContextTypes,typeof j.getChildContext!="function")return A;j=j.getChildContext();for(var K in j)if(!(K in c))throw Error(r(108,ee(s)||"Unknown",K));return z({},A,j)}function us(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ls,ll=Ei.current,Xr(Ei,s),Xr(ia,ia.current),!0}function Kf(s,c,A){var j=s.stateNode;if(!j)throw Error(r(169));A?(s=Yu(s,c,ll),j.__reactInternalMemoizedMergedChildContext=s,Ur(ia),Ur(Ei),Xr(Ei,s)):Ur(ia),Xr(ia,A)}var cs=null,Tl=!1,O=!1;function B(s){cs===null?cs=[s]:cs.push(s)}function Z(s){Tl=!0,B(s)}function ie(){if(!O&&cs!==null){O=!0;var s=0,c=wr;try{var A=cs;for(wr=1;s<A.length;s++){var j=A[s];do j=j(!0);while(j!==null)}cs=null,Tl=!1}catch(K){throw cs!==null&&(cs=cs.slice(s+1)),As(co,ie),K}finally{wr=c,O=!1}}return null}var he=[],ve=0,be=null,we=0,_e=[],Oe=0,Fe=null,Ye=1,Ve="";function He(s,c){he[ve++]=we,he[ve++]=be,be=s,we=c}function lt(s,c,A){_e[Oe++]=Ye,_e[Oe++]=Ve,_e[Oe++]=Fe,Fe=s;var j=Ye;s=Ve;var K=32-dr(j)-1;j&=~(1<<K),A+=1;var ne=32-dr(c)+K;if(30<ne){var me=K-K%5;ne=(j&(1<<me)-1).toString(32),j>>=me,K-=me,Ye=1<<32-dr(c)+K|A<<K|j,Ve=ne+s}else Ye=1<<ne|A<<K|j,Ve=s}function rt(s){s.return!==null&&(He(s,1),lt(s,1,0))}function Ie(s){for(;s===be;)be=he[--ve],he[ve]=null,we=he[--ve],he[ve]=null;for(;s===Fe;)Fe=_e[--Oe],_e[Oe]=null,Ve=_e[--Oe],_e[Oe]=null,Ye=_e[--Oe],_e[Oe]=null}var ze=null,qe=null,it=!1,st=null;function At(s,c){var A=hl(5,null,null,0);A.elementType="DELETED",A.stateNode=c,A.return=s,c=s.deletions,c===null?(s.deletions=[A],s.flags|=16):c.push(A)}function xt(s,c){switch(s.tag){case 5:var A=s.type;return c=c.nodeType!==1||A.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(s.stateNode=c,ze=s,qe=qi(c.firstChild),!0):!1;case 6:return c=s.pendingProps===""||c.nodeType!==3?null:c,c!==null?(s.stateNode=c,ze=s,qe=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(A=Fe!==null?{id:Ye,overflow:Ve}:null,s.memoizedState={dehydrated:c,treeContext:A,retryLane:1073741824},A=hl(18,null,null,0),A.stateNode=c,A.return=s,s.child=A,ze=s,qe=null,!0):!1;default:return!1}}function Bt(s){return(s.mode&1)!==0&&(s.flags&128)===0}function wt(s){if(it){var c=qe;if(c){var A=c;if(!xt(s,c)){if(Bt(s))throw Error(r(418));c=qi(A.nextSibling);var j=ze;c&&xt(s,c)?At(j,A):(s.flags=s.flags&-4097|2,it=!1,ze=s)}}else{if(Bt(s))throw Error(r(418));s.flags=s.flags&-4097|2,it=!1,ze=s}}}function xr(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;ze=s}function Ar(s){if(s!==ze)return!1;if(!it)return xr(s),it=!0,!1;var c;if((c=s.tag!==3)&&!(c=s.tag!==5)&&(c=s.type,c=c!=="head"&&c!=="body"&&!ff(s.type,s.memoizedProps)),c&&(c=qe)){if(Bt(s))throw mr(),Error(r(418));for(;c;)At(s,c),c=qi(c.nextSibling)}if(xr(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));e:{for(s=s.nextSibling,c=0;s;){if(s.nodeType===8){var A=s.data;if(A==="/$"){if(c===0){qe=qi(s.nextSibling);break e}c--}else A!=="$"&&A!=="$!"&&A!=="$?"||c++}s=s.nextSibling}qe=null}}else qe=ze?qi(s.stateNode.nextSibling):null;return!0}function mr(){for(var s=qe;s;)s=qi(s.nextSibling)}function ar(){qe=ze=null,it=!1}function jr(s){st===null?st=[s]:st.push(s)}var Hr=E.ReactCurrentBatchConfig;function Rt(s,c,A){if(s=A.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(A._owner){if(A=A._owner,A){if(A.tag!==1)throw Error(r(309));var j=A.stateNode}if(!j)throw Error(r(147,s));var K=j,ne=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===ne?c.ref:(c=function(me){var Me=K.refs;me===null?delete Me[ne]:Me[ne]=me},c._stringRef=ne,c)}if(typeof s!="string")throw Error(r(284));if(!A._owner)throw Error(r(290,s))}return s}function Or(s,c){throw s=Object.prototype.toString.call(c),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s))}function An(s){var c=s._init;return c(s._payload)}function Mn(s){function c(Ke,Ue){if(s){var Je=Ke.deletions;Je===null?(Ke.deletions=[Ue],Ke.flags|=16):Je.push(Ue)}}function A(Ke,Ue){if(!s)return null;for(;Ue!==null;)c(Ke,Ue),Ue=Ue.sibling;return null}function j(Ke,Ue){for(Ke=new Map;Ue!==null;)Ue.key!==null?Ke.set(Ue.key,Ue):Ke.set(Ue.index,Ue),Ue=Ue.sibling;return Ke}function K(Ke,Ue){return Ke=Mc(Ke,Ue),Ke.index=0,Ke.sibling=null,Ke}function ne(Ke,Ue,Je){return Ke.index=Je,s?(Je=Ke.alternate,Je!==null?(Je=Je.index,Je<Ue?(Ke.flags|=2,Ue):Je):(Ke.flags|=2,Ue)):(Ke.flags|=1048576,Ue)}function me(Ke){return s&&Ke.alternate===null&&(Ke.flags|=2),Ke}function Me(Ke,Ue,Je,bt){return Ue===null||Ue.tag!==6?(Ue=T0(Je,Ke.mode,bt),Ue.return=Ke,Ue):(Ue=K(Ue,Je),Ue.return=Ke,Ue)}function De(Ke,Ue,Je,bt){var Ht=Je.type;return Ht===k?dt(Ke,Ue,Je.props.children,bt,Je.key):Ue!==null&&(Ue.elementType===Ht||typeof Ht=="object"&&Ht!==null&&Ht.$$typeof===se&&An(Ht)===Ue.type)?(bt=K(Ue,Je.props),bt.ref=Rt(Ke,Ue,Je),bt.return=Ke,bt):(bt=jp(Je.type,Je.key,Je.props,null,Ke.mode,bt),bt.ref=Rt(Ke,Ue,Je),bt.return=Ke,bt)}function tt(Ke,Ue,Je,bt){return Ue===null||Ue.tag!==4||Ue.stateNode.containerInfo!==Je.containerInfo||Ue.stateNode.implementation!==Je.implementation?(Ue=R0(Je,Ke.mode,bt),Ue.return=Ke,Ue):(Ue=K(Ue,Je.children||[]),Ue.return=Ke,Ue)}function dt(Ke,Ue,Je,bt,Ht){return Ue===null||Ue.tag!==7?(Ue=bf(Je,Ke.mode,bt,Ht),Ue.return=Ke,Ue):(Ue=K(Ue,Je),Ue.return=Ke,Ue)}function vt(Ke,Ue,Je){if(typeof Ue=="string"&&Ue!==""||typeof Ue=="number")return Ue=T0(""+Ue,Ke.mode,Je),Ue.return=Ke,Ue;if(typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case P:return Je=jp(Ue.type,Ue.key,Ue.props,null,Ke.mode,Je),Je.ref=Rt(Ke,null,Ue),Je.return=Ke,Je;case R:return Ue=R0(Ue,Ke.mode,Je),Ue.return=Ke,Ue;case se:var bt=Ue._init;return vt(Ke,bt(Ue._payload),Je)}if(Ne(Ue)||X(Ue))return Ue=bf(Ue,Ke.mode,Je,null),Ue.return=Ke,Ue;Or(Ke,Ue)}return null}function ht(Ke,Ue,Je,bt){var Ht=Ue!==null?Ue.key:null;if(typeof Je=="string"&&Je!==""||typeof Je=="number")return Ht!==null?null:Me(Ke,Ue,""+Je,bt);if(typeof Je=="object"&&Je!==null){switch(Je.$$typeof){case P:return Je.key===Ht?De(Ke,Ue,Je,bt):null;case R:return Je.key===Ht?tt(Ke,Ue,Je,bt):null;case se:return Ht=Je._init,ht(Ke,Ue,Ht(Je._payload),bt)}if(Ne(Je)||X(Je))return Ht!==null?null:dt(Ke,Ue,Je,bt,null);Or(Ke,Je)}return null}function Nt(Ke,Ue,Je,bt,Ht){if(typeof bt=="string"&&bt!==""||typeof bt=="number")return Ke=Ke.get(Je)||null,Me(Ue,Ke,""+bt,Ht);if(typeof bt=="object"&&bt!==null){switch(bt.$$typeof){case P:return Ke=Ke.get(bt.key===null?Je:bt.key)||null,De(Ue,Ke,bt,Ht);case R:return Ke=Ke.get(bt.key===null?Je:bt.key)||null,tt(Ue,Ke,bt,Ht);case se:var Yt=bt._init;return Nt(Ke,Ue,Je,Yt(bt._payload),Ht)}if(Ne(bt)||X(bt))return Ke=Ke.get(Je)||null,dt(Ue,Ke,bt,Ht,null);Or(Ue,bt)}return null}function jt(Ke,Ue,Je,bt){for(var Ht=null,Yt=null,Xt=Ue,ir=Ue=0,Ma=null;Xt!==null&&ir<Je.length;ir++){Xt.index>ir?(Ma=Xt,Xt=null):Ma=Xt.sibling;var nn=ht(Ke,Xt,Je[ir],bt);if(nn===null){Xt===null&&(Xt=Ma);break}s&&Xt&&nn.alternate===null&&c(Ke,Xt),Ue=ne(nn,Ue,ir),Yt===null?Ht=nn:Yt.sibling=nn,Yt=nn,Xt=Ma}if(ir===Je.length)return A(Ke,Xt),it&&He(Ke,ir),Ht;if(Xt===null){for(;ir<Je.length;ir++)Xt=vt(Ke,Je[ir],bt),Xt!==null&&(Ue=ne(Xt,Ue,ir),Yt===null?Ht=Xt:Yt.sibling=Xt,Yt=Xt);return it&&He(Ke,ir),Ht}for(Xt=j(Ke,Xt);ir<Je.length;ir++)Ma=Nt(Xt,Ke,ir,Je[ir],bt),Ma!==null&&(s&&Ma.alternate!==null&&Xt.delete(Ma.key===null?ir:Ma.key),Ue=ne(Ma,Ue,ir),Yt===null?Ht=Ma:Yt.sibling=Ma,Yt=Ma);return s&&Xt.forEach(function(Ic){return c(Ke,Ic)}),it&&He(Ke,ir),Ht}function zt(Ke,Ue,Je,bt){var Ht=X(Je);if(typeof Ht!="function")throw Error(r(150));if(Je=Ht.call(Je),Je==null)throw Error(r(151));for(var Yt=Ht=null,Xt=Ue,ir=Ue=0,Ma=null,nn=Je.next();Xt!==null&&!nn.done;ir++,nn=Je.next()){Xt.index>ir?(Ma=Xt,Xt=null):Ma=Xt.sibling;var Ic=ht(Ke,Xt,nn.value,bt);if(Ic===null){Xt===null&&(Xt=Ma);break}s&&Xt&&Ic.alternate===null&&c(Ke,Xt),Ue=ne(Ic,Ue,ir),Yt===null?Ht=Ic:Yt.sibling=Ic,Yt=Ic,Xt=Ma}if(nn.done)return A(Ke,Xt),it&&He(Ke,ir),Ht;if(Xt===null){for(;!nn.done;ir++,nn=Je.next())nn=vt(Ke,nn.value,bt),nn!==null&&(Ue=ne(nn,Ue,ir),Yt===null?Ht=nn:Yt.sibling=nn,Yt=nn);return it&&He(Ke,ir),Ht}for(Xt=j(Ke,Xt);!nn.done;ir++,nn=Je.next())nn=Nt(Xt,Ke,ir,nn.value,bt),nn!==null&&(s&&nn.alternate!==null&&Xt.delete(nn.key===null?ir:nn.key),Ue=ne(nn,Ue,ir),Yt===null?Ht=nn:Yt.sibling=nn,Yt=nn);return s&&Xt.forEach(function(Q8){return c(Ke,Q8)}),it&&He(Ke,ir),Ht}function Wi(Ke,Ue,Je,bt){if(typeof Je=="object"&&Je!==null&&Je.type===k&&Je.key===null&&(Je=Je.props.children),typeof Je=="object"&&Je!==null){switch(Je.$$typeof){case P:e:{for(var Ht=Je.key,Yt=Ue;Yt!==null;){if(Yt.key===Ht){if(Ht=Je.type,Ht===k){if(Yt.tag===7){A(Ke,Yt.sibling),Ue=K(Yt,Je.props.children),Ue.return=Ke,Ke=Ue;break e}}else if(Yt.elementType===Ht||typeof Ht=="object"&&Ht!==null&&Ht.$$typeof===se&&An(Ht)===Yt.type){A(Ke,Yt.sibling),Ue=K(Yt,Je.props),Ue.ref=Rt(Ke,Yt,Je),Ue.return=Ke,Ke=Ue;break e}A(Ke,Yt);break}else c(Ke,Yt);Yt=Yt.sibling}Je.type===k?(Ue=bf(Je.props.children,Ke.mode,bt,Je.key),Ue.return=Ke,Ke=Ue):(bt=jp(Je.type,Je.key,Je.props,null,Ke.mode,bt),bt.ref=Rt(Ke,Ue,Je),bt.return=Ke,Ke=bt)}return me(Ke);case R:e:{for(Yt=Je.key;Ue!==null;){if(Ue.key===Yt)if(Ue.tag===4&&Ue.stateNode.containerInfo===Je.containerInfo&&Ue.stateNode.implementation===Je.implementation){A(Ke,Ue.sibling),Ue=K(Ue,Je.children||[]),Ue.return=Ke,Ke=Ue;break e}else{A(Ke,Ue);break}else c(Ke,Ue);Ue=Ue.sibling}Ue=R0(Je,Ke.mode,bt),Ue.return=Ke,Ke=Ue}return me(Ke);case se:return Yt=Je._init,Wi(Ke,Ue,Yt(Je._payload),bt)}if(Ne(Je))return jt(Ke,Ue,Je,bt);if(X(Je))return zt(Ke,Ue,Je,bt);Or(Ke,Je)}return typeof Je=="string"&&Je!==""||typeof Je=="number"?(Je=""+Je,Ue!==null&&Ue.tag===6?(A(Ke,Ue.sibling),Ue=K(Ue,Je),Ue.return=Ke,Ke=Ue):(A(Ke,Ue),Ue=T0(Je,Ke.mode,bt),Ue.return=Ke,Ke=Ue),me(Ke)):A(Ke,Ue)}return Wi}var si=Mn(!0),fr=Mn(!1),Vi=bo(null),bn=null,In=null,li=null;function Pi(){li=In=bn=null}function ma(s){var c=Vi.current;Ur(Vi),s._currentValue=c}function Ka(s,c,A){for(;s!==null;){var j=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,j!==null&&(j.childLanes|=c)):j!==null&&(j.childLanes&c)!==c&&(j.childLanes|=c),s===A)break;s=s.return}}function fn(s,c){bn=s,li=In=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&c)!==0&&(oe=!0),s.firstContext=null)}function jn(s){var c=s._currentValue;if(li!==s)if(s={context:s,memoizedValue:c,next:null},In===null){if(bn===null)throw Error(r(308));In=s,bn.dependencies={lanes:0,firstContext:s}}else In=In.next=s;return c}var oa=null;function Uo(s){oa===null?oa=[s]:oa.push(s)}function wo(s,c,A,j){var K=c.interleaved;return K===null?(A.next=A,Uo(c)):(A.next=K.next,K.next=A),c.interleaved=A,Sr(s,j)}function Sr(s,c){s.lanes|=c;var A=s.alternate;for(A!==null&&(A.lanes|=c),A=s,s=s.return;s!==null;)s.childLanes|=c,A=s.alternate,A!==null&&(A.childLanes|=c),A=s,s=s.return;return A.tag===3?A.stateNode:null}var _o=!1;function pu(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xu(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function Za(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function Na(s,c,A){var j=s.updateQueue;if(j===null)return null;if(j=j.shared,(Zr&2)!==0){var K=j.pending;return K===null?c.next=c:(c.next=K.next,K.next=c),j.pending=c,Sr(s,A)}return K=j.interleaved,K===null?(c.next=c,Uo(j)):(c.next=K.next,K.next=c),j.interleaved=c,Sr(s,A)}function Rl(s,c,A){if(c=c.updateQueue,c!==null&&(c=c.shared,(A&4194240)!==0)){var j=c.lanes;j&=s.pendingLanes,A|=j,c.lanes=A,eu(s,A)}}function ya(s,c){var A=s.updateQueue,j=s.alternate;if(j!==null&&(j=j.updateQueue,A===j)){var K=null,ne=null;if(A=A.firstBaseUpdate,A!==null){do{var me={eventTime:A.eventTime,lane:A.lane,tag:A.tag,payload:A.payload,callback:A.callback,next:null};ne===null?K=ne=me:ne=ne.next=me,A=A.next}while(A!==null);ne===null?K=ne=c:ne=ne.next=c}else K=ne=c;A={baseState:j.baseState,firstBaseUpdate:K,lastBaseUpdate:ne,shared:j.shared,effects:j.effects},s.updateQueue=A;return}s=A.lastBaseUpdate,s===null?A.firstBaseUpdate=c:s.next=c,A.lastBaseUpdate=c}function Ho(s,c,A,j){var K=s.updateQueue;_o=!1;var ne=K.firstBaseUpdate,me=K.lastBaseUpdate,Me=K.shared.pending;if(Me!==null){K.shared.pending=null;var De=Me,tt=De.next;De.next=null,me===null?ne=tt:me.next=tt,me=De;var dt=s.alternate;dt!==null&&(dt=dt.updateQueue,Me=dt.lastBaseUpdate,Me!==me&&(Me===null?dt.firstBaseUpdate=tt:Me.next=tt,dt.lastBaseUpdate=De))}if(ne!==null){var vt=K.baseState;me=0,dt=tt=De=null,Me=ne;do{var ht=Me.lane,Nt=Me.eventTime;if((j&ht)===ht){dt!==null&&(dt=dt.next={eventTime:Nt,lane:0,tag:Me.tag,payload:Me.payload,callback:Me.callback,next:null});e:{var jt=s,zt=Me;switch(ht=c,Nt=A,zt.tag){case 1:if(jt=zt.payload,typeof jt=="function"){vt=jt.call(Nt,vt,ht);break e}vt=jt;break e;case 3:jt.flags=jt.flags&-65537|128;case 0:if(jt=zt.payload,ht=typeof jt=="function"?jt.call(Nt,vt,ht):jt,ht==null)break e;vt=z({},vt,ht);break e;case 2:_o=!0}}Me.callback!==null&&Me.lane!==0&&(s.flags|=64,ht=K.effects,ht===null?K.effects=[Me]:ht.push(Me))}else Nt={eventTime:Nt,lane:ht,tag:Me.tag,payload:Me.payload,callback:Me.callback,next:null},dt===null?(tt=dt=Nt,De=vt):dt=dt.next=Nt,me|=ht;if(Me=Me.next,Me===null){if(Me=K.shared.pending,Me===null)break;ht=Me,Me=ht.next,ht.next=null,K.lastBaseUpdate=ht,K.shared.pending=null}}while(!0);if(dt===null&&(De=vt),K.baseState=De,K.firstBaseUpdate=tt,K.lastBaseUpdate=dt,c=K.shared.interleaved,c!==null){K=c;do me|=K.lane,K=K.next;while(K!==c)}else ne===null&&(K.shared.lanes=0);gf|=me,s.lanes=me,s.memoizedState=vt}}function un(s,c,A){if(s=c.effects,c.effects=null,s!==null)for(c=0;c<s.length;c++){var j=s[c],K=j.callback;if(K!==null){if(j.callback=null,j=A,typeof K!="function")throw Error(r(191,K));K.call(j)}}}var nr={},Vr=bo(nr),wn=bo(nr),On=bo(nr);function Zn(s){if(s===nr)throw Error(r(174));return s}function Vo(s,c){switch(Xr(On,c),Xr(wn,s),Xr(Vr,nr),s=c.nodeType,s){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:mt(null,"");break;default:s=s===8?c.parentNode:c,c=s.namespaceURI||null,s=s.tagName,c=mt(c,s)}Ur(Vr),Xr(Vr,c)}function tn(){Ur(Vr),Ur(wn),Ur(On)}function gu(s){Zn(On.current);var c=Zn(Vr.current),A=mt(c,s.type);c!==A&&(Xr(wn,s),Xr(Vr,A))}function Fs(s){wn.current===s&&(Ur(Vr),Ur(wn))}var rn=bo(0);function Qa(s){for(var c=s;c!==null;){if(c.tag===13){var A=c.memoizedState;if(A!==null&&(A=A.dehydrated,A===null||A.data==="$?"||A.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===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Ml=[];function sa(){for(var s=0;s<Ml.length;s++)Ml[s]._workInProgressVersionPrimary=null;Ml.length=0}var vu=E.ReactCurrentDispatcher,mu=E.ReactCurrentBatchConfig,Ai=0,Kr=null,Fn=null,Dn=null,Ja=!1,xo=!1,eo=0,_c=0;function Bn(){throw Error(r(321))}function yu(s,c){if(c===null)return!1;for(var A=0;A<c.length&&A<s.length;A++)if(!_r(s[A],c[A]))return!1;return!0}function ul(s,c,A,j,K,ne){if(Ai=ne,Kr=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,vu.current=s===null||s.memoizedState===null?d0:wu,s=A(j,K),xo){ne=0;do{if(xo=!1,eo=0,25<=ne)throw Error(r(301));ne+=1,Dn=Fn=null,c.updateQueue=null,vu.current=Qf,s=A(j,K)}while(xo)}if(vu.current=Pc,c=Fn!==null&&Fn.next!==null,Ai=0,Dn=Fn=Kr=null,Ja=!1,c)throw Error(r(300));return s}function to(){var s=eo!==0;return eo=0,s}function hn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dn===null?Kr.memoizedState=Dn=s:Dn=Dn.next=s,Dn}function ui(){if(Fn===null){var s=Kr.alternate;s=s!==null?s.memoizedState:null}else s=Fn.next;var c=Dn===null?Kr.memoizedState:Dn.next;if(c!==null)Dn=c,Fn=s;else{if(s===null)throw Error(r(310));Fn=s,s={memoizedState:Fn.memoizedState,baseState:Fn.baseState,baseQueue:Fn.baseQueue,queue:Fn.queue,next:null},Dn===null?Kr.memoizedState=Dn=s:Dn=Dn.next=s}return Dn}function la(s,c){return typeof c=="function"?c(s):c}function Gi(s){var c=ui(),A=c.queue;if(A===null)throw Error(r(311));A.lastRenderedReducer=s;var j=Fn,K=j.baseQueue,ne=A.pending;if(ne!==null){if(K!==null){var me=K.next;K.next=ne.next,ne.next=me}j.baseQueue=K=ne,A.pending=null}if(K!==null){ne=K.next,j=j.baseState;var Me=me=null,De=null,tt=ne;do{var dt=tt.lane;if((Ai&dt)===dt)De!==null&&(De=De.next={lane:0,action:tt.action,hasEagerState:tt.hasEagerState,eagerState:tt.eagerState,next:null}),j=tt.hasEagerState?tt.eagerState:s(j,tt.action);else{var vt={lane:dt,action:tt.action,hasEagerState:tt.hasEagerState,eagerState:tt.eagerState,next:null};De===null?(Me=De=vt,me=j):De=De.next=vt,Kr.lanes|=dt,gf|=dt}tt=tt.next}while(tt!==null&&tt!==ne);De===null?me=j:De.next=Me,_r(j,c.memoizedState)||(oe=!0),c.memoizedState=j,c.baseState=me,c.baseQueue=De,A.lastRenderedState=j}if(s=A.interleaved,s!==null){K=s;do ne=K.lane,Kr.lanes|=ne,gf|=ne,K=K.next;while(K!==s)}else K===null&&(A.lanes=0);return[c.memoizedState,A.dispatch]}function Ds(s){var c=ui(),A=c.queue;if(A===null)throw Error(r(311));A.lastRenderedReducer=s;var j=A.dispatch,K=A.pending,ne=c.memoizedState;if(K!==null){A.pending=null;var me=K=K.next;do ne=s(ne,me.action),me=me.next;while(me!==K);_r(ne,c.memoizedState)||(oe=!0),c.memoizedState=ne,c.baseQueue===null&&(c.baseState=ne),A.lastRenderedState=ne}return[ne,j]}function xc(){}function Ku(s,c){var A=Kr,j=ui(),K=c(),ne=!_r(j.memoizedState,K);if(ne&&(j.memoizedState=K,oe=!0),j=j.queue,Ec(df.bind(null,A,j,s),[s]),j.getSnapshot!==c||ne||Dn!==null&&Dn.memoizedState.tag&1){if(A.flags|=2048,La(9,fs.bind(null,A,j,K,c),void 0,null),Ra===null)throw Error(r(349));(Ai&30)!==0||Zf(A,c,K)}return K}function Zf(s,c,A){s.flags|=16384,s={getSnapshot:c,value:A},c=Kr.updateQueue,c===null?(c={lastEffect:null,stores:null},Kr.updateQueue=c,c.stores=[s]):(A=c.stores,A===null?c.stores=[s]:A.push(s))}function fs(s,c,A,j){c.value=A,c.getSnapshot=j,Il(c)&&bu(s)}function df(s,c,A){return A(function(){Il(c)&&bu(s)})}function Il(s){var c=s.getSnapshot;s=s.value;try{var A=c();return!_r(s,A)}catch{return!0}}function bu(s){var c=Sr(s,1);c!==null&&Bl(c,s,1,-1)}function Go(s){var c=hn();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:s},c.queue=s,s=s.dispatch=xp.bind(null,Kr,s),[c.memoizedState,s]}function La(s,c,A,j){return s={tag:s,create:c,destroy:A,deps:j,next:null},c=Kr.updateQueue,c===null?(c={lastEffect:null,stores:null},Kr.updateQueue=c,c.lastEffect=s.next=s):(A=c.lastEffect,A===null?c.lastEffect=s.next=s:(j=A.next,A.next=s,s.next=j,c.lastEffect=s)),s}function hs(){return ui().memoizedState}function ro(s,c,A,j){var K=hn();Kr.flags|=s,K.memoizedState=La(1|c,A,void 0,j===void 0?null:j)}function ds(s,c,A,j){var K=ui();j=j===void 0?null:j;var ne=void 0;if(Fn!==null){var me=Fn.memoizedState;if(ne=me.destroy,j!==null&&yu(j,me.deps)){K.memoizedState=La(c,A,ne,j);return}}Kr.flags|=s,K.memoizedState=La(1|c,A,ne,j)}function Sc(s,c){return ro(8390656,8,s,c)}function Ec(s,c){return ds(2048,8,s,c)}function pf(s,c){return ds(4,2,s,c)}function Zu(s,c){return ds(4,4,s,c)}function ps(s,c){if(typeof c=="function")return s=s(),c(s),function(){c(null)};if(c!=null)return s=s(),c.current=s,function(){c.current=null}}function yp(s,c,A){return A=A!=null?A.concat([s]):null,ds(4,4,ps.bind(null,c,s),A)}function jl(){}function jh(s,c){var A=ui();c=c===void 0?null:c;var j=A.memoizedState;return j!==null&&c!==null&&yu(c,j[1])?j[0]:(A.memoizedState=[s,c],s)}function zn(s,c){var A=ui();c=c===void 0?null:c;var j=A.memoizedState;return j!==null&&c!==null&&yu(c,j[1])?j[0]:(s=s(),A.memoizedState=[s,c],s)}function bp(s,c,A){return(Ai&21)===0?(s.baseState&&(s.baseState=!1,oe=!0),s.memoizedState=A):(_r(A,c)||(A=Jl(),Kr.lanes|=A,gf|=A,s.baseState=!0),c)}function wp(s,c){var A=wr;wr=A!==0&&4>A?A:4,s(!0);var j=mu.transition;mu.transition={};try{s(!1),c()}finally{wr=A,mu.transition=j}}function _p(){return ui().memoizedState}function h0(s,c,A){var j=Tc(s);if(A={lane:j,action:A,hasEagerState:!1,eagerState:null,next:null},Fh(s))Sp(c,A);else if(A=wo(s,c,A,j),A!==null){var K=Wo();Bl(A,s,j,K),$o(A,c,j)}}function xp(s,c,A){var j=Tc(s),K={lane:j,action:A,hasEagerState:!1,eagerState:null,next:null};if(Fh(s))Sp(c,K);else{var ne=s.alternate;if(s.lanes===0&&(ne===null||ne.lanes===0)&&(ne=c.lastRenderedReducer,ne!==null))try{var me=c.lastRenderedState,Me=ne(me,A);if(K.hasEagerState=!0,K.eagerState=Me,_r(Me,me)){var De=c.interleaved;De===null?(K.next=K,Uo(c)):(K.next=De.next,De.next=K),c.interleaved=K;return}}catch{}finally{}A=wo(s,c,K,j),A!==null&&(K=Wo(),Bl(A,s,j,K),$o(A,c,j))}}function Fh(s){var c=s.alternate;return s===Kr||c!==null&&c===Kr}function Sp(s,c){xo=Ja=!0;var A=s.pending;A===null?c.next=c:(c.next=A.next,A.next=c),s.pending=c}function $o(s,c,A){if((A&4194240)!==0){var j=c.lanes;j&=s.pendingLanes,A|=j,c.lanes=A,eu(s,A)}}var Pc={readContext:jn,useCallback:Bn,useContext:Bn,useEffect:Bn,useImperativeHandle:Bn,useInsertionEffect:Bn,useLayoutEffect:Bn,useMemo:Bn,useReducer:Bn,useRef:Bn,useState:Bn,useDebugValue:Bn,useDeferredValue:Bn,useTransition:Bn,useMutableSource:Bn,useSyncExternalStore:Bn,useId:Bn,unstable_isNewReconciler:!1},d0={readContext:jn,useCallback:function(s,c){return hn().memoizedState=[s,c===void 0?null:c],s},useContext:jn,useEffect:Sc,useImperativeHandle:function(s,c,A){return A=A!=null?A.concat([s]):null,ro(4194308,4,ps.bind(null,c,s),A)},useLayoutEffect:function(s,c){return ro(4194308,4,s,c)},useInsertionEffect:function(s,c){return ro(4,2,s,c)},useMemo:function(s,c){var A=hn();return c=c===void 0?null:c,s=s(),A.memoizedState=[s,c],s},useReducer:function(s,c,A){var j=hn();return c=A!==void 0?A(c):c,j.memoizedState=j.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},j.queue=s,s=s.dispatch=h0.bind(null,Kr,s),[j.memoizedState,s]},useRef:function(s){var c=hn();return s={current:s},c.memoizedState=s},useState:Go,useDebugValue:jl,useDeferredValue:function(s){return hn().memoizedState=s},useTransition:function(){var s=Go(!1),c=s[0];return s=wp.bind(null,s[1]),hn().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,A){var j=Kr,K=hn();if(it){if(A===void 0)throw Error(r(407));A=A()}else{if(A=c(),Ra===null)throw Error(r(349));(Ai&30)!==0||Zf(j,c,A)}K.memoizedState=A;var ne={value:A,getSnapshot:c};return K.queue=ne,Sc(df.bind(null,j,ne,s),[s]),j.flags|=2048,La(9,fs.bind(null,j,ne,A,c),void 0,null),A},useId:function(){var s=hn(),c=Ra.identifierPrefix;if(it){var A=Ve,j=Ye;A=(j&~(1<<32-dr(j)-1)).toString(32)+A,c=":"+c+"R"+A,A=eo++,0<A&&(c+="H"+A.toString(32)),c+=":"}else A=_c++,c=":"+c+"r"+A.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},wu={readContext:jn,useCallback:jh,useContext:jn,useEffect:Ec,useImperativeHandle:yp,useInsertionEffect:pf,useLayoutEffect:Zu,useMemo:zn,useReducer:Gi,useRef:hs,useState:function(){return Gi(la)},useDebugValue:jl,useDeferredValue:function(s){var c=ui();return bp(c,Fn.memoizedState,s)},useTransition:function(){var s=Gi(la)[0],c=ui().memoizedState;return[s,c]},useMutableSource:xc,useSyncExternalStore:Ku,useId:_p,unstable_isNewReconciler:!1},Qf={readContext:jn,useCallback:jh,useContext:jn,useEffect:Ec,useImperativeHandle:yp,useInsertionEffect:pf,useLayoutEffect:Zu,useMemo:zn,useReducer:Ds,useRef:hs,useState:function(){return Ds(la)},useDebugValue:jl,useDeferredValue:function(s){var c=ui();return Fn===null?c.memoizedState=s:bp(c,Fn.memoizedState,s)},useTransition:function(){var s=Ds(la)[0],c=ui().memoizedState;return[s,c]},useMutableSource:xc,useSyncExternalStore:Ku,useId:_p,unstable_isNewReconciler:!1};function ba(s,c){if(s&&s.defaultProps){c=z({},c),s=s.defaultProps;for(var A in s)c[A]===void 0&&(c[A]=s[A]);return c}return c}function Ac(s,c,A,j){c=s.memoizedState,A=A(j,c),A=A==null?c:z({},c,A),s.memoizedState=A,s.lanes===0&&(s.updateQueue.baseState=A)}var Oc={isMounted:function(s){return(s=s._reactInternals)?Yn(s)===s:!1},enqueueSetState:function(s,c,A){s=s._reactInternals;var j=Wo(),K=Tc(s),ne=Za(j,K);ne.payload=c,A!=null&&(ne.callback=A),c=Na(s,ne,K),c!==null&&(Bl(c,s,K,j),Rl(c,s,K))},enqueueReplaceState:function(s,c,A){s=s._reactInternals;var j=Wo(),K=Tc(s),ne=Za(j,K);ne.tag=1,ne.payload=c,A!=null&&(ne.callback=A),c=Na(s,ne,K),c!==null&&(Bl(c,s,K,j),Rl(c,s,K))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var A=Wo(),j=Tc(s),K=Za(A,j);K.tag=2,c!=null&&(K.callback=c),c=Na(s,K,j),c!==null&&(Bl(c,s,j,A),Rl(c,s,j))}};function Jf(s,c,A,j,K,ne,me){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(j,ne,me):c.prototype&&c.prototype.isPureReactComponent?!Mo(A,j)||!Mo(K,ne):!0}function Ep(s,c,A){var j=!1,K=ls,ne=c.contextType;return typeof ne=="object"&&ne!==null?ne=jn(ne):(K=aa(c)?ll:Ei.current,j=c.contextTypes,ne=(j=j!=null)?Ll(s,K):ls),c=new c(A,ne),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Oc,s.stateNode=c,c._reactInternals=s,j&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=K,s.__reactInternalMemoizedMaskedChildContext=ne),c}function Dh(s,c,A,j){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(A,j),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(A,j),c.state!==s&&Oc.enqueueReplaceState(c,c.state,null)}function eh(s,c,A,j){var K=s.stateNode;K.props=A,K.state=s.memoizedState,K.refs={},pu(s);var ne=c.contextType;typeof ne=="object"&&ne!==null?K.context=jn(ne):(ne=aa(c)?ll:Ei.current,K.context=Ll(s,ne)),K.state=s.memoizedState,ne=c.getDerivedStateFromProps,typeof ne=="function"&&(Ac(s,c,ne,A),K.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof K.getSnapshotBeforeUpdate=="function"||typeof K.UNSAFE_componentWillMount!="function"&&typeof K.componentWillMount!="function"||(c=K.state,typeof K.componentWillMount=="function"&&K.componentWillMount(),typeof K.UNSAFE_componentWillMount=="function"&&K.UNSAFE_componentWillMount(),c!==K.state&&Oc.enqueueReplaceState(K,K.state,null),Ho(s,A,K,j),K.state=s.memoizedState),typeof K.componentDidMount=="function"&&(s.flags|=4194308)}function Qu(s,c){try{var A="",j=c;do A+=re(j),j=j.return;while(j);var K=A}catch(ne){K=`
31
- Error generating stack: `+ne.message+`
32
- `+ne.stack}return{value:s,source:c,stack:K,digest:null}}function th(s,c,A){return{value:s,source:null,stack:A??null,digest:c??null}}function Cc(s,c){try{console.error(c.value)}catch(A){setTimeout(function(){throw A})}}var p0=typeof WeakMap=="function"?WeakMap:Map;function Pp(s,c,A){A=Za(-1,A),A.tag=3,A.payload={element:null};var j=c.value;return A.callback=function(){Np||(Np=!0,E0=j),Cc(s,c)},A}function g(s,c,A){A=Za(-1,A),A.tag=3;var j=s.type.getDerivedStateFromError;if(typeof j=="function"){var K=c.value;A.payload=function(){return j(K)},A.callback=function(){Cc(s,c)}}var ne=s.stateNode;return ne!==null&&typeof ne.componentDidCatch=="function"&&(A.callback=function(){Cc(s,c),typeof j!="function"&&(Nc===null?Nc=new Set([this]):Nc.add(this));var me=c.stack;this.componentDidCatch(c.value,{componentStack:me!==null?me:""})}),A}function y(s,c,A){var j=s.pingCache;if(j===null){j=s.pingCache=new p0;var K=new Set;j.set(c,K)}else K=j.get(c),K===void 0&&(K=new Set,j.set(c,K));K.has(A)||(K.add(A),s=q8.bind(null,s,c,A),c.then(s,s))}function I(s){do{var c;if((c=s.tag===13)&&(c=s.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return s;s=s.return}while(s!==null);return null}function W(s,c,A,j,K){return(s.mode&1)===0?(s===c?s.flags|=65536:(s.flags|=128,A.flags|=131072,A.flags&=-52805,A.tag===1&&(A.alternate===null?A.tag=17:(c=Za(-1,1),c.tag=2,Na(A,c,1))),A.lanes|=1),s):(s.flags|=65536,s.lanes=K,s)}var te=E.ReactCurrentOwner,oe=!1;function Pe(s,c,A,j){c.child=s===null?fr(c,null,A,j):si(c,s.child,A,j)}function $e(s,c,A,j,K){A=A.render;var ne=c.ref;return fn(c,K),j=ul(s,c,A,j,ne,K),A=to(),s!==null&&!oe?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~K,Ta(s,c,K)):(it&&A&&rt(c),c.flags|=1,Pe(s,c,j,K),c.child)}function nt(s,c,A,j,K){if(s===null){var ne=A.type;return typeof ne=="function"&&!L0(ne)&&ne.defaultProps===void 0&&A.compare===null&&A.defaultProps===void 0?(c.tag=15,c.type=ne,yt(s,c,ne,j,K)):(s=jp(A.type,null,j,c,c.mode,K),s.ref=c.ref,s.return=c,c.child=s)}if(ne=s.child,(s.lanes&K)===0){var me=ne.memoizedProps;if(A=A.compare,A=A!==null?A:Mo,A(me,j)&&s.ref===c.ref)return Ta(s,c,K)}return c.flags|=1,s=Mc(ne,j),s.ref=c.ref,s.return=c,c.child=s}function yt(s,c,A,j,K){if(s!==null){var ne=s.memoizedProps;if(Mo(ne,j)&&s.ref===c.ref)if(oe=!1,c.pendingProps=j=ne,(s.lanes&K)!==0)(s.flags&131072)!==0&&(oe=!0);else return c.lanes=s.lanes,Ta(s,c,K)}return Ot(s,c,A,j,K)}function Tt(s,c,A){var j=c.pendingProps,K=j.children,ne=s!==null?s.memoizedState:null;if(j.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xr(nh,Bs),Bs|=A;else{if((A&1073741824)===0)return s=ne!==null?ne.baseLanes|A:A,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,Xr(nh,Bs),Bs|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},j=ne!==null?ne.baseLanes:A,Xr(nh,Bs),Bs|=j}else ne!==null?(j=ne.baseLanes|A,c.memoizedState=null):j=A,Xr(nh,Bs),Bs|=j;return Pe(s,c,K,A),c.child}function or(s,c){var A=c.ref;(s===null&&A!==null||s!==null&&s.ref!==A)&&(c.flags|=512,c.flags|=2097152)}function Ot(s,c,A,j,K){var ne=aa(A)?ll:Ei.current;return ne=Ll(c,ne),fn(c,K),A=ul(s,c,A,j,ne,K),j=to(),s!==null&&!oe?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~K,Ta(s,c,K)):(it&&j&&rt(c),c.flags|=1,Pe(s,c,A,K),c.child)}function Cn(s,c,A,j,K){if(aa(A)){var ne=!0;us(c)}else ne=!1;if(fn(c,K),c.stateNode===null)Cr(s,c),Ep(c,A,j),eh(c,A,j,K),j=!0;else if(s===null){var me=c.stateNode,Me=c.memoizedProps;me.props=Me;var De=me.context,tt=A.contextType;typeof tt=="object"&&tt!==null?tt=jn(tt):(tt=aa(A)?ll:Ei.current,tt=Ll(c,tt));var dt=A.getDerivedStateFromProps,vt=typeof dt=="function"||typeof me.getSnapshotBeforeUpdate=="function";vt||typeof me.UNSAFE_componentWillReceiveProps!="function"&&typeof me.componentWillReceiveProps!="function"||(Me!==j||De!==tt)&&Dh(c,me,j,tt),_o=!1;var ht=c.memoizedState;me.state=ht,Ho(c,j,me,K),De=c.memoizedState,Me!==j||ht!==De||ia.current||_o?(typeof dt=="function"&&(Ac(c,A,dt,j),De=c.memoizedState),(Me=_o||Jf(c,A,Me,j,ht,De,tt))?(vt||typeof me.UNSAFE_componentWillMount!="function"&&typeof me.componentWillMount!="function"||(typeof me.componentWillMount=="function"&&me.componentWillMount(),typeof me.UNSAFE_componentWillMount=="function"&&me.UNSAFE_componentWillMount()),typeof me.componentDidMount=="function"&&(c.flags|=4194308)):(typeof me.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=j,c.memoizedState=De),me.props=j,me.state=De,me.context=tt,j=Me):(typeof me.componentDidMount=="function"&&(c.flags|=4194308),j=!1)}else{me=c.stateNode,Xu(s,c),Me=c.memoizedProps,tt=c.type===c.elementType?Me:ba(c.type,Me),me.props=tt,vt=c.pendingProps,ht=me.context,De=A.contextType,typeof De=="object"&&De!==null?De=jn(De):(De=aa(A)?ll:Ei.current,De=Ll(c,De));var Nt=A.getDerivedStateFromProps;(dt=typeof Nt=="function"||typeof me.getSnapshotBeforeUpdate=="function")||typeof me.UNSAFE_componentWillReceiveProps!="function"&&typeof me.componentWillReceiveProps!="function"||(Me!==vt||ht!==De)&&Dh(c,me,j,De),_o=!1,ht=c.memoizedState,me.state=ht,Ho(c,j,me,K);var jt=c.memoizedState;Me!==vt||ht!==jt||ia.current||_o?(typeof Nt=="function"&&(Ac(c,A,Nt,j),jt=c.memoizedState),(tt=_o||Jf(c,A,tt,j,ht,jt,De)||!1)?(dt||typeof me.UNSAFE_componentWillUpdate!="function"&&typeof me.componentWillUpdate!="function"||(typeof me.componentWillUpdate=="function"&&me.componentWillUpdate(j,jt,De),typeof me.UNSAFE_componentWillUpdate=="function"&&me.UNSAFE_componentWillUpdate(j,jt,De)),typeof me.componentDidUpdate=="function"&&(c.flags|=4),typeof me.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof me.componentDidUpdate!="function"||Me===s.memoizedProps&&ht===s.memoizedState||(c.flags|=4),typeof me.getSnapshotBeforeUpdate!="function"||Me===s.memoizedProps&&ht===s.memoizedState||(c.flags|=1024),c.memoizedProps=j,c.memoizedState=jt),me.props=j,me.state=jt,me.context=De,j=tt):(typeof me.componentDidUpdate!="function"||Me===s.memoizedProps&&ht===s.memoizedState||(c.flags|=4),typeof me.getSnapshotBeforeUpdate!="function"||Me===s.memoizedProps&&ht===s.memoizedState||(c.flags|=1024),j=!1)}return cn(s,c,A,j,ne,K)}function cn(s,c,A,j,K,ne){or(s,c);var me=(c.flags&128)!==0;if(!j&&!me)return K&&Kf(c,A,!1),Ta(s,c,ne);j=c.stateNode,te.current=c;var Me=me&&typeof A.getDerivedStateFromError!="function"?null:j.render();return c.flags|=1,s!==null&&me?(c.child=si(c,s.child,null,ne),c.child=si(c,null,Me,ne)):Pe(s,c,Me,ne),c.memoizedState=j.state,K&&Kf(c,A,!0),c.child}function no(s){var c=s.stateNode;c.pendingContext?hf(s,c.pendingContext,c.pendingContext!==c.context):c.context&&hf(s,c.context,!1),Vo(s,c.containerInfo)}function cl(s,c,A,j,K){return ar(),jr(K),c.flags|=256,Pe(s,c,A,j),c.child}var et={dehydrated:null,treeContext:null,retryLane:0};function We(s){return{baseLanes:s,cachePool:null,transitions:null}}function ot(s,c,A){var j=c.pendingProps,K=rn.current,ne=!1,me=(c.flags&128)!==0,Me;if((Me=me)||(Me=s!==null&&s.memoizedState===null?!1:(K&2)!==0),Me?(ne=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(K|=1),Xr(rn,K&1),s===null)return wt(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((c.mode&1)===0?c.lanes=1:s.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(me=j.children,s=j.fallback,ne?(j=c.mode,ne=c.child,me={mode:"hidden",children:me},(j&1)===0&&ne!==null?(ne.childLanes=0,ne.pendingProps=me):ne=Fp(me,j,0,null),s=bf(s,j,A,null),ne.return=c,s.return=c,ne.sibling=s,c.child=ne,c.child.memoizedState=We(A),c.memoizedState=et,s):Ct(c,me));if(K=s.memoizedState,K!==null&&(Me=K.dehydrated,Me!==null))return pr(s,c,me,j,Me,K,A);if(ne){ne=j.fallback,me=c.mode,K=s.child,Me=K.sibling;var De={mode:"hidden",children:j.children};return(me&1)===0&&c.child!==K?(j=c.child,j.childLanes=0,j.pendingProps=De,c.deletions=null):(j=Mc(K,De),j.subtreeFlags=K.subtreeFlags&14680064),Me!==null?ne=Mc(Me,ne):(ne=bf(ne,me,A,null),ne.flags|=2),ne.return=c,j.return=c,j.sibling=ne,c.child=j,j=ne,ne=c.child,me=s.child.memoizedState,me=me===null?We(A):{baseLanes:me.baseLanes|A,cachePool:null,transitions:me.transitions},ne.memoizedState=me,ne.childLanes=s.childLanes&~A,c.memoizedState=et,j}return ne=s.child,s=ne.sibling,j=Mc(ne,{mode:"visible",children:j.children}),(c.mode&1)===0&&(j.lanes=A),j.return=c,j.sibling=null,s!==null&&(A=c.deletions,A===null?(c.deletions=[s],c.flags|=16):A.push(s)),c.child=j,c.memoizedState=null,j}function Ct(s,c){return c=Fp({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function Gt(s,c,A,j){return j!==null&&jr(j),si(c,s.child,null,A),s=Ct(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function pr(s,c,A,j,K,ne,me){if(A)return c.flags&256?(c.flags&=-257,j=th(Error(r(422))),Gt(s,c,me,j)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(ne=j.fallback,K=c.mode,j=Fp({mode:"visible",children:j.children},K,0,null),ne=bf(ne,K,me,null),ne.flags|=2,j.return=c,ne.return=c,j.sibling=ne,c.child=j,(c.mode&1)!==0&&si(c,s.child,null,me),c.child.memoizedState=We(me),c.memoizedState=et,ne);if((c.mode&1)===0)return Gt(s,c,me,null);if(K.data==="$!"){if(j=K.nextSibling&&K.nextSibling.dataset,j)var Me=j.dgst;return j=Me,ne=Error(r(419)),j=th(ne,j,void 0),Gt(s,c,me,j)}if(Me=(me&s.childLanes)!==0,oe||Me){if(j=Ra,j!==null){switch(me&-me){case 4:K=2;break;case 16:K=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:K=32;break;case 536870912:K=268435456;break;default:K=0}K=(K&(j.suspendedLanes|me))!==0?0:K,K!==0&&K!==ne.retryLane&&(ne.retryLane=K,Sr(s,K),Bl(j,s,K,-1))}return N0(),j=th(Error(r(421))),Gt(s,c,me,j)}return K.data==="$?"?(c.flags|=128,c.child=s.child,c=U8.bind(null,s),K._reactRetry=c,null):(s=ne.treeContext,qe=qi(K.nextSibling),ze=c,it=!0,st=null,s!==null&&(_e[Oe++]=Ye,_e[Oe++]=Ve,_e[Oe++]=Fe,Ye=s.id,Ve=s.overflow,Fe=c),c=Ct(c,j.children),c.flags|=4096,c)}function sr(s,c,A){s.lanes|=c;var j=s.alternate;j!==null&&(j.lanes|=c),Ka(s.return,c,A)}function Lr(s,c,A,j,K){var ne=s.memoizedState;ne===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:j,tail:A,tailMode:K}:(ne.isBackwards=c,ne.rendering=null,ne.renderingStartTime=0,ne.last=j,ne.tail=A,ne.tailMode=K)}function $i(s,c,A){var j=c.pendingProps,K=j.revealOrder,ne=j.tail;if(Pe(s,c,j.children,A),j=rn.current,(j&2)!==0)j=j&1|2,c.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&sr(s,A,c);else if(s.tag===19)sr(s,A,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}j&=1}if(Xr(rn,j),(c.mode&1)===0)c.memoizedState=null;else switch(K){case"forwards":for(A=c.child,K=null;A!==null;)s=A.alternate,s!==null&&Qa(s)===null&&(K=A),A=A.sibling;A=K,A===null?(K=c.child,c.child=null):(K=A.sibling,A.sibling=null),Lr(c,!1,K,A,ne);break;case"backwards":for(A=null,K=c.child,c.child=null;K!==null;){if(s=K.alternate,s!==null&&Qa(s)===null){c.child=K;break}s=K.sibling,K.sibling=A,A=K,K=s}Lr(c,!0,A,null,ne);break;case"together":Lr(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Cr(s,c){(c.mode&1)===0&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function Ta(s,c,A){if(s!==null&&(c.dependencies=s.dependencies),gf|=c.lanes,(A&c.childLanes)===0)return null;if(s!==null&&c.child!==s.child)throw Error(r(153));if(c.child!==null){for(s=c.child,A=Mc(s,s.pendingProps),c.child=A,A.return=c;s.sibling!==null;)s=s.sibling,A=A.sibling=Mc(s,s.pendingProps),A.return=c;A.sibling=null}return c.child}function g0(s,c,A){switch(c.tag){case 3:no(c),ar();break;case 5:gu(c);break;case 1:aa(c.type)&&us(c);break;case 4:Vo(c,c.stateNode.containerInfo);break;case 10:var j=c.type._context,K=c.memoizedProps.value;Xr(Vi,j._currentValue),j._currentValue=K;break;case 13:if(j=c.memoizedState,j!==null)return j.dehydrated!==null?(Xr(rn,rn.current&1),c.flags|=128,null):(A&c.child.childLanes)!==0?ot(s,c,A):(Xr(rn,rn.current&1),s=Ta(s,c,A),s!==null?s.sibling:null);Xr(rn,rn.current&1);break;case 19:if(j=(A&c.childLanes)!==0,(s.flags&128)!==0){if(j)return $i(s,c,A);c.flags|=128}if(K=c.memoizedState,K!==null&&(K.rendering=null,K.tail=null,K.lastEffect=null),Xr(rn,rn.current),j)break;return null;case 22:case 23:return c.lanes=0,Tt(s,c,A)}return Ta(s,c,A)}var lm,v0,um,cm;lm=function(s,c){for(var A=c.child;A!==null;){if(A.tag===5||A.tag===6)s.appendChild(A.stateNode);else if(A.tag!==4&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===c)break;for(;A.sibling===null;){if(A.return===null||A.return===c)return;A=A.return}A.sibling.return=A.return,A=A.sibling}},v0=function(){},um=function(s,c,A,j){var K=s.memoizedProps;if(K!==j){s=c.stateNode,Zn(Vr.current);var ne=null;switch(A){case"input":K=ke(s,K),j=ke(s,j),ne=[];break;case"select":K=z({},K,{value:void 0}),j=z({},j,{value:void 0}),ne=[];break;case"textarea":K=ge(s,K),j=ge(s,j),ne=[];break;default:typeof K.onClick!="function"&&typeof j.onClick=="function"&&(s.onclick=Is)}Ge(A,j);var me;A=null;for(tt in K)if(!j.hasOwnProperty(tt)&&K.hasOwnProperty(tt)&&K[tt]!=null)if(tt==="style"){var Me=K[tt];for(me in Me)Me.hasOwnProperty(me)&&(A||(A={}),A[me]="")}else tt!=="dangerouslySetInnerHTML"&&tt!=="children"&&tt!=="suppressContentEditableWarning"&&tt!=="suppressHydrationWarning"&&tt!=="autoFocus"&&(i.hasOwnProperty(tt)?ne||(ne=[]):(ne=ne||[]).push(tt,null));for(tt in j){var De=j[tt];if(Me=K?.[tt],j.hasOwnProperty(tt)&&De!==Me&&(De!=null||Me!=null))if(tt==="style")if(Me){for(me in Me)!Me.hasOwnProperty(me)||De&&De.hasOwnProperty(me)||(A||(A={}),A[me]="");for(me in De)De.hasOwnProperty(me)&&Me[me]!==De[me]&&(A||(A={}),A[me]=De[me])}else A||(ne||(ne=[]),ne.push(tt,A)),A=De;else tt==="dangerouslySetInnerHTML"?(De=De?De.__html:void 0,Me=Me?Me.__html:void 0,De!=null&&Me!==De&&(ne=ne||[]).push(tt,De)):tt==="children"?typeof De!="string"&&typeof De!="number"||(ne=ne||[]).push(tt,""+De):tt!=="suppressContentEditableWarning"&&tt!=="suppressHydrationWarning"&&(i.hasOwnProperty(tt)?(De!=null&&tt==="onScroll"&&en("scroll",s),ne||Me===De||(ne=[])):(ne=ne||[]).push(tt,De))}A&&(ne=ne||[]).push("style",A);var tt=ne;(c.updateQueue=tt)&&(c.flags|=4)}},cm=function(s,c,A,j){A!==j&&(c.flags|=4)};function Bh(s,c){if(!it)switch(s.tailMode){case"hidden":c=s.tail;for(var A=null;c!==null;)c.alternate!==null&&(A=c),c=c.sibling;A===null?s.tail=null:A.sibling=null;break;case"collapsed":A=s.tail;for(var j=null;A!==null;)A.alternate!==null&&(j=A),A=A.sibling;j===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:j.sibling=null}}function So(s){var c=s.alternate!==null&&s.alternate.child===s.child,A=0,j=0;if(c)for(var K=s.child;K!==null;)A|=K.lanes|K.childLanes,j|=K.subtreeFlags&14680064,j|=K.flags&14680064,K.return=s,K=K.sibling;else for(K=s.child;K!==null;)A|=K.lanes|K.childLanes,j|=K.subtreeFlags,j|=K.flags,K.return=s,K=K.sibling;return s.subtreeFlags|=j,s.childLanes=A,c}function L8(s,c,A){var j=c.pendingProps;switch(Ie(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return So(c),null;case 1:return aa(c.type)&&du(),So(c),null;case 3:return j=c.stateNode,tn(),Ur(ia),Ur(Ei),sa(),j.pendingContext&&(j.context=j.pendingContext,j.pendingContext=null),(s===null||s.child===null)&&(Ar(c)?c.flags|=4:s===null||s.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,st!==null&&(O0(st),st=null))),v0(s,c),So(c),null;case 5:Fs(c);var K=Zn(On.current);if(A=c.type,s!==null&&c.stateNode!=null)um(s,c,A,j,K),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!j){if(c.stateNode===null)throw Error(r(166));return So(c),null}if(s=Zn(Vr.current),Ar(c)){j=c.stateNode,A=c.type;var ne=c.memoizedProps;switch(j[yo]=c,j[fu]=ne,s=(c.mode&1)!==0,A){case"dialog":en("cancel",j),en("close",j);break;case"iframe":case"object":case"embed":en("load",j);break;case"video":case"audio":for(K=0;K<qo.length;K++)en(qo[K],j);break;case"source":en("error",j);break;case"img":case"image":case"link":en("error",j),en("load",j);break;case"details":en("toggle",j);break;case"input":Se(j,ne),en("invalid",j);break;case"select":j._wrapperState={wasMultiple:!!ne.multiple},en("invalid",j);break;case"textarea":Re(j,ne),en("invalid",j)}Ge(A,ne),K=null;for(var me in ne)if(ne.hasOwnProperty(me)){var Me=ne[me];me==="children"?typeof Me=="string"?j.textContent!==Me&&(ne.suppressHydrationWarning!==!0&&Gu(j.textContent,Me,s),K=["children",Me]):typeof Me=="number"&&j.textContent!==""+Me&&(ne.suppressHydrationWarning!==!0&&Gu(j.textContent,Me,s),K=["children",""+Me]):i.hasOwnProperty(me)&&Me!=null&&me==="onScroll"&&en("scroll",j)}switch(A){case"input":pe(j),xe(j,ne,!0);break;case"textarea":pe(j),Qe(j);break;case"select":case"option":break;default:typeof ne.onClick=="function"&&(j.onclick=Is)}j=K,c.updateQueue=j,j!==null&&(c.flags|=4)}else{me=K.nodeType===9?K:K.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=ct(A)),s==="http://www.w3.org/1999/xhtml"?A==="script"?(s=me.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof j.is=="string"?s=me.createElement(A,{is:j.is}):(s=me.createElement(A),A==="select"&&(me=s,j.multiple?me.multiple=!0:j.size&&(me.size=j.size))):s=me.createElementNS(s,A),s[yo]=c,s[fu]=j,lm(s,c,!1,!1),c.stateNode=s;e:{switch(me=Ze(A,j),A){case"dialog":en("cancel",s),en("close",s),K=j;break;case"iframe":case"object":case"embed":en("load",s),K=j;break;case"video":case"audio":for(K=0;K<qo.length;K++)en(qo[K],s);K=j;break;case"source":en("error",s),K=j;break;case"img":case"image":case"link":en("error",s),en("load",s),K=j;break;case"details":en("toggle",s),K=j;break;case"input":Se(s,j),K=ke(s,j),en("invalid",s);break;case"option":K=j;break;case"select":s._wrapperState={wasMultiple:!!j.multiple},K=z({},j,{value:void 0}),en("invalid",s);break;case"textarea":Re(s,j),K=ge(s,j),en("invalid",s);break;default:K=j}Ge(A,K),Me=K;for(ne in Me)if(Me.hasOwnProperty(ne)){var De=Me[ne];ne==="style"?Nr(s,De):ne==="dangerouslySetInnerHTML"?(De=De?De.__html:void 0,De!=null&&St(s,De)):ne==="children"?typeof De=="string"?(A!=="textarea"||De!=="")&&pt(s,De):typeof De=="number"&&pt(s,""+De):ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&ne!=="autoFocus"&&(i.hasOwnProperty(ne)?De!=null&&ne==="onScroll"&&en("scroll",s):De!=null&&w(s,ne,De,me))}switch(A){case"input":pe(s),xe(s,j,!1);break;case"textarea":pe(s),Qe(s);break;case"option":j.value!=null&&s.setAttribute("value",""+ae(j.value));break;case"select":s.multiple=!!j.multiple,ne=j.value,ne!=null?Te(s,!!j.multiple,ne,!1):j.defaultValue!=null&&Te(s,!!j.multiple,j.defaultValue,!0);break;default:typeof K.onClick=="function"&&(s.onclick=Is)}switch(A){case"button":case"input":case"select":case"textarea":j=!!j.autoFocus;break e;case"img":j=!0;break e;default:j=!1}}j&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return So(c),null;case 6:if(s&&c.stateNode!=null)cm(s,c,s.memoizedProps,j);else{if(typeof j!="string"&&c.stateNode===null)throw Error(r(166));if(A=Zn(On.current),Zn(Vr.current),Ar(c)){if(j=c.stateNode,A=c.memoizedProps,j[yo]=c,(ne=j.nodeValue!==A)&&(s=ze,s!==null))switch(s.tag){case 3:Gu(j.nodeValue,A,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&Gu(j.nodeValue,A,(s.mode&1)!==0)}ne&&(c.flags|=4)}else j=(A.nodeType===9?A:A.ownerDocument).createTextNode(j),j[yo]=c,c.stateNode=j}return So(c),null;case 13:if(Ur(rn),j=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(it&&qe!==null&&(c.mode&1)!==0&&(c.flags&128)===0)mr(),ar(),c.flags|=98560,ne=!1;else if(ne=Ar(c),j!==null&&j.dehydrated!==null){if(s===null){if(!ne)throw Error(r(318));if(ne=c.memoizedState,ne=ne!==null?ne.dehydrated:null,!ne)throw Error(r(317));ne[yo]=c}else ar(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;So(c),ne=!1}else st!==null&&(O0(st),st=null),ne=!0;if(!ne)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=A,c):(j=j!==null,j!==(s!==null&&s.memoizedState!==null)&&j&&(c.child.flags|=8192,(c.mode&1)!==0&&(s===null||(rn.current&1)!==0?wa===0&&(wa=3):N0())),c.updateQueue!==null&&(c.flags|=4),So(c),null);case 4:return tn(),v0(s,c),s===null&&Ms(c.stateNode.containerInfo),So(c),null;case 10:return ma(c.type._context),So(c),null;case 17:return aa(c.type)&&du(),So(c),null;case 19:if(Ur(rn),ne=c.memoizedState,ne===null)return So(c),null;if(j=(c.flags&128)!==0,me=ne.rendering,me===null)if(j)Bh(ne,!1);else{if(wa!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(me=Qa(s),me!==null){for(c.flags|=128,Bh(ne,!1),j=me.updateQueue,j!==null&&(c.updateQueue=j,c.flags|=4),c.subtreeFlags=0,j=A,A=c.child;A!==null;)ne=A,s=j,ne.flags&=14680066,me=ne.alternate,me===null?(ne.childLanes=0,ne.lanes=s,ne.child=null,ne.subtreeFlags=0,ne.memoizedProps=null,ne.memoizedState=null,ne.updateQueue=null,ne.dependencies=null,ne.stateNode=null):(ne.childLanes=me.childLanes,ne.lanes=me.lanes,ne.child=me.child,ne.subtreeFlags=0,ne.deletions=null,ne.memoizedProps=me.memoizedProps,ne.memoizedState=me.memoizedState,ne.updateQueue=me.updateQueue,ne.type=me.type,s=me.dependencies,ne.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),A=A.sibling;return Xr(rn,rn.current&1|2),c.child}s=s.sibling}ne.tail!==null&&Nn()>ih&&(c.flags|=128,j=!0,Bh(ne,!1),c.lanes=4194304)}else{if(!j)if(s=Qa(me),s!==null){if(c.flags|=128,j=!0,A=s.updateQueue,A!==null&&(c.updateQueue=A,c.flags|=4),Bh(ne,!0),ne.tail===null&&ne.tailMode==="hidden"&&!me.alternate&&!it)return So(c),null}else 2*Nn()-ne.renderingStartTime>ih&&A!==1073741824&&(c.flags|=128,j=!0,Bh(ne,!1),c.lanes=4194304);ne.isBackwards?(me.sibling=c.child,c.child=me):(A=ne.last,A!==null?A.sibling=me:c.child=me,ne.last=me)}return ne.tail!==null?(c=ne.tail,ne.rendering=c,ne.tail=c.sibling,ne.renderingStartTime=Nn(),c.sibling=null,A=rn.current,Xr(rn,j?A&1|2:A&1),c):(So(c),null);case 22:case 23:return k0(),j=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==j&&(c.flags|=8192),j&&(c.mode&1)!==0?(Bs&1073741824)!==0&&(So(c),c.subtreeFlags&6&&(c.flags|=8192)):So(c),null;case 24:return null;case 25:return null}throw Error(r(156,c.tag))}function T8(s,c){switch(Ie(c),c.tag){case 1:return aa(c.type)&&du(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return tn(),Ur(ia),Ur(Ei),sa(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 5:return Fs(c),null;case 13:if(Ur(rn),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));ar()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return Ur(rn),null;case 4:return tn(),null;case 10:return ma(c.type._context),null;case 22:case 23:return k0(),null;case 24:return null;default:return null}}var Ap=!1,Eo=!1,R8=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function rh(s,c){var A=s.ref;if(A!==null)if(typeof A=="function")try{A(null)}catch(j){Oi(s,c,j)}else A.current=null}function m0(s,c,A){try{A()}catch(j){Oi(s,c,j)}}var fm=!1;function M8(s,c){if($u=nu,s=Vn(),os(s)){if("selectionStart"in s)var A={start:s.selectionStart,end:s.selectionEnd};else e:{A=(A=s.ownerDocument)&&A.defaultView||window;var j=A.getSelection&&A.getSelection();if(j&&j.rangeCount!==0){A=j.anchorNode;var K=j.anchorOffset,ne=j.focusNode;j=j.focusOffset;try{A.nodeType,ne.nodeType}catch{A=null;break e}var me=0,Me=-1,De=-1,tt=0,dt=0,vt=s,ht=null;t:for(;;){for(var Nt;vt!==A||K!==0&&vt.nodeType!==3||(Me=me+K),vt!==ne||j!==0&&vt.nodeType!==3||(De=me+j),vt.nodeType===3&&(me+=vt.nodeValue.length),(Nt=vt.firstChild)!==null;)ht=vt,vt=Nt;for(;;){if(vt===s)break t;if(ht===A&&++tt===K&&(Me=me),ht===ne&&++dt===j&&(De=me),(Nt=vt.nextSibling)!==null)break;vt=ht,ht=vt.parentNode}vt=Nt}A=Me===-1||De===-1?null:{start:Me,end:De}}else A=null}A=A||{start:0,end:0}}else A=null;for(Nl={focusedElem:s,selectionRange:A},nu=!1,Mt=c;Mt!==null;)if(c=Mt,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,Mt=s;else for(;Mt!==null;){c=Mt;try{var jt=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(jt!==null){var zt=jt.memoizedProps,Wi=jt.memoizedState,Ke=c.stateNode,Ue=Ke.getSnapshotBeforeUpdate(c.elementType===c.type?zt:ba(c.type,zt),Wi);Ke.__reactInternalSnapshotBeforeUpdate=Ue}break;case 3:var Je=c.stateNode.containerInfo;Je.nodeType===1?Je.textContent="":Je.nodeType===9&&Je.documentElement&&Je.removeChild(Je.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(bt){Oi(c,c.return,bt)}if(s=c.sibling,s!==null){s.return=c.return,Mt=s;break}Mt=c.return}return jt=fm,fm=!1,jt}function zh(s,c,A){var j=c.updateQueue;if(j=j!==null?j.lastEffect:null,j!==null){var K=j=j.next;do{if((K.tag&s)===s){var ne=K.destroy;K.destroy=void 0,ne!==void 0&&m0(c,A,ne)}K=K.next}while(K!==j)}}function Op(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var A=c=c.next;do{if((A.tag&s)===s){var j=A.create;A.destroy=j()}A=A.next}while(A!==c)}}function y0(s){var c=s.ref;if(c!==null){var A=s.stateNode;switch(s.tag){case 5:s=A;break;default:s=A}typeof c=="function"?c(s):c.current=s}}function hm(s){var c=s.alternate;c!==null&&(s.alternate=null,hm(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&(delete c[yo],delete c[fu],delete c[va],delete c[Yf],delete c[Xf])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function dm(s){return s.tag===5||s.tag===3||s.tag===4}function pm(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||dm(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function b0(s,c,A){var j=s.tag;if(j===5||j===6)s=s.stateNode,c?A.nodeType===8?A.parentNode.insertBefore(s,c):A.insertBefore(s,c):(A.nodeType===8?(c=A.parentNode,c.insertBefore(s,A)):(c=A,c.appendChild(s)),A=A._reactRootContainer,A!=null||c.onclick!==null||(c.onclick=Is));else if(j!==4&&(s=s.child,s!==null))for(b0(s,c,A),s=s.sibling;s!==null;)b0(s,c,A),s=s.sibling}function w0(s,c,A){var j=s.tag;if(j===5||j===6)s=s.stateNode,c?A.insertBefore(s,c):A.appendChild(s);else if(j!==4&&(s=s.child,s!==null))for(w0(s,c,A),s=s.sibling;s!==null;)w0(s,c,A),s=s.sibling}var io=null,Fl=!1;function kc(s,c,A){for(A=A.child;A!==null;)gm(s,c,A),A=A.sibling}function gm(s,c,A){if(fi&&typeof fi.onCommitFiberUnmount=="function")try{fi.onCommitFiberUnmount(fo,A)}catch{}switch(A.tag){case 5:Eo||rh(A,c);case 6:var j=io,K=Fl;io=null,kc(s,c,A),io=j,Fl=K,io!==null&&(Fl?(s=io,A=A.stateNode,s.nodeType===8?s.parentNode.removeChild(A):s.removeChild(A)):io.removeChild(A.stateNode));break;case 18:io!==null&&(Fl?(s=io,A=A.stateNode,s.nodeType===8?bc(s.parentNode,A):s.nodeType===1&&bc(s,A),ri(s)):bc(io,A.stateNode));break;case 4:j=io,K=Fl,io=A.stateNode.containerInfo,Fl=!0,kc(s,c,A),io=j,Fl=K;break;case 0:case 11:case 14:case 15:if(!Eo&&(j=A.updateQueue,j!==null&&(j=j.lastEffect,j!==null))){K=j=j.next;do{var ne=K,me=ne.destroy;ne=ne.tag,me!==void 0&&((ne&2)!==0||(ne&4)!==0)&&m0(A,c,me),K=K.next}while(K!==j)}kc(s,c,A);break;case 1:if(!Eo&&(rh(A,c),j=A.stateNode,typeof j.componentWillUnmount=="function"))try{j.props=A.memoizedProps,j.state=A.memoizedState,j.componentWillUnmount()}catch(Me){Oi(A,c,Me)}kc(s,c,A);break;case 21:kc(s,c,A);break;case 22:A.mode&1?(Eo=(j=Eo)||A.memoizedState!==null,kc(s,c,A),Eo=j):kc(s,c,A);break;default:kc(s,c,A)}}function vm(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var A=s.stateNode;A===null&&(A=s.stateNode=new R8),c.forEach(function(j){var K=H8.bind(null,s,j);A.has(j)||(A.add(j),j.then(K,K))})}}function Dl(s,c){var A=c.deletions;if(A!==null)for(var j=0;j<A.length;j++){var K=A[j];try{var ne=s,me=c,Me=me;e:for(;Me!==null;){switch(Me.tag){case 5:io=Me.stateNode,Fl=!1;break e;case 3:io=Me.stateNode.containerInfo,Fl=!0;break e;case 4:io=Me.stateNode.containerInfo,Fl=!0;break e}Me=Me.return}if(io===null)throw Error(r(160));gm(ne,me,K),io=null,Fl=!1;var De=K.alternate;De!==null&&(De.return=null),K.return=null}catch(tt){Oi(K,c,tt)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)mm(c,s),c=c.sibling}function mm(s,c){var A=s.alternate,j=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Dl(c,s),_u(s),j&4){try{zh(3,s,s.return),Op(3,s)}catch(zt){Oi(s,s.return,zt)}try{zh(5,s,s.return)}catch(zt){Oi(s,s.return,zt)}}break;case 1:Dl(c,s),_u(s),j&512&&A!==null&&rh(A,A.return);break;case 5:if(Dl(c,s),_u(s),j&512&&A!==null&&rh(A,A.return),s.flags&32){var K=s.stateNode;try{pt(K,"")}catch(zt){Oi(s,s.return,zt)}}if(j&4&&(K=s.stateNode,K!=null)){var ne=s.memoizedProps,me=A!==null?A.memoizedProps:ne,Me=s.type,De=s.updateQueue;if(s.updateQueue=null,De!==null)try{Me==="input"&&ne.type==="radio"&&ne.name!=null&&le(K,ne),Ze(Me,me);var tt=Ze(Me,ne);for(me=0;me<De.length;me+=2){var dt=De[me],vt=De[me+1];dt==="style"?Nr(K,vt):dt==="dangerouslySetInnerHTML"?St(K,vt):dt==="children"?pt(K,vt):w(K,dt,vt,tt)}switch(Me){case"input":Ee(K,ne);break;case"textarea":Be(K,ne);break;case"select":var ht=K._wrapperState.wasMultiple;K._wrapperState.wasMultiple=!!ne.multiple;var Nt=ne.value;Nt!=null?Te(K,!!ne.multiple,Nt,!1):ht!==!!ne.multiple&&(ne.defaultValue!=null?Te(K,!!ne.multiple,ne.defaultValue,!0):Te(K,!!ne.multiple,ne.multiple?[]:"",!1))}K[fu]=ne}catch(zt){Oi(s,s.return,zt)}}break;case 6:if(Dl(c,s),_u(s),j&4){if(s.stateNode===null)throw Error(r(162));K=s.stateNode,ne=s.memoizedProps;try{K.nodeValue=ne}catch(zt){Oi(s,s.return,zt)}}break;case 3:if(Dl(c,s),_u(s),j&4&&A!==null&&A.memoizedState.isDehydrated)try{ri(c.containerInfo)}catch(zt){Oi(s,s.return,zt)}break;case 4:Dl(c,s),_u(s);break;case 13:Dl(c,s),_u(s),K=s.child,K.flags&8192&&(ne=K.memoizedState!==null,K.stateNode.isHidden=ne,!ne||K.alternate!==null&&K.alternate.memoizedState!==null||(S0=Nn())),j&4&&vm(s);break;case 22:if(dt=A!==null&&A.memoizedState!==null,s.mode&1?(Eo=(tt=Eo)||dt,Dl(c,s),Eo=tt):Dl(c,s),_u(s),j&8192){if(tt=s.memoizedState!==null,(s.stateNode.isHidden=tt)&&!dt&&(s.mode&1)!==0)for(Mt=s,dt=s.child;dt!==null;){for(vt=Mt=dt;Mt!==null;){switch(ht=Mt,Nt=ht.child,ht.tag){case 0:case 11:case 14:case 15:zh(4,ht,ht.return);break;case 1:rh(ht,ht.return);var jt=ht.stateNode;if(typeof jt.componentWillUnmount=="function"){j=ht,A=ht.return;try{c=j,jt.props=c.memoizedProps,jt.state=c.memoizedState,jt.componentWillUnmount()}catch(zt){Oi(j,A,zt)}}break;case 5:rh(ht,ht.return);break;case 22:if(ht.memoizedState!==null){wm(vt);continue}}Nt!==null?(Nt.return=ht,Mt=Nt):wm(vt)}dt=dt.sibling}e:for(dt=null,vt=s;;){if(vt.tag===5){if(dt===null){dt=vt;try{K=vt.stateNode,tt?(ne=K.style,typeof ne.setProperty=="function"?ne.setProperty("display","none","important"):ne.display="none"):(Me=vt.stateNode,De=vt.memoizedProps.style,me=De!=null&&De.hasOwnProperty("display")?De.display:null,Me.style.display=rr("display",me))}catch(zt){Oi(s,s.return,zt)}}}else if(vt.tag===6){if(dt===null)try{vt.stateNode.nodeValue=tt?"":vt.memoizedProps}catch(zt){Oi(s,s.return,zt)}}else if((vt.tag!==22&&vt.tag!==23||vt.memoizedState===null||vt===s)&&vt.child!==null){vt.child.return=vt,vt=vt.child;continue}if(vt===s)break e;for(;vt.sibling===null;){if(vt.return===null||vt.return===s)break e;dt===vt&&(dt=null),vt=vt.return}dt===vt&&(dt=null),vt.sibling.return=vt.return,vt=vt.sibling}}break;case 19:Dl(c,s),_u(s),j&4&&vm(s);break;case 21:break;default:Dl(c,s),_u(s)}}function _u(s){var c=s.flags;if(c&2){try{e:{for(var A=s.return;A!==null;){if(dm(A)){var j=A;break e}A=A.return}throw Error(r(160))}switch(j.tag){case 5:var K=j.stateNode;j.flags&32&&(pt(K,""),j.flags&=-33);var ne=pm(s);w0(s,ne,K);break;case 3:case 4:var me=j.stateNode.containerInfo,Me=pm(s);b0(s,Me,me);break;default:throw Error(r(161))}}catch(De){Oi(s,s.return,De)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function I8(s,c,A){Mt=s,ym(s)}function ym(s,c,A){for(var j=(s.mode&1)!==0;Mt!==null;){var K=Mt,ne=K.child;if(K.tag===22&&j){var me=K.memoizedState!==null||Ap;if(!me){var Me=K.alternate,De=Me!==null&&Me.memoizedState!==null||Eo;Me=Ap;var tt=Eo;if(Ap=me,(Eo=De)&&!tt)for(Mt=K;Mt!==null;)me=Mt,De=me.child,me.tag===22&&me.memoizedState!==null?_m(K):De!==null?(De.return=me,Mt=De):_m(K);for(;ne!==null;)Mt=ne,ym(ne),ne=ne.sibling;Mt=K,Ap=Me,Eo=tt}bm(s)}else(K.subtreeFlags&8772)!==0&&ne!==null?(ne.return=K,Mt=ne):bm(s)}}function bm(s){for(;Mt!==null;){var c=Mt;if((c.flags&8772)!==0){var A=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Eo||Op(5,c);break;case 1:var j=c.stateNode;if(c.flags&4&&!Eo)if(A===null)j.componentDidMount();else{var K=c.elementType===c.type?A.memoizedProps:ba(c.type,A.memoizedProps);j.componentDidUpdate(K,A.memoizedState,j.__reactInternalSnapshotBeforeUpdate)}var ne=c.updateQueue;ne!==null&&un(c,ne,j);break;case 3:var me=c.updateQueue;if(me!==null){if(A=null,c.child!==null)switch(c.child.tag){case 5:A=c.child.stateNode;break;case 1:A=c.child.stateNode}un(c,me,A)}break;case 5:var Me=c.stateNode;if(A===null&&c.flags&4){A=Me;var De=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":De.autoFocus&&A.focus();break;case"img":De.src&&(A.src=De.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var tt=c.alternate;if(tt!==null){var dt=tt.memoizedState;if(dt!==null){var vt=dt.dehydrated;vt!==null&&ri(vt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Eo||c.flags&512&&y0(c)}catch(ht){Oi(c,c.return,ht)}}if(c===s){Mt=null;break}if(A=c.sibling,A!==null){A.return=c.return,Mt=A;break}Mt=c.return}}function wm(s){for(;Mt!==null;){var c=Mt;if(c===s){Mt=null;break}var A=c.sibling;if(A!==null){A.return=c.return,Mt=A;break}Mt=c.return}}function _m(s){for(;Mt!==null;){var c=Mt;try{switch(c.tag){case 0:case 11:case 15:var A=c.return;try{Op(4,c)}catch(De){Oi(c,A,De)}break;case 1:var j=c.stateNode;if(typeof j.componentDidMount=="function"){var K=c.return;try{j.componentDidMount()}catch(De){Oi(c,K,De)}}var ne=c.return;try{y0(c)}catch(De){Oi(c,ne,De)}break;case 5:var me=c.return;try{y0(c)}catch(De){Oi(c,me,De)}}}catch(De){Oi(c,c.return,De)}if(c===s){Mt=null;break}var Me=c.sibling;if(Me!==null){Me.return=c.return,Mt=Me;break}Mt=c.return}}var j8=Math.ceil,Cp=E.ReactCurrentDispatcher,_0=E.ReactCurrentOwner,fl=E.ReactCurrentBatchConfig,Zr=0,Ra=null,ua=null,ao=0,Bs=0,nh=bo(0),wa=0,qh=null,gf=0,kp=0,x0=0,Uh=null,gs=null,S0=0,ih=1/0,Ju=null,Np=!1,E0=null,Nc=null,Lp=!1,Lc=null,Tp=0,Hh=0,P0=null,Rp=-1,Mp=0;function Wo(){return(Zr&6)!==0?Nn():Rp!==-1?Rp:Rp=Nn()}function Tc(s){return(s.mode&1)===0?1:(Zr&2)!==0&&ao!==0?ao&-ao:Hr.transition!==null?(Mp===0&&(Mp=Jl()),Mp):(s=wr,s!==0||(s=window.event,s=s===void 0?16:Uu(s.type)),s)}function Bl(s,c,A,j){if(50<Hh)throw Hh=0,P0=null,Error(r(185));Ys(s,A,j),((Zr&2)===0||s!==Ra)&&(s===Ra&&((Zr&2)===0&&(kp|=A),wa===4&&Rc(s,ao)),vs(s,j),A===1&&Zr===0&&(c.mode&1)===0&&(ih=Nn()+500,Tl&&ie()))}function vs(s,c){var A=s.callbackNode;pa(s,c);var j=Ti(s,s===Ra?ao:0);if(j===0)A!==null&&Ko(A),s.callbackNode=null,s.callbackPriority=0;else if(c=j&-j,s.callbackPriority!==c){if(A!=null&&Ko(A),c===1)s.tag===0?Z(Sm.bind(null,s)):B(Sm.bind(null,s)),$f(function(){(Zr&6)===0&&ie()}),A=null;else{switch(Os(j)){case 1:A=co;break;case 4:A=ml;break;case 16:A=Ws;break;case 536870912:A=Ql;break;default:A=Ws}A=Lm(A,xm.bind(null,s))}s.callbackPriority=c,s.callbackNode=A}}function xm(s,c){if(Rp=-1,Mp=0,(Zr&6)!==0)throw Error(r(327));var A=s.callbackNode;if(ah()&&s.callbackNode!==A)return null;var j=Ti(s,s===Ra?ao:0);if(j===0)return null;if((j&30)!==0||(j&s.expiredLanes)!==0||c)c=Ip(s,j);else{c=j;var K=Zr;Zr|=2;var ne=Pm();(Ra!==s||ao!==c)&&(Ju=null,ih=Nn()+500,mf(s,c));do try{B8();break}catch(Me){Em(s,Me)}while(!0);Pi(),Cp.current=ne,Zr=K,ua!==null?c=0:(Ra=null,ao=0,c=wa)}if(c!==0){if(c===2&&(K=Zo(s),K!==0&&(j=K,c=A0(s,K))),c===1)throw A=qh,mf(s,0),Rc(s,j),vs(s,Nn()),A;if(c===6)Rc(s,j);else{if(K=s.current.alternate,(j&30)===0&&!F8(K)&&(c=Ip(s,j),c===2&&(ne=Zo(s),ne!==0&&(j=ne,c=A0(s,ne))),c===1))throw A=qh,mf(s,0),Rc(s,j),vs(s,Nn()),A;switch(s.finishedWork=K,s.finishedLanes=j,c){case 0:case 1:throw Error(r(345));case 2:yf(s,gs,Ju);break;case 3:if(Rc(s,j),(j&130023424)===j&&(c=S0+500-Nn(),10<c)){if(Ti(s,0)!==0)break;if(K=s.suspendedLanes,(K&j)!==j){Wo(),s.pingedLanes|=s.suspendedLanes&K;break}s.timeoutHandle=Xa(yf.bind(null,s,gs,Ju),c);break}yf(s,gs,Ju);break;case 4:if(Rc(s,j),(j&4194240)===j)break;for(c=s.eventTimes,K=-1;0<j;){var me=31-dr(j);ne=1<<me,me=c[me],me>K&&(K=me),j&=~ne}if(j=K,j=Nn()-j,j=(120>j?120:480>j?480:1080>j?1080:1920>j?1920:3e3>j?3e3:4320>j?4320:1960*j8(j/1960))-j,10<j){s.timeoutHandle=Xa(yf.bind(null,s,gs,Ju),j);break}yf(s,gs,Ju);break;case 5:yf(s,gs,Ju);break;default:throw Error(r(329))}}}return vs(s,Nn()),s.callbackNode===A?xm.bind(null,s):null}function A0(s,c){var A=Uh;return s.current.memoizedState.isDehydrated&&(mf(s,c).flags|=256),s=Ip(s,c),s!==2&&(c=gs,gs=A,c!==null&&O0(c)),s}function O0(s){gs===null?gs=s:gs.push.apply(gs,s)}function F8(s){for(var c=s;;){if(c.flags&16384){var A=c.updateQueue;if(A!==null&&(A=A.stores,A!==null))for(var j=0;j<A.length;j++){var K=A[j],ne=K.getSnapshot;K=K.value;try{if(!_r(ne(),K))return!1}catch{return!1}}}if(A=c.child,c.subtreeFlags&16384&&A!==null)A.return=c,c=A;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Rc(s,c){for(c&=~x0,c&=~kp,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var A=31-dr(c),j=1<<A;s[A]=-1,c&=~j}}function Sm(s){if((Zr&6)!==0)throw Error(r(327));ah();var c=Ti(s,0);if((c&1)===0)return vs(s,Nn()),null;var A=Ip(s,c);if(s.tag!==0&&A===2){var j=Zo(s);j!==0&&(c=j,A=A0(s,j))}if(A===1)throw A=qh,mf(s,0),Rc(s,c),vs(s,Nn()),A;if(A===6)throw Error(r(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,yf(s,gs,Ju),vs(s,Nn()),null}function C0(s,c){var A=Zr;Zr|=1;try{return s(c)}finally{Zr=A,Zr===0&&(ih=Nn()+500,Tl&&ie())}}function vf(s){Lc!==null&&Lc.tag===0&&(Zr&6)===0&&ah();var c=Zr;Zr|=1;var A=fl.transition,j=wr;try{if(fl.transition=null,wr=1,s)return s()}finally{wr=j,fl.transition=A,Zr=c,(Zr&6)===0&&ie()}}function k0(){Bs=nh.current,Ur(nh)}function mf(s,c){s.finishedWork=null,s.finishedLanes=0;var A=s.timeoutHandle;if(A!==-1&&(s.timeoutHandle=-1,yc(A)),ua!==null)for(A=ua.return;A!==null;){var j=A;switch(Ie(j),j.tag){case 1:j=j.type.childContextTypes,j!=null&&du();break;case 3:tn(),Ur(ia),Ur(Ei),sa();break;case 5:Fs(j);break;case 4:tn();break;case 13:Ur(rn);break;case 19:Ur(rn);break;case 10:ma(j.type._context);break;case 22:case 23:k0()}A=A.return}if(Ra=s,ua=s=Mc(s.current,null),ao=Bs=c,wa=0,qh=null,x0=kp=gf=0,gs=Uh=null,oa!==null){for(c=0;c<oa.length;c++)if(A=oa[c],j=A.interleaved,j!==null){A.interleaved=null;var K=j.next,ne=A.pending;if(ne!==null){var me=ne.next;ne.next=K,j.next=me}A.pending=j}oa=null}return s}function Em(s,c){do{var A=ua;try{if(Pi(),vu.current=Pc,Ja){for(var j=Kr.memoizedState;j!==null;){var K=j.queue;K!==null&&(K.pending=null),j=j.next}Ja=!1}if(Ai=0,Dn=Fn=Kr=null,xo=!1,eo=0,_0.current=null,A===null||A.return===null){wa=1,qh=c,ua=null;break}e:{var ne=s,me=A.return,Me=A,De=c;if(c=ao,Me.flags|=32768,De!==null&&typeof De=="object"&&typeof De.then=="function"){var tt=De,dt=Me,vt=dt.tag;if((dt.mode&1)===0&&(vt===0||vt===11||vt===15)){var ht=dt.alternate;ht?(dt.updateQueue=ht.updateQueue,dt.memoizedState=ht.memoizedState,dt.lanes=ht.lanes):(dt.updateQueue=null,dt.memoizedState=null)}var Nt=I(me);if(Nt!==null){Nt.flags&=-257,W(Nt,me,Me,ne,c),Nt.mode&1&&y(ne,tt,c),c=Nt,De=tt;var jt=c.updateQueue;if(jt===null){var zt=new Set;zt.add(De),c.updateQueue=zt}else jt.add(De);break e}else{if((c&1)===0){y(ne,tt,c),N0();break e}De=Error(r(426))}}else if(it&&Me.mode&1){var Wi=I(me);if(Wi!==null){(Wi.flags&65536)===0&&(Wi.flags|=256),W(Wi,me,Me,ne,c),jr(Qu(De,Me));break e}}ne=De=Qu(De,Me),wa!==4&&(wa=2),Uh===null?Uh=[ne]:Uh.push(ne),ne=me;do{switch(ne.tag){case 3:ne.flags|=65536,c&=-c,ne.lanes|=c;var Ke=Pp(ne,De,c);ya(ne,Ke);break e;case 1:Me=De;var Ue=ne.type,Je=ne.stateNode;if((ne.flags&128)===0&&(typeof Ue.getDerivedStateFromError=="function"||Je!==null&&typeof Je.componentDidCatch=="function"&&(Nc===null||!Nc.has(Je)))){ne.flags|=65536,c&=-c,ne.lanes|=c;var bt=g(ne,Me,c);ya(ne,bt);break e}}ne=ne.return}while(ne!==null)}Om(A)}catch(Ht){c=Ht,ua===A&&A!==null&&(ua=A=A.return);continue}break}while(!0)}function Pm(){var s=Cp.current;return Cp.current=Pc,s===null?Pc:s}function N0(){(wa===0||wa===3||wa===2)&&(wa=4),Ra===null||(gf&268435455)===0&&(kp&268435455)===0||Rc(Ra,ao)}function Ip(s,c){var A=Zr;Zr|=2;var j=Pm();(Ra!==s||ao!==c)&&(Ju=null,mf(s,c));do try{D8();break}catch(K){Em(s,K)}while(!0);if(Pi(),Zr=A,Cp.current=j,ua!==null)throw Error(r(261));return Ra=null,ao=0,wa}function D8(){for(;ua!==null;)Am(ua)}function B8(){for(;ua!==null&&!Zl();)Am(ua)}function Am(s){var c=Nm(s.alternate,s,Bs);s.memoizedProps=s.pendingProps,c===null?Om(s):ua=c,_0.current=null}function Om(s){var c=s;do{var A=c.alternate;if(s=c.return,(c.flags&32768)===0){if(A=L8(A,c,Bs),A!==null){ua=A;return}}else{if(A=T8(A,c),A!==null){A.flags&=32767,ua=A;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{wa=6,ua=null;return}}if(c=c.sibling,c!==null){ua=c;return}ua=c=s}while(c!==null);wa===0&&(wa=5)}function yf(s,c,A){var j=wr,K=fl.transition;try{fl.transition=null,wr=1,z8(s,c,A,j)}finally{fl.transition=K,wr=j}return null}function z8(s,c,A,j){do ah();while(Lc!==null);if((Zr&6)!==0)throw Error(r(327));A=s.finishedWork;var K=s.finishedLanes;if(A===null)return null;if(s.finishedWork=null,s.finishedLanes=0,A===s.current)throw Error(r(177));s.callbackNode=null,s.callbackPriority=0;var ne=A.lanes|A.childLanes;if(sf(s,ne),s===Ra&&(ua=Ra=null,ao=0),(A.subtreeFlags&2064)===0&&(A.flags&2064)===0||Lp||(Lp=!0,Lm(Ws,function(){return ah(),null})),ne=(A.flags&15990)!==0,(A.subtreeFlags&15990)!==0||ne){ne=fl.transition,fl.transition=null;var me=wr;wr=1;var Me=Zr;Zr|=4,_0.current=null,M8(s,A),mm(A,s),Io(Nl),nu=!!$u,Nl=$u=null,s.current=A,I8(A),gc(),Zr=Me,wr=me,fl.transition=ne}else s.current=A;if(Lp&&(Lp=!1,Lc=s,Tp=K),ne=s.pendingLanes,ne===0&&(Nc=null),qr(A.stateNode),vs(s,Nn()),c!==null)for(j=s.onRecoverableError,A=0;A<c.length;A++)K=c[A],j(K.value,{componentStack:K.stack,digest:K.digest});if(Np)throw Np=!1,s=E0,E0=null,s;return(Tp&1)!==0&&s.tag!==0&&ah(),ne=s.pendingLanes,(ne&1)!==0?s===P0?Hh++:(Hh=0,P0=s):Hh=0,ie(),null}function ah(){if(Lc!==null){var s=Os(Tp),c=fl.transition,A=wr;try{if(fl.transition=null,wr=16>s?16:s,Lc===null)var j=!1;else{if(s=Lc,Lc=null,Tp=0,(Zr&6)!==0)throw Error(r(331));var K=Zr;for(Zr|=4,Mt=s.current;Mt!==null;){var ne=Mt,me=ne.child;if((Mt.flags&16)!==0){var Me=ne.deletions;if(Me!==null){for(var De=0;De<Me.length;De++){var tt=Me[De];for(Mt=tt;Mt!==null;){var dt=Mt;switch(dt.tag){case 0:case 11:case 15:zh(8,dt,ne)}var vt=dt.child;if(vt!==null)vt.return=dt,Mt=vt;else for(;Mt!==null;){dt=Mt;var ht=dt.sibling,Nt=dt.return;if(hm(dt),dt===tt){Mt=null;break}if(ht!==null){ht.return=Nt,Mt=ht;break}Mt=Nt}}}var jt=ne.alternate;if(jt!==null){var zt=jt.child;if(zt!==null){jt.child=null;do{var Wi=zt.sibling;zt.sibling=null,zt=Wi}while(zt!==null)}}Mt=ne}}if((ne.subtreeFlags&2064)!==0&&me!==null)me.return=ne,Mt=me;else e:for(;Mt!==null;){if(ne=Mt,(ne.flags&2048)!==0)switch(ne.tag){case 0:case 11:case 15:zh(9,ne,ne.return)}var Ke=ne.sibling;if(Ke!==null){Ke.return=ne.return,Mt=Ke;break e}Mt=ne.return}}var Ue=s.current;for(Mt=Ue;Mt!==null;){me=Mt;var Je=me.child;if((me.subtreeFlags&2064)!==0&&Je!==null)Je.return=me,Mt=Je;else e:for(me=Ue;Mt!==null;){if(Me=Mt,(Me.flags&2048)!==0)try{switch(Me.tag){case 0:case 11:case 15:Op(9,Me)}}catch(Ht){Oi(Me,Me.return,Ht)}if(Me===me){Mt=null;break e}var bt=Me.sibling;if(bt!==null){bt.return=Me.return,Mt=bt;break e}Mt=Me.return}}if(Zr=K,ie(),fi&&typeof fi.onPostCommitFiberRoot=="function")try{fi.onPostCommitFiberRoot(fo,s)}catch{}j=!0}return j}finally{wr=A,fl.transition=c}}return!1}function Cm(s,c,A){c=Qu(A,c),c=Pp(s,c,1),s=Na(s,c,1),c=Wo(),s!==null&&(Ys(s,1,c),vs(s,c))}function Oi(s,c,A){if(s.tag===3)Cm(s,s,A);else for(;c!==null;){if(c.tag===3){Cm(c,s,A);break}else if(c.tag===1){var j=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof j.componentDidCatch=="function"&&(Nc===null||!Nc.has(j))){s=Qu(A,s),s=g(c,s,1),c=Na(c,s,1),s=Wo(),c!==null&&(Ys(c,1,s),vs(c,s));break}}c=c.return}}function q8(s,c,A){var j=s.pingCache;j!==null&&j.delete(c),c=Wo(),s.pingedLanes|=s.suspendedLanes&A,Ra===s&&(ao&A)===A&&(wa===4||wa===3&&(ao&130023424)===ao&&500>Nn()-S0?mf(s,0):x0|=A),vs(s,c)}function km(s,c){c===0&&((s.mode&1)===0?c=1:(c=Da,Da<<=1,(Da&130023424)===0&&(Da=4194304)));var A=Wo();s=Sr(s,c),s!==null&&(Ys(s,c,A),vs(s,A))}function U8(s){var c=s.memoizedState,A=0;c!==null&&(A=c.retryLane),km(s,A)}function H8(s,c){var A=0;switch(s.tag){case 13:var j=s.stateNode,K=s.memoizedState;K!==null&&(A=K.retryLane);break;case 19:j=s.stateNode;break;default:throw Error(r(314))}j!==null&&j.delete(c),km(s,A)}var Nm;Nm=function(s,c,A){if(s!==null)if(s.memoizedProps!==c.pendingProps||ia.current)oe=!0;else{if((s.lanes&A)===0&&(c.flags&128)===0)return oe=!1,g0(s,c,A);oe=(s.flags&131072)!==0}else oe=!1,it&&(c.flags&1048576)!==0&&lt(c,we,c.index);switch(c.lanes=0,c.tag){case 2:var j=c.type;Cr(s,c),s=c.pendingProps;var K=Ll(c,Ei.current);fn(c,A),K=ul(null,c,j,s,K,A);var ne=to();return c.flags|=1,typeof K=="object"&&K!==null&&typeof K.render=="function"&&K.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,aa(j)?(ne=!0,us(c)):ne=!1,c.memoizedState=K.state!==null&&K.state!==void 0?K.state:null,pu(c),K.updater=Oc,c.stateNode=K,K._reactInternals=c,eh(c,j,s,A),c=cn(null,c,j,!0,ne,A)):(c.tag=0,it&&ne&&rt(c),Pe(null,c,K,A),c=c.child),c;case 16:j=c.elementType;e:{switch(Cr(s,c),s=c.pendingProps,K=j._init,j=K(j._payload),c.type=j,K=c.tag=G8(j),s=ba(j,s),K){case 0:c=Ot(null,c,j,s,A);break e;case 1:c=Cn(null,c,j,s,A);break e;case 11:c=$e(null,c,j,s,A);break e;case 14:c=nt(null,c,j,ba(j.type,s),A);break e}throw Error(r(306,j,""))}return c;case 0:return j=c.type,K=c.pendingProps,K=c.elementType===j?K:ba(j,K),Ot(s,c,j,K,A);case 1:return j=c.type,K=c.pendingProps,K=c.elementType===j?K:ba(j,K),Cn(s,c,j,K,A);case 3:e:{if(no(c),s===null)throw Error(r(387));j=c.pendingProps,ne=c.memoizedState,K=ne.element,Xu(s,c),Ho(c,j,null,A);var me=c.memoizedState;if(j=me.element,ne.isDehydrated)if(ne={element:j,isDehydrated:!1,cache:me.cache,pendingSuspenseBoundaries:me.pendingSuspenseBoundaries,transitions:me.transitions},c.updateQueue.baseState=ne,c.memoizedState=ne,c.flags&256){K=Qu(Error(r(423)),c),c=cl(s,c,j,A,K);break e}else if(j!==K){K=Qu(Error(r(424)),c),c=cl(s,c,j,A,K);break e}else for(qe=qi(c.stateNode.containerInfo.firstChild),ze=c,it=!0,st=null,A=fr(c,null,j,A),c.child=A;A;)A.flags=A.flags&-3|4096,A=A.sibling;else{if(ar(),j===K){c=Ta(s,c,A);break e}Pe(s,c,j,A)}c=c.child}return c;case 5:return gu(c),s===null&&wt(c),j=c.type,K=c.pendingProps,ne=s!==null?s.memoizedProps:null,me=K.children,ff(j,K)?me=null:ne!==null&&ff(j,ne)&&(c.flags|=32),or(s,c),Pe(s,c,me,A),c.child;case 6:return s===null&&wt(c),null;case 13:return ot(s,c,A);case 4:return Vo(c,c.stateNode.containerInfo),j=c.pendingProps,s===null?c.child=si(c,null,j,A):Pe(s,c,j,A),c.child;case 11:return j=c.type,K=c.pendingProps,K=c.elementType===j?K:ba(j,K),$e(s,c,j,K,A);case 7:return Pe(s,c,c.pendingProps,A),c.child;case 8:return Pe(s,c,c.pendingProps.children,A),c.child;case 12:return Pe(s,c,c.pendingProps.children,A),c.child;case 10:e:{if(j=c.type._context,K=c.pendingProps,ne=c.memoizedProps,me=K.value,Xr(Vi,j._currentValue),j._currentValue=me,ne!==null)if(_r(ne.value,me)){if(ne.children===K.children&&!ia.current){c=Ta(s,c,A);break e}}else for(ne=c.child,ne!==null&&(ne.return=c);ne!==null;){var Me=ne.dependencies;if(Me!==null){me=ne.child;for(var De=Me.firstContext;De!==null;){if(De.context===j){if(ne.tag===1){De=Za(-1,A&-A),De.tag=2;var tt=ne.updateQueue;if(tt!==null){tt=tt.shared;var dt=tt.pending;dt===null?De.next=De:(De.next=dt.next,dt.next=De),tt.pending=De}}ne.lanes|=A,De=ne.alternate,De!==null&&(De.lanes|=A),Ka(ne.return,A,c),Me.lanes|=A;break}De=De.next}}else if(ne.tag===10)me=ne.type===c.type?null:ne.child;else if(ne.tag===18){if(me=ne.return,me===null)throw Error(r(341));me.lanes|=A,Me=me.alternate,Me!==null&&(Me.lanes|=A),Ka(me,A,c),me=ne.sibling}else me=ne.child;if(me!==null)me.return=ne;else for(me=ne;me!==null;){if(me===c){me=null;break}if(ne=me.sibling,ne!==null){ne.return=me.return,me=ne;break}me=me.return}ne=me}Pe(s,c,K.children,A),c=c.child}return c;case 9:return K=c.type,j=c.pendingProps.children,fn(c,A),K=jn(K),j=j(K),c.flags|=1,Pe(s,c,j,A),c.child;case 14:return j=c.type,K=ba(j,c.pendingProps),K=ba(j.type,K),nt(s,c,j,K,A);case 15:return yt(s,c,c.type,c.pendingProps,A);case 17:return j=c.type,K=c.pendingProps,K=c.elementType===j?K:ba(j,K),Cr(s,c),c.tag=1,aa(j)?(s=!0,us(c)):s=!1,fn(c,A),Ep(c,j,K),eh(c,j,K,A),cn(null,c,j,!0,s,A);case 19:return $i(s,c,A);case 22:return Tt(s,c,A)}throw Error(r(156,c.tag))};function Lm(s,c){return As(s,c)}function V8(s,c,A,j){this.tag=s,this.key=A,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=j,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hl(s,c,A,j){return new V8(s,c,A,j)}function L0(s){return s=s.prototype,!(!s||!s.isReactComponent)}function G8(s){if(typeof s=="function")return L0(s)?1:0;if(s!=null){if(s=s.$$typeof,s===L)return 11;if(s===J)return 14}return 2}function Mc(s,c){var A=s.alternate;return A===null?(A=hl(s.tag,c,s.key,s.mode),A.elementType=s.elementType,A.type=s.type,A.stateNode=s.stateNode,A.alternate=s,s.alternate=A):(A.pendingProps=c,A.type=s.type,A.flags=0,A.subtreeFlags=0,A.deletions=null),A.flags=s.flags&14680064,A.childLanes=s.childLanes,A.lanes=s.lanes,A.child=s.child,A.memoizedProps=s.memoizedProps,A.memoizedState=s.memoizedState,A.updateQueue=s.updateQueue,c=s.dependencies,A.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},A.sibling=s.sibling,A.index=s.index,A.ref=s.ref,A}function jp(s,c,A,j,K,ne){var me=2;if(j=s,typeof s=="function")L0(s)&&(me=1);else if(typeof s=="string")me=5;else e:switch(s){case k:return bf(A.children,K,ne,c);case N:me=8,K|=8;break;case M:return s=hl(12,A,c,K|2),s.elementType=M,s.lanes=ne,s;case H:return s=hl(13,A,c,K),s.elementType=H,s.lanes=ne,s;case G:return s=hl(19,A,c,K),s.elementType=G,s.lanes=ne,s;case U:return Fp(A,K,ne,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case T:me=10;break e;case C:me=9;break e;case L:me=11;break e;case J:me=14;break e;case se:me=16,j=null;break e}throw Error(r(130,s==null?s:typeof s,""))}return c=hl(me,A,c,K),c.elementType=s,c.type=j,c.lanes=ne,c}function bf(s,c,A,j){return s=hl(7,s,j,c),s.lanes=A,s}function Fp(s,c,A,j){return s=hl(22,s,j,c),s.elementType=U,s.lanes=A,s.stateNode={isHidden:!1},s}function T0(s,c,A){return s=hl(6,s,null,c),s.lanes=A,s}function R0(s,c,A){return c=hl(4,s.children!==null?s.children:[],s.key,c),c.lanes=A,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function $8(s,c,A,j,K){this.tag=c,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ga(0),this.expirationTimes=ga(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ga(0),this.identifierPrefix=j,this.onRecoverableError=K,this.mutableSourceEagerHydrationData=null}function M0(s,c,A,j,K,ne,me,Me,De){return s=new $8(s,c,A,Me,De),c===1?(c=1,ne===!0&&(c|=8)):c=0,ne=hl(3,null,null,c),s.current=ne,ne.stateNode=s,ne.memoizedState={element:j,isDehydrated:A,cache:null,transitions:null,pendingSuspenseBoundaries:null},pu(ne),s}function W8(s,c,A){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:j==null?null:""+j,children:s,containerInfo:c,implementation:A}}function Tm(s){if(!s)return ls;s=s._reactInternals;e:{if(Yn(s)!==s||s.tag!==1)throw Error(r(170));var c=s;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(aa(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(r(171))}if(s.tag===1){var A=s.type;if(aa(A))return Yu(s,A,c)}return c}function Rm(s,c,A,j,K,ne,me,Me,De){return s=M0(A,j,!0,s,K,ne,me,Me,De),s.context=Tm(null),A=s.current,j=Wo(),K=Tc(A),ne=Za(j,K),ne.callback=c??null,Na(A,ne,K),s.current.lanes=K,Ys(s,K,j),vs(s,j),s}function Dp(s,c,A,j){var K=c.current,ne=Wo(),me=Tc(K);return A=Tm(A),c.context===null?c.context=A:c.pendingContext=A,c=Za(ne,me),c.payload={element:s},j=j===void 0?null:j,j!==null&&(c.callback=j),s=Na(K,c,me),s!==null&&(Bl(s,K,me,ne),Rl(s,K,me)),me}function Bp(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function Mm(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var A=s.retryLane;s.retryLane=A!==0&&A<c?A:c}}function I0(s,c){Mm(s,c),(s=s.alternate)&&Mm(s,c)}function Y8(){return null}var Im=typeof reportError=="function"?reportError:function(s){console.error(s)};function j0(s){this._internalRoot=s}zp.prototype.render=j0.prototype.render=function(s){var c=this._internalRoot;if(c===null)throw Error(r(409));Dp(s,c,null,null)},zp.prototype.unmount=j0.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var c=s.containerInfo;vf(function(){Dp(null,s,null,null)}),c[Hi]=null}};function zp(s){this._internalRoot=s}zp.prototype.unstable_scheduleHydration=function(s){if(s){var c=Qo();s={blockedOn:null,target:s,priority:c};for(var A=0;A<ho.length&&c!==0&&c<ho[A].priority;A++);ho.splice(A,0,s),A===0&&Js(s)}};function F0(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function qp(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function jm(){}function X8(s,c,A,j,K){if(K){if(typeof j=="function"){var ne=j;j=function(){var tt=Bp(me);ne.call(tt)}}var me=Rm(c,j,s,0,null,!1,!1,"",jm);return s._reactRootContainer=me,s[Hi]=me.current,Ms(s.nodeType===8?s.parentNode:s),vf(),me}for(;K=s.lastChild;)s.removeChild(K);if(typeof j=="function"){var Me=j;j=function(){var tt=Bp(De);Me.call(tt)}}var De=M0(s,0,!1,null,null,!1,!1,"",jm);return s._reactRootContainer=De,s[Hi]=De.current,Ms(s.nodeType===8?s.parentNode:s),vf(function(){Dp(c,De,A,j)}),De}function Up(s,c,A,j,K){var ne=A._reactRootContainer;if(ne){var me=ne;if(typeof K=="function"){var Me=K;K=function(){var De=Bp(me);Me.call(De)}}Dp(c,me,s,K)}else me=X8(A,c,s,K,j);return Bp(me)}Xs=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var A=ti(c.pendingLanes);A!==0&&(eu(c,A|1),vs(c,Nn()),(Zr&6)===0&&(ih=Nn()+500,ie()))}break;case 13:vf(function(){var j=Sr(s,1);if(j!==null){var K=Wo();Bl(j,s,1,K)}}),I0(s,1)}},Ks=function(s){if(s.tag===13){var c=Sr(s,134217728);if(c!==null){var A=Wo();Bl(c,s,134217728,A)}I0(s,134217728)}},vc=function(s){if(s.tag===13){var c=Tc(s),A=Sr(s,c);if(A!==null){var j=Wo();Bl(A,s,c,j)}I0(s,c)}},Qo=function(){return wr},Cs=function(s,c){var A=wr;try{return wr=s,c()}finally{wr=A}},Wt=function(s,c,A){switch(c){case"input":if(Ee(s,A),c=A.name,A.type==="radio"&&c!=null){for(A=s;A.parentNode;)A=A.parentNode;for(A=A.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<A.length;c++){var j=A[c];if(j!==s&&j.form===s.form){var K=mi(j);if(!K)throw Error(r(90));Ae(j),Ee(j,K)}}}break;case"textarea":Be(s,A);break;case"select":c=A.value,c!=null&&Te(s,!!A.multiple,c,!1)}},so=C0,on=vf;var K8={usingClientEntryPoint:!1,Events:[hu,oi,mi,It,lr,C0]},Vh={findFiberByHostInstance:js,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Z8={bundleType:Vh.bundleType,version:Vh.version,rendererPackageName:Vh.rendererPackageName,rendererConfig:Vh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=da(s),s===null?null:s.stateNode},findFiberByHostInstance:Vh.findFiberByHostInstance||Y8,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 Hp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hp.isDisabled&&Hp.supportsFiber)try{fo=Hp.inject(Z8),fi=Hp}catch{}}return ms.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=K8,ms.createPortal=function(s,c){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!F0(c))throw Error(r(200));return W8(s,c,null,A)},ms.createRoot=function(s,c){if(!F0(s))throw Error(r(299));var A=!1,j="",K=Im;return c!=null&&(c.unstable_strictMode===!0&&(A=!0),c.identifierPrefix!==void 0&&(j=c.identifierPrefix),c.onRecoverableError!==void 0&&(K=c.onRecoverableError)),c=M0(s,1,!1,null,null,A,!1,j,K),s[Hi]=c.current,Ms(s.nodeType===8?s.parentNode:s),new j0(c)},ms.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=da(c),s=s===null?null:s.stateNode,s},ms.flushSync=function(s){return vf(s)},ms.hydrate=function(s,c,A){if(!qp(c))throw Error(r(200));return Up(null,s,c,!0,A)},ms.hydrateRoot=function(s,c,A){if(!F0(s))throw Error(r(405));var j=A!=null&&A.hydratedSources||null,K=!1,ne="",me=Im;if(A!=null&&(A.unstable_strictMode===!0&&(K=!0),A.identifierPrefix!==void 0&&(ne=A.identifierPrefix),A.onRecoverableError!==void 0&&(me=A.onRecoverableError)),c=Rm(c,null,s,1,A??null,K,!1,ne,me),s[Hi]=c.current,Ms(s),j)for(s=0;s<j.length;s++)A=j[s],K=A._getVersion,K=K(A._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[A,K]:c.mutableSourceEagerHydrationData.push(A,K);return new zp(c)},ms.render=function(s,c,A){if(!qp(c))throw Error(r(200));return Up(null,s,c,!1,A)},ms.unmountComponentAtNode=function(s){if(!qp(s))throw Error(r(40));return s._reactRootContainer?(vf(function(){Up(null,null,s,!1,function(){s._reactRootContainer=null,s[Hi]=null})}),!0):!1},ms.unstable_batchedUpdates=C0,ms.unstable_renderSubtreeIntoContainer=function(s,c,A,j){if(!qp(A))throw Error(r(200));if(s==null||s._reactInternals===void 0)throw Error(r(38));return Up(s,c,A,!1,j)},ms.version="18.3.1-next-f1338f8080-20240426",ms}var Um;function f4(){if(Um)return B0.exports;Um=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),B0.exports=r7(),B0.exports}var Hm;function n7(){if(Hm)return Vp;Hm=1;var e=f4();return Vp.createRoot=e.createRoot,Vp.hydrateRoot=e.hydrateRoot,Vp}var i7=n7();const h4=dc(i7);function yr(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(r.length?" "+r.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var a7={};function F1(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:a7}var d4=Object.assign,m1=Object.getOwnPropertyDescriptor,Ou=Object.defineProperty,D1=Object.prototype,z2=[];Object.freeze(z2);var Sv={};Object.freeze(Sv);var o7=typeof Proxy<"u",s7=Object.toString();function p4(){o7||yr("Proxy not available")}function g4(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var dh=function(){};function Gs(e){return typeof e=="function"}function If(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function B1(e){return e!==null&&typeof e=="object"}function Yc(e){if(!B1(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===s7}function v4(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function z1(e,t,r){Ou(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function m4(e,t,r){Ou(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function tf(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return B1(n)&&n[r]===!0}}function Nh(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function l7(e){var t=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t),n=Object.getPrototypeOf(r);return n===null}function ac(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var y4=typeof Object.getOwnPropertySymbols<"u";function u7(e){var t=Object.keys(e);if(!y4)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return D1.propertyIsEnumerable.call(e,n)})):t}var q1=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:y4?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function b4(e){return e===null?null:typeof e=="object"?""+e:e}function lc(e,t){return D1.hasOwnProperty.call(e,t)}var c7=Object.getOwnPropertyDescriptors||function(t){var r={};return q1(t).forEach(function(n){r[n]=m1(t,n)}),r};function Us(e,t){return!!(e&t)}function Hs(e,t,r){return r?e|=t:e&=~t,e}function Vm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function f7(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d7(n.key),n)}}function Lh(e,t,r){return t&&f7(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ph(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=p7(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xc(){return Xc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xc.apply(null,arguments)}function w4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,q2(e,t)}function q2(e,t){return q2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},q2(e,t)}function h7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function d7(e){var t=h7(e,"string");return typeof t=="symbol"?t:t+""}function p7(e,t){if(e){if(typeof e=="string")return Vm(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Vm(e,t):void 0}}var Su=Symbol("mobx-stored-annotations");function Cu(e){function t(r,n){if(lp(n))return e.decorate_20223_(r,n);sp(r,n,e)}return Object.assign(t,e)}function sp(e,t,r){lc(e,Su)||z1(e,Su,Xc({},e[Su])),_7(r)||(e[Su][t]=r)}function g7(e){return lc(e,Su)||z1(e,Su,Xc({},e[Su])),e[Su]}function lp(e){return typeof e=="object"&&typeof e.kind=="string"}var Qt=Symbol("mobx administration"),rf=function(){function e(r){r===void 0&&(r="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=an.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.reportObserved=function(){return F4(this)},t.reportChanged=function(){bs(),D4(this),ws()},t.toString=function(){return this.name_},Lh(e,[{key:"isBeingObserved",get:function(){return Us(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=Hs(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Us(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=Hs(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Us(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Hs(this.flags_,e.diffValueMask_,n===1)}}])}();rf.isBeingObservedMask_=1;rf.isPendingUnobservationMask_=2;rf.diffValueMask_=4;var Ev=tf("Atom",rf);function y1(e,t,r){t===void 0&&(t=dh),r===void 0&&(r=dh);var n=new rf(e);return t!==dh&&E_(n,t),r!==dh&&$4(n,r),n}function v7(e,t){return uw(e,t)}function m7(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Sh={structural:v7,default:m7};function jf(e,t,r){return Z4(e)?e:Array.isArray(e)?Fr.array(e,{name:r}):Yc(e)?Fr.object(e,void 0,{name:r}):Nh(e)?Fr.map(e,{name:r}):ac(e)?Fr.set(e,{name:r}):typeof e=="function"&&!Kd(e)&&!Zd(e)?v4(e)?Eh(e):Xd(r,e):e}function y7(e,t,r){if(e==null||Yl(e)||Fu(e)||vl(e)||Xo(e))return e;if(Array.isArray(e))return Fr.array(e,{name:r,deep:!1});if(Yc(e))return Fr.object(e,void 0,{name:r,deep:!1});if(Nh(e))return Fr.map(e,{name:r,deep:!1});if(ac(e))return Fr.set(e,{name:r,deep:!1})}function U1(e){return e}function b7(e,t){return uw(e,t)?t:e}var w7="override";function _7(e){return e.annotationType_===w7}function up(e,t){return{annotationType_:e,options_:t,make_:x7,extend_:S7,decorate_20223_:E7}}function x7(e,t,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,r,!1)===null?0:1;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if(Kd(r.value))return 1;var a=_4(e,this,t,r,!1);return Ou(n,t,a),2}function S7(e,t,r,n){var i=_4(e,this,t,r);return e.defineProperty_(t,i,n)}function E7(e,t){var r=t.kind,n=t.name,i=t.addInitializer,a=this,o=function(d){var h,v,p,f;return Kc((h=(v=a.options_)==null?void 0:v.name)!=null?h:n.toString(),d,(p=(f=a.options_)==null?void 0:f.autoAction)!=null?p:!1)};if(r=="field")return function(u){var d,h=u;return Kd(h)||(h=o(h)),(d=a.options_)!=null&&d.bound&&(h=h.bind(this),h.isMobxAction=!0),h};if(r=="method"){var l;return Kd(e)||(e=o(e)),(l=this.options_)!=null&&l.bound&&i(function(){var u=this,d=u[n].bind(u);d.isMobxAction=!0,u[n]=d}),e}yr("Cannot apply '"+a.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
34
- '`+a.annotationType_+"' can only be used on properties with a function value."))}function P7(e,t,r,n){t.annotationType_,n.value}function _4(e,t,r,n,i){var a,o,l,u,d,h,v;i===void 0&&(i=Pt.safeDescriptors),P7(e,t,r,n);var p=n.value;if((a=t.options_)!=null&&a.bound){var f;p=p.bind((f=e.proxy_)!=null?f:e.target_)}return{value:Kc((o=(l=t.options_)==null?void 0:l.name)!=null?o:r.toString(),p,(u=(d=t.options_)==null?void 0:d.autoAction)!=null?u:!1,(h=t.options_)!=null&&h.bound?(v=e.proxy_)!=null?v:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function x4(e,t){return{annotationType_:e,options_:t,make_:A7,extend_:O7,decorate_20223_:C7}}function A7(e,t,r,n){var i;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!lc(e.target_,t)||!Zd(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(Zd(r.value))return 1;var a=S4(e,this,t,r,!1,!1);return Ou(n,t,a),2}function O7(e,t,r,n){var i,a=S4(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,n)}function C7(e,t){var r,n=t.name,i=t.addInitializer;return Zd(e)||(e=Eh(e)),(r=this.options_)!=null&&r.bound&&i(function(){var a=this,o=a[n].bind(a);o.isMobXFlow=!0,a[n]=o}),e}function k7(e,t,r,n){t.annotationType_,n.value}function S4(e,t,r,n,i,a){a===void 0&&(a=Pt.safeDescriptors),k7(e,t,r,n);var o=n.value;if(Zd(o)||(o=Eh(o)),i){var l;o=o.bind((l=e.proxy_)!=null?l:e.target_),o.isMobXFlow=!0}return{value:o,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function Pv(e,t){return{annotationType_:e,options_:t,make_:N7,extend_:L7,decorate_20223_:T7}}function N7(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function L7(e,t,r,n){return R7(e,this,t,r),e.defineComputedProperty_(t,Xc({},this.options_,{get:r.get,set:r.set}),n)}function T7(e,t){var r=this,n=t.name,i=t.addInitializer;return i(function(){var a=Th(this)[Qt],o=Xc({},r.options_,{get:e,context:this});o.name||(o.name="ObservableObject."+n.toString()),a.values_.set(n,new $l(o))}),function(){return this[Qt].getObservablePropValue_(n)}}function R7(e,t,r,n){t.annotationType_,n.get}function H1(e,t){return{annotationType_:e,options_:t,make_:M7,extend_:I7,decorate_20223_:j7}}function M7(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function I7(e,t,r,n){var i,a;return F7(e,this),e.defineObservableProperty_(t,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:jf,n)}function j7(e,t){var r=this,n=t.kind,i=t.name,a=new WeakSet;function o(l,u){var d,h,v=Th(l)[Qt],p=new Wc(u,(d=(h=r.options_)==null?void 0:h.enhancer)!=null?d:jf,"ObservableObject."+i.toString(),!1);v.values_.set(i,p),a.add(l)}if(n=="accessor")return{get:function(){return a.has(this)||o(this,e.get.call(this)),this[Qt].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[Qt].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||o(this,u),u}}}function F7(e,t,r,n){t.annotationType_}var D7="true",B7=E4();function E4(e){return{annotationType_:D7,options_:e,make_:z7,extend_:q7,decorate_20223_:U7}}function z7(e,t,r,n){var i,a;if(r.get)return Df.make_(e,t,r,n);if(r.set){var o=Kc(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:Pt.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Ou(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var l;if(v4(r.value)){var u,d=(u=this.options_)!=null&&u.autoBind?Eh.bound:Eh;return d.make_(e,t,r,n)}var h=(l=this.options_)!=null&&l.autoBind?Xd.bound:Xd;return h.make_(e,t,r,n)}var v=((i=this.options_)==null?void 0:i.deep)===!1?Fr.ref:Fr;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var p;r.value=r.value.bind((p=e.proxy_)!=null?p:e.target_)}return v.make_(e,t,r,n)}function q7(e,t,r,n){var i,a;if(r.get)return Df.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:Pt.safeDescriptors?e.isPlainObject_:!0,set:Kc(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;r.value=r.value.bind((o=e.proxy_)!=null?o:e.target_)}var l=((a=this.options_)==null?void 0:a.deep)===!1?Fr.ref:Fr;return l.extend_(e,t,r,n)}function U7(e,t){yr("'"+this.annotationType_+"' cannot be used as a decorator")}var H7="observable",V7="observable.ref",G7="observable.shallow",$7="observable.struct",P4={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(P4);function Gp(e){return e||P4}var U2=H1(H7),W7=H1(V7,{enhancer:U1}),Y7=H1(G7,{enhancer:y7}),X7=H1($7,{enhancer:b7}),A4=Cu(U2);function $p(e){return e.deep===!0?jf:e.deep===!1?U1:Z7(e.defaultDecorator)}function K7(e){var t;return e?(t=e.defaultDecorator)!=null?t:E4(e):void 0}function Z7(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:jf}function O4(e,t,r){if(lp(t))return U2.decorate_20223_(e,t);if(If(t)){sp(e,t,U2);return}return Z4(e)?e:Yc(e)?Fr.object(e,t,r):Array.isArray(e)?Fr.array(e,t):Nh(e)?Fr.map(e,t):ac(e)?Fr.set(e,t):typeof e=="object"&&e!==null?e:Fr.box(e,t)}d4(O4,A4);var Q7={box:function(t,r){var n=Gp(r);return new Wc(t,$p(n),n.name,!0,n.equals)},array:function(t,r){var n=Gp(r);return(Pt.useProxies===!1||n.proxy===!1?e9:V_)(t,$p(n),n.name)},map:function(t,r){var n=Gp(r);return new Nv(t,$p(n),n.name)},set:function(t,r){var n=Gp(r);return new iw(t,$p(n),n.name)},object:function(t,r,n){return zf(function(){return C_(Pt.useProxies===!1||n?.proxy===!1?Th({},n):q_({},n),t,r)})},ref:Cu(W7),shallow:Cu(Y7),deep:A4,struct:Cu(X7)},Fr=d4(O4,Q7),C4="computed",J7="computed.struct",H2=Pv(C4),e_=Pv(J7,{equals:Sh.structural}),Df=function(t,r){if(lp(r))return H2.decorate_20223_(t,r);if(If(r))return sp(t,r,H2);if(Yc(t))return Cu(Pv(C4,t));var n=Yc(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new $l(n)};Object.assign(Df,H2);Df.struct=Cu(e_);var Gm,$m,b1=0,t_=1,r_=(Gm=($m=m1(function(){},"name"))==null?void 0:$m.configurable)!=null?Gm:!1,Wm={value:"action",configurable:!0,writable:!1,enumerable:!1};function Kc(e,t,r,n){r===void 0&&(r=!1);function i(){return k4(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},r_&&(Wm.value=e,Ou(i,"name",Wm)),i}function k4(e,t,r,n,i){var a=n_(e,t);try{return r.apply(n,i)}catch(o){throw a.error_=o,o}finally{i_(a)}}function n_(e,t,r,n){var i=!1,a=0,o=Pt.trackingDerivation,l=!t||!o;bs();var u=Pt.allowStateChanges;l&&(Bf(),u=V1(!0));var d=Av(!0),h={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:d,notifySpy_:i,startTime_:a,actionId_:t_++,parentActionId_:b1};return b1=h.actionId_,h}function i_(e){b1!==e.actionId_&&yr(30),b1=e.parentActionId_,e.error_!==void 0&&(Pt.suppressReactionErrors=!0),G1(e.prevAllowStateChanges_),qd(e.prevAllowStateReads_),ws(),e.runAsAction_&&uc(e.prevDerivation_),Pt.suppressReactionErrors=!1}function N4(e,t){var r=V1(e);try{return t()}finally{G1(r)}}function V1(e){var t=Pt.allowStateChanges;return Pt.allowStateChanges=e,t}function G1(e){Pt.allowStateChanges=e}var Wc=function(e){function t(n,i,a,o,l){var u;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=Sh.default),u=e.call(this,a)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=i,u.name_=a,u.equals=l,u.value_=i(n,void 0,a),u}w4(t,e);var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==Pt.UNCHANGED&&this.setNewValue_(i)},r.prepareNewValue_=function(i){if(dl(this)){var a=pl(this,{object:this,type:ku,newValue:i});if(!a)return Pt.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Pt.UNCHANGED:i},r.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),Vl(this)&&Gl(this,{type:ku,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return cp(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:ku,newValue:this.value_,oldValue:void 0}),fp(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 b4(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},t}(rf),a_=tf("ObservableValue",Wc),$l=function(){function e(r){this.dependenciesState_=an.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=an.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new _1(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=w1.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||yr(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=Kc("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?Sh.structural:Sh.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){f_(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.get=function(){if(this.isComputing&&yr(32,this.name_,this.derivation),Pt.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)V2(this)&&(this.warnAboutUntrackedRead_(),bs(),this.value_=this.computeValue_(!1),ws());else if(F4(this),V2(this)){var n=Pt.trackingContext;this.keepAlive_&&!n&&(Pt.trackingContext=this),this.trackAndCompute()&&c_(this),Pt.trackingContext=n}var i=this.value_;if(i1(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter&&yr(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else yr(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===an.NOT_TRACKING_,a=this.computeValue_(!0),o=i||i1(n)||i1(a)||!this.equals_(n,a);return o&&(this.value_=a),o},t.computeValue_=function(n){this.isComputing=!0;var i=V1(!1),a;if(n)a=L4(this,this.derivation,this.scope_);else if(Pt.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new _1(o)}return G1(i),this.isComputing=!1,a},t.suspend_=function(){this.keepAlive_||(G2(this),this.value_=void 0)},t.observe_=function(n,i){var a=this,o=!0,l=void 0;return Mu(function(){var u=a.get();if(!o||i){var d=Bf();n({observableKind:"computed",debugObjectName:a.name_,type:ku,object:a,newValue:u,oldValue:l}),uc(d)}o=!1,l=u})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return b4(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},Lh(e,[{key:"isComputing",get:function(){return Us(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=Hs(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return Us(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=Hs(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return Us(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=Hs(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Us(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=Hs(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Us(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Hs(this.flags_,e.diffValueMask_,n===1)}}])}();$l.isComputingMask_=1;$l.isRunningSetterMask_=2;$l.isBeingObservedMask_=4;$l.isPendingUnobservationMask_=8;$l.diffValueMask_=16;var $1=tf("ComputedValue",$l),an;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(an||(an={}));var w1;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(w1||(w1={}));var _1=function(t){this.cause=void 0,this.cause=t};function i1(e){return e instanceof _1}function V2(e){switch(e.dependenciesState_){case an.UP_TO_DATE_:return!1;case an.NOT_TRACKING_:case an.STALE_:return!0;case an.POSSIBLY_STALE_:{for(var t=Av(!0),r=Bf(),n=e.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if($1(o)){if(Pt.disableErrorBoundaries)o.get();else try{o.get()}catch{return uc(r),qd(t),!0}if(e.dependenciesState_===an.STALE_)return uc(r),qd(t),!0}}return R4(e),uc(r),qd(t),!1}}}function L4(e,t,r){var n=Av(!0);R4(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++Pt.runId;var i=Pt.trackingDerivation;Pt.trackingDerivation=e,Pt.inBatch++;var a;if(Pt.disableErrorBoundaries===!0)a=t.call(r);else try{a=t.call(r)}catch(o){a=new _1(o)}return Pt.inBatch--,Pt.trackingDerivation=i,o_(e),qd(n),a}function o_(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=an.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,o=0;o<a;o++){var l=r[o];l.diffValue===0&&(l.diffValue=1,i!==o&&(r[i]=l),i++),l.dependenciesState_>n&&(n=l.dependenciesState_)}for(r.length=i,e.newObserving_=null,a=t.length;a--;){var u=t[a];u.diffValue===0&&I4(u,e),u.diffValue=0}for(;i--;){var d=r[i];d.diffValue===1&&(d.diffValue=0,u_(d,e))}n!==an.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function G2(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)I4(t[r],e);e.dependenciesState_=an.NOT_TRACKING_}function T4(e){var t=Bf();try{return e()}finally{uc(t)}}function Bf(){var e=Pt.trackingDerivation;return Pt.trackingDerivation=null,e}function uc(e){Pt.trackingDerivation=e}function Av(e){var t=Pt.allowStateReads;return Pt.allowStateReads=e,t}function qd(e){Pt.allowStateReads=e}function R4(e){if(e.dependenciesState_!==an.UP_TO_DATE_){e.dependenciesState_=an.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=an.UP_TO_DATE_}}var a1=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},o1=!0,M4=!1,Pt=function(){var e=F1();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(o1=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new a1().version&&(o1=!1),o1?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new a1):(setTimeout(function(){M4||yr(35)},1),new a1)}();function s_(){if((Pt.pendingReactions.length||Pt.inBatch||Pt.isRunningReactions)&&yr(36),M4=!0,o1){var e=F1();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),Pt=new a1}}function l_(){return Pt}function u_(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function I4(e,t){e.observers_.delete(t),e.observers_.size===0&&j4(e)}function j4(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,Pt.pendingUnobservations.push(e))}function bs(){Pt.inBatch++}function ws(){if(--Pt.inBatch===0){B4();for(var e=Pt.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,r.observers_.size===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBUO()),r instanceof $l&&r.suspend_())}Pt.pendingUnobservations=[]}}function F4(e){var t=Pt.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&Pt.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&Pt.inBatch>0&&j4(e),!1)}function D4(e){e.lowestObserverState_!==an.STALE_&&(e.lowestObserverState_=an.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===an.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=an.STALE_}))}function c_(e){e.lowestObserverState_!==an.STALE_&&(e.lowestObserverState_=an.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===an.POSSIBLY_STALE_?t.dependenciesState_=an.STALE_:t.dependenciesState_===an.UP_TO_DATE_&&(e.lowestObserverState_=an.UP_TO_DATE_)}))}function f_(e){e.lowestObserverState_===an.UP_TO_DATE_&&(e.lowestObserverState_=an.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===an.UP_TO_DATE_&&(t.dependenciesState_=an.POSSIBLY_STALE_,t.onBecomeStale_())}))}var Ru=function(){function e(r,n,i,a){r===void 0&&(r="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=an.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=w1.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=a}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Pt.pendingReactions.push(this),B4())},t.runReaction_=function(){if(!this.isDisposed){bs(),this.isScheduled=!1;var n=Pt.trackingContext;if(Pt.trackingContext=this,V2(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Pt.trackingContext=n,ws()}},t.track=function(n){if(!this.isDisposed){bs(),this.isRunning=!0;var i=Pt.trackingContext;Pt.trackingContext=this;var a=L4(this,n,void 0);Pt.trackingContext=i,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&G2(this),i1(a)&&this.reportExceptionInDerivation_(a.cause),ws()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(Pt.disableErrorBoundaries)throw n;var a="[mobx] uncaught error in '"+this+"'";Pt.suppressReactionErrors||console.error(a,n),Pt.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(bs(),G2(this),ws()))},t.getDisposer_=function(n){var i=this,a=function o(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",a),a[Qt]=this,a},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){},Lh(e,[{key:"isDisposed",get:function(){return Us(this.flags_,e.isDisposedMask_)},set:function(n){this.flags_=Hs(this.flags_,e.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return Us(this.flags_,e.isScheduledMask_)},set:function(n){this.flags_=Hs(this.flags_,e.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return Us(this.flags_,e.isTrackPendingMask_)},set:function(n){this.flags_=Hs(this.flags_,e.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return Us(this.flags_,e.isRunningMask_)},set:function(n){this.flags_=Hs(this.flags_,e.isRunningMask_,n)}},{key:"diffValue",get:function(){return Us(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=Hs(this.flags_,e.diffValueMask_,n===1)}}])}();Ru.isDisposedMask_=1;Ru.isScheduledMask_=2;Ru.isTrackPendingMask_=4;Ru.isRunningMask_=8;Ru.diffValueMask_=16;var h_=100,$2=function(t){return t()};function B4(){Pt.inBatch>0||Pt.isRunningReactions||$2(d_)}function d_(){Pt.isRunningReactions=!0;for(var e=Pt.pendingReactions,t=0;e.length>0;){++t===h_&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}Pt.isRunningReactions=!1}var x1=tf("Reaction",Ru);function p_(e){var t=$2;$2=function(n){return e(function(){return t(n)})}}function Ud(){return!1}function g_(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var z4="action",v_="action.bound",q4="autoAction",m_="autoAction.bound",U4="<unnamed action>",W2=up(z4),y_=up(v_,{bound:!0}),Y2=up(q4,{autoAction:!0}),b_=up(m_,{autoAction:!0,bound:!0});function H4(e){var t=function(n,i){if(Gs(n))return Kc(n.name||U4,n,e);if(Gs(i))return Kc(n,i,e);if(lp(i))return(e?Y2:W2).decorate_20223_(n,i);if(If(i))return sp(n,i,e?Y2:W2);if(If(n))return Cu(up(e?q4:z4,{name:n,autoAction:e}))};return t}var Dr=H4(!1);Object.assign(Dr,W2);var Xd=H4(!0);Object.assign(Xd,Y2);Dr.bound=Cu(y_);Xd.bound=Cu(b_);function oc(e){return k4(e.name||U4,!1,e,this,void 0)}function Kd(e){return Gs(e)&&e.isMobxAction===!0}function Mu(e,t){var r,n,i,a;t===void 0&&(t=Sv);var o=(r=(n=t)==null?void 0:n.name)!=null?r:"Autorun",l=!t.scheduler&&!t.delay,u;if(l)u=new Ru(o,function(){this.track(v)},t.onError,t.requiresObservable);else{var d=V4(t),h=!1;u=new Ru(o,function(){h||(h=!0,d(function(){h=!1,u.isDisposed||u.track(v)}))},t.onError,t.requiresObservable)}function v(){e(u)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||u.schedule_(),u.getDisposer_((a=t)==null?void 0:a.signal)}var w_=function(t){return t()};function V4(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:w_}function G4(e,t,r){var n,i,a;r===void 0&&(r=Sv);var o=(n=r.name)!=null?n:"Reaction",l=Dr(o,r.onError?__(r.onError,t):t),u=!r.scheduler&&!r.delay,d=V4(r),h=!0,v=!1,p,f=r.compareStructural?Sh.structural:r.equals||Sh.default,b=new Ru(o,function(){h||u?_():v||(v=!0,d(_))},r.onError,r.requiresObservable);function _(){if(v=!1,!b.isDisposed){var S=!1,x=p;b.track(function(){var m=N4(!1,function(){return e(b)});S=h||!f(p,m),p=m}),(h&&r.fireImmediately||!h&&S)&&l(p,x,b),h=!1}}return(i=r)!=null&&(i=i.signal)!=null&&i.aborted||b.schedule_(),b.getDisposer_((a=r)==null?void 0:a.signal)}function __(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var x_="onBO",S_="onBUO";function E_(e,t,r){return W4(x_,e,t,r)}function $4(e,t,r){return W4(S_,e,t,r)}function W4(e,t,r,n){var i=Ph(t),a=Gs(n)?n:r,o=e+"L";return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var l=i[o];l&&(l.delete(a),l.size===0&&delete i[o])}}var P_="never",Wp="always",A_="observed";function O_(e){e.isolateGlobalState===!0&&s_();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(Pt.useProxies=t===Wp?!0:t===P_?!1:typeof Proxy<"u"),t==="ifavailable"&&(Pt.verifyProxies=!0),r!==void 0){var n=r===Wp?Wp:r===A_;Pt.enforceActions=n,Pt.allowStateChanges=!(n===!0||n===Wp)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(Pt[i]=!!e[i])}),Pt.allowStateReads=!Pt.observableRequiresReaction,e.reactionScheduler&&p_(e.reactionScheduler)}function C_(e,t,r,n){var i=c7(t);return zf(function(){var a=Th(e,n)[Qt];q1(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function k_(e,t){return Y4(Ph(e,t))}function Y4(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=N_(e.observing_).map(Y4)),t}function N_(e){return Array.from(new Set(e))}var L_=0;function X4(){this.message="FLOW_CANCELLED"}X4.prototype=Object.create(Error.prototype);var U0=x4("flow"),T_=x4("flow.bound",{bound:!0}),Eh=Object.assign(function(t,r){if(lp(r))return U0.decorate_20223_(t,r);if(If(r))return sp(t,r,U0);var n=t,i=n.name||"<unnamed flow>",a=function(){var l=this,u=arguments,d=++L_,h=Dr(i+" - runid: "+d+" - init",n).apply(l,u),v,p=void 0,f=new Promise(function(b,_){var S=0;v=_;function x(E){p=void 0;var P;try{P=Dr(i+" - runid: "+d+" - yield "+S++,h.next).call(h,E)}catch(R){return _(R)}w(P)}function m(E){p=void 0;var P;try{P=Dr(i+" - runid: "+d+" - yield "+S++,h.throw).call(h,E)}catch(R){return _(R)}w(P)}function w(E){if(Gs(E?.then)){E.then(w,_);return}return E.done?b(E.value):(p=Promise.resolve(E.value),p.then(x,m))}x(void 0)});return f.cancel=Dr(i+" - runid: "+d+" - cancel",function(){try{p&&Ym(p);var b=h.return(void 0),_=Promise.resolve(b.value);_.then(dh,dh),Ym(_),v(new X4)}catch(S){v(S)}}),f};return a.isMobXFlow=!0,a},U0);Eh.bound=Cu(T_);function Ym(e){Gs(e.cancel)&&e.cancel()}function Zd(e){return e?.isMobXFlow===!0}function K4(e,t,r){var n;return vl(e)||Fu(e)||a_(e)?n=Iu(e):Yl(e)&&(n=Iu(e,t)),n.dehancer=typeof t=="function"?t:r,function(){n.dehancer=void 0}}function Ov(e,t,r){return Gs(r)?M_(e,t,r):R_(e,t)}function R_(e,t){return Iu(e).intercept_(t)}function M_(e,t,r){return Iu(e,t).intercept_(r)}function I_(e,t){return e?Yl(e)||!!e[Qt]||Ev(e)||x1(e)||$1(e):!1}function Z4(e){return I_(e)}function S1(e){if(Yl(e))return e[Qt].keys_();if(vl(e)||Xo(e))return Array.from(e.keys());if(Fu(e))return e.map(function(t,r){return r});yr(5)}function Q4(e){if(Yl(e))return S1(e).map(function(t){return e[t]});if(vl(e))return S1(e).map(function(t){return e.get(t)});if(Xo(e))return Array.from(e.values());if(Fu(e))return e.slice();yr(6)}function j_(e){if(Yl(e))return S1(e).map(function(t){return[t,e[t]]});if(vl(e))return S1(e).map(function(t){return[t,e.get(t)]});if(Xo(e))return Array.from(e.entries());if(Fu(e))return e.map(function(t,r){return[r,t]});yr(7)}function J4(e,t,r){if(arguments.length===2&&!Xo(e)){bs();var n=t;try{for(var i in n)J4(e,i,n[i])}finally{ws()}return}Yl(e)?e[Qt].set_(t,r):vl(e)?e.set(t,r):Xo(e)?e.add(t):Fu(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&yr("Invalid index: '"+t+"'"),bs(),t>=e.length&&(e.length=t+1),e[t]=r,ws()):yr(8)}function ew(e,t,r){if(Yl(e))return e[Qt].defineProperty_(t,r);yr(39)}function Cv(e,t,r,n){return Gs(r)?D_(e,t,r,n):F_(e,t,r)}function F_(e,t,r){return Iu(e).observe_(t,r)}function D_(e,t,r,n){return Iu(e,t).observe_(r,n)}function sc(e,t){t===void 0&&(t=void 0),bs();try{return e.apply(t)}finally{ws()}}function Xm(e,t,r){return arguments.length===1||t&&typeof t=="object"?B_(e,t):tw(e,t,{})}function tw(e,t,r){var n;if(typeof r.timeout=="number"){var i=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[Qt].isDisposed)if(o(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=Kc("When-effect",t),o=Mu(function(l){var u=N4(!1,e);u&&(l.dispose(),n&&clearTimeout(n),a())},r);return o}function B_(e,t){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,i,a=new Promise(function(o,l){var u,d=tw(e,o,Xc({},t,{onError:l}));n=function(){d(),l(new Error("WHEN_CANCELLED"))},i=function(){d(),l(new Error("WHEN_ABORTED"))},t==null||(u=t.signal)==null||u.addEventListener==null||u.addEventListener("abort",i)}).finally(function(){var o;return t==null||(o=t.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",i)});return a.cancel=n,a}function oh(e){return e[Qt]}var z_={has:function(t,r){return oh(t).has_(r)},get:function(t,r){return oh(t).get_(r)},set:function(t,r,n){var i;return If(r)?(i=oh(t).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(t,r){var n;return If(r)?(n=oh(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return(i=oh(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return oh(t).ownKeys_()},preventExtensions:function(t){yr(13)}};function q_(e,t){var r,n;return p4(),e=Th(e,t),(n=(r=e[Qt]).proxy_)!=null?n:r.proxy_=new Proxy(e,z_)}function dl(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function cp(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),g4(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function pl(e,t){var r=Bf();try{for(var n=[].concat(e.interceptors_||[]),i=0,a=n.length;i<a&&(t=n[i](t),t&&!t.type&&yr(14),!!t);i++);return t}finally{uc(r)}}function Vl(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function fp(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),g4(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Gl(e,t){var r=Bf(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](t);uc(r)}}function rw(e,t,r){return zf(function(){var n,i=Th(e,r)[Qt];(n=t)!=null||(t=g7(e)),q1(t).forEach(function(a){return i.make_(a,t[a])})}),e}var Km="splice",ku="update",U_=1e4,H_={get:function(t,r){var n=t[Qt];return r===Qt?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):lc(E1,r)?E1[r]:t[r]},set:function(t,r,n){var i=t[Qt];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){yr(15)}},kv=function(){function e(r,n,i,a){r===void 0&&(r="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=a,this.atom_=new rf(r),this.enhancer_=function(o,l){return n(o,l,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},t.intercept_=function(n){return cp(this,n)},t.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),fp(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&yr("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var a=new Array(n-i),o=0;o<n-i;o++)a[o]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&yr(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&lw(n+i+1)},t.spliceWithArray_=function(n,i,a){var o=this;this.atom_;var l=this.values_.length;if(n===void 0?n=0:n>l?n=l:n<0&&(n=Math.max(0,l+n)),arguments.length===1?i=l-n:i==null?i=0:i=Math.max(0,Math.min(i,l-n)),a===void 0&&(a=z2),dl(this)){var u=pl(this,{object:this.proxy_,type:Km,index:n,removedCount:i,added:a});if(!u)return z2;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 d=a.length-i;this.updateArrayLength_(l,d)}var h=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,h),this.dehanceValues_(h)},t.spliceItemsIntoValues_=function(n,i,a){if(a.length<U_){var o;return(o=this.values_).splice.apply(o,[n,i].concat(a))}else{var l=this.values_.slice(n,n+i),u=this.values_.slice(n+i);this.values_.length+=a.length-i;for(var d=0;d<a.length;d++)this.values_[n+d]=a[d];for(var h=0;h<u.length;h++)this.values_[n+a.length+h]=u[h];return l}},t.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&Ud(),l=Vl(this),u=l||o?{observableKind:"array",object:this.proxy_,type:ku,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),l&&Gl(this,u)},t.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&Ud(),l=Vl(this),u=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Km,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),l&&Gl(this,u)},t.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx] Out of bounds read: "+n);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},t.set_=function(n,i){var a=this.values_;if(this.legacyMode_&&n>a.length&&yr(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(dl(this)){var l=pl(this,{type:ku,object:this.proxy_,index:n,newValue:i});if(!l)return;i=l.newValue}i=this.enhancer_(i,o);var u=i!==o;u&&(a[n]=i,this.notifyArrayChildUpdate_(n,i,o))}else{for(var d=new Array(n+1-a.length),h=0;h<d.length-1;h++)d[h]=void 0;d[d.length-1]=i,this.spliceWithArray_(a.length,0,d)}},e}();function V_(e,t,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),p4(),zf(function(){var i=new kv(r,t,n,!1);m4(i.values_,Qt,i);var a=new Proxy(i.values_,H_);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var E1={clear:function(){return this.splice(0)},replace:function(t){var r=this[Qt];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];var o=this[Qt];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,r)}return o.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[Qt].spliceWithArray_(t,r,n)},push:function(){for(var t=this[Qt],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[Qt].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[Qt],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return Pt.trackingDerivation&&yr(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Pt.trackingDerivation&&yr(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[Qt],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};$n("at",$s);$n("concat",$s);$n("flat",$s);$n("includes",$s);$n("indexOf",$s);$n("join",$s);$n("lastIndexOf",$s);$n("slice",$s);$n("toString",$s);$n("toLocaleString",$s);$n("toSorted",$s);$n("toSpliced",$s);$n("with",$s);$n("every",Wl);$n("filter",Wl);$n("find",Wl);$n("findIndex",Wl);$n("findLast",Wl);$n("findLastIndex",Wl);$n("flatMap",Wl);$n("forEach",Wl);$n("map",Wl);$n("some",Wl);$n("toReversed",Wl);$n("reduce",nw);$n("reduceRight",nw);function $n(e,t){typeof Array.prototype[e]=="function"&&(E1[e]=t(e))}function $s(e){return function(){var t=this[Qt];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function Wl(e){return function(t,r){var n=this,i=this[Qt];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[e](function(o,l){return t.call(r,o,l,n)})}}function nw(e){return function(){var t=this,r=this[Qt];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(a,o,l){return i(a,o,l,t)},n[e].apply(n,arguments)}}var G_=tf("ObservableArrayAdministration",kv);function Fu(e){return B1(e)&&G_(e[Qt])}var $_={},Hc="add",P1="delete",Nv=function(){function e(r,n,i){var a=this;n===void 0&&(n=jf),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Qt]=$_,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,Gs(Map)||yr(18),zf(function(){a.keysAtom_=y1("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,r&&a.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!Pt.trackingDerivation)return this.has_(n);var a=this.hasMap_.get(n);if(!a){var o=a=new Wc(this.has_(n),U1,"ObservableMap.key?",!1);this.hasMap_.set(n,o),$4(o,function(){return i.hasMap_.delete(n)})}return a.get()},t.set=function(n,i){var a=this.has_(n);if(dl(this)){var o=pl(this,{type:a?ku:Hc,object:this,newValue:i,name:n});if(!o)return this;i=o.newValue}return a?this.updateValue_(n,i):this.addValue_(n,i),this},t.delete=function(n){var i=this;if(this.keysAtom_,dl(this)){var a=pl(this,{type:P1,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=Ud(),l=Vl(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:P1,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return sc(function(){var d;i.keysAtom_.reportChanged(),(d=i.hasMap_.get(n))==null||d.setNewValue_(!1);var h=i.data_.get(n);h.setNewValue_(void 0),i.data_.delete(n)}),l&&Gl(this,u),!0}return!1},t.updateValue_=function(n,i){var a=this.data_.get(n);if(i=a.prepareNewValue_(i),i!==Pt.UNCHANGED){var o=Ud(),l=Vl(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:ku,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&Gl(this,u)}},t.addValue_=function(n,i){var a=this;this.keysAtom_,sc(function(){var d,h=new Wc(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,h),i=h.value_,(d=a.hasMap_.get(n))==null||d.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=Ud(),l=Vl(this),u=l||o?{observableKind:"map",debugObjectName:this.name_,type:Hc,object:this,name:n,newValue:i}:null;l&&Gl(this,u)},t.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var n=this,i=this.keys();return Zm({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:n.get(u)}}})},t.entries=function(){var n=this,i=this.keys();return Zm({next:function(){var o=i.next(),l=o.done,u=o.value;return{done:l,value:l?void 0:[u,n.get(u)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(n,i){for(var a=ph(this),o;!(o=a()).done;){var l=o.value,u=l[0],d=l[1];n.call(i,d,u,this)}},t.merge=function(n){var i=this;return vl(n)&&(n=new Map(n)),sc(function(){Yc(n)?u7(n).forEach(function(a){return i.set(a,n[a])}):Array.isArray(n)?n.forEach(function(a){var o=a[0],l=a[1];return i.set(o,l)}):Nh(n)?(l7(n)||yr(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&yr(20,n)}),this},t.clear=function(){var n=this;sc(function(){T4(function(){for(var i=ph(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.replace=function(n){var i=this;return sc(function(){for(var a=W_(n),o=new Map,l=!1,u=ph(i.data_.keys()),d;!(d=u()).done;){var h=d.value;if(!a.has(h)){var v=i.delete(h);if(v)l=!0;else{var p=i.data_.get(h);o.set(h,p)}}}for(var f=ph(a.entries()),b;!(b=f()).done;){var _=b.value,S=_[0],x=_[1],m=i.data_.has(S);if(i.set(S,x),i.data_.has(S)){var w=i.data_.get(S);o.set(S,w),m||(l=!0)}}if(!l)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var E=i.data_.keys(),P=o.keys(),R=E.next(),k=P.next();!R.done;){if(R.value!==k.value){i.keysAtom_.reportChanged();break}R=E.next(),k=P.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return fp(this,n)},t.intercept_=function(n){return cp(this,n)},Lh(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),vl=tf("ObservableMap",Nv);function Zm(e){return e[Symbol.toStringTag]="MapIterator",Tv(e)}function W_(e){if(Nh(e)||vl(e))return e;if(Array.isArray(e))return new Map(e);if(Yc(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return yr(21,e)}var Y_={},iw=function(){function e(r,n,i){var a=this;n===void 0&&(n=jf),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Qt]=Y_,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,Gs(Set)||yr(22),this.enhancer_=function(o,l){return n(o,l,i)},zf(function(){a.atom_=y1(a.name_),r&&a.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;sc(function(){T4(function(){for(var i=ph(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},t.forEach=function(n,i){for(var a=ph(this),o;!(o=a()).done;){var l=o.value;n.call(i,l,l,this)}},t.add=function(n){var i=this;if(this.atom_,dl(this)){var a=pl(this,{type:Hc,object:this,newValue:n});if(!a)return this;n=a.newValue}if(!this.has(n)){sc(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,l=Vl(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:Hc,object:this,newValue:n}:null;l&&Gl(this,u)}return this},t.delete=function(n){var i=this;if(dl(this)){var a=pl(this,{type:P1,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,l=Vl(this),u=l||o?{observableKind:"set",debugObjectName:this.name_,type:P1,object:this,oldValue:n}:null;return sc(function(){i.atom_.reportChanged(),i.data_.delete(n)}),l&&Gl(this,u),!0}return!1},t.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},t.entries=function(){var n=this.values();return Qm({next:function(){var a=n.next(),o=a.value,l=a.done;return l?{value:void 0,done:l}:{value:[o,o],done:l}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var n=this,i=this.data_.values();return Qm({next:function(){var o=i.next(),l=o.value,u=o.done;return u?{value:void 0,done:u}:{value:n.dehanceValue_(l),done:u}}})},t.intersection=function(n){if(ac(n)&&!Xo(n))return n.intersection(this);var i=new Set(this);return i.intersection(n)},t.union=function(n){if(ac(n)&&!Xo(n))return n.union(this);var i=new Set(this);return i.union(n)},t.difference=function(n){return new Set(this).difference(n)},t.symmetricDifference=function(n){if(ac(n)&&!Xo(n))return n.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(n)},t.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},t.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},t.isDisjointFrom=function(n){if(ac(n)&&!Xo(n))return n.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(n)},t.replace=function(n){var i=this;return Xo(n)&&(n=new Set(n)),sc(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):ac(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&yr("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return fp(this,n)},t.intercept_=function(n){return cp(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},Lh(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Xo=tf("ObservableSet",iw);function Qm(e){return e[Symbol.toStringTag]="SetIterator",Tv(e)}var Jm=Object.create(null),ey="remove",aw=function(){function e(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=B7),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 rf("ObservableObject.keys"),this.isPlainObject_=Yc(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(n){return this.values_.get(n).get()},t.setObservablePropValue_=function(n,i){var a=this.values_.get(n);if(a instanceof $l)return a.set(i),!0;if(dl(this)){var o=pl(this,{type:ku,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Pt.UNCHANGED){var l=Vl(this),u=!1,d=l||u?{type:ku,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),l&&Gl(this,d)}return!0},t.get_=function(n){return Pt.trackingDerivation&&!lc(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,a){return a===void 0&&(a=!1),lc(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):a?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},t.has_=function(n){if(!Pt.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new Wc(n in this.target_,U1,"ObservableObject.key?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(n in this.target_)){var a;if((a=this.target_[Su])!=null&&a[n])return;yr(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==D1;){var l=m1(o,n);if(l){var u=i.make_(this,n,l,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}ry(this,i,n)}},t.extend_=function(n,i,a,o){if(o===void 0&&(o=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(n,i,o);var l=a.extend_(this,n,i,o);return l&&ry(this,a,n),l},t.defineProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{bs();var o=this.delete_(n);if(!o)return o;if(dl(this)){var l=pl(this,{object:this.proxy_||this.target_,name:n,type:Hc,newValue:i.value});if(!l)return null;var u=l.newValue;i.value!==u&&(i=Xc({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Ou(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{ws()}return!0},t.defineObservableProperty_=function(n,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{bs();var l=this.delete_(n);if(!l)return l;if(dl(this)){var u=pl(this,{object:this.proxy_||this.target_,name:n,type:Hc,newValue:i});if(!u)return null;i=u.newValue}var d=ty(n),h={configurable:Pt.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:d.get,set:d.set};if(o){if(!Reflect.defineProperty(this.target_,n,h))return!1}else Ou(this.target_,n,h);var v=new Wc(i,a,"ObservableObject.key",!1);this.values_.set(n,v),this.notifyPropertyAddition_(n,v.value_)}finally{ws()}return!0},t.defineComputedProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{bs();var o=this.delete_(n);if(!o)return o;if(dl(this)){var l=pl(this,{object:this.proxy_||this.target_,name:n,type:Hc,newValue:void 0});if(!l)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=ty(n),d={configurable:Pt.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,n,d))return!1}else Ou(this.target_,n,d);this.values_.set(n,new $l(i)),this.notifyPropertyAddition_(n,void 0)}finally{ws()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!lc(this.target_,n))return!0;if(dl(this)){var a=pl(this,{object:this.proxy_||this.target_,name:n,type:ey});if(!a)return null}try{var o;bs();var l=Vl(this),u=!1,d=this.values_.get(n),h=void 0;if(!d&&(l||u)){var v;h=(v=m1(this.target_,n))==null?void 0:v.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(d&&(this.values_.delete(n),d instanceof Wc&&(h=d.value_),D4(d)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(n in this.target_),l||u){var p={type:ey,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:h,name:n};l&&Gl(this,p)}}finally{ws()}return!0},t.observe_=function(n,i){return fp(this,n)},t.intercept_=function(n){return cp(this,n)},t.notifyPropertyAddition_=function(n,i){var a,o=Vl(this),l=!1;if(o||l){var u=o||l?{type:Hc,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;o&&Gl(this,u)}(a=this.pendingKeys_)==null||(a=a.get(n))==null||a.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),q1(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Th(e,t){var r;if(lc(e,Qt))return e;var n=(r=t?.name)!=null?r:"ObservableObject",i=new aw(e,new Map,String(n),K7(t));return z1(e,Qt,i),e}var X_=tf("ObservableObjectAdministration",aw);function ty(e){return Jm[e]||(Jm[e]={get:function(){return this[Qt].getObservablePropValue_(e)},set:function(r){return this[Qt].setObservablePropValue_(e,r)}})}function Yl(e){return B1(e)?X_(e[Qt]):!1}function ry(e,t,r){var n;(n=e.target_[Su])==null||delete n[r]}var K_=sw(0),Z_=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),H0=0,ow=function(){};function Q_(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}Q_(ow,Array.prototype);var Lv=function(e){function t(n,i,a,o){var l;return a===void 0&&(a="ObservableArray"),o===void 0&&(o=!1),l=e.call(this)||this,zf(function(){var u=new kv(a,i,o,!0);u.proxy_=l,m4(l,Qt,u),n&&n.length&&l.spliceWithArray(0,0,n),Z_&&Object.defineProperty(l,"0",K_)}),l}w4(t,e);var r=t.prototype;return r.concat=function(){this[Qt].atom_.reportObserved();for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),a.map(function(l){return Fu(l)?l.slice():l}))},r[Symbol.iterator]=function(){var n=this,i=0;return Tv({next:function(){return i<n.length?{value:n[i++],done:!1}:{done:!0,value:void 0}}})},Lh(t,[{key:"length",get:function(){return this[Qt].getArrayLength_()},set:function(i){this[Qt].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(ow);Object.entries(E1).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&z1(Lv.prototype,t,r)});function sw(e){return{enumerable:!1,configurable:!0,get:function(){return this[Qt].get_(e)},set:function(r){this[Qt].set_(e,r)}}}function J_(e){Ou(Lv.prototype,""+e,sw(e))}function lw(e){if(e>H0){for(var t=H0;t<e+100;t++)J_(t);H0=e}}lw(1e3);function e9(e,t,r){return new Lv(e,t,r)}function Ph(e,t){if(typeof e=="object"&&e!==null){if(Fu(e))return t!==void 0&&yr(23),e[Qt].atom_;if(Xo(e))return e.atom_;if(vl(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||yr(25,t,X2(e)),r}if(Yl(e)){if(!t)return yr(26);var n=e[Qt].values_.get(t);return n||yr(27,t,X2(e)),n}if(Ev(e)||$1(e)||x1(e))return e}else if(Gs(e)&&x1(e[Qt]))return e[Qt];yr(28)}function Iu(e,t){if(e||yr(29),t!==void 0)return Iu(Ph(e,t));if(Ev(e)||$1(e)||x1(e)||vl(e)||Xo(e))return e;if(e[Qt])return e[Qt];yr(24,e)}function X2(e,t){var r;if(t!==void 0)r=Ph(e,t);else{if(Kd(e))return e.name;Yl(e)||vl(e)||Xo(e)?r=Iu(e):r=Ph(e)}return r.name_}function zf(e){var t=Bf(),r=V1(!0);bs();try{return e()}finally{ws(),G1(r),uc(t)}}var ny=D1.toString;function uw(e,t,r){return r===void 0&&(r=-1),K2(e,t,r)}function K2(e,t,r,n,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!=="function"&&a!=="object"&&typeof t!="object")return!1;var o=ny.call(e);if(o!==ny.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++;break}e=iy(e),t=iy(t);var l=o==="[object Array]";if(!l){if(typeof e!="object"||typeof t!="object")return!1;var u=e.constructor,d=t.constructor;if(u!==d&&!(Gs(u)&&u instanceof u&&Gs(d)&&d instanceof d)&&"constructor"in e&&"constructor"in t)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var h=n.length;h--;)if(n[h]===e)return i[h]===t;if(n.push(e),i.push(t),l){if(h=e.length,h!==t.length)return!1;for(;h--;)if(!K2(e[h],t[h],r-1,n,i))return!1}else{var v=Object.keys(e),p=v.length;if(Object.keys(t).length!==p)return!1;for(var f=0;f<p;f++){var b=v[f];if(!(lc(t,b)&&K2(e[b],t[b],r-1,n,i)))return!1}}return n.pop(),i.pop(),!0}function iy(e){return Fu(e)?e.slice():Nh(e)||vl(e)||ac(e)||Xo(e)?Array.from(e.entries()):e}var ay,t9=((ay=F1().Iterator)==null?void 0:ay.prototype)||{};function Tv(e){return e[Symbol.iterator]=r9,Object.assign(Object.create(t9),e)}function r9(){return this}["Symbol","Map","Set"].forEach(function(e){var t=F1();typeof t[e]>"u"&&yr("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:g_,extras:{getDebugName:X2},$mobx:Qt});if(!wi.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!rw)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var cw=f4();function n9(e){e()}function i9(e){e||(e=n9),O_({reactionScheduler:e})}function a9(e){return k_(e)}var o9=1e4,s9=1e4,l9=function(){function e(t){var r=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=o9),clearTimeout(r.sweepTimeout),r.sweepTimeout=void 0;var i=Date.now();r.registrations.forEach(function(a,o){i-a.registeredAt>=n&&(r.finalize(a.value),r.registrations.delete(o))}),r.registrations.size>0&&r.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){r.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){this.registrations.set(n,{value:r,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.registrations.delete(t)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,s9))}}),e}(),u9=typeof FinalizationRegistry<"u"?FinalizationRegistry:l9,Z2=new u9(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),V0={exports:{}},G0={};/**
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 oy;function c9(){if(oy)return G0;oy=1;var e=op();function t(v,p){return v===p&&(v!==0||1/v===1/p)||v!==v&&p!==p}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function l(v,p){var f=p(),b=n({inst:{value:f,getSnapshot:p}}),_=b[0].inst,S=b[1];return a(function(){_.value=f,_.getSnapshot=p,u(_)&&S({inst:_})},[v,f,p]),i(function(){return u(_)&&S({inst:_}),v(function(){u(_)&&S({inst:_})})},[v]),o(f),f}function u(v){var p=v.getSnapshot;v=v.value;try{var f=p();return!r(v,f)}catch{return!0}}function d(v,p){return p()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return G0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,G0}var sy;function f9(){return sy||(sy=1,V0.exports=c9()),V0.exports}var h9=f9();function ly(e){e.reaction=new Ru("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function d9(e,t){t===void 0&&(t="observed");var r=fe.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(l){return Z2.unregister(n),n.onStoreChange=l,n.reaction||(ly(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||(ly(i),Z2.register(r,i,i)),fe.useDebugValue(i.reaction,a9),h9.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var a,o;if(i.reaction.track(function(){try{a=e()}catch(l){o=l}}),o)throw o;return a}var $0,W0,fw=typeof Symbol=="function"&&Symbol.for,p9=(W0=($0=Object.getOwnPropertyDescriptor(function(){},"name"))===null||$0===void 0?void 0:$0.configurable)!==null&&W0!==void 0?W0:!1,uy=fw?Symbol.for("react.forward_ref"):typeof wi.forwardRef=="function"&&wi.forwardRef(function(e){return null}).$$typeof,cy=fw?Symbol.for("react.memo"):typeof wi.memo=="function"&&wi.memo(function(e){return null}).$$typeof;function Gn(e,t){var r;if(cy&&e.$$typeof===cy)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=e,a=e.displayName||e.name;if(uy&&e.$$typeof===uy&&(n=!0,i=e.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var o=function(l,u){return d9(function(){return i(l,u)},a)};return o.displayName=e.displayName,p9&&Object.defineProperty(o,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(o.contextTypes=e.contextTypes),n&&(o=wi.forwardRef(o)),o=wi.memo(o),v9(e,o),o}var g9={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function v9(e,t){Object.keys(e).forEach(function(r){g9[r]||Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}function m9(e,t){return wi.useState(function(){return Fr(e(),t,{autoBind:!0})})[0]}var Y0;i9(cw.unstable_batchedUpdates);Y0=Z2.finalizeAllImmediately;var s1={exports:{}},Gh={},X0={},K0={},fy;function br(){return fy||(fy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const t=Math.PI/180;function r(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof xh<"u"?xh:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.22",isBrowser:r(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return e.Konva.angleDeg?i*t:i},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){var i;return(i=e.Konva.Transformer)===null||i===void 0?void 0:i.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(i){e.glob.Konva=i}};const n=i=>{e.Konva[i.prototype.getClassName()]=i};e._registerNode=n,e.Konva._injectGlobal(e.Konva)}(K0)),K0}var Z0={},hy;function Ni(){return hy||(hy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=br();class r{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 r(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 P=this.m;return{x:P[0]*E.x+P[2]*E.y+P[4],y:P[1]*E.x+P[3]*E.y+P[5]}}translate(E,P){return this.m[4]+=this.m[0]*E+this.m[2]*P,this.m[5]+=this.m[1]*E+this.m[3]*P,this}scale(E,P){return this.m[0]*=E,this.m[1]*=E,this.m[2]*=P,this.m[3]*=P,this}rotate(E){const P=Math.cos(E),R=Math.sin(E),k=this.m[0]*P+this.m[2]*R,N=this.m[1]*P+this.m[3]*R,M=this.m[0]*-R+this.m[2]*P,T=this.m[1]*-R+this.m[3]*P;return this.m[0]=k,this.m[1]=N,this.m[2]=M,this.m[3]=T,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(E,P){const R=this.m[0]+this.m[2]*P,k=this.m[1]+this.m[3]*P,N=this.m[2]+this.m[0]*E,M=this.m[3]+this.m[1]*E;return this.m[0]=R,this.m[1]=k,this.m[2]=N,this.m[3]=M,this}multiply(E){const P=this.m[0]*E.m[0]+this.m[2]*E.m[1],R=this.m[1]*E.m[0]+this.m[3]*E.m[1],k=this.m[0]*E.m[2]+this.m[2]*E.m[3],N=this.m[1]*E.m[2]+this.m[3]*E.m[3],M=this.m[0]*E.m[4]+this.m[2]*E.m[5]+this.m[4],T=this.m[1]*E.m[4]+this.m[3]*E.m[5]+this.m[5];return this.m[0]=P,this.m[1]=R,this.m[2]=k,this.m[3]=N,this.m[4]=M,this.m[5]=T,this}invert(){const E=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),P=this.m[3]*E,R=-this.m[1]*E,k=-this.m[2]*E,N=this.m[0]*E,M=E*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),T=E*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=P,this.m[1]=R,this.m[2]=k,this.m[3]=N,this.m[4]=M,this.m[5]=T,this}getMatrix(){return this.m}decompose(){const E=this.m[0],P=this.m[1],R=this.m[2],k=this.m[3],N=this.m[4],M=this.m[5],T=E*k-P*R,C={x:N,y:M,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(E!=0||P!=0){const L=Math.sqrt(E*E+P*P);C.rotation=P>0?Math.acos(E/L):-Math.acos(E/L),C.scaleX=L,C.scaleY=T/L,C.skewX=(E*R+P*k)/T,C.skewY=0}else if(R!=0||k!=0){const L=Math.sqrt(R*R+k*k);C.rotation=Math.PI/2-(k>0?Math.acos(-R/L):-Math.acos(R/L)),C.scaleX=T/L,C.scaleY=L,C.skewX=0,C.skewY=(E*R+P*k)/T}return C.rotation=e.Util._getRotation(C.rotation),C}}e.Transform=r;const n="[object Array]",i="[object Number]",a="[object String]",o="[object Boolean]",l=Math.PI/180,u=180/Math.PI,d="#",h="",v="0",p="Konva warning: ",f="Konva error: ",b="rgb(",_={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]},S=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let x=[];const m=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(w){setTimeout(w,60)};e.Util={_isElement(w){return!!(w&&w.nodeType==1)},_isFunction(w){return!!(w&&w.constructor&&w.call&&w.apply)},_isPlainObject(w){return!!w&&w.constructor===Object},_isArray(w){return Object.prototype.toString.call(w)===n},_isNumber(w){return Object.prototype.toString.call(w)===i&&!isNaN(w)&&isFinite(w)},_isString(w){return Object.prototype.toString.call(w)===a},_isBoolean(w){return Object.prototype.toString.call(w)===o},isObject(w){return w instanceof Object},isValidSelector(w){if(typeof w!="string")return!1;const E=w[0];return E==="#"||E==="."||E===E.toUpperCase()},_sign(w){return w===0||w>0?1:-1},requestAnimFrame(w){x.push(w),x.length===1&&m(function(){const E=x;x=[],E.forEach(function(P){P()})})},createCanvasElement(){const w=document.createElement("canvas");try{w.style=w.style||{}}catch{}return w},createImageElement(){return document.createElement("img")},_isInDocument(w){for(;w=w.parentNode;)if(w==document)return!0;return!1},_urlToImage(w,E){const P=e.Util.createImageElement();P.onload=function(){E(P)},P.src=w},_rgbToHex(w,E,P){return((1<<24)+(w<<16)+(E<<8)+P).toString(16).slice(1)},_hexToRgb(w){w=w.replace(d,h);const E=parseInt(w,16);return{r:E>>16&255,g:E>>8&255,b:E&255}},getRandomColor(){let w=(Math.random()*16777215<<0).toString(16);for(;w.length<6;)w=v+w;return d+w},getRGB(w){let E;return w in _?(E=_[w],{r:E[0],g:E[1],b:E[2]}):w[0]===d?this._hexToRgb(w.substring(1)):w.substr(0,4)===b?(E=S.exec(w.replace(/ /g,"")),{r:parseInt(E[1],10),g:parseInt(E[2],10),b:parseInt(E[3],10)}):{r:0,g:0,b:0}},colorToRGBA(w){return w=w||"black",e.Util._namedColorToRBA(w)||e.Util._hex3ColorToRGBA(w)||e.Util._hex4ColorToRGBA(w)||e.Util._hex6ColorToRGBA(w)||e.Util._hex8ColorToRGBA(w)||e.Util._rgbColorToRGBA(w)||e.Util._rgbaColorToRGBA(w)||e.Util._hslColorToRGBA(w)},_namedColorToRBA(w){const E=_[w.toLowerCase()];return E?{r:E[0],g:E[1],b:E[2],a:1}:null},_rgbColorToRGBA(w){if(w.indexOf("rgb(")===0){w=w.match(/rgb\(([^)]+)\)/)[1];const E=w.split(/ *, */).map(Number);return{r:E[0],g:E[1],b:E[2],a:1}}},_rgbaColorToRGBA(w){if(w.indexOf("rgba(")===0){w=w.match(/rgba\(([^)]+)\)/)[1];const E=w.split(/ *, */).map((P,R)=>P.slice(-1)==="%"?R===3?parseInt(P)/100:parseInt(P)/100*255:Number(P));return{r:E[0],g:E[1],b:E[2],a:E[3]}}},_hex8ColorToRGBA(w){if(w[0]==="#"&&w.length===9)return{r:parseInt(w.slice(1,3),16),g:parseInt(w.slice(3,5),16),b:parseInt(w.slice(5,7),16),a:parseInt(w.slice(7,9),16)/255}},_hex6ColorToRGBA(w){if(w[0]==="#"&&w.length===7)return{r:parseInt(w.slice(1,3),16),g:parseInt(w.slice(3,5),16),b:parseInt(w.slice(5,7),16),a:1}},_hex4ColorToRGBA(w){if(w[0]==="#"&&w.length===5)return{r:parseInt(w[1]+w[1],16),g:parseInt(w[2]+w[2],16),b:parseInt(w[3]+w[3],16),a:parseInt(w[4]+w[4],16)/255}},_hex3ColorToRGBA(w){if(w[0]==="#"&&w.length===4)return{r:parseInt(w[1]+w[1],16),g:parseInt(w[2]+w[2],16),b:parseInt(w[3]+w[3],16),a:1}},_hslColorToRGBA(w){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(w)){const[E,...P]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(w),R=Number(P[0])/360,k=Number(P[1])/100,N=Number(P[2])/100;let M,T,C;if(k===0)return C=N*255,{r:Math.round(C),g:Math.round(C),b:Math.round(C),a:1};N<.5?M=N*(1+k):M=N+k-N*k;const L=2*N-M,H=[0,0,0];for(let G=0;G<3;G++)T=R+1/3*-(G-1),T<0&&T++,T>1&&T--,6*T<1?C=L+(M-L)*6*T:2*T<1?C=M:3*T<2?C=L+(M-L)*(2/3-T)*6:C=L,H[G]=C*255;return{r:Math.round(H[0]),g:Math.round(H[1]),b:Math.round(H[2]),a:1}}},haveIntersection(w,E){return!(E.x>w.x+w.width||E.x+E.width<w.x||E.y>w.y+w.height||E.y+E.height<w.y)},cloneObject(w){const E={};for(const P in w)this._isPlainObject(w[P])?E[P]=this.cloneObject(w[P]):this._isArray(w[P])?E[P]=this.cloneArray(w[P]):E[P]=w[P];return E},cloneArray(w){return w.slice(0)},degToRad(w){return w*l},radToDeg(w){return w*u},_degToRad(w){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(w)},_radToDeg(w){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(w)},_getRotation(w){return t.Konva.angleDeg?e.Util.radToDeg(w):w},_capitalize(w){return w.charAt(0).toUpperCase()+w.slice(1)},throw(w){throw new Error(f+w)},error(w){console.error(f+w)},warn(w){t.Konva.showWarnings&&console.warn(p+w)},each(w,E){for(const P in w)E(P,w[P])},_inRange(w,E,P){return E<=w&&w<P},_getProjectionToSegment(w,E,P,R,k,N){let M,T,C;const L=(w-P)*(w-P)+(E-R)*(E-R);if(L==0)M=w,T=E,C=(k-P)*(k-P)+(N-R)*(N-R);else{const H=((k-w)*(P-w)+(N-E)*(R-E))/L;H<0?(M=w,T=E,C=(w-k)*(w-k)+(E-N)*(E-N)):H>1?(M=P,T=R,C=(P-k)*(P-k)+(R-N)*(R-N)):(M=w+H*(P-w),T=E+H*(R-E),C=(M-k)*(M-k)+(T-N)*(T-N))}return[M,T,C]},_getProjectionToLine(w,E,P){const R=e.Util.cloneObject(w);let k=Number.MAX_VALUE;return E.forEach(function(N,M){if(!P&&M===E.length-1)return;const T=E[(M+1)%E.length],C=e.Util._getProjectionToSegment(N.x,N.y,T.x,T.y,w.x,w.y),L=C[0],H=C[1],G=C[2];G<k&&(R.x=L,R.y=H,k=G)}),R},_prepareArrayForTween(w,E,P){const R=[],k=[];if(w.length>E.length){const M=E;E=w,w=M}for(let M=0;M<w.length;M+=2)R.push({x:w[M],y:w[M+1]});for(let M=0;M<E.length;M+=2)k.push({x:E[M],y:E[M+1]});const N=[];return k.forEach(function(M){const T=e.Util._getProjectionToLine(M,R,P);N.push(T.x),N.push(T.y)}),N},_prepareToStringify(w){let E;w.visitedByCircularReferenceRemoval=!0;for(const P in w)if(w.hasOwnProperty(P)&&w[P]&&typeof w[P]=="object"){if(E=Object.getOwnPropertyDescriptor(w,P),w[P].visitedByCircularReferenceRemoval||e.Util._isElement(w[P]))if(E.configurable)delete w[P];else return null;else if(e.Util._prepareToStringify(w[P])===null)if(E.configurable)delete w[P];else return null}return delete w.visitedByCircularReferenceRemoval,w},_assign(w,E){for(const P in E)w[P]=E[P];return w},_getFirstPointerId(w){return w.touches?w.changedTouches[0].identifier:w.pointerId||999},releaseCanvas(...w){t.Konva.releaseCanvasOnDestroy&&w.forEach(E=>{E.width=0,E.height=0})},drawRoundedRectPath(w,E,P,R){let k=0,N=0,M=0,T=0;typeof R=="number"?k=N=M=T=Math.min(R,E/2,P/2):(k=Math.min(R[0]||0,E/2,P/2),N=Math.min(R[1]||0,E/2,P/2),T=Math.min(R[2]||0,E/2,P/2),M=Math.min(R[3]||0,E/2,P/2)),w.moveTo(k,0),w.lineTo(E-N,0),w.arc(E-N,N,N,Math.PI*3/2,0,!1),w.lineTo(E,P-T),w.arc(E-T,P-T,T,0,Math.PI/2,!1),w.lineTo(M,P),w.arc(M,P-M,M,Math.PI/2,Math.PI,!1),w.lineTo(0,k),w.arc(k,k,k,Math.PI,Math.PI*3/2,!1)}}}(Z0)),Z0}var $h={},ec={},tc={},dy;function hw(){if(dy)return tc;dy=1,Object.defineProperty(tc,"__esModule",{value:!0}),tc.HitContext=tc.SceneContext=tc.Context=void 0;const e=Ni(),t=br();function r(x){const m=[],w=x.length,E=e.Util;for(let P=0;P<w;P++){let R=x[P];E._isNumber(R)?R=Math.round(R*1e3)/1e3:E._isString(R)||(R=R+""),m.push(R)}return m}const n=",",i="(",a=")",o="([",l="])",u=";",d="()",h="=",v=["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"],p=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],f=100;let b=class{constructor(m){this.canvas=m,t.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(m){m.fillEnabled()&&this._fill(m)}_fill(m){}strokeShape(m){m.hasStroke()&&this._stroke(m)}_stroke(m){}fillStrokeShape(m){m.attrs.fillAfterStrokeEnabled?(this.strokeShape(m),this.fillShape(m)):(this.fillShape(m),this.strokeShape(m))}getTrace(m,w){let E=this.traceArr,P=E.length,R="",k,N,M,T;for(k=0;k<P;k++)N=E[k],M=N.method,M?(T=N.args,R+=M,m?R+=d:e.Util._isArray(T[0])?R+=o+T.join(n)+l:(w&&(T=T.map(C=>typeof C=="number"?Math.floor(C):C)),R+=i+T.join(n)+a)):(R+=N.property,m||(R+=h+N.val)),R+=u;return R}clearTrace(){this.traceArr=[]}_trace(m){let w=this.traceArr,E;w.push(m),E=w.length,E>=f&&w.shift()}reset(){const m=this.getCanvas().getPixelRatio();this.setTransform(1*m,0,0,1*m,0,0)}getCanvas(){return this.canvas}clear(m){const w=this.getCanvas();m?this.clearRect(m.x||0,m.y||0,m.width||0,m.height||0):this.clearRect(0,0,w.getWidth()/w.pixelRatio,w.getHeight()/w.pixelRatio)}_applyLineCap(m){const w=m.attrs.lineCap;w&&this.setAttr("lineCap",w)}_applyOpacity(m){const w=m.getAbsoluteOpacity();w!==1&&this.setAttr("globalAlpha",w)}_applyLineJoin(m){const w=m.attrs.lineJoin;w&&this.setAttr("lineJoin",w)}setAttr(m,w){this._context[m]=w}arc(m,w,E,P,R,k){this._context.arc(m,w,E,P,R,k)}arcTo(m,w,E,P,R){this._context.arcTo(m,w,E,P,R)}beginPath(){this._context.beginPath()}bezierCurveTo(m,w,E,P,R,k){this._context.bezierCurveTo(m,w,E,P,R,k)}clearRect(m,w,E,P){this._context.clearRect(m,w,E,P)}clip(...m){this._context.clip.apply(this._context,m)}closePath(){this._context.closePath()}createImageData(m,w){const E=arguments;if(E.length===2)return this._context.createImageData(m,w);if(E.length===1)return this._context.createImageData(m)}createLinearGradient(m,w,E,P){return this._context.createLinearGradient(m,w,E,P)}createPattern(m,w){return this._context.createPattern(m,w)}createRadialGradient(m,w,E,P,R,k){return this._context.createRadialGradient(m,w,E,P,R,k)}drawImage(m,w,E,P,R,k,N,M,T){const C=arguments,L=this._context;C.length===3?L.drawImage(m,w,E):C.length===5?L.drawImage(m,w,E,P,R):C.length===9&&L.drawImage(m,w,E,P,R,k,N,M,T)}ellipse(m,w,E,P,R,k,N,M){this._context.ellipse(m,w,E,P,R,k,N,M)}isPointInPath(m,w,E,P){return E?this._context.isPointInPath(E,m,w,P):this._context.isPointInPath(m,w,P)}fill(...m){this._context.fill.apply(this._context,m)}fillRect(m,w,E,P){this._context.fillRect(m,w,E,P)}strokeRect(m,w,E,P){this._context.strokeRect(m,w,E,P)}fillText(m,w,E,P){P?this._context.fillText(m,w,E,P):this._context.fillText(m,w,E)}measureText(m){return this._context.measureText(m)}getImageData(m,w,E,P){return this._context.getImageData(m,w,E,P)}lineTo(m,w){this._context.lineTo(m,w)}moveTo(m,w){this._context.moveTo(m,w)}rect(m,w,E,P){this._context.rect(m,w,E,P)}roundRect(m,w,E,P,R){this._context.roundRect(m,w,E,P,R)}putImageData(m,w,E){this._context.putImageData(m,w,E)}quadraticCurveTo(m,w,E,P){this._context.quadraticCurveTo(m,w,E,P)}restore(){this._context.restore()}rotate(m){this._context.rotate(m)}save(){this._context.save()}scale(m,w){this._context.scale(m,w)}setLineDash(m){this._context.setLineDash?this._context.setLineDash(m):"mozDash"in this._context?this._context.mozDash=m:"webkitLineDash"in this._context&&(this._context.webkitLineDash=m)}getLineDash(){return this._context.getLineDash()}setTransform(m,w,E,P,R,k){this._context.setTransform(m,w,E,P,R,k)}stroke(m){m?this._context.stroke(m):this._context.stroke()}strokeText(m,w,E,P){this._context.strokeText(m,w,E,P)}transform(m,w,E,P,R,k){this._context.transform(m,w,E,P,R,k)}translate(m,w){this._context.translate(m,w)}_enableTrace(){let m=this,w=v.length,E=this.setAttr,P,R;const k=function(N){let M=m[N],T;m[N]=function(){return R=r(Array.prototype.slice.call(arguments,0)),T=M.apply(m,arguments),m._trace({method:N,args:R}),T}};for(P=0;P<w;P++)k(v[P]);m.setAttr=function(){E.apply(m,arguments);const N=arguments[0];let M=arguments[1];(N==="shadowOffsetX"||N==="shadowOffsetY"||N==="shadowBlur")&&(M=M/this.canvas.getPixelRatio()),m._trace({property:N,val:M})}}_applyGlobalCompositeOperation(m){const w=m.attrs.globalCompositeOperation;!w||w==="source-over"||this.setAttr("globalCompositeOperation",w)}};tc.Context=b,p.forEach(function(x){Object.defineProperty(b.prototype,x,{get(){return this._context[x]},set(m){this._context[x]=m}})});class _ extends b{constructor(m,{willReadFrequently:w=!1}={}){super(m),this._context=m._canvas.getContext("2d",{willReadFrequently:w})}_fillColor(m){const w=m.fill();this.setAttr("fillStyle",w),m._fillFunc(this)}_fillPattern(m){this.setAttr("fillStyle",m._getFillPattern()),m._fillFunc(this)}_fillLinearGradient(m){const w=m._getLinearGradient();w&&(this.setAttr("fillStyle",w),m._fillFunc(this))}_fillRadialGradient(m){const w=m._getRadialGradient();w&&(this.setAttr("fillStyle",w),m._fillFunc(this))}_fill(m){const w=m.fill(),E=m.getFillPriority();if(w&&E==="color"){this._fillColor(m);return}const P=m.getFillPatternImage();if(P&&E==="pattern"){this._fillPattern(m);return}const R=m.getFillLinearGradientColorStops();if(R&&E==="linear-gradient"){this._fillLinearGradient(m);return}const k=m.getFillRadialGradientColorStops();if(k&&E==="radial-gradient"){this._fillRadialGradient(m);return}w?this._fillColor(m):P?this._fillPattern(m):R?this._fillLinearGradient(m):k&&this._fillRadialGradient(m)}_strokeLinearGradient(m){const w=m.getStrokeLinearGradientStartPoint(),E=m.getStrokeLinearGradientEndPoint(),P=m.getStrokeLinearGradientColorStops(),R=this.createLinearGradient(w.x,w.y,E.x,E.y);if(P){for(let k=0;k<P.length;k+=2)R.addColorStop(P[k],P[k+1]);this.setAttr("strokeStyle",R)}}_stroke(m){const w=m.dash(),E=m.getStrokeScaleEnabled();if(m.hasStroke()){if(!E){this.save();const R=this.getCanvas().getPixelRatio();this.setTransform(R,0,0,R,0,0)}this._applyLineCap(m),w&&m.dashEnabled()&&(this.setLineDash(w),this.setAttr("lineDashOffset",m.dashOffset())),this.setAttr("lineWidth",m.strokeWidth()),m.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),m.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(m):this.setAttr("strokeStyle",m.stroke()),m._strokeFunc(this),E||this.restore()}}_applyShadow(m){var w,E,P;const R=(w=m.getShadowRGBA())!==null&&w!==void 0?w:"black",k=(E=m.getShadowBlur())!==null&&E!==void 0?E:5,N=(P=m.getShadowOffset())!==null&&P!==void 0?P:{x:0,y:0},M=m.getAbsoluteScale(),T=this.canvas.getPixelRatio(),C=M.x*T,L=M.y*T;this.setAttr("shadowColor",R),this.setAttr("shadowBlur",k*Math.min(Math.abs(C),Math.abs(L))),this.setAttr("shadowOffsetX",N.x*C),this.setAttr("shadowOffsetY",N.y*L)}}tc.SceneContext=_;class S extends b{constructor(m){super(m),this._context=m._canvas.getContext("2d",{willReadFrequently:!0})}_fill(m){this.save(),this.setAttr("fillStyle",m.colorKey),m._fillFuncHit(this),this.restore()}strokeShape(m){m.hasHitStroke()&&this._stroke(m)}_stroke(m){if(m.hasHitStroke()){const w=m.getStrokeScaleEnabled();if(!w){this.save();const R=this.getCanvas().getPixelRatio();this.setTransform(R,0,0,R,0,0)}this._applyLineCap(m);const E=m.hitStrokeWidth(),P=E==="auto"?m.strokeWidth():E;this.setAttr("lineWidth",P),this.setAttr("strokeStyle",m.colorKey),m._strokeFuncHit(this),w||this.restore()}}}return tc.HitContext=S,tc}var py;function W1(){if(py)return ec;py=1,Object.defineProperty(ec,"__esModule",{value:!0}),ec.HitCanvas=ec.SceneCanvas=ec.Canvas=void 0;const e=Ni(),t=hw(),r=br();let n;function i(){if(n)return n;const u=e.Util.createCanvasElement(),d=u.getContext("2d");return n=function(){const h=r.Konva._global.devicePixelRatio||1,v=d.webkitBackingStorePixelRatio||d.mozBackingStorePixelRatio||d.msBackingStorePixelRatio||d.oBackingStorePixelRatio||d.backingStorePixelRatio||1;return h/v}(),e.Util.releaseCanvas(u),n}let a=class{constructor(d){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const v=(d||{}).pixelRatio||r.Konva.pixelRatio||i();this.pixelRatio=v,this._canvas=e.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(d){const h=this.pixelRatio;this.pixelRatio=d,this.setSize(this.getWidth()/h,this.getHeight()/h)}setWidth(d){this.width=this._canvas.width=d*this.pixelRatio,this._canvas.style.width=d+"px";const h=this.pixelRatio;this.getContext()._context.scale(h,h)}setHeight(d){this.height=this._canvas.height=d*this.pixelRatio,this._canvas.style.height=d+"px";const h=this.pixelRatio;this.getContext()._context.scale(h,h)}getWidth(){return this.width}getHeight(){return this.height}setSize(d,h){this.setWidth(d||0),this.setHeight(h||0)}toDataURL(d,h){try{return this._canvas.toDataURL(d,h)}catch{try{return this._canvas.toDataURL()}catch(p){return e.Util.error("Unable to get data URL. "+p.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}};ec.Canvas=a;class o extends a{constructor(d={width:0,height:0,willReadFrequently:!1}){super(d),this.context=new t.SceneContext(this,{willReadFrequently:d.willReadFrequently}),this.setSize(d.width,d.height)}}ec.SceneCanvas=o;class l extends a{constructor(d={width:0,height:0}){super(d),this.hitCanvas=!0,this.context=new t.HitContext(this),this.setSize(d.width,d.height)}}return ec.HitCanvas=l,ec}var Q0={},gy;function Rv(){return gy||(gy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=br(),r=Ni();e.DD={get isDragging(){let n=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){let n;return e.DD._dragElements.forEach(i=>{n=i.node}),n},_dragElements:new Map,_drag(n){const i=[];e.DD._dragElements.forEach((a,o)=>{const{node:l}=a,u=l.getStage();u.setPointersPositions(n),a.pointerId===void 0&&(a.pointerId=r.Util._getFirstPointerId(n));const d=u._changedPointerPositions.find(h=>h.id===a.pointerId);if(d){if(a.dragStatus!=="dragging"){const h=l.dragDistance();if(Math.max(Math.abs(d.x-a.startPointerPos.x),Math.abs(d.y-a.startPointerPos.y))<h||(l.startDrag({evt:n}),!l.isDragging()))return}l._setDragPosition(n,a),i.push(l)}}),i.forEach(a=>{a.fire("dragmove",{type:"dragmove",target:a,evt:n},!0)})},_endDragBefore(n){const i=[];e.DD._dragElements.forEach(a=>{const{node:o}=a,l=o.getStage();if(n&&l.setPointersPositions(n),!l._changedPointerPositions.find(h=>h.id===a.pointerId))return;(a.dragStatus==="dragging"||a.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,a.dragStatus="stopped");const d=a.node.getLayer()||a.node instanceof t.Konva.Stage&&a.node;d&&i.indexOf(d)===-1&&i.push(d)}),i.forEach(a=>{a.draw()})},_endDragAfter(n){e.DD._dragElements.forEach((i,a)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:n},!0),i.dragStatus!=="dragging"&&e.DD._dragElements.delete(a)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("touchcancel",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1),window.addEventListener("touchcancel",e.DD._endDragAfter,!1))}(Q0)),Q0}var J0={},ys={},vy;function Tr(){if(vy)return ys;vy=1,Object.defineProperty(ys,"__esModule",{value:!0}),ys.RGBComponent=n,ys.alphaComponent=i,ys.getNumberValidator=a,ys.getNumberOrArrayOfNumbersValidator=o,ys.getNumberOrAutoValidator=l,ys.getStringValidator=u,ys.getStringOrGradientValidator=d,ys.getFunctionValidator=h,ys.getNumberArrayValidator=v,ys.getBooleanValidator=p,ys.getComponentValidator=f;const e=br(),t=Ni();function r(b){return t.Util._isString(b)?'"'+b+'"':Object.prototype.toString.call(b)==="[object Number]"||t.Util._isBoolean(b)?b:Object.prototype.toString.call(b)}function n(b){return b>255?255:b<0?0:Math.round(b)}function i(b){return b>1?1:b<1e-4?1e-4:b}function a(){if(e.Konva.isUnminified)return function(b,_){return t.Util._isNumber(b)||t.Util.warn(r(b)+' is a not valid value for "'+_+'" attribute. The value should be a number.'),b}}function o(b){if(e.Konva.isUnminified)return function(_,S){let x=t.Util._isNumber(_),m=t.Util._isArray(_)&&_.length==b;return!x&&!m&&t.Util.warn(r(_)+' is a not valid value for "'+S+'" attribute. The value should be a number or Array<number>('+b+")"),_}}function l(){if(e.Konva.isUnminified)return function(b,_){return t.Util._isNumber(b)||b==="auto"||t.Util.warn(r(b)+' is a not valid value for "'+_+'" attribute. The value should be a number or "auto".'),b}}function u(){if(e.Konva.isUnminified)return function(b,_){return t.Util._isString(b)||t.Util.warn(r(b)+' is a not valid value for "'+_+'" attribute. The value should be a string.'),b}}function d(){if(e.Konva.isUnminified)return function(b,_){const S=t.Util._isString(b),x=Object.prototype.toString.call(b)==="[object CanvasGradient]"||b&&b.addColorStop;return S||x||t.Util.warn(r(b)+' is a not valid value for "'+_+'" attribute. The value should be a string or a native gradient.'),b}}function h(){if(e.Konva.isUnminified)return function(b,_){return t.Util._isFunction(b)||t.Util.warn(r(b)+' is a not valid value for "'+_+'" attribute. The value should be a function.'),b}}function v(){if(e.Konva.isUnminified)return function(b,_){const S=Int8Array?Object.getPrototypeOf(Int8Array):null;return S&&b instanceof S||(t.Util._isArray(b)?b.forEach(function(x){t.Util._isNumber(x)||t.Util.warn('"'+_+'" attribute has non numeric element '+x+". Make sure that all elements are numbers.")}):t.Util.warn(r(b)+' is a not valid value for "'+_+'" attribute. The value should be a array of numbers.')),b}}function p(){if(e.Konva.isUnminified)return function(b,_){return b===!0||b===!1||t.Util.warn(r(b)+' is a not valid value for "'+_+'" attribute. The value should be a boolean.'),b}}function f(b){if(e.Konva.isUnminified)return function(_,S){return _==null||t.Util.isObject(_)||t.Util.warn(r(_)+' is a not valid value for "'+S+'" attribute. The value should be an object with properties '+b),_}}return ys}var my;function kr(){return my||(my=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=Ni(),r=Tr(),n="get",i="set";e.Factory={addGetterSetter(a,o,l,u,d){e.Factory.addGetter(a,o,l),e.Factory.addSetter(a,o,u,d),e.Factory.addOverloadedGetterSetter(a,o)},addGetter(a,o,l){const u=n+t.Util._capitalize(o);a.prototype[u]=a.prototype[u]||function(){const d=this.attrs[o];return d===void 0?l:d}},addSetter(a,o,l,u){const d=i+t.Util._capitalize(o);a.prototype[d]||e.Factory.overWriteSetter(a,o,l,u)},overWriteSetter(a,o,l,u){const d=i+t.Util._capitalize(o);a.prototype[d]=function(h){return l&&h!==void 0&&h!==null&&(h=l.call(this,h,o)),this._setAttr(o,h),u&&u.call(this),this}},addComponentsGetterSetter(a,o,l,u,d){const h=l.length,v=t.Util._capitalize,p=n+v(o),f=i+v(o);a.prototype[p]=function(){const _={};for(let S=0;S<h;S++){const x=l[S];_[x]=this.getAttr(o+v(x))}return _};const b=(0,r.getComponentValidator)(l);a.prototype[f]=function(_){const S=this.attrs[o];u&&(_=u.call(this,_,o)),b&&b.call(this,_,o);for(const x in _)_.hasOwnProperty(x)&&this._setAttr(o+v(x),_[x]);return _||l.forEach(x=>{this._setAttr(o+v(x),void 0)}),this._fireChangeEvent(o,S,_),d&&d.call(this),this},e.Factory.addOverloadedGetterSetter(a,o)},addOverloadedGetterSetter(a,o){const l=t.Util._capitalize(o),u=i+l,d=n+l;a.prototype[o]=function(){return arguments.length?(this[u](arguments[0]),this):this[d]()}},addDeprecatedGetterSetter(a,o,l,u){t.Util.error("Adding deprecated "+o);const d=n+t.Util._capitalize(o),h=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[d]=function(){t.Util.error(h);const v=this.attrs[o];return v===void 0?l:v},e.Factory.addSetter(a,o,u,function(){t.Util.error(h)}),e.Factory.addOverloadedGetterSetter(a,o)},backCompat(a,o){t.Util.each(o,function(l,u){const d=a.prototype[u],h=n+t.Util._capitalize(l),v=i+t.Util._capitalize(l);function p(){d.apply(this,arguments),t.Util.error('"'+l+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}a.prototype[l]=p,a.prototype[h]=p,a.prototype[v]=p})},afterSetFilter(){this._filterUpToDate=!1}}}(J0)),J0}var yy;function Qi(){if(yy)return $h;yy=1,Object.defineProperty($h,"__esModule",{value:!0}),$h.Node=void 0;const e=W1(),t=Rv(),r=kr(),n=br(),i=Ni(),a=Tr(),o="absoluteOpacity",l="allEventListeners",u="absoluteTransform",d="absoluteScale",h="canvas",v="Change",p="children",f="konva",b="listening",_="mouseenter",S="mouseleave",x="pointerenter",m="pointerleave",w="touchenter",E="touchleave",P="set",R="Shape",k=" ",N="stage",M="transform",T="Stage",C="visible",L=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(k);let H=1;class G{constructor(U){this._id=H++,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(U),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(U){(U===M||U===u)&&this._cache.get(U)?this._cache.get(U).dirty=!0:U?this._cache.delete(U):this._cache.clear()}_getCache(U,V){let X=this._cache.get(U);return(X===void 0||(U===M||U===u)&&X.dirty===!0)&&(X=V.call(this),this._cache.set(U,X)),X}_calculate(U,V,X){if(!this._attachedDepsListeners.get(U)){const z=V.map(D=>D+"Change.konva").join(k);this.on(z,()=>{this._clearCache(U)}),this._attachedDepsListeners.set(U,!0)}return this._getCache(U,X)}_getCanvasCache(){return this._cache.get(h)}_clearSelfAndDescendantCache(U){this._clearCache(U),U===u&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(h)){const{scene:U,filter:V,hit:X,buffer:z}=this._cache.get(h);i.Util.releaseCanvas(U,V,X,z),this._cache.delete(h)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(U){const V=U||{};let X={};(V.x===void 0||V.y===void 0||V.width===void 0||V.height===void 0)&&(X=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let z=Math.ceil(V.width||X.width),D=Math.ceil(V.height||X.height),F=V.pixelRatio,q=V.x===void 0?Math.floor(X.x):V.x,Q=V.y===void 0?Math.floor(X.y):V.y,re=V.offset||0,Y=V.drawBorder||!1,ee=V.hitCanvasPixelRatio||1;if(!z||!D){i.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const ae=Math.abs(Math.round(X.x)-q)>.5?1:0,ue=Math.abs(Math.round(X.y)-Q)>.5?1:0;z+=re*2+ae,D+=re*2+ue,q-=re,Q-=re;const ce=new e.SceneCanvas({pixelRatio:F,width:z,height:D}),pe=new e.SceneCanvas({pixelRatio:F,width:0,height:0,willReadFrequently:!0}),Ae=new e.HitCanvas({pixelRatio:ee,width:z,height:D}),Ce=ce.getContext(),ke=Ae.getContext(),Se=new e.SceneCanvas({width:ce.width/ce.pixelRatio+Math.abs(q),height:ce.height/ce.pixelRatio+Math.abs(Q),pixelRatio:ce.pixelRatio}),le=Se.getContext();return Ae.isCache=!0,ce.isCache=!0,this._cache.delete(h),this._filterUpToDate=!1,V.imageSmoothingEnabled===!1&&(ce.getContext()._context.imageSmoothingEnabled=!1,pe.getContext()._context.imageSmoothingEnabled=!1),Ce.save(),ke.save(),le.save(),Ce.translate(-q,-Q),ke.translate(-q,-Q),le.translate(-q,-Q),Se.x=q,Se.y=Q,this._isUnderCache=!0,this._clearSelfAndDescendantCache(o),this._clearSelfAndDescendantCache(d),this.drawScene(ce,this,Se),this.drawHit(Ae,this),this._isUnderCache=!1,Ce.restore(),ke.restore(),Y&&(Ce.save(),Ce.beginPath(),Ce.rect(0,0,z,D),Ce.closePath(),Ce.setAttr("strokeStyle","red"),Ce.setAttr("lineWidth",5),Ce.stroke(),Ce.restore()),this._cache.set(h,{scene:ce,filter:pe,hit:Ae,buffer:Se,x:q,y:Q}),this._requestDraw(),this}isCached(){return this._cache.has(h)}getClientRect(U){throw new Error('abstract "getClientRect" method call')}_transformedRect(U,V){const X=[{x:U.x,y:U.y},{x:U.x+U.width,y:U.y},{x:U.x+U.width,y:U.y+U.height},{x:U.x,y:U.y+U.height}];let z=1/0,D=1/0,F=-1/0,q=-1/0;const Q=this.getAbsoluteTransform(V);return X.forEach(function(re){const Y=Q.point(re);z===void 0&&(z=F=Y.x,D=q=Y.y),z=Math.min(z,Y.x),D=Math.min(D,Y.y),F=Math.max(F,Y.x),q=Math.max(q,Y.y)}),{x:z,y:D,width:F-z,height:q-D}}_drawCachedSceneCanvas(U){U.save(),U._applyOpacity(this),U._applyGlobalCompositeOperation(this);const V=this._getCanvasCache();U.translate(V.x,V.y);const X=this._getCachedSceneCanvas(),z=X.pixelRatio;U.drawImage(X._canvas,0,0,X.width/z,X.height/z),U.restore()}_drawCachedHitCanvas(U){const V=this._getCanvasCache(),X=V.hit;U.save(),U.translate(V.x,V.y),U.drawImage(X._canvas,0,0,X.width/X.pixelRatio,X.height/X.pixelRatio),U.restore()}_getCachedSceneCanvas(){let U=this.filters(),V=this._getCanvasCache(),X=V.scene,z=V.filter,D=z.getContext(),F,q,Q,re;if(U){if(!this._filterUpToDate){const Y=X.pixelRatio;z.setSize(X.width/X.pixelRatio,X.height/X.pixelRatio);try{for(F=U.length,D.clear(),D.drawImage(X._canvas,0,0,X.getWidth()/Y,X.getHeight()/Y),q=D.getImageData(0,0,z.getWidth(),z.getHeight()),Q=0;Q<F;Q++){if(re=U[Q],typeof re!="function"){i.Util.error("Filter should be type of function, but got "+typeof re+" instead. Please check correct filters");continue}re.call(this,q),D.putImageData(q,0,0)}}catch(ee){i.Util.error("Unable to apply filter. "+ee.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return z}return X}on(U,V){if(this._cache&&this._cache.delete(l),arguments.length===3)return this._delegate.apply(this,arguments);const X=U.split(k);for(let z=0;z<X.length;z++){const F=X[z].split("."),q=F[0],Q=F[1]||"";this.eventListeners[q]||(this.eventListeners[q]=[]),this.eventListeners[q].push({name:Q,handler:V})}return this}off(U,V){let X=(U||"").split(k),z=X.length,D,F,q,Q,re,Y;if(this._cache&&this._cache.delete(l),!U)for(F in this.eventListeners)this._off(F);for(D=0;D<z;D++)if(q=X[D],Q=q.split("."),re=Q[0],Y=Q[1],re)this.eventListeners[re]&&this._off(re,Y,V);else for(F in this.eventListeners)this._off(F,Y,V);return this}dispatchEvent(U){const V={target:this,type:U.type,evt:U};return this.fire(U.type,V),this}addEventListener(U,V){return this.on(U,function(X){V.call(this,X.evt)}),this}removeEventListener(U){return this.off(U),this}_delegate(U,V,X){const z=this;this.on(U,function(D){const F=D.target.findAncestors(V,!0,z);for(let q=0;q<F.length;q++)D=i.Util.cloneObject(D),D.currentTarget=F[q],X.call(F[q],D)})}remove(){return this.isDragging()&&this.stopDrag(),t.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(u),this._clearSelfAndDescendantCache(o),this._clearSelfAndDescendantCache(d),this._clearSelfAndDescendantCache(N),this._clearSelfAndDescendantCache(C),this._clearSelfAndDescendantCache(b)}_remove(){this._clearCaches();const U=this.getParent();U&&U.children&&(U.children.splice(this.index,1),U._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(U){const V="get"+i.Util._capitalize(U);return i.Util._isFunction(this[V])?this[V]():this.attrs[U]}getAncestors(){let U=this.getParent(),V=[];for(;U;)V.push(U),U=U.getParent();return V}getAttrs(){return this.attrs||{}}setAttrs(U){return this._batchTransformChanges(()=>{let V,X;if(!U)return this;for(V in U)V!==p&&(X=P+i.Util._capitalize(V),i.Util._isFunction(this[X])?this[X](U[V]):this._setAttr(V,U[V]))}),this}isListening(){return this._getCache(b,this._isListening)}_isListening(U){if(!this.listening())return!1;const X=this.getParent();return X&&X!==U&&this!==U?X._isListening(U):!0}isVisible(){return this._getCache(C,this._isVisible)}_isVisible(U){if(!this.visible())return!1;const X=this.getParent();return X&&X!==U&&this!==U?X._isVisible(U):!0}shouldDrawHit(U,V=!1){if(U)return this._isVisible(U)&&this._isListening(U);const X=this.getLayer();let z=!1;t.DD._dragElements.forEach(F=>{F.dragStatus==="dragging"&&(F.node.nodeType==="Stage"||F.node.getLayer()===X)&&(z=!0)});const D=!V&&!n.Konva.hitOnDragEnabled&&(z||n.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!D}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let U=this.getDepth(),V=this,X=0,z,D,F,q;function Q(Y){for(z=[],D=Y.length,F=0;F<D;F++)q=Y[F],X++,q.nodeType!==R&&(z=z.concat(q.getChildren().slice())),q._id===V._id&&(F=D);z.length>0&&z[0].getDepth()<=U&&Q(z)}const re=this.getStage();return V.nodeType!==T&&re&&Q(re.getChildren()),X}getDepth(){let U=0,V=this.parent;for(;V;)U++,V=V.parent;return U}_batchTransformChanges(U){this._batchingTransformChange=!0,U(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(M),this._clearSelfAndDescendantCache(u)),this._needClearTransformCache=!1}setPosition(U){return this._batchTransformChanges(()=>{this.x(U.x),this.y(U.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const U=this.getStage();if(!U)return null;const V=U.getPointerPosition();if(!V)return null;const X=this.getAbsoluteTransform().copy();return X.invert(),X.point(V)}getAbsolutePosition(U){let V=!1,X=this.parent;for(;X;){if(X.isCached()){V=!0;break}X=X.parent}V&&!U&&(U=!0);const z=this.getAbsoluteTransform(U).getMatrix(),D=new i.Transform,F=this.offset();return D.m=z.slice(),D.translate(F.x,F.y),D.getTranslation()}setAbsolutePosition(U){const{x:V,y:X,...z}=this._clearTransform();this.attrs.x=V,this.attrs.y=X,this._clearCache(M);const D=this._getAbsoluteTransform().copy();return D.invert(),D.translate(U.x,U.y),U={x:this.attrs.x+D.getTranslation().x,y:this.attrs.y+D.getTranslation().y},this._setTransform(z),this.setPosition({x:U.x,y:U.y}),this._clearCache(M),this._clearSelfAndDescendantCache(u),this}_setTransform(U){let V;for(V in U)this.attrs[V]=U[V]}_clearTransform(){const U={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,U}move(U){let V=U.x,X=U.y,z=this.x(),D=this.y();return V!==void 0&&(z+=V),X!==void 0&&(D+=X),this.setPosition({x:z,y:D}),this}_eachAncestorReverse(U,V){let X=[],z=this.getParent(),D,F;if(!(V&&V._id===this._id)){for(X.unshift(this);z&&(!V||z._id!==V._id);)X.unshift(z),z=z.parent;for(D=X.length,F=0;F<D;F++)U(X[F])}}rotate(U){return this.rotation(this.rotation()+U),this}moveToTop(){if(!this.parent)return i.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const U=this.index,V=this.parent.getChildren().length;return U<V-1?(this.parent.children.splice(U,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return i.Util.warn("Node has no parent. moveUp function is ignored."),!1;const U=this.index,V=this.parent.getChildren().length;return U<V-1?(this.parent.children.splice(U,1),this.parent.children.splice(U+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return i.Util.warn("Node has no parent. moveDown function is ignored."),!1;const U=this.index;return U>0?(this.parent.children.splice(U,1),this.parent.children.splice(U-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return i.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;const U=this.index;return U>0?(this.parent.children.splice(U,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(U){if(!this.parent)return i.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(U<0||U>=this.parent.children.length)&&i.Util.warn("Unexpected value "+U+" 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 V=this.index;return this.parent.children.splice(V,1),this.parent.children.splice(U,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(o,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let U=this.opacity();const V=this.getParent();return V&&!V._isUnderCache&&(U*=V.getAbsoluteOpacity()),U}moveTo(U){return this.getParent()!==U&&(this._remove(),U.add(this)),this}toObject(){let U=this.getAttrs(),V,X,z,D,F;const q={attrs:{},className:this.getClassName()};for(V in U)X=U[V],F=i.Util.isObject(X)&&!i.Util._isPlainObject(X)&&!i.Util._isArray(X),!F&&(z=typeof this[V]=="function"&&this[V],delete U[V],D=z?z.call(this):null,U[V]=X,D!==X&&(q.attrs[V]=X));return i.Util._prepareToStringify(q)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(U,V,X){const z=[];V&&this._isMatch(U)&&z.push(this);let D=this.parent;for(;D;){if(D===X)return z;D._isMatch(U)&&z.push(D),D=D.parent}return z}isAncestorOf(U){return!1}findAncestor(U,V,X){return this.findAncestors(U,V,X)[0]}_isMatch(U){if(!U)return!1;if(typeof U=="function")return U(this);let V=U.replace(/ /g,"").split(","),X=V.length,z,D;for(z=0;z<X;z++)if(D=V[z],i.Util.isValidSelector(D)||(i.Util.warn('Selector "'+D+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),i.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),i.Util.warn("Konva is awesome, right?")),D.charAt(0)==="#"){if(this.id()===D.slice(1))return!0}else if(D.charAt(0)==="."){if(this.hasName(D.slice(1)))return!0}else if(this.className===D||this.nodeType===D)return!0;return!1}getLayer(){const U=this.getParent();return U?U.getLayer():null}getStage(){return this._getCache(N,this._getStage)}_getStage(){const U=this.getParent();return U?U.getStage():null}fire(U,V={},X){return V.target=V.target||this,X?this._fireAndBubble(U,V):this._fire(U,V),this}getAbsoluteTransform(U){return U?this._getAbsoluteTransform(U):this._getCache(u,this._getAbsoluteTransform)}_getAbsoluteTransform(U){let V;if(U)return V=new i.Transform,this._eachAncestorReverse(function(X){const z=X.transformsEnabled();z==="all"?V.multiply(X.getTransform()):z==="position"&&V.translate(X.x()-X.offsetX(),X.y()-X.offsetY())},U),V;{V=this._cache.get(u)||new i.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(V):V.reset();const X=this.transformsEnabled();if(X==="all")V.multiply(this.getTransform());else if(X==="position"){const z=this.attrs.x||0,D=this.attrs.y||0,F=this.attrs.offsetX||0,q=this.attrs.offsetY||0;V.translate(z-F,D-q)}return V.dirty=!1,V}}getAbsoluteScale(U){let V=this;for(;V;)V._isUnderCache&&(U=V),V=V.getParent();const z=this.getAbsoluteTransform(U).decompose();return{x:z.scaleX,y:z.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(M,this._getTransform)}_getTransform(){var U,V;const X=this._cache.get(M)||new i.Transform;X.reset();const z=this.x(),D=this.y(),F=n.Konva.getAngle(this.rotation()),q=(U=this.attrs.scaleX)!==null&&U!==void 0?U:1,Q=(V=this.attrs.scaleY)!==null&&V!==void 0?V:1,re=this.attrs.skewX||0,Y=this.attrs.skewY||0,ee=this.attrs.offsetX||0,ae=this.attrs.offsetY||0;return(z!==0||D!==0)&&X.translate(z,D),F!==0&&X.rotate(F),(re!==0||Y!==0)&&X.skew(re,Y),(q!==1||Q!==1)&&X.scale(q,Q),(ee!==0||ae!==0)&&X.translate(-1*ee,-1*ae),X.dirty=!1,X}clone(U){let V=i.Util.cloneObject(this.attrs),X,z,D,F,q;for(X in U)V[X]=U[X];const Q=new this.constructor(V);for(X in this.eventListeners)for(z=this.eventListeners[X],D=z.length,F=0;F<D;F++)q=z[F],q.name.indexOf(f)<0&&(Q.eventListeners[X]||(Q.eventListeners[X]=[]),Q.eventListeners[X].push(q));return Q}_toKonvaCanvas(U){U=U||{};const V=this.getClientRect(),X=this.getStage(),z=U.x!==void 0?U.x:Math.floor(V.x),D=U.y!==void 0?U.y:Math.floor(V.y),F=U.pixelRatio||1,q=new e.SceneCanvas({width:U.width||Math.ceil(V.width)||(X?X.width():0),height:U.height||Math.ceil(V.height)||(X?X.height():0),pixelRatio:F}),Q=q.getContext(),re=new e.SceneCanvas({width:q.width/q.pixelRatio+Math.abs(z),height:q.height/q.pixelRatio+Math.abs(D),pixelRatio:q.pixelRatio});return U.imageSmoothingEnabled===!1&&(Q._context.imageSmoothingEnabled=!1),Q.save(),(z||D)&&Q.translate(-1*z,-1*D),this.drawScene(q,void 0,re),Q.restore(),q}toCanvas(U){return this._toKonvaCanvas(U)._canvas}toDataURL(U){U=U||{};const V=U.mimeType||null,X=U.quality||null,z=this._toKonvaCanvas(U).toDataURL(V,X);return U.callback&&U.callback(z),z}toImage(U){return new Promise((V,X)=>{try{const z=U?.callback;z&&delete U.callback,i.Util._urlToImage(this.toDataURL(U),function(D){V(D),z?.(D)})}catch(z){X(z)}})}toBlob(U){return new Promise((V,X)=>{try{const z=U?.callback;z&&delete U.callback,this.toCanvas(U).toBlob(D=>{V(D),z?.(D)},U?.mimeType,U?.quality)}catch(z){X(z)}})}setSize(U){return this.width(U.width),this.height(U.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():n.Konva.dragDistance}_off(U,V,X){let z=this.eventListeners[U],D,F,q;for(D=0;D<z.length;D++)if(F=z[D].name,q=z[D].handler,(F!=="konva"||V==="konva")&&(!V||F===V)&&(!X||X===q)){if(z.splice(D,1),z.length===0){delete this.eventListeners[U];break}D--}}_fireChangeEvent(U,V,X){this._fire(U+v,{oldVal:V,newVal:X})}addName(U){if(!this.hasName(U)){const V=this.name(),X=V?V+" "+U:U;this.name(X)}return this}hasName(U){if(!U)return!1;const V=this.name();return V?(V||"").split(/\s/g).indexOf(U)!==-1:!1}removeName(U){const V=(this.name()||"").split(/\s/g),X=V.indexOf(U);return X!==-1&&(V.splice(X,1),this.name(V.join(" "))),this}setAttr(U,V){const X=this[P+i.Util._capitalize(U)];return i.Util._isFunction(X)?X.call(this,V):this._setAttr(U,V),this}_requestDraw(){if(n.Konva.autoDrawEnabled){const U=this.getLayer()||this.getStage();U?.batchDraw()}}_setAttr(U,V){const X=this.attrs[U];X===V&&!i.Util.isObject(V)||(V==null?delete this.attrs[U]:this.attrs[U]=V,this._shouldFireChangeEvents&&this._fireChangeEvent(U,X,V),this._requestDraw())}_setComponentAttr(U,V,X){let z;X!==void 0&&(z=this.attrs[U],z||(this.attrs[U]=this.getAttr(U)),this.attrs[U][V]=X,this._fireChangeEvent(U,z,X))}_fireAndBubble(U,V,X){V&&this.nodeType===R&&(V.target=this);const z=[_,S,x,m,w,E];if(!(z.indexOf(U)!==-1&&(X&&(this===X||this.isAncestorOf&&this.isAncestorOf(X))||this.nodeType==="Stage"&&!X))){this._fire(U,V);const F=z.indexOf(U)!==-1&&X&&X.isAncestorOf&&X.isAncestorOf(this)&&!X.isAncestorOf(this.parent);(V&&!V.cancelBubble||!V)&&this.parent&&this.parent.isListening()&&!F&&(X&&X.parent?this._fireAndBubble.call(this.parent,U,V,X):this._fireAndBubble.call(this.parent,U,V))}}_getProtoListeners(U){var V,X,z;const D=(V=this._cache.get(l))!==null&&V!==void 0?V:{};let F=D?.[U];if(F===void 0){F=[];let q=Object.getPrototypeOf(this);for(;q;){const Q=(z=(X=q.eventListeners)===null||X===void 0?void 0:X[U])!==null&&z!==void 0?z:[];F.push(...Q),q=Object.getPrototypeOf(q)}D[U]=F,this._cache.set(l,D)}return F}_fire(U,V){V=V||{},V.currentTarget=this,V.type=U;const X=this._getProtoListeners(U);if(X)for(let D=0;D<X.length;D++)X[D].handler.call(this,V);const z=this.eventListeners[U];if(z)for(let D=0;D<z.length;D++)z[D].handler.call(this,V)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(U){const V=U?U.pointerId:void 0,X=this.getStage(),z=this.getAbsolutePosition();if(!X)return;const D=X._getPointerById(V)||X._changedPointerPositions[0]||z;t.DD._dragElements.set(this._id,{node:this,startPointerPos:D,offset:{x:D.x-z.x,y:D.y-z.y},dragStatus:"ready",pointerId:V})}startDrag(U,V=!0){t.DD._dragElements.has(this._id)||this._createDragElement(U);const X=t.DD._dragElements.get(this._id);X.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:U&&U.evt},V)}_setDragPosition(U,V){const X=this.getStage()._getPointerById(V.pointerId);if(!X)return;let z={x:X.x-V.offset.x,y:X.y-V.offset.y};const D=this.dragBoundFunc();if(D!==void 0){const F=D.call(this,z,U);F?z=F:i.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==z.x||this._lastPos.y!==z.y)&&(this.setAbsolutePosition(z),this._requestDraw()),this._lastPos=z}stopDrag(U){const V=t.DD._dragElements.get(this._id);V&&(V.dragStatus="stopped"),t.DD._endDragBefore(U),t.DD._endDragAfter(U)}setDraggable(U){this._setAttr("draggable",U),this._dragChange()}isDragging(){const U=t.DD._dragElements.get(this._id);return U?U.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(U){if(!(!(U.evt.button!==void 0)||n.Konva.dragButtons.indexOf(U.evt.button)>=0)||this.isDragging())return;let z=!1;t.DD._dragElements.forEach(D=>{this.isAncestorOf(D.node)&&(z=!0)}),z||this._createDragElement(U)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const V=t.DD._dragElements.get(this._id),X=V&&V.dragStatus==="dragging",z=V&&V.dragStatus==="ready";X?this.stopDrag():z&&t.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(U={x:0,y:0}){const V=this.getStage();if(!V)return!1;const X={x:-U.x,y:-U.y,width:V.width()+2*U.x,height:V.height()+2*U.y};return i.Util.haveIntersection(X,this.getClientRect())}static create(U,V){return i.Util._isString(U)&&(U=JSON.parse(U)),this._createNode(U,V)}static _createNode(U,V){let X=G.prototype.getClassName.call(U),z=U.children,D,F,q;V&&(U.attrs.container=V),n.Konva[X]||(i.Util.warn('Can not find a node with class name "'+X+'". Fallback to "Shape".'),X="Shape");const Q=n.Konva[X];if(D=new Q(U.attrs),z)for(F=z.length,q=0;q<F;q++)D.add(G._createNode(z[q]));return D}}$h.Node=G,G.prototype.nodeType="Node",G.prototype._attrsAffectingSize=[],G.prototype.eventListeners={},G.prototype.on.call(G.prototype,L,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(M),this._clearSelfAndDescendantCache(u)}),G.prototype.on.call(G.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(C)}),G.prototype.on.call(G.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(b)}),G.prototype.on.call(G.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(o)});const J=r.Factory.addGetterSetter;return J(G,"zIndex"),J(G,"absolutePosition"),J(G,"position"),J(G,"x",0,(0,a.getNumberValidator)()),J(G,"y",0,(0,a.getNumberValidator)()),J(G,"globalCompositeOperation","source-over",(0,a.getStringValidator)()),J(G,"opacity",1,(0,a.getNumberValidator)()),J(G,"name","",(0,a.getStringValidator)()),J(G,"id","",(0,a.getStringValidator)()),J(G,"rotation",0,(0,a.getNumberValidator)()),r.Factory.addComponentsGetterSetter(G,"scale",["x","y"]),J(G,"scaleX",1,(0,a.getNumberValidator)()),J(G,"scaleY",1,(0,a.getNumberValidator)()),r.Factory.addComponentsGetterSetter(G,"skew",["x","y"]),J(G,"skewX",0,(0,a.getNumberValidator)()),J(G,"skewY",0,(0,a.getNumberValidator)()),r.Factory.addComponentsGetterSetter(G,"offset",["x","y"]),J(G,"offsetX",0,(0,a.getNumberValidator)()),J(G,"offsetY",0,(0,a.getNumberValidator)()),J(G,"dragDistance",void 0,(0,a.getNumberValidator)()),J(G,"width",0,(0,a.getNumberValidator)()),J(G,"height",0,(0,a.getNumberValidator)()),J(G,"listening",!0,(0,a.getBooleanValidator)()),J(G,"preventDefault",!0,(0,a.getBooleanValidator)()),J(G,"filters",void 0,function(se){return this._filterUpToDate=!1,se}),J(G,"visible",!0,(0,a.getBooleanValidator)()),J(G,"transformsEnabled","all",(0,a.getStringValidator)()),J(G,"size"),J(G,"dragBoundFunc"),J(G,"draggable",!1,(0,a.getBooleanValidator)()),r.Factory.backCompat(G,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"}),$h}var Wh={},by;function Y1(){if(by)return Wh;by=1,Object.defineProperty(Wh,"__esModule",{value:!0}),Wh.Container=void 0;const e=kr(),t=Qi(),r=Tr();let n=class extends t.Node{constructor(){super(...arguments),this.children=[]}getChildren(a){const o=this.children||[];return a?o.filter(a):o}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(a=>{a.parent=null,a.index=0,a.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(a=>{a.parent=null,a.index=0,a.destroy()}),this.children=[],this._requestDraw(),this}add(...a){if(a.length===0)return this;if(a.length>1){for(let l=0;l<a.length;l++)this.add(a[l]);return this}const o=a[0];return o.getParent()?(o.moveTo(this),this):(this._validateAdd(o),o.index=this.getChildren().length,o.parent=this,o._clearCaches(),this.getChildren().push(o),this._fire("add",{child:o}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(a){return this._generalFind(a,!1)}findOne(a){const o=this._generalFind(a,!0);return o.length>0?o[0]:void 0}_generalFind(a,o){const l=[];return this._descendants(u=>{const d=u._isMatch(a);return d&&l.push(u),!!(d&&o)}),l}_descendants(a){let o=!1;const l=this.getChildren();for(const u of l){if(o=a(u),o)return!0;if(u.hasChildren()&&(o=u._descendants(a),o))return!0}return!1}toObject(){const a=t.Node.prototype.toObject.call(this);return a.children=[],this.getChildren().forEach(o=>{a.children.push(o.toObject())}),a}isAncestorOf(a){let o=a.getParent();for(;o;){if(o._id===this._id)return!0;o=o.getParent()}return!1}clone(a){const o=t.Node.prototype.clone.call(this,a);return this.getChildren().forEach(function(l){o.add(l.clone())}),o}getAllIntersections(a){const o=[];return this.find("Shape").forEach(l=>{l.isVisible()&&l.intersects(a)&&o.push(l)}),o}_clearSelfAndDescendantCache(a){var o;super._clearSelfAndDescendantCache(a),!this.isCached()&&((o=this.children)===null||o===void 0||o.forEach(function(l){l._clearSelfAndDescendantCache(a)}))}_setChildrenIndices(){var a;(a=this.children)===null||a===void 0||a.forEach(function(o,l){o.index=l}),this._requestDraw()}drawScene(a,o,l){const u=this.getLayer(),d=a||u&&u.getCanvas(),h=d&&d.getContext(),v=this._getCanvasCache(),p=v&&v.scene,f=d&&d.isCache;if(!this.isVisible()&&!f)return this;if(p){h.save();const b=this.getAbsoluteTransform(o).getMatrix();h.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(h),h.restore()}else this._drawChildren("drawScene",d,o,l);return this}drawHit(a,o){if(!this.shouldDrawHit(o))return this;const l=this.getLayer(),u=a||l&&l.hitCanvas,d=u&&u.getContext(),h=this._getCanvasCache();if(h&&h.hit){d.save();const p=this.getAbsoluteTransform(o).getMatrix();d.transform(p[0],p[1],p[2],p[3],p[4],p[5]),this._drawCachedHitCanvas(d),d.restore()}else this._drawChildren("drawHit",u,o);return this}_drawChildren(a,o,l,u){var d;const h=o&&o.getContext(),v=this.clipWidth(),p=this.clipHeight(),f=this.clipFunc(),b=typeof v=="number"&&typeof p=="number"||f,_=l===this;if(b){h.save();const x=this.getAbsoluteTransform(l);let m=x.getMatrix();h.transform(m[0],m[1],m[2],m[3],m[4],m[5]),h.beginPath();let w;if(f)w=f.call(this,h,this);else{const E=this.clipX(),P=this.clipY();h.rect(E||0,P||0,v,p)}h.clip.apply(h,w),m=x.copy().invert().getMatrix(),h.transform(m[0],m[1],m[2],m[3],m[4],m[5])}const S=!_&&this.globalCompositeOperation()!=="source-over"&&a==="drawScene";S&&(h.save(),h._applyGlobalCompositeOperation(this)),(d=this.children)===null||d===void 0||d.forEach(function(x){x[a](o,l,u)}),S&&h.restore(),b&&h.restore()}getClientRect(a={}){var o;const l=a.skipTransform,u=a.relativeTo;let d,h,v,p,f={x:1/0,y:1/0,width:0,height:0};const b=this;(o=this.children)===null||o===void 0||o.forEach(function(x){if(!x.visible())return;const m=x.getClientRect({relativeTo:b,skipShadow:a.skipShadow,skipStroke:a.skipStroke});m.width===0&&m.height===0||(d===void 0?(d=m.x,h=m.y,v=m.x+m.width,p=m.y+m.height):(d=Math.min(d,m.x),h=Math.min(h,m.y),v=Math.max(v,m.x+m.width),p=Math.max(p,m.y+m.height)))});const _=this.find("Shape");let S=!1;for(let x=0;x<_.length;x++)if(_[x]._isVisible(this)){S=!0;break}return S&&d!==void 0?f={x:d,y:h,width:v-d,height:p-h}:f={x:0,y:0,width:0,height:0},l?f:this._transformedRect(f,u)}};return Wh.Container=n,e.Factory.addComponentsGetterSetter(n,"clip",["x","y","width","height"]),e.Factory.addGetterSetter(n,"clipX",void 0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipY",void 0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipWidth",void 0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipHeight",void 0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipFunc"),Wh}var eg={},jc={},wy;function dw(){if(wy)return jc;wy=1,Object.defineProperty(jc,"__esModule",{value:!0}),jc.getCapturedShape=n,jc.createEvent=i,jc.hasPointerCapture=a,jc.setPointerCapture=o,jc.releaseCapture=l;const e=br(),t=new Map,r=e.Konva._global.PointerEvent!==void 0;function n(u){return t.get(u)}function i(u){return{evt:u,pointerId:u.pointerId}}function a(u,d){return t.get(u)===d}function o(u,d){l(u),d.getStage()&&(t.set(u,d),r&&d._fire("gotpointercapture",i(new PointerEvent("gotpointercapture"))))}function l(u,d){const h=t.get(u);if(!h)return;const v=h.getStage();v&&v.content,t.delete(u),r&&h._fire("lostpointercapture",i(new PointerEvent("lostpointercapture")))}return jc}var _y;function y9(){return _y||(_y=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=Ni(),r=kr(),n=Y1(),i=br(),a=W1(),o=Rv(),l=br(),u=dw(),d="Stage",h="string",v="px",p="mouseout",f="mouseleave",b="mouseover",_="mouseenter",S="mousemove",x="mousedown",m="mouseup",w="pointermove",E="pointerdown",P="pointerup",R="pointercancel",k="lostpointercapture",N="pointerout",M="pointerleave",T="pointerover",C="pointerenter",L="contextmenu",H="touchstart",G="touchend",J="touchmove",se="touchcancel",U="wheel",V=5,X=[[_,"_pointerenter"],[x,"_pointerdown"],[S,"_pointermove"],[m,"_pointerup"],[f,"_pointerleave"],[H,"_pointerdown"],[J,"_pointermove"],[G,"_pointerup"],[se,"_pointercancel"],[b,"_pointerover"],[U,"_wheel"],[L,"_contextmenu"],[E,"_pointerdown"],[w,"_pointermove"],[P,"_pointerup"],[R,"_pointercancel"],[M,"_pointerleave"],[k,"_lostpointercapture"]],z={mouse:{[N]:p,[M]:f,[T]:b,[C]:_,[w]:S,[E]:x,[P]:m,[R]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[N]:"touchout",[M]:"touchleave",[T]:"touchover",[C]:"touchenter",[w]:J,[E]:H,[P]:G,[R]:se,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[N]:N,[M]:M,[T]:T,[C]:C,[w]:w,[E]:E,[P]:P,[R]:R,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},D=Y=>Y.indexOf("pointer")>=0?"pointer":Y.indexOf("touch")>=0?"touch":"mouse",F=Y=>{const ee=D(Y);if(ee==="pointer")return i.Konva.pointerEventsEnabled&&z.pointer;if(ee==="touch")return z.touch;if(ee==="mouse")return z.mouse};function q(Y={}){return(Y.clipFunc||Y.clipWidth||Y.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),Y}const Q="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class re extends n.Container{constructor(ee){super(q(ee)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{q(this.attrs)}),this._checkVisibility()}_validateAdd(ee){const ae=ee.getType()==="Layer",ue=ee.getType()==="FastLayer";ae||ue||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const ee=this.visible()?"":"none";this.content.style.display=ee}setContainer(ee){if(typeof ee===h){let ae;if(ee.charAt(0)==="."){const ue=ee.slice(1);ee=document.getElementsByClassName(ue)[0]}else ee.charAt(0)!=="#"?ae=ee:ae=ee.slice(1),ee=document.getElementById(ae);if(!ee)throw"Can not find container in document with id "+ae}return this._setAttr("container",ee),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),ee.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const ee=this.children,ae=ee.length;for(let ue=0;ue<ae;ue++)ee[ue].clear();return this}clone(ee){return ee||(ee={}),ee.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,ee)}destroy(){super.destroy();const ee=this.content;ee&&t.Util._isInDocument(ee)&&this.container().removeChild(ee);const ae=e.stages.indexOf(this);return ae>-1&&e.stages.splice(ae,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const ee=this._pointerPositions[0]||this._changedPointerPositions[0];return ee?{x:ee.x,y:ee.y}:(t.Util.warn(Q),null)}_getPointerById(ee){return this._pointerPositions.find(ae=>ae.id===ee)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(ee){ee=ee||{},ee.x=ee.x||0,ee.y=ee.y||0,ee.width=ee.width||this.width(),ee.height=ee.height||this.height();const ae=new a.SceneCanvas({width:ee.width,height:ee.height,pixelRatio:ee.pixelRatio||1}),ue=ae.getContext()._context,ce=this.children;return(ee.x||ee.y)&&ue.translate(-1*ee.x,-1*ee.y),ce.forEach(function(pe){if(!pe.isVisible())return;const Ae=pe._toKonvaCanvas(ee);ue.drawImage(Ae._canvas,ee.x,ee.y,Ae.getWidth()/Ae.getPixelRatio(),Ae.getHeight()/Ae.getPixelRatio())}),ae}getIntersection(ee){if(!ee)return null;const ae=this.children,ue=ae.length,ce=ue-1;for(let pe=ce;pe>=0;pe--){const Ae=ae[pe].getIntersection(ee);if(Ae)return Ae}return null}_resizeDOM(){const ee=this.width(),ae=this.height();this.content&&(this.content.style.width=ee+v,this.content.style.height=ae+v),this.bufferCanvas.setSize(ee,ae),this.bufferHitCanvas.setSize(ee,ae),this.children.forEach(ue=>{ue.setSize({width:ee,height:ae}),ue.draw()})}add(ee,...ae){if(arguments.length>1){for(let ce=0;ce<arguments.length;ce++)this.add(arguments[ce]);return this}super.add(ee);const ue=this.children.length;return ue>V&&t.Util.warn("The stage has "+ue+" 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."),ee.setSize({width:this.width(),height:this.height()}),ee.draw(),i.Konva.isBrowser&&this.content.appendChild(ee.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(ee){return u.hasPointerCapture(ee,this)}setPointerCapture(ee){u.setPointerCapture(ee,this)}releaseCapture(ee){u.releaseCapture(ee,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&X.forEach(([ee,ae])=>{this.content.addEventListener(ee,ue=>{this[ae](ue)},{passive:!1})})}_pointerenter(ee){this.setPointersPositions(ee);const ae=F(ee.type);ae&&this._fire(ae.pointerenter,{evt:ee,target:this,currentTarget:this})}_pointerover(ee){this.setPointersPositions(ee);const ae=F(ee.type);ae&&this._fire(ae.pointerover,{evt:ee,target:this,currentTarget:this})}_getTargetShape(ee){let ae=this[ee+"targetShape"];return ae&&!ae.getStage()&&(ae=null),ae}_pointerleave(ee){const ae=F(ee.type),ue=D(ee.type);if(!ae)return;this.setPointersPositions(ee);const ce=this._getTargetShape(ue),pe=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;ce&&pe?(ce._fireAndBubble(ae.pointerout,{evt:ee}),ce._fireAndBubble(ae.pointerleave,{evt:ee}),this._fire(ae.pointerleave,{evt:ee,target:this,currentTarget:this}),this[ue+"targetShape"]=null):pe&&(this._fire(ae.pointerleave,{evt:ee,target:this,currentTarget:this}),this._fire(ae.pointerout,{evt:ee,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(ee){const ae=F(ee.type),ue=D(ee.type);if(!ae)return;this.setPointersPositions(ee);let ce=!1;this._changedPointerPositions.forEach(pe=>{const Ae=this.getIntersection(pe);if(o.DD.justDragged=!1,i.Konva["_"+ue+"ListenClick"]=!0,!Ae||!Ae.isListening()){this[ue+"ClickStartShape"]=void 0;return}i.Konva.capturePointerEventsEnabled&&Ae.setPointerCapture(pe.id),this[ue+"ClickStartShape"]=Ae,Ae._fireAndBubble(ae.pointerdown,{evt:ee,pointerId:pe.id}),ce=!0;const Ce=ee.type.indexOf("touch")>=0;Ae.preventDefault()&&ee.cancelable&&Ce&&ee.preventDefault()}),ce||this._fire(ae.pointerdown,{evt:ee,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(ee){const ae=F(ee.type),ue=D(ee.type);if(!ae||(i.Konva.isDragging()&&o.DD.node.preventDefault()&&ee.cancelable&&ee.preventDefault(),this.setPointersPositions(ee),!(!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled)))return;const pe={};let Ae=!1;const Ce=this._getTargetShape(ue);this._changedPointerPositions.forEach(ke=>{const Se=u.getCapturedShape(ke.id)||this.getIntersection(ke),le=ke.id,Ee={evt:ee,pointerId:le},xe=Ce!==Se;if(xe&&Ce&&(Ce._fireAndBubble(ae.pointerout,{...Ee},Se),Ce._fireAndBubble(ae.pointerleave,{...Ee},Se)),Se){if(pe[Se._id])return;pe[Se._id]=!0}Se&&Se.isListening()?(Ae=!0,xe&&(Se._fireAndBubble(ae.pointerover,{...Ee},Ce),Se._fireAndBubble(ae.pointerenter,{...Ee},Ce),this[ue+"targetShape"]=Se),Se._fireAndBubble(ae.pointermove,{...Ee})):Ce&&(this._fire(ae.pointerover,{evt:ee,target:this,currentTarget:this,pointerId:le}),this[ue+"targetShape"]=null)}),Ae||this._fire(ae.pointermove,{evt:ee,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(ee){const ae=F(ee.type),ue=D(ee.type);if(!ae)return;this.setPointersPositions(ee);const ce=this[ue+"ClickStartShape"],pe=this[ue+"ClickEndShape"],Ae={};let Ce=!1;this._changedPointerPositions.forEach(ke=>{const Se=u.getCapturedShape(ke.id)||this.getIntersection(ke);if(Se){if(Se.releaseCapture(ke.id),Ae[Se._id])return;Ae[Se._id]=!0}const le=ke.id,Ee={evt:ee,pointerId:le};let xe=!1;i.Konva["_"+ue+"InDblClickWindow"]?(xe=!0,clearTimeout(this[ue+"DblTimeout"])):o.DD.justDragged||(i.Konva["_"+ue+"InDblClickWindow"]=!0,clearTimeout(this[ue+"DblTimeout"])),this[ue+"DblTimeout"]=setTimeout(function(){i.Konva["_"+ue+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),Se&&Se.isListening()?(Ce=!0,this[ue+"ClickEndShape"]=Se,Se._fireAndBubble(ae.pointerup,{...Ee}),i.Konva["_"+ue+"ListenClick"]&&ce&&ce===Se&&(Se._fireAndBubble(ae.pointerclick,{...Ee}),xe&&pe&&pe===Se&&Se._fireAndBubble(ae.pointerdblclick,{...Ee}))):(this[ue+"ClickEndShape"]=null,i.Konva["_"+ue+"ListenClick"]&&this._fire(ae.pointerclick,{evt:ee,target:this,currentTarget:this,pointerId:le}),xe&&this._fire(ae.pointerdblclick,{evt:ee,target:this,currentTarget:this,pointerId:le}))}),Ce||this._fire(ae.pointerup,{evt:ee,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+ue+"ListenClick"]=!1,ee.cancelable&&ue!=="touch"&&ue!=="pointer"&&ee.preventDefault()}_contextmenu(ee){this.setPointersPositions(ee);const ae=this.getIntersection(this.getPointerPosition());ae&&ae.isListening()?ae._fireAndBubble(L,{evt:ee}):this._fire(L,{evt:ee,target:this,currentTarget:this})}_wheel(ee){this.setPointersPositions(ee);const ae=this.getIntersection(this.getPointerPosition());ae&&ae.isListening()?ae._fireAndBubble(U,{evt:ee}):this._fire(U,{evt:ee,target:this,currentTarget:this})}_pointercancel(ee){this.setPointersPositions(ee);const ae=u.getCapturedShape(ee.pointerId)||this.getIntersection(this.getPointerPosition());ae&&ae._fireAndBubble(P,u.createEvent(ee)),u.releaseCapture(ee.pointerId)}_lostpointercapture(ee){u.releaseCapture(ee.pointerId)}setPointersPositions(ee){const ae=this._getContentPosition();let ue=null,ce=null;ee=ee||window.event,ee.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(ee.touches,pe=>{this._pointerPositions.push({id:pe.identifier,x:(pe.clientX-ae.left)/ae.scaleX,y:(pe.clientY-ae.top)/ae.scaleY})}),Array.prototype.forEach.call(ee.changedTouches||ee.touches,pe=>{this._changedPointerPositions.push({id:pe.identifier,x:(pe.clientX-ae.left)/ae.scaleX,y:(pe.clientY-ae.top)/ae.scaleY})})):(ue=(ee.clientX-ae.left)/ae.scaleX,ce=(ee.clientY-ae.top)/ae.scaleY,this.pointerPos={x:ue,y:ce},this._pointerPositions=[{x:ue,y:ce,id:t.Util._getFirstPointerId(ee)}],this._changedPointerPositions=[{x:ue,y:ce,id:t.Util._getFirstPointerId(ee)}])}_setPointerPosition(ee){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(ee)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const ee=this.content.getBoundingClientRect();return{top:ee.top,left:ee.left,scaleX:ee.width/this.content.clientWidth||1,scaleY:ee.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new a.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new a.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!i.Konva.isBrowser)return;const ee=this.container();if(!ee)throw"Stage has no container. A container is required.";ee.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"),ee.appendChild(this.content),this._resizeDOM()}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(ee){ee.batchDraw()}),this}}e.Stage=re,re.prototype.nodeType=d,(0,l._registerNode)(re),r.Factory.addGetterSetter(re,"container"),i.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(Y=>{Y.batchDraw()})})}(eg)),eg}var Yh={},tg={},xy;function ja(){return xy||(xy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=br(),r=Ni(),n=kr(),i=Qi(),a=Tr(),o=br(),l=dw(),u="hasShadow",d="shadowRGBA",h="patternImage",v="linearGradient",p="radialGradient";let f;function b(){return f||(f=r.Util.createCanvasElement().getContext("2d"),f)}e.shapes={};function _(M){const T=this.attrs.fillRule;T?M.fill(T):M.fill()}function S(M){M.stroke()}function x(M){const T=this.attrs.fillRule;T?M.fill(T):M.fill()}function m(M){M.stroke()}function w(){this._clearCache(u)}function E(){this._clearCache(d)}function P(){this._clearCache(h)}function R(){this._clearCache(v)}function k(){this._clearCache(p)}class N extends i.Node{constructor(T){super(T);let C;for(;C=r.Util.getRandomColor(),!(C&&!(C in e.shapes)););this.colorKey=C,e.shapes[C]=this}getContext(){return r.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return r.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(u,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(h,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const C=b().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(C&&C.setTransform){const L=new r.Transform;L.translate(this.fillPatternX(),this.fillPatternY()),L.rotate(t.Konva.getAngle(this.fillPatternRotation())),L.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),L.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const H=L.getMatrix(),G=typeof DOMMatrix>"u"?{a:H[0],b:H[1],c:H[2],d:H[3],e:H[4],f:H[5]}:new DOMMatrix(H);C.setTransform(G)}return C}}_getLinearGradient(){return this._getCache(v,this.__getLinearGradient)}__getLinearGradient(){const T=this.fillLinearGradientColorStops();if(T){const C=b(),L=this.fillLinearGradientStartPoint(),H=this.fillLinearGradientEndPoint(),G=C.createLinearGradient(L.x,L.y,H.x,H.y);for(let J=0;J<T.length;J+=2)G.addColorStop(T[J],T[J+1]);return G}}_getRadialGradient(){return this._getCache(p,this.__getRadialGradient)}__getRadialGradient(){const T=this.fillRadialGradientColorStops();if(T){const C=b(),L=this.fillRadialGradientStartPoint(),H=this.fillRadialGradientEndPoint(),G=C.createRadialGradient(L.x,L.y,this.fillRadialGradientStartRadius(),H.x,H.y,this.fillRadialGradientEndRadius());for(let J=0;J<T.length;J+=2)G.addColorStop(T[J],T[J+1]);return G}}getShadowRGBA(){return this._getCache(d,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const T=r.Util.colorToRGBA(this.shadowColor());if(T)return"rgba("+T.r+","+T.g+","+T.b+","+T.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 T=this.hitStrokeWidth();return T==="auto"?this.hasStroke():this.strokeEnabled()&&!!T}intersects(T){const C=this.getStage();if(!C)return!1;const L=C.bufferHitCanvas;return L.getContext().clear(),this.drawHit(L,void 0,!0),L.context.getImageData(Math.round(T.x),Math.round(T.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(T){var C;if(!((C=this.attrs.perfectDrawEnabled)!==null&&C!==void 0?C:!0))return!1;const H=T||this.hasFill(),G=this.hasStroke(),J=this.getAbsoluteOpacity()!==1;if(H&&G&&J)return!0;const se=this.hasShadow(),U=this.shadowForStrokeEnabled();return!!(H&&G&&se&&U)}setStrokeHitEnabled(T){r.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),T?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const T=this.size();return{x:this._centroid?-T.width/2:0,y:this._centroid?-T.height/2:0,width:T.width,height:T.height}}getClientRect(T={}){let C=!1,L=this.getParent();for(;L;){if(L.isCached()){C=!0;break}L=L.getParent()}const H=T.skipTransform,G=T.relativeTo||C&&this.getStage()||void 0,J=this.getSelfRect(),U=!T.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,V=J.width+U,X=J.height+U,z=!T.skipShadow&&this.hasShadow(),D=z?this.shadowOffsetX():0,F=z?this.shadowOffsetY():0,q=V+Math.abs(D),Q=X+Math.abs(F),re=z&&this.shadowBlur()||0,Y=q+re*2,ee=Q+re*2,ae={width:Y,height:ee,x:-(U/2+re)+Math.min(D,0)+J.x,y:-(U/2+re)+Math.min(F,0)+J.y};return H?ae:this._transformedRect(ae,G)}drawScene(T,C,L){const H=this.getLayer(),G=T||H.getCanvas(),J=G.getContext(),se=this._getCanvasCache(),U=this.getSceneFunc(),V=this.hasShadow();let X;const z=C===this;if(!this.isVisible()&&!z)return this;if(se){J.save();const D=this.getAbsoluteTransform(C).getMatrix();return J.transform(D[0],D[1],D[2],D[3],D[4],D[5]),this._drawCachedSceneCanvas(J),J.restore(),this}if(!U)return this;if(J.save(),this._useBufferCanvas()){X=this.getStage();const D=L||X.bufferCanvas,F=D.getContext();F.clear(),F.save(),F._applyLineJoin(this);const q=this.getAbsoluteTransform(C).getMatrix();F.transform(q[0],q[1],q[2],q[3],q[4],q[5]),U.call(this,F,this),F.restore();const Q=D.pixelRatio;V&&J._applyShadow(this),J._applyOpacity(this),J._applyGlobalCompositeOperation(this),J.drawImage(D._canvas,D.x||0,D.y||0,D.width/Q,D.height/Q)}else{if(J._applyLineJoin(this),!z){const D=this.getAbsoluteTransform(C).getMatrix();J.transform(D[0],D[1],D[2],D[3],D[4],D[5]),J._applyOpacity(this),J._applyGlobalCompositeOperation(this)}V&&J._applyShadow(this),U.call(this,J,this)}return J.restore(),this}drawHit(T,C,L=!1){if(!this.shouldDrawHit(C,L))return this;const H=this.getLayer(),G=T||H.hitCanvas,J=G&&G.getContext(),se=this.hitFunc()||this.sceneFunc(),U=this._getCanvasCache(),V=U&&U.hit;if(this.colorKey||r.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),V){J.save();const z=this.getAbsoluteTransform(C).getMatrix();return J.transform(z[0],z[1],z[2],z[3],z[4],z[5]),this._drawCachedHitCanvas(J),J.restore(),this}if(!se)return this;if(J.save(),J._applyLineJoin(this),!(this===C)){const z=this.getAbsoluteTransform(C).getMatrix();J.transform(z[0],z[1],z[2],z[3],z[4],z[5])}return se.call(this,J,this),J.restore(),this}drawHitFromCache(T=0){const C=this._getCanvasCache(),L=this._getCachedSceneCanvas(),H=C.hit,G=H.getContext(),J=H.getWidth(),se=H.getHeight();G.clear(),G.drawImage(L._canvas,0,0,J,se);try{const U=G.getImageData(0,0,J,se),V=U.data,X=V.length,z=r.Util._hexToRgb(this.colorKey);for(let D=0;D<X;D+=4)V[D+3]>T?(V[D]=z.r,V[D+1]=z.g,V[D+2]=z.b,V[D+3]=255):V[D+3]=0;G.putImageData(U,0,0)}catch(U){r.Util.error("Unable to draw hit graph from cached scene canvas. "+U.message)}return this}hasPointerCapture(T){return l.hasPointerCapture(T,this)}setPointerCapture(T){l.setPointerCapture(T,this)}releaseCapture(T){l.releaseCapture(T,this)}}e.Shape=N,N.prototype._fillFunc=_,N.prototype._strokeFunc=S,N.prototype._fillFuncHit=x,N.prototype._strokeFuncHit=m,N.prototype._centroid=!1,N.prototype.nodeType="Shape",(0,o._registerNode)(N),N.prototype.eventListeners={},N.prototype.on.call(N.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",w),N.prototype.on.call(N.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",E),N.prototype.on.call(N.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",P),N.prototype.on.call(N.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",R),N.prototype.on.call(N.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",k),n.Factory.addGetterSetter(N,"stroke",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(N,"strokeWidth",2,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(N,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(N,"hitStrokeWidth","auto",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(N,"strokeHitEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(N,"perfectDrawEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(N,"shadowForStrokeEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(N,"lineJoin"),n.Factory.addGetterSetter(N,"lineCap"),n.Factory.addGetterSetter(N,"sceneFunc"),n.Factory.addGetterSetter(N,"hitFunc"),n.Factory.addGetterSetter(N,"dash"),n.Factory.addGetterSetter(N,"dashOffset",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(N,"shadowColor",void 0,(0,a.getStringValidator)()),n.Factory.addGetterSetter(N,"shadowBlur",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(N,"shadowOpacity",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(N,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(N,"shadowOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(N,"shadowOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(N,"fillPatternImage"),n.Factory.addGetterSetter(N,"fill",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(N,"fillPatternX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(N,"fillPatternY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(N,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(N,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(N,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(N,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(N,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(N,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(N,"fillEnabled",!0),n.Factory.addGetterSetter(N,"strokeEnabled",!0),n.Factory.addGetterSetter(N,"shadowEnabled",!0),n.Factory.addGetterSetter(N,"dashEnabled",!0),n.Factory.addGetterSetter(N,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(N,"fillPriority","color"),n.Factory.addComponentsGetterSetter(N,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(N,"fillPatternOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(N,"fillPatternOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(N,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(N,"fillPatternScaleX",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(N,"fillPatternScaleY",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(N,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(N,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(N,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(N,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(N,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(N,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(N,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(N,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(N,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(N,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(N,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(N,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(N,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(N,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(N,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(N,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(N,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(N,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(N,"fillPatternRotation",0),n.Factory.addGetterSetter(N,"fillRule",void 0,(0,a.getStringValidator)()),n.Factory.backCompat(N,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})}(tg)),tg}var Sy;function pw(){if(Sy)return Yh;Sy=1,Object.defineProperty(Yh,"__esModule",{value:!0}),Yh.Layer=void 0;const e=Ni(),t=Y1(),r=Qi(),n=kr(),i=W1(),a=Tr(),o=ja(),l=br(),u="#",d="beforeDraw",h="draw",v=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],p=v.length;class f extends t.Container{constructor(_){super(_),this.canvas=new i.SceneCanvas,this.hitCanvas=new i.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(_){return this.getContext().clear(_),this.getHitCanvas().getContext().clear(_),this}setZIndex(_){super.setZIndex(_);const S=this.getStage();return S&&S.content&&(S.content.removeChild(this.getNativeCanvasElement()),_<S.children.length-1?S.content.insertBefore(this.getNativeCanvasElement(),S.children[_+1].getCanvas()._canvas):S.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){r.Node.prototype.moveToTop.call(this);const _=this.getStage();return _&&_.content&&(_.content.removeChild(this.getNativeCanvasElement()),_.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!r.Node.prototype.moveUp.call(this))return!1;const S=this.getStage();return!S||!S.content?!1:(S.content.removeChild(this.getNativeCanvasElement()),this.index<S.children.length-1?S.content.insertBefore(this.getNativeCanvasElement(),S.children[this.index+1].getCanvas()._canvas):S.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(r.Node.prototype.moveDown.call(this)){const _=this.getStage();if(_){const S=_.children;_.content&&(_.content.removeChild(this.getNativeCanvasElement()),_.content.insertBefore(this.getNativeCanvasElement(),S[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(r.Node.prototype.moveToBottom.call(this)){const _=this.getStage();if(_){const S=_.children;_.content&&(_.content.removeChild(this.getNativeCanvasElement()),_.content.insertBefore(this.getNativeCanvasElement(),S[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const _=this.getNativeCanvasElement();return r.Node.prototype.remove.call(this),_&&_.parentNode&&e.Util._isInDocument(_)&&_.parentNode.removeChild(_),this}getStage(){return this.parent}setSize({width:_,height:S}){return this.canvas.setSize(_,S),this.hitCanvas.setSize(_,S),this._setSmoothEnabled(),this}_validateAdd(_){const S=_.getType();S!=="Group"&&S!=="Shape"&&e.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(_){return _=_||{},_.width=_.width||this.getWidth(),_.height=_.height||this.getHeight(),_.x=_.x!==void 0?_.x:this.x(),_.y=_.y!==void 0?_.y:this.y(),r.Node.prototype._toKonvaCanvas.call(this,_)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){e.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){e.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,e.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(_){if(!this.isListening()||!this.isVisible())return null;let S=1,x=!1;for(;;){for(let m=0;m<p;m++){const w=v[m],E=this._getIntersection({x:_.x+w.x*S,y:_.y+w.y*S}),P=E.shape;if(P)return P;if(x=!!E.antialiased,!E.antialiased)break}if(x)S+=1;else return null}}_getIntersection(_){const S=this.hitCanvas.pixelRatio,x=this.hitCanvas.context.getImageData(Math.round(_.x*S),Math.round(_.y*S),1,1).data,m=x[3];if(m===255){const w=e.Util._rgbToHex(x[0],x[1],x[2]),E=o.shapes[u+w];return E?{shape:E}:{antialiased:!0}}else if(m>0)return{antialiased:!0};return{}}drawScene(_,S,x){const m=this.getLayer(),w=_||m&&m.getCanvas();return this._fire(d,{node:this}),this.clearBeforeDraw()&&w.getContext().clear(),t.Container.prototype.drawScene.call(this,w,S,x),this._fire(h,{node:this}),this}drawHit(_,S){const x=this.getLayer(),m=_||x&&x.hitCanvas;return x&&x.clearBeforeDraw()&&x.getHitCanvas().getContext().clear(),t.Container.prototype.drawHit.call(this,m,S),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(_){e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(_)}getHitGraphEnabled(_){return e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const _=this.parent;!!this.hitCanvas._canvas.parentNode?_.content.removeChild(this.hitCanvas._canvas):_.content.appendChild(this.hitCanvas._canvas)}destroy(){return e.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}return Yh.Layer=f,f.prototype.nodeType="Layer",(0,l._registerNode)(f),n.Factory.addGetterSetter(f,"imageSmoothingEnabled",!0),n.Factory.addGetterSetter(f,"clearBeforeDraw",!0),n.Factory.addGetterSetter(f,"hitGraphEnabled",!0,(0,a.getBooleanValidator)()),Yh}var Xh={},Ey;function b9(){if(Ey)return Xh;Ey=1,Object.defineProperty(Xh,"__esModule",{value:!0}),Xh.FastLayer=void 0;const e=Ni(),t=pw(),r=br();let n=class extends t.Layer{constructor(a){super(a),this.listening(!1),e.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};return Xh.FastLayer=n,n.prototype.nodeType="FastLayer",(0,r._registerNode)(n),Xh}var Kh={},Py;function Mv(){if(Py)return Kh;Py=1,Object.defineProperty(Kh,"__esModule",{value:!0}),Kh.Group=void 0;const e=Ni(),t=Y1(),r=br();class n extends t.Container{_validateAdd(a){const o=a.getType();o!=="Group"&&o!=="Shape"&&e.Util.throw("You may only add groups and shapes to groups.")}}return Kh.Group=n,n.prototype.nodeType="Group",(0,r._registerNode)(n),Kh}var Zh={},Ay;function Iv(){if(Ay)return Zh;Ay=1,Object.defineProperty(Zh,"__esModule",{value:!0}),Zh.Animation=void 0;const e=br(),t=Ni(),r=function(){return e.glob.performance&&e.glob.performance.now?function(){return e.glob.performance.now()}:function(){return new Date().getTime()}}();class n{constructor(a,o){this.id=n.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:r(),frameRate:0},this.func=a,this.setLayers(o)}setLayers(a){let o=[];return a&&(o=Array.isArray(a)?a:[a]),this.layers=o,this}getLayers(){return this.layers}addLayer(a){const o=this.layers,l=o.length;for(let u=0;u<l;u++)if(o[u]._id===a._id)return!1;return this.layers.push(a),!0}isRunning(){const o=n.animations,l=o.length;for(let u=0;u<l;u++)if(o[u].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=r(),n._addAnimation(this),this}stop(){return n._removeAnimation(this),this}_updateFrameObject(a){this.frame.timeDiff=a-this.frame.lastTime,this.frame.lastTime=a,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(a){this.animations.push(a),this._handleAnimation()}static _removeAnimation(a){const o=a.id,l=this.animations,u=l.length;for(let d=0;d<u;d++)if(l[d].id===o){this.animations.splice(d,1);break}}static _runFrames(){const a={},o=this.animations;for(let l=0;l<o.length;l++){const u=o[l],d=u.layers,h=u.func;u._updateFrameObject(r());const v=d.length;let p;if(h?p=h.call(u,u.frame)!==!1:p=!0,!!p)for(let f=0;f<v;f++){const b=d[f];b._id!==void 0&&(a[b._id]=b)}}for(const l in a)a.hasOwnProperty(l)&&a[l].batchDraw()}static _animationLoop(){const a=n;a.animations.length?(a._runFrames(),t.Util.requestAnimFrame(a._animationLoop)):a.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,t.Util.requestAnimFrame(this._animationLoop))}}return Zh.Animation=n,n.animations=[],n.animIdCounter=0,n.animRunning=!1,Zh}var rg={},Oy;function w9(){return Oy||(Oy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=Ni(),r=Iv(),n=Qi(),i=br(),a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},o=1,l=2,u=3,d=["fill","stroke","shadowColor"];let h=0;class v{constructor(b,_,S,x,m,w,E){this.prop=b,this.propFunc=_,this.begin=x,this._pos=x,this.duration=w,this._change=0,this.prevPos=0,this.yoyo=E,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=S,this._change=m-this.begin,this.pause()}fire(b){const _=this[b];_&&_()}setTime(b){b>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():b<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=b,this.update())}getTime(){return this._time}setPosition(b){this.prevPos=this._pos,this.propFunc(b),this._pos=b}getPosition(b){return b===void 0&&(b=this._time),this.func(b,this.begin,this._change,this.duration)}play(){this.state=l,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=u,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(b){this.pause(),this._time=b,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 b=this.getTimer()-this._startTime;this.state===l?this.setTime(b):this.state===u&&this.setTime(this.duration-b)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class p{constructor(b){const _=this,S=b.node,x=S._id,m=b.easing||e.Easings.Linear,w=!!b.yoyo;let E,P;typeof b.duration>"u"?E=.3:b.duration===0?E=.001:E=b.duration,this.node=S,this._id=h++;const R=S.getLayer()||(S instanceof i.Konva.Stage?S.getLayers():null);R||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new r.Animation(function(){_.tween.onEnterFrame()},R),this.tween=new v(P,function(k){_._tweenFunc(k)},m,0,1,E*1e3,w),this._addListeners(),p.attrs[x]||(p.attrs[x]={}),p.attrs[x][this._id]||(p.attrs[x][this._id]={}),p.tweens[x]||(p.tweens[x]={});for(P in b)a[P]===void 0&&this._addAttr(P,b[P]);this.reset(),this.onFinish=b.onFinish,this.onReset=b.onReset,this.onUpdate=b.onUpdate}_addAttr(b,_){const S=this.node,x=S._id;let m,w,E,P,R;const k=p.tweens[x][b];k&&delete p.attrs[x][k][b];let N=S.getAttr(b);if(t.Util._isArray(_))if(m=[],w=Math.max(_.length,N.length),b==="points"&&_.length!==N.length&&(_.length>N.length?(P=N,N=t.Util._prepareArrayForTween(N,_,S.closed())):(E=_,_=t.Util._prepareArrayForTween(_,N,S.closed()))),b.indexOf("fill")===0)for(let M=0;M<w;M++)if(M%2===0)m.push(_[M]-N[M]);else{const T=t.Util.colorToRGBA(N[M]);R=t.Util.colorToRGBA(_[M]),N[M]=T,m.push({r:R.r-T.r,g:R.g-T.g,b:R.b-T.b,a:R.a-T.a})}else for(let M=0;M<w;M++)m.push(_[M]-N[M]);else d.indexOf(b)!==-1?(N=t.Util.colorToRGBA(N),R=t.Util.colorToRGBA(_),m={r:R.r-N.r,g:R.g-N.g,b:R.b-N.b,a:R.a-N.a}):m=_-N;p.attrs[x][this._id][b]={start:N,diff:m,end:_,trueEnd:E,trueStart:P},p.tweens[x][b]=this._id}_tweenFunc(b){const _=this.node,S=p.attrs[_._id][this._id];let x,m,w,E,P,R,k,N;for(x in S){if(m=S[x],w=m.start,E=m.diff,N=m.end,t.Util._isArray(w))if(P=[],k=Math.max(w.length,N.length),x.indexOf("fill")===0)for(R=0;R<k;R++)R%2===0?P.push((w[R]||0)+E[R]*b):P.push("rgba("+Math.round(w[R].r+E[R].r*b)+","+Math.round(w[R].g+E[R].g*b)+","+Math.round(w[R].b+E[R].b*b)+","+(w[R].a+E[R].a*b)+")");else for(R=0;R<k;R++)P.push((w[R]||0)+E[R]*b);else d.indexOf(x)!==-1?P="rgba("+Math.round(w.r+E.r*b)+","+Math.round(w.g+E.g*b)+","+Math.round(w.b+E.b*b)+","+(w.a+E.a*b)+")":P=w+E*b;_.setAttr(x,P)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const b=this.node,_=p.attrs[b._id][this._id];_.points&&_.points.trueEnd&&b.setAttr("points",_.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const b=this.node,_=p.attrs[b._id][this._id];_.points&&_.points.trueStart&&b.points(_.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(b){return this.tween.seek(b*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const b=this.node._id,_=this._id,S=p.tweens[b];this.pause(),this.anim&&this.anim.stop();for(const x in S)delete p.tweens[b][x];delete p.attrs[b][_],p.tweens[b]&&(Object.keys(p.tweens[b]).length===0&&delete p.tweens[b],Object.keys(p.attrs[b]).length===0&&delete p.attrs[b])}}e.Tween=p,p.attrs={},p.tweens={},n.Node.prototype.to=function(f){const b=f.onFinish;f.node=this,f.onFinish=function(){this.destroy(),b&&b()},new p(f).play()},e.Easings={BackEaseIn(f,b,_,S){return _*(f/=S)*f*((1.70158+1)*f-1.70158)+b},BackEaseOut(f,b,_,S){return _*((f=f/S-1)*f*((1.70158+1)*f+1.70158)+1)+b},BackEaseInOut(f,b,_,S){let x=1.70158;return(f/=S/2)<1?_/2*(f*f*(((x*=1.525)+1)*f-x))+b:_/2*((f-=2)*f*(((x*=1.525)+1)*f+x)+2)+b},ElasticEaseIn(f,b,_,S,x,m){let w=0;return f===0?b:(f/=S)===1?b+_:(m||(m=S*.3),!x||x<Math.abs(_)?(x=_,w=m/4):w=m/(2*Math.PI)*Math.asin(_/x),-(x*Math.pow(2,10*(f-=1))*Math.sin((f*S-w)*(2*Math.PI)/m))+b)},ElasticEaseOut(f,b,_,S,x,m){let w=0;return f===0?b:(f/=S)===1?b+_:(m||(m=S*.3),!x||x<Math.abs(_)?(x=_,w=m/4):w=m/(2*Math.PI)*Math.asin(_/x),x*Math.pow(2,-10*f)*Math.sin((f*S-w)*(2*Math.PI)/m)+_+b)},ElasticEaseInOut(f,b,_,S,x,m){let w=0;return f===0?b:(f/=S/2)===2?b+_:(m||(m=S*(.3*1.5)),!x||x<Math.abs(_)?(x=_,w=m/4):w=m/(2*Math.PI)*Math.asin(_/x),f<1?-.5*(x*Math.pow(2,10*(f-=1))*Math.sin((f*S-w)*(2*Math.PI)/m))+b:x*Math.pow(2,-10*(f-=1))*Math.sin((f*S-w)*(2*Math.PI)/m)*.5+_+b)},BounceEaseOut(f,b,_,S){return(f/=S)<1/2.75?_*(7.5625*f*f)+b:f<2/2.75?_*(7.5625*(f-=1.5/2.75)*f+.75)+b:f<2.5/2.75?_*(7.5625*(f-=2.25/2.75)*f+.9375)+b:_*(7.5625*(f-=2.625/2.75)*f+.984375)+b},BounceEaseIn(f,b,_,S){return _-e.Easings.BounceEaseOut(S-f,0,_,S)+b},BounceEaseInOut(f,b,_,S){return f<S/2?e.Easings.BounceEaseIn(f*2,0,_,S)*.5+b:e.Easings.BounceEaseOut(f*2-S,0,_,S)*.5+_*.5+b},EaseIn(f,b,_,S){return _*(f/=S)*f+b},EaseOut(f,b,_,S){return-_*(f/=S)*(f-2)+b},EaseInOut(f,b,_,S){return(f/=S/2)<1?_/2*f*f+b:-_/2*(--f*(f-2)-1)+b},StrongEaseIn(f,b,_,S){return _*(f/=S)*f*f*f*f+b},StrongEaseOut(f,b,_,S){return _*((f=f/S-1)*f*f*f*f+1)+b},StrongEaseInOut(f,b,_,S){return(f/=S/2)<1?_/2*f*f*f*f*f+b:_/2*((f-=2)*f*f*f*f+2)+b},Linear(f,b,_,S){return _*f/S+b}}}(rg)),rg}var Cy;function Q2(){return Cy||(Cy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=br(),r=Ni(),n=Qi(),i=Y1(),a=y9(),o=pw(),l=b9(),u=Mv(),d=Rv(),h=ja(),v=Iv(),p=w9(),f=hw(),b=W1();e.Konva=r.Util._assign(t.Konva,{Util:r.Util,Transform:r.Transform,Node:n.Node,Container:i.Container,Stage:a.Stage,stages:a.stages,Layer:o.Layer,FastLayer:l.FastLayer,Group:u.Group,DD:d.DD,Shape:h.Shape,shapes:h.shapes,Animation:v.Animation,Tween:p.Tween,Easings:p.Easings,Context:f.Context,Canvas:b.Canvas}),e.default=e.Konva}(X0)),X0}var Qh={},ky;function _9(){if(ky)return Qh;ky=1,Object.defineProperty(Qh,"__esModule",{value:!0}),Qh.Arc=void 0;const e=kr(),t=ja(),r=br(),n=Tr(),i=br();class a extends t.Shape{_sceneFunc(l){const u=r.Konva.getAngle(this.angle()),d=this.clockwise();l.beginPath(),l.arc(0,0,this.outerRadius(),0,u,d),l.arc(0,0,this.innerRadius(),u,0,!d),l.closePath(),l.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(l){this.outerRadius(l/2)}setHeight(l){this.outerRadius(l/2)}getSelfRect(){const l=this.innerRadius(),u=this.outerRadius(),d=this.clockwise(),h=r.Konva.getAngle(d?360-this.angle():this.angle()),v=Math.cos(Math.min(h,Math.PI)),p=1,f=Math.sin(Math.min(Math.max(Math.PI,h),3*Math.PI/2)),b=Math.sin(Math.min(h,Math.PI/2)),_=v*(v>0?l:u),S=p*u,x=f*(f>0?l:u),m=b*(b>0?u:l);return{x:_,y:d?-1*m:x,width:S-_,height:m-x}}}return Qh.Arc=a,a.prototype._centroid=!0,a.prototype.className="Arc",a.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"],(0,i._registerNode)(a),e.Factory.addGetterSetter(a,"innerRadius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(a,"outerRadius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(a,"angle",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(a,"clockwise",!1,(0,n.getBooleanValidator)()),Qh}var Jh={},ed={},Ny;function gw(){if(Ny)return ed;Ny=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.Line=void 0;const e=kr(),t=br(),r=ja(),n=Tr();function i(l,u,d,h,v,p,f){const b=Math.sqrt(Math.pow(d-l,2)+Math.pow(h-u,2)),_=Math.sqrt(Math.pow(v-d,2)+Math.pow(p-h,2)),S=f*b/(b+_),x=f*_/(b+_),m=d-S*(v-l),w=h-S*(p-u),E=d+x*(v-l),P=h+x*(p-u);return[m,w,E,P]}function a(l,u){const d=l.length,h=[];for(let v=2;v<d-2;v+=2){const p=i(l[v-2],l[v-1],l[v],l[v+1],l[v+2],l[v+3],u);isNaN(p[0])||(h.push(p[0]),h.push(p[1]),h.push(l[v]),h.push(l[v+1]),h.push(p[2]),h.push(p[3]))}return h}class o extends r.Shape{constructor(u){super(u),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(u){const d=this.points(),h=d.length,v=this.tension(),p=this.closed(),f=this.bezier();if(!h)return;let b=0;if(u.beginPath(),u.moveTo(d[0],d[1]),v!==0&&h>4){const _=this.getTensionPoints(),S=_.length;for(b=p?0:4,p||u.quadraticCurveTo(_[0],_[1],_[2],_[3]);b<S-2;)u.bezierCurveTo(_[b++],_[b++],_[b++],_[b++],_[b++],_[b++]);p||u.quadraticCurveTo(_[S-2],_[S-1],d[h-2],d[h-1])}else if(f)for(b=2;b<h;)u.bezierCurveTo(d[b++],d[b++],d[b++],d[b++],d[b++],d[b++]);else for(b=2;b<h;b+=2)u.lineTo(d[b],d[b+1]);p?(u.closePath(),u.fillStrokeShape(this)):u.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():a(this.points(),this.tension())}_getTensionPointsClosed(){const u=this.points(),d=u.length,h=this.tension(),v=i(u[d-2],u[d-1],u[0],u[1],u[2],u[3],h),p=i(u[d-4],u[d-3],u[d-2],u[d-1],u[0],u[1],h),f=a(u,h);return[v[2],v[3]].concat(f).concat([p[0],p[1],u[d-2],u[d-1],p[2],p[3],v[0],v[1],u[0],u[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let u=this.points();if(u.length<4)return{x:u[0]||0,y:u[1]||0,width:0,height:0};this.tension()!==0?u=[u[0],u[1],...this._getTensionPoints(),u[u.length-2],u[u.length-1]]:u=this.points();let d=u[0],h=u[0],v=u[1],p=u[1],f,b;for(let _=0;_<u.length/2;_++)f=u[_*2],b=u[_*2+1],d=Math.min(d,f),h=Math.max(h,f),v=Math.min(v,b),p=Math.max(p,b);return{x:d,y:v,width:h-d,height:p-v}}}return ed.Line=o,o.prototype.className="Line",o.prototype._attrsAffectingSize=["points","bezier","tension"],(0,t._registerNode)(o),e.Factory.addGetterSetter(o,"closed",!1),e.Factory.addGetterSetter(o,"bezier",!1),e.Factory.addGetterSetter(o,"tension",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(o,"points",[],(0,n.getNumberArrayValidator)()),ed}var td={},ng={},Ly;function x9(){return Ly||(Ly=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(o,l,u)=>{let d,h;const p=u/2;d=0;for(let f=0;f<20;f++)h=p*e.tValues[20][f]+p,d+=e.cValues[20][f]*n(o,l,h);return p*d};e.getCubicArcLength=t;const r=(o,l,u)=>{u===void 0&&(u=1);const d=o[0]-2*o[1]+o[2],h=l[0]-2*l[1]+l[2],v=2*o[1]-2*o[0],p=2*l[1]-2*l[0],f=4*(d*d+h*h),b=4*(d*v+h*p),_=v*v+p*p;if(f===0)return u*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(l[2]-l[0],2));const S=b/(2*f),x=_/f,m=u+S,w=x-S*S,E=m*m+w>0?Math.sqrt(m*m+w):0,P=S*S+w>0?Math.sqrt(S*S+w):0,R=S+Math.sqrt(S*S+w)!==0?w*Math.log(Math.abs((m+E)/(S+P))):0;return Math.sqrt(f)/2*(m*E-S*P+R)};e.getQuadraticArcLength=r;function n(o,l,u){const d=i(1,u,o),h=i(1,u,l),v=d*d+h*h;return Math.sqrt(v)}const i=(o,l,u)=>{const d=u.length-1;let h,v;if(d===0)return 0;if(o===0){v=0;for(let p=0;p<=d;p++)v+=e.binomialCoefficients[d][p]*Math.pow(1-l,d-p)*Math.pow(l,p)*u[p];return v}else{h=new Array(d);for(let p=0;p<d;p++)h[p]=d*(u[p+1]-u[p]);return i(o-1,l,h)}},a=(o,l,u)=>{let d=1,h=o/l,v=(o-u(h))/l,p=0;for(;d>.001;){const f=u(h+v),b=Math.abs(o-f)/l;if(b<d)d=b,h+=v;else{const _=u(h-v),S=Math.abs(o-_)/l;S<d?(d=S,h-=v):v/=2}if(p++,p>500)break}return h};e.t2length=a}(ng)),ng}var Ty;function jv(){if(Ty)return td;Ty=1,Object.defineProperty(td,"__esModule",{value:!0}),td.Path=void 0;const e=kr(),t=br(),r=ja(),n=x9();class i extends r.Shape{constructor(o){super(o),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=i.parsePathData(this.data()),this.pathLength=i.getPathLength(this.dataArray)}_sceneFunc(o){const l=this.dataArray;o.beginPath();let u=!1;for(let d=0;d<l.length;d++){const h=l[d].command,v=l[d].points;switch(h){case"L":o.lineTo(v[0],v[1]);break;case"M":o.moveTo(v[0],v[1]);break;case"C":o.bezierCurveTo(v[0],v[1],v[2],v[3],v[4],v[5]);break;case"Q":o.quadraticCurveTo(v[0],v[1],v[2],v[3]);break;case"A":const p=v[0],f=v[1],b=v[2],_=v[3],S=v[4],x=v[5],m=v[6],w=v[7],E=b>_?b:_,P=b>_?1:b/_,R=b>_?_/b:1;o.translate(p,f),o.rotate(m),o.scale(P,R),o.arc(0,0,E,S,S+x,1-w),o.scale(1/P,1/R),o.rotate(-m),o.translate(-p,-f);break;case"z":u=!0,o.closePath();break}}!u&&!this.hasFill()?o.strokeShape(this):o.fillStrokeShape(this)}getSelfRect(){let o=[];this.dataArray.forEach(function(f){if(f.command==="A"){const b=f.points[4],_=f.points[5],S=f.points[4]+_;let x=Math.PI/180;if(Math.abs(b-S)<x&&(x=Math.abs(b-S)),_<0)for(let m=b-x;m>S;m-=x){const w=i.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],m,0);o.push(w.x,w.y)}else for(let m=b+x;m<S;m+=x){const w=i.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],m,0);o.push(w.x,w.y)}}else if(f.command==="C")for(let b=0;b<=1;b+=.01){const _=i.getPointOnCubicBezier(b,f.start.x,f.start.y,f.points[0],f.points[1],f.points[2],f.points[3],f.points[4],f.points[5]);o.push(_.x,_.y)}else o=o.concat(f.points)});let l=o[0],u=o[0],d=o[1],h=o[1],v,p;for(let f=0;f<o.length/2;f++)v=o[f*2],p=o[f*2+1],isNaN(v)||(l=Math.min(l,v),u=Math.max(u,v)),isNaN(p)||(d=Math.min(d,p),h=Math.max(h,p));return{x:l,y:d,width:u-l,height:h-d}}getLength(){return this.pathLength}getPointAtLength(o){return i.getPointAtLengthOfDataArray(o,this.dataArray)}static getLineLength(o,l,u,d){return Math.sqrt((u-o)*(u-o)+(d-l)*(d-l))}static getPathLength(o){let l=0;for(let u=0;u<o.length;++u)l+=o[u].pathLength;return l}static getPointAtLengthOfDataArray(o,l){let u,d=0,h=l.length;if(!h)return null;for(;d<h&&o>l[d].pathLength;)o-=l[d].pathLength,++d;if(d===h)return u=l[d-1].points.slice(-2),{x:u[0],y:u[1]};if(o<.01)return l[d].command==="M"?(u=l[d].points.slice(0,2),{x:u[0],y:u[1]}):{x:l[d].start.x,y:l[d].start.y};const v=l[d],p=v.points;switch(v.command){case"L":return i.getPointOnLine(o,v.start.x,v.start.y,p[0],p[1]);case"C":return i.getPointOnCubicBezier((0,n.t2length)(o,i.getPathLength(l),E=>(0,n.getCubicArcLength)([v.start.x,p[0],p[2],p[4]],[v.start.y,p[1],p[3],p[5]],E)),v.start.x,v.start.y,p[0],p[1],p[2],p[3],p[4],p[5]);case"Q":return i.getPointOnQuadraticBezier((0,n.t2length)(o,i.getPathLength(l),E=>(0,n.getQuadraticArcLength)([v.start.x,p[0],p[2]],[v.start.y,p[1],p[3]],E)),v.start.x,v.start.y,p[0],p[1],p[2],p[3]);case"A":const f=p[0],b=p[1],_=p[2],S=p[3],x=p[5],m=p[6];let w=p[4];return w+=x*o/v.pathLength,i.getPointOnEllipticalArc(f,b,_,S,w,m)}return null}static getPointOnLine(o,l,u,d,h,v,p){v=v??l,p=p??u;const f=this.getLineLength(l,u,d,h);if(f<1e-10)return{x:l,y:u};if(d===l)return{x:v,y:p+(h>u?o:-o)};const b=(h-u)/(d-l),_=Math.sqrt(o*o/(1+b*b))*(d<l?-1:1),S=b*_;if(Math.abs(p-u-b*(v-l))<1e-10)return{x:v+_,y:p+S};const x=((v-l)*(d-l)+(p-u)*(h-u))/(f*f),m=l+x*(d-l),w=u+x*(h-u),E=this.getLineLength(v,p,m,w),P=Math.sqrt(o*o-E*E),R=Math.sqrt(P*P/(1+b*b))*(d<l?-1:1),k=b*R;return{x:m+R,y:w+k}}static getPointOnCubicBezier(o,l,u,d,h,v,p,f,b){function _(P){return P*P*P}function S(P){return 3*P*P*(1-P)}function x(P){return 3*P*(1-P)*(1-P)}function m(P){return(1-P)*(1-P)*(1-P)}const w=f*_(o)+v*S(o)+d*x(o)+l*m(o),E=b*_(o)+p*S(o)+h*x(o)+u*m(o);return{x:w,y:E}}static getPointOnQuadraticBezier(o,l,u,d,h,v,p){function f(m){return m*m}function b(m){return 2*m*(1-m)}function _(m){return(1-m)*(1-m)}const S=v*f(o)+d*b(o)+l*_(o),x=p*f(o)+h*b(o)+u*_(o);return{x:S,y:x}}static getPointOnEllipticalArc(o,l,u,d,h,v){const p=Math.cos(v),f=Math.sin(v),b={x:u*Math.cos(h),y:d*Math.sin(h)};return{x:o+(b.x*p-b.y*f),y:l+(b.x*f+b.y*p)}}static parsePathData(o){if(!o)return[];let l=o;const u=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];l=l.replace(new RegExp(" ","g"),",");for(let S=0;S<u.length;S++)l=l.replace(new RegExp(u[S],"g"),"|"+u[S]);const d=l.split("|"),h=[],v=[];let p=0,f=0;const b=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let _;for(let S=1;S<d.length;S++){let x=d[S],m=x.charAt(0);for(x=x.slice(1),v.length=0;_=b.exec(x);)v.push(_[0]);const w=[];for(let E=0,P=v.length;E<P;E++){if(v[E]==="00"){w.push(0,0);continue}const R=parseFloat(v[E]);isNaN(R)?w.push(0):w.push(R)}for(;w.length>0&&!isNaN(w[0]);){let E="",P=[];const R=p,k=f;let N,M,T,C,L,H,G,J,se,U;switch(m){case"l":p+=w.shift(),f+=w.shift(),E="L",P.push(p,f);break;case"L":p=w.shift(),f=w.shift(),P.push(p,f);break;case"m":const V=w.shift(),X=w.shift();if(p+=V,f+=X,E="M",h.length>2&&h[h.length-1].command==="z"){for(let z=h.length-2;z>=0;z--)if(h[z].command==="M"){p=h[z].points[0]+V,f=h[z].points[1]+X;break}}P.push(p,f),m="l";break;case"M":p=w.shift(),f=w.shift(),E="M",P.push(p,f),m="L";break;case"h":p+=w.shift(),E="L",P.push(p,f);break;case"H":p=w.shift(),E="L",P.push(p,f);break;case"v":f+=w.shift(),E="L",P.push(p,f);break;case"V":f=w.shift(),E="L",P.push(p,f);break;case"C":P.push(w.shift(),w.shift(),w.shift(),w.shift()),p=w.shift(),f=w.shift(),P.push(p,f);break;case"c":P.push(p+w.shift(),f+w.shift(),p+w.shift(),f+w.shift()),p+=w.shift(),f+=w.shift(),E="C",P.push(p,f);break;case"S":M=p,T=f,N=h[h.length-1],N.command==="C"&&(M=p+(p-N.points[2]),T=f+(f-N.points[3])),P.push(M,T,w.shift(),w.shift()),p=w.shift(),f=w.shift(),E="C",P.push(p,f);break;case"s":M=p,T=f,N=h[h.length-1],N.command==="C"&&(M=p+(p-N.points[2]),T=f+(f-N.points[3])),P.push(M,T,p+w.shift(),f+w.shift()),p+=w.shift(),f+=w.shift(),E="C",P.push(p,f);break;case"Q":P.push(w.shift(),w.shift()),p=w.shift(),f=w.shift(),P.push(p,f);break;case"q":P.push(p+w.shift(),f+w.shift()),p+=w.shift(),f+=w.shift(),E="Q",P.push(p,f);break;case"T":M=p,T=f,N=h[h.length-1],N.command==="Q"&&(M=p+(p-N.points[0]),T=f+(f-N.points[1])),p=w.shift(),f=w.shift(),E="Q",P.push(M,T,p,f);break;case"t":M=p,T=f,N=h[h.length-1],N.command==="Q"&&(M=p+(p-N.points[0]),T=f+(f-N.points[1])),p+=w.shift(),f+=w.shift(),E="Q",P.push(M,T,p,f);break;case"A":C=w.shift(),L=w.shift(),H=w.shift(),G=w.shift(),J=w.shift(),se=p,U=f,p=w.shift(),f=w.shift(),E="A",P=this.convertEndpointToCenterParameterization(se,U,p,f,G,J,C,L,H);break;case"a":C=w.shift(),L=w.shift(),H=w.shift(),G=w.shift(),J=w.shift(),se=p,U=f,p+=w.shift(),f+=w.shift(),E="A",P=this.convertEndpointToCenterParameterization(se,U,p,f,G,J,C,L,H);break}h.push({command:E||m,points:P,start:{x:R,y:k},pathLength:this.calcLength(R,k,E||m,P)})}(m==="z"||m==="Z")&&h.push({command:"z",points:[],start:void 0,pathLength:0})}return h}static calcLength(o,l,u,d){let h,v,p,f;const b=i;switch(u){case"L":return b.getLineLength(o,l,d[0],d[1]);case"C":return(0,n.getCubicArcLength)([o,d[0],d[2],d[4]],[l,d[1],d[3],d[5]],1);case"Q":return(0,n.getQuadraticArcLength)([o,d[0],d[2]],[l,d[1],d[3]],1);case"A":h=0;const _=d[4],S=d[5],x=d[4]+S;let m=Math.PI/180;if(Math.abs(_-x)<m&&(m=Math.abs(_-x)),v=b.getPointOnEllipticalArc(d[0],d[1],d[2],d[3],_,0),S<0)for(f=_-m;f>x;f-=m)p=b.getPointOnEllipticalArc(d[0],d[1],d[2],d[3],f,0),h+=b.getLineLength(v.x,v.y,p.x,p.y),v=p;else for(f=_+m;f<x;f+=m)p=b.getPointOnEllipticalArc(d[0],d[1],d[2],d[3],f,0),h+=b.getLineLength(v.x,v.y,p.x,p.y),v=p;return p=b.getPointOnEllipticalArc(d[0],d[1],d[2],d[3],x,0),h+=b.getLineLength(v.x,v.y,p.x,p.y),h}return 0}static convertEndpointToCenterParameterization(o,l,u,d,h,v,p,f,b){const _=b*(Math.PI/180),S=Math.cos(_)*(o-u)/2+Math.sin(_)*(l-d)/2,x=-1*Math.sin(_)*(o-u)/2+Math.cos(_)*(l-d)/2,m=S*S/(p*p)+x*x/(f*f);m>1&&(p*=Math.sqrt(m),f*=Math.sqrt(m));let w=Math.sqrt((p*p*(f*f)-p*p*(x*x)-f*f*(S*S))/(p*p*(x*x)+f*f*(S*S)));h===v&&(w*=-1),isNaN(w)&&(w=0);const E=w*p*x/f,P=w*-f*S/p,R=(o+u)/2+Math.cos(_)*E-Math.sin(_)*P,k=(l+d)/2+Math.sin(_)*E+Math.cos(_)*P,N=function(J){return Math.sqrt(J[0]*J[0]+J[1]*J[1])},M=function(J,se){return(J[0]*se[0]+J[1]*se[1])/(N(J)*N(se))},T=function(J,se){return(J[0]*se[1]<J[1]*se[0]?-1:1)*Math.acos(M(J,se))},C=T([1,0],[(S-E)/p,(x-P)/f]),L=[(S-E)/p,(x-P)/f],H=[(-1*S-E)/p,(-1*x-P)/f];let G=T(L,H);return M(L,H)<=-1&&(G=Math.PI),M(L,H)>=1&&(G=0),v===0&&G>0&&(G=G-2*Math.PI),v===1&&G<0&&(G=G+2*Math.PI),[R,k,p,f,C,G,_,v]}}return td.Path=i,i.prototype.className="Path",i.prototype._attrsAffectingSize=["data"],(0,t._registerNode)(i),e.Factory.addGetterSetter(i,"data"),td}var Ry;function S9(){if(Ry)return Jh;Ry=1,Object.defineProperty(Jh,"__esModule",{value:!0}),Jh.Arrow=void 0;const e=kr(),t=gw(),r=Tr(),n=br(),i=jv();let a=class extends t.Line{_sceneFunc(l){super._sceneFunc(l);const u=Math.PI*2,d=this.points();let h=d;const v=this.tension()!==0&&d.length>4;v&&(h=this.getTensionPoints());const p=this.pointerLength(),f=d.length;let b,_;if(v){const m=[h[h.length-4],h[h.length-3],h[h.length-2],h[h.length-1],d[f-2],d[f-1]],w=i.Path.calcLength(h[h.length-4],h[h.length-3],"C",m),E=i.Path.getPointOnQuadraticBezier(Math.min(1,1-p/w),m[0],m[1],m[2],m[3],m[4],m[5]);b=d[f-2]-E.x,_=d[f-1]-E.y}else b=d[f-2]-d[f-4],_=d[f-1]-d[f-3];const S=(Math.atan2(_,b)+u)%u,x=this.pointerWidth();this.pointerAtEnding()&&(l.save(),l.beginPath(),l.translate(d[f-2],d[f-1]),l.rotate(S),l.moveTo(0,0),l.lineTo(-p,x/2),l.lineTo(-p,-x/2),l.closePath(),l.restore(),this.__fillStroke(l)),this.pointerAtBeginning()&&(l.save(),l.beginPath(),l.translate(d[0],d[1]),v?(b=(h[0]+h[2])/2-d[0],_=(h[1]+h[3])/2-d[1]):(b=d[2]-d[0],_=d[3]-d[1]),l.rotate((Math.atan2(-_,-b)+u)%u),l.moveTo(0,0),l.lineTo(-p,x/2),l.lineTo(-p,-x/2),l.closePath(),l.restore(),this.__fillStroke(l))}__fillStroke(l){const u=this.dashEnabled();u&&(this.attrs.dashEnabled=!1,l.setLineDash([])),l.fillStrokeShape(this),u&&(this.attrs.dashEnabled=!0)}getSelfRect(){const l=super.getSelfRect(),u=this.pointerWidth()/2;return{x:l.x,y:l.y-u,width:l.width,height:l.height+u*2}}};return Jh.Arrow=a,a.prototype.className="Arrow",(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"pointerLength",10,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(a,"pointerWidth",10,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(a,"pointerAtBeginning",!1),e.Factory.addGetterSetter(a,"pointerAtEnding",!0),Jh}var rd={},My;function E9(){if(My)return rd;My=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.Circle=void 0;const e=kr(),t=ja(),r=Tr(),n=br();class i extends t.Shape{_sceneFunc(o){o.beginPath(),o.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(o){this.radius()!==o/2&&this.radius(o/2)}setHeight(o){this.radius()!==o/2&&this.radius(o/2)}}return rd.Circle=i,i.prototype._centroid=!0,i.prototype.className="Circle",i.prototype._attrsAffectingSize=["radius"],(0,n._registerNode)(i),e.Factory.addGetterSetter(i,"radius",0,(0,r.getNumberValidator)()),rd}var nd={},Iy;function P9(){if(Iy)return nd;Iy=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.Ellipse=void 0;const e=kr(),t=ja(),r=Tr(),n=br();let i=class extends t.Shape{_sceneFunc(o){const l=this.radiusX(),u=this.radiusY();o.beginPath(),o.save(),l!==u&&o.scale(1,u/l),o.arc(0,0,l,0,Math.PI*2,!1),o.restore(),o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(o){this.radiusX(o/2)}setHeight(o){this.radiusY(o/2)}};return nd.Ellipse=i,i.prototype.className="Ellipse",i.prototype._centroid=!0,i.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,n._registerNode)(i),e.Factory.addComponentsGetterSetter(i,"radius",["x","y"]),e.Factory.addGetterSetter(i,"radiusX",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(i,"radiusY",0,(0,r.getNumberValidator)()),nd}var id={},jy;function A9(){if(jy)return id;jy=1,Object.defineProperty(id,"__esModule",{value:!0}),id.Image=void 0;const e=Ni(),t=kr(),r=ja(),n=br(),i=Tr();class a extends r.Shape{constructor(l){super(l),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",u=>{this._removeImageLoad(u.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const l=this.image();l&&l.complete||l&&l.readyState===4||l&&l.addEventListener&&l.addEventListener("load",this._loadListener)}_removeImageLoad(l){l&&l.removeEventListener&&l.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const l=!!this.cornerRadius(),u=this.hasShadow();return l&&u?!0:super._useBufferCanvas(!0)}_sceneFunc(l){const u=this.getWidth(),d=this.getHeight(),h=this.cornerRadius(),v=this.attrs.image;let p;if(v){const f=this.attrs.cropWidth,b=this.attrs.cropHeight;f&&b?p=[v,this.cropX(),this.cropY(),f,b,0,0,u,d]:p=[v,0,0,u,d]}(this.hasFill()||this.hasStroke()||h)&&(l.beginPath(),h?e.Util.drawRoundedRectPath(l,u,d,h):l.rect(0,0,u,d),l.closePath(),l.fillStrokeShape(this)),v&&(h&&l.clip(),l.drawImage.apply(l,p))}_hitFunc(l){const u=this.width(),d=this.height(),h=this.cornerRadius();l.beginPath(),h?e.Util.drawRoundedRectPath(l,u,d,h):l.rect(0,0,u,d),l.closePath(),l.fillStrokeShape(this)}getWidth(){var l,u;return(l=this.attrs.width)!==null&&l!==void 0?l:(u=this.image())===null||u===void 0?void 0:u.width}getHeight(){var l,u;return(l=this.attrs.height)!==null&&l!==void 0?l:(u=this.image())===null||u===void 0?void 0:u.height}static fromURL(l,u,d=null){const h=e.Util.createImageElement();h.onload=function(){const v=new a({image:h});u(v)},h.onerror=d,h.crossOrigin="Anonymous",h.src=l}}return id.Image=a,a.prototype.className="Image",(0,n._registerNode)(a),t.Factory.addGetterSetter(a,"cornerRadius",0,(0,i.getNumberOrArrayOfNumbersValidator)(4)),t.Factory.addGetterSetter(a,"image"),t.Factory.addComponentsGetterSetter(a,"crop",["x","y","width","height"]),t.Factory.addGetterSetter(a,"cropX",0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(a,"cropY",0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(a,"cropWidth",0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(a,"cropHeight",0,(0,i.getNumberValidator)()),id}var wf={},Fy;function O9(){if(Fy)return wf;Fy=1,Object.defineProperty(wf,"__esModule",{value:!0}),wf.Tag=wf.Label=void 0;const e=kr(),t=ja(),r=Mv(),n=Tr(),i=br(),a=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],o="Change.konva",l="none",u="up",d="right",h="down",v="left",p=a.length;class f extends r.Group{constructor(S){super(S),this.on("add.konva",function(x){this._addListeners(x.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(S){let x=this,m;const w=function(){x._sync()};for(m=0;m<p;m++)S.on(a[m]+o,w)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let S=this.getText(),x=this.getTag(),m,w,E,P,R,k,N;if(S&&x){switch(m=S.width(),w=S.height(),E=x.pointerDirection(),P=x.pointerWidth(),N=x.pointerHeight(),R=0,k=0,E){case u:R=m/2,k=-1*N;break;case d:R=m+P,k=w/2;break;case h:R=m/2,k=w+N;break;case v:R=-1*P,k=w/2;break}x.setAttrs({x:-1*R,y:-1*k,width:m,height:w}),S.setAttrs({x:-1*R,y:-1*k})}}}wf.Label=f,f.prototype.className="Label",(0,i._registerNode)(f);class b extends t.Shape{_sceneFunc(S){const x=this.width(),m=this.height(),w=this.pointerDirection(),E=this.pointerWidth(),P=this.pointerHeight(),R=this.cornerRadius();let k=0,N=0,M=0,T=0;typeof R=="number"?k=N=M=T=Math.min(R,x/2,m/2):(k=Math.min(R[0]||0,x/2,m/2),N=Math.min(R[1]||0,x/2,m/2),T=Math.min(R[2]||0,x/2,m/2),M=Math.min(R[3]||0,x/2,m/2)),S.beginPath(),S.moveTo(k,0),w===u&&(S.lineTo((x-E)/2,0),S.lineTo(x/2,-1*P),S.lineTo((x+E)/2,0)),S.lineTo(x-N,0),S.arc(x-N,N,N,Math.PI*3/2,0,!1),w===d&&(S.lineTo(x,(m-P)/2),S.lineTo(x+E,m/2),S.lineTo(x,(m+P)/2)),S.lineTo(x,m-T),S.arc(x-T,m-T,T,0,Math.PI/2,!1),w===h&&(S.lineTo((x+E)/2,m),S.lineTo(x/2,m+P),S.lineTo((x-E)/2,m)),S.lineTo(M,m),S.arc(M,m-M,M,Math.PI/2,Math.PI,!1),w===v&&(S.lineTo(0,(m+P)/2),S.lineTo(-1*E,m/2),S.lineTo(0,(m-P)/2)),S.lineTo(0,k),S.arc(k,k,k,Math.PI,Math.PI*3/2,!1),S.closePath(),S.fillStrokeShape(this)}getSelfRect(){let S=0,x=0,m=this.pointerWidth(),w=this.pointerHeight(),E=this.pointerDirection(),P=this.width(),R=this.height();return E===u?(x-=w,R+=w):E===h?R+=w:E===v?(S-=m*1.5,P+=m):E===d&&(P+=m*1.5),{x:S,y:x,width:P,height:R}}}return wf.Tag=b,b.prototype.className="Tag",(0,i._registerNode)(b),e.Factory.addGetterSetter(b,"pointerDirection",l),e.Factory.addGetterSetter(b,"pointerWidth",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(b,"pointerHeight",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(b,"cornerRadius",0,(0,n.getNumberOrArrayOfNumbersValidator)(4)),wf}var ad={},Dy;function vw(){if(Dy)return ad;Dy=1,Object.defineProperty(ad,"__esModule",{value:!0}),ad.Rect=void 0;const e=kr(),t=ja(),r=br(),n=Ni(),i=Tr();class a extends t.Shape{_sceneFunc(l){const u=this.cornerRadius(),d=this.width(),h=this.height();l.beginPath(),u?n.Util.drawRoundedRectPath(l,d,h,u):l.rect(0,0,d,h),l.closePath(),l.fillStrokeShape(this)}}return ad.Rect=a,a.prototype.className="Rect",(0,r._registerNode)(a),e.Factory.addGetterSetter(a,"cornerRadius",0,(0,i.getNumberOrArrayOfNumbersValidator)(4)),ad}var od={},By;function C9(){if(By)return od;By=1,Object.defineProperty(od,"__esModule",{value:!0}),od.RegularPolygon=void 0;const e=kr(),t=ja(),r=Tr(),n=br();let i=class extends t.Shape{_sceneFunc(o){const l=this._getPoints();o.beginPath(),o.moveTo(l[0].x,l[0].y);for(let u=1;u<l.length;u++)o.lineTo(l[u].x,l[u].y);o.closePath(),o.fillStrokeShape(this)}_getPoints(){const o=this.attrs.sides,l=this.attrs.radius||0,u=[];for(let d=0;d<o;d++)u.push({x:l*Math.sin(d*2*Math.PI/o),y:-1*l*Math.cos(d*2*Math.PI/o)});return u}getSelfRect(){const o=this._getPoints();let l=o[0].x,u=o[0].y,d=o[0].x,h=o[0].y;return o.forEach(v=>{l=Math.min(l,v.x),u=Math.max(u,v.x),d=Math.min(d,v.y),h=Math.max(h,v.y)}),{x:l,y:d,width:u-l,height:h-d}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(o){this.radius(o/2)}setHeight(o){this.radius(o/2)}};return od.RegularPolygon=i,i.prototype.className="RegularPolygon",i.prototype._centroid=!0,i.prototype._attrsAffectingSize=["radius"],(0,n._registerNode)(i),e.Factory.addGetterSetter(i,"radius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(i,"sides",0,(0,r.getNumberValidator)()),od}var sd={},zy;function k9(){if(zy)return sd;zy=1,Object.defineProperty(sd,"__esModule",{value:!0}),sd.Ring=void 0;const e=kr(),t=ja(),r=Tr(),n=br(),i=Math.PI*2;let a=class extends t.Shape{_sceneFunc(l){l.beginPath(),l.arc(0,0,this.innerRadius(),0,i,!1),l.moveTo(this.outerRadius(),0),l.arc(0,0,this.outerRadius(),i,0,!0),l.closePath(),l.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(l){this.outerRadius(l/2)}setHeight(l){this.outerRadius(l/2)}};return sd.Ring=a,a.prototype.className="Ring",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"innerRadius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(a,"outerRadius",0,(0,r.getNumberValidator)()),sd}var ld={},qy;function N9(){if(qy)return ld;qy=1,Object.defineProperty(ld,"__esModule",{value:!0}),ld.Sprite=void 0;const e=kr(),t=ja(),r=Iv(),n=Tr(),i=br();let a=class extends t.Shape{constructor(l){super(l),this._updated=!0,this.anim=new r.Animation(()=>{const u=this._updated;return this._updated=!1,u}),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(l){const u=this.animation(),d=this.frameIndex(),h=d*4,v=this.animations()[u],p=this.frameOffsets(),f=v[h+0],b=v[h+1],_=v[h+2],S=v[h+3],x=this.image();if((this.hasFill()||this.hasStroke())&&(l.beginPath(),l.rect(0,0,_,S),l.closePath(),l.fillStrokeShape(this)),x)if(p){const m=p[u],w=d*2;l.drawImage(x,f,b,_,S,m[w+0],m[w+1],_,S)}else l.drawImage(x,f,b,_,S,0,0,_,S)}_hitFunc(l){const u=this.animation(),d=this.frameIndex(),h=d*4,v=this.animations()[u],p=this.frameOffsets(),f=v[h+2],b=v[h+3];if(l.beginPath(),p){const _=p[u],S=d*2;l.rect(_[S+0],_[S+1],f,b)}else l.rect(0,0,f,b);l.closePath(),l.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const l=this;this.interval=setInterval(function(){l._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const l=this.getLayer();this.anim.setLayers(l),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const l=this.frameIndex(),u=this.animation(),d=this.animations(),h=d[u],v=h.length/4;l<v-1?this.frameIndex(l+1):this.frameIndex(0)}};return ld.Sprite=a,a.prototype.className="Sprite",(0,i._registerNode)(a),e.Factory.addGetterSetter(a,"animation"),e.Factory.addGetterSetter(a,"animations"),e.Factory.addGetterSetter(a,"frameOffsets"),e.Factory.addGetterSetter(a,"image"),e.Factory.addGetterSetter(a,"frameIndex",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(a,"frameRate",17,(0,n.getNumberValidator)()),e.Factory.backCompat(a,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"}),ld}var ud={},Uy;function L9(){if(Uy)return ud;Uy=1,Object.defineProperty(ud,"__esModule",{value:!0}),ud.Star=void 0;const e=kr(),t=ja(),r=Tr(),n=br();let i=class extends t.Shape{_sceneFunc(o){const l=this.innerRadius(),u=this.outerRadius(),d=this.numPoints();o.beginPath(),o.moveTo(0,0-u);for(let h=1;h<d*2;h++){const v=h%2===0?u:l,p=v*Math.sin(h*Math.PI/d),f=-1*v*Math.cos(h*Math.PI/d);o.lineTo(p,f)}o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(o){this.outerRadius(o/2)}setHeight(o){this.outerRadius(o/2)}};return ud.Star=i,i.prototype.className="Star",i.prototype._centroid=!0,i.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,n._registerNode)(i),e.Factory.addGetterSetter(i,"numPoints",5,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(i,"innerRadius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(i,"outerRadius",0,(0,r.getNumberValidator)()),ud}var sh={},Hy;function mw(){if(Hy)return sh;Hy=1,Object.defineProperty(sh,"__esModule",{value:!0}),sh.Text=void 0,sh.stringToArray=o;const e=Ni(),t=kr(),r=ja(),n=br(),i=Tr(),a=br();function o(F){return[...F].reduce((q,Q,re,Y)=>{if(new RegExp("\\p{Emoji}","u").test(Q)){const ee=Y[re+1];ee&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(ee)?(q.push(Q+ee),Y[re+1]=""):q.push(Q)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(Q+(Y[re+1]||""))?q.push(Q+Y[re+1]):re>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(Q)?q[q.length-1]+=Q:Q&&q.push(Q);return q},[])}const l="auto",u="center",d="inherit",h="justify",v="Change.konva",p="2d",f="-",b="left",_="text",S="Text",x="top",m="bottom",w="middle",E="normal",P="px ",R=" ",k="right",N="rtl",M="word",T="char",C="none",L="…",H=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],G=H.length;function J(F){return F.split(",").map(q=>{q=q.trim();const Q=q.indexOf(" ")>=0,re=q.indexOf('"')>=0||q.indexOf("'")>=0;return Q&&!re&&(q=`"${q}"`),q}).join(", ")}let se;function U(){return se||(se=e.Util.createCanvasElement().getContext(p),se)}function V(F){F.fillText(this._partialText,this._partialTextX,this._partialTextY)}function X(F){F.setAttr("miterLimit",2),F.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function z(F){return F=F||{},!F.fillLinearGradientColorStops&&!F.fillRadialGradientColorStops&&!F.fillPatternImage&&(F.fill=F.fill||"black"),F}class D extends r.Shape{constructor(q){super(z(q)),this._partialTextX=0,this._partialTextY=0;for(let Q=0;Q<G;Q++)this.on(H[Q]+v,this._setTextData);this._setTextData()}_sceneFunc(q){const Q=this.textArr,re=Q.length;if(!this.text())return;let Y=this.padding(),ee=this.fontSize(),ae=this.lineHeight()*ee,ue=this.verticalAlign(),ce=this.direction(),pe=0,Ae=this.align(),Ce=this.getWidth(),ke=this.letterSpacing(),Se=this.fill(),le=this.textDecoration(),Ee=le.indexOf("underline")!==-1,xe=le.indexOf("line-through")!==-1,ye;ce=ce===d?q.direction:ce;let Ne=ae/2,Te=w;if(n.Konva._fixTextRendering){const ge=this.measureSize("M");Te="alphabetic",Ne=(ge.fontBoundingBoxAscent-ge.fontBoundingBoxDescent)/2+ae/2}for(ce===N&&q.setAttr("direction",ce),q.setAttr("font",this._getContextFont()),q.setAttr("textBaseline",Te),q.setAttr("textAlign",b),ue===w?pe=(this.getHeight()-re*ae-Y*2)/2:ue===m&&(pe=this.getHeight()-re*ae-Y*2),q.translate(Y,pe+Y),ye=0;ye<re;ye++){let ge=0,Re=0;const Be=Q[ye],Qe=Be.text,ct=Be.width,mt=Be.lastInParagraph;if(q.save(),Ae===k?ge+=Ce-ct-Y*2:Ae===u&&(ge+=(Ce-ct-Y*2)/2),Ee){q.save(),q.beginPath();const gt=n.Konva._fixTextRendering?Math.round(ee/4):Math.round(ee/2),St=ge,pt=Ne+Re+gt;q.moveTo(St,pt);const ut=Ae===h&&!mt?Ce-Y*2:ct;q.lineTo(St+Math.round(ut),pt),q.lineWidth=ee/15;const Br=this._getLinearGradient();q.strokeStyle=Br||Se,q.stroke(),q.restore()}if(xe){q.save(),q.beginPath();const gt=n.Konva._fixTextRendering?-Math.round(ee/4):0;q.moveTo(ge,Ne+Re+gt);const St=Ae===h&&!mt?Ce-Y*2:ct;q.lineTo(ge+Math.round(St),Ne+Re+gt),q.lineWidth=ee/15;const pt=this._getLinearGradient();q.strokeStyle=pt||Se,q.stroke(),q.restore()}if(ce!==N&&(ke!==0||Ae===h)){const gt=Qe.split(" ").length-1,St=o(Qe);for(let pt=0;pt<St.length;pt++){const ut=St[pt];ut===" "&&!mt&&Ae===h&&(ge+=(Ce-Y*2-ct)/gt),this._partialTextX=ge,this._partialTextY=Ne+Re,this._partialText=ut,q.fillStrokeShape(this),ge+=this.measureSize(ut).width+ke}}else ke!==0&&q.setAttr("letterSpacing",`${ke}px`),this._partialTextX=ge,this._partialTextY=Ne+Re,this._partialText=Qe,q.fillStrokeShape(this);q.restore(),re>1&&(Ne+=ae)}}_hitFunc(q){const Q=this.getWidth(),re=this.getHeight();q.beginPath(),q.rect(0,0,Q,re),q.closePath(),q.fillStrokeShape(this)}setText(q){const Q=e.Util._isString(q)?q:q==null?"":q+"";return this._setAttr(_,Q),this}getWidth(){return this.attrs.width===l||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===l||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(q){var Q,re,Y,ee,ae,ue,ce,pe,Ae,Ce,ke;let Se=U(),le=this.fontSize(),Ee;Se.save(),Se.font=this._getContextFont(),Ee=Se.measureText(q),Se.restore();const xe=le/100;return{actualBoundingBoxAscent:(Q=Ee.actualBoundingBoxAscent)!==null&&Q!==void 0?Q:71.58203125*xe,actualBoundingBoxDescent:(re=Ee.actualBoundingBoxDescent)!==null&&re!==void 0?re:0,actualBoundingBoxLeft:(Y=Ee.actualBoundingBoxLeft)!==null&&Y!==void 0?Y:-7.421875*xe,actualBoundingBoxRight:(ee=Ee.actualBoundingBoxRight)!==null&&ee!==void 0?ee:75.732421875*xe,alphabeticBaseline:(ae=Ee.alphabeticBaseline)!==null&&ae!==void 0?ae:0,emHeightAscent:(ue=Ee.emHeightAscent)!==null&&ue!==void 0?ue:100*xe,emHeightDescent:(ce=Ee.emHeightDescent)!==null&&ce!==void 0?ce:-20*xe,fontBoundingBoxAscent:(pe=Ee.fontBoundingBoxAscent)!==null&&pe!==void 0?pe:91*xe,fontBoundingBoxDescent:(Ae=Ee.fontBoundingBoxDescent)!==null&&Ae!==void 0?Ae:21*xe,hangingBaseline:(Ce=Ee.hangingBaseline)!==null&&Ce!==void 0?Ce:72.80000305175781*xe,ideographicBaseline:(ke=Ee.ideographicBaseline)!==null&&ke!==void 0?ke:-21*xe,width:Ee.width,height:le}}_getContextFont(){return this.fontStyle()+R+this.fontVariant()+R+(this.fontSize()+P)+J(this.fontFamily())}_addTextLine(q){this.align()===h&&(q=q.trim());const re=this._getTextWidth(q);return this.textArr.push({text:q,width:re,lastInParagraph:!1})}_getTextWidth(q){const Q=this.letterSpacing(),re=q.length;return U().measureText(q).width+Q*re}_setTextData(){let q=this.text().split(`
43
- `),Q=+this.fontSize(),re=0,Y=this.lineHeight()*Q,ee=this.attrs.width,ae=this.attrs.height,ue=ee!==l&&ee!==void 0,ce=ae!==l&&ae!==void 0,pe=this.padding(),Ae=ee-pe*2,Ce=ae-pe*2,ke=0,Se=this.wrap(),le=Se!==C,Ee=Se!==T&&le,xe=this.ellipsis();this.textArr=[],U().font=this._getContextFont();const ye=xe?this._getTextWidth(L):0;for(let Ne=0,Te=q.length;Ne<Te;++Ne){let ge=q[Ne],Re=this._getTextWidth(ge);if(ue&&Re>Ae)for(;ge.length>0;){let Be=0,Qe=o(ge).length,ct="",mt=0;for(;Be<Qe;){const gt=Be+Qe>>>1,St=o(ge),pt=St.slice(0,gt+1).join(""),ut=this._getTextWidth(pt);(xe&&ce&&ke+Y>Ce?ut+ye:ut)<=Ae?(Be=gt+1,ct=pt,mt=ut):Qe=gt}if(ct){if(Ee){const pt=o(ge),ut=o(ct),Br=pt[ut.length],rr=Br===R||Br===f;let Nr;if(rr&&mt<=Ae)Nr=ut.length;else{const ur=ut.lastIndexOf(R),Ge=ut.lastIndexOf(f);Nr=Math.max(ur,Ge)+1}Nr>0&&(Be=Nr,ct=pt.slice(0,Be).join(""),mt=this._getTextWidth(ct))}if(ct=ct.trimRight(),this._addTextLine(ct),re=Math.max(re,mt),ke+=Y,this._shouldHandleEllipsis(ke)){this._tryToAddEllipsisToLastLine();break}if(ge=o(ge).slice(Be).join("").trimLeft(),ge.length>0&&(Re=this._getTextWidth(ge),Re<=Ae)){this._addTextLine(ge),ke+=Y,re=Math.max(re,Re);break}}else break}else this._addTextLine(ge),ke+=Y,re=Math.max(re,Re),this._shouldHandleEllipsis(ke)&&Ne<Te-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),ce&&ke+Y>Ce)break}this.textHeight=Q,this.textWidth=re}_shouldHandleEllipsis(q){const Q=+this.fontSize(),re=this.lineHeight()*Q,Y=this.attrs.height,ee=Y!==l&&Y!==void 0,ae=this.padding(),ue=Y-ae*2;return!(this.wrap()!==C)||ee&&q+re>ue}_tryToAddEllipsisToLastLine(){const q=this.attrs.width,Q=q!==l&&q!==void 0,re=this.padding(),Y=q-re*2,ee=this.ellipsis(),ae=this.textArr[this.textArr.length-1];!ae||!ee||(Q&&(this._getTextWidth(ae.text+L)<Y||(ae.text=ae.text.slice(0,ae.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(ae.text+L))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const q=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,Q=this.hasShadow();return q&&Q?!0:super._useBufferCanvas()}}return sh.Text=D,D.prototype._fillFunc=V,D.prototype._strokeFunc=X,D.prototype.className=S,D.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,a._registerNode)(D),t.Factory.overWriteSetter(D,"width",(0,i.getNumberOrAutoValidator)()),t.Factory.overWriteSetter(D,"height",(0,i.getNumberOrAutoValidator)()),t.Factory.addGetterSetter(D,"direction",d),t.Factory.addGetterSetter(D,"fontFamily","Arial"),t.Factory.addGetterSetter(D,"fontSize",12,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(D,"fontStyle",E),t.Factory.addGetterSetter(D,"fontVariant",E),t.Factory.addGetterSetter(D,"padding",0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(D,"align",b),t.Factory.addGetterSetter(D,"verticalAlign",x),t.Factory.addGetterSetter(D,"lineHeight",1,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(D,"wrap",M),t.Factory.addGetterSetter(D,"ellipsis",!1,(0,i.getBooleanValidator)()),t.Factory.addGetterSetter(D,"letterSpacing",0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(D,"text","",(0,i.getStringValidator)()),t.Factory.addGetterSetter(D,"textDecoration",""),sh}var cd={},Vy;function T9(){if(Vy)return cd;Vy=1,Object.defineProperty(cd,"__esModule",{value:!0}),cd.TextPath=void 0;const e=Ni(),t=kr(),r=ja(),n=jv(),i=mw(),a=Tr(),o=br(),l="",u="normal";function d(p){p.fillText(this.partialText,0,0)}function h(p){p.strokeText(this.partialText,0,0)}let v=class extends r.Shape{constructor(f){super(f),this.dummyCanvas=e.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return n.Path.getPathLength(this.dataArray)}_getPointAtLength(f){if(!this.attrs.data)return null;const b=this.pathLength;return f-1>b?null:n.Path.getPointAtLengthOfDataArray(f,this.dataArray)}_readDataAttribute(){this.dataArray=n.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(f){f.setAttr("font",this._getContextFont()),f.setAttr("textBaseline",this.textBaseline()),f.setAttr("textAlign","left"),f.save();const b=this.textDecoration(),_=this.fill(),S=this.fontSize(),x=this.glyphInfo;b==="underline"&&f.beginPath();for(let m=0;m<x.length;m++){f.save();const w=x[m].p0;f.translate(w.x,w.y),f.rotate(x[m].rotation),this.partialText=x[m].text,f.fillStrokeShape(this),b==="underline"&&(m===0&&f.moveTo(0,S/2+1),f.lineTo(S,S/2+1)),f.restore()}b==="underline"&&(f.strokeStyle=_,f.lineWidth=S/20,f.stroke()),f.restore()}_hitFunc(f){f.beginPath();const b=this.glyphInfo;if(b.length>=1){const _=b[0].p0;f.moveTo(_.x,_.y)}for(let _=0;_<b.length;_++){const S=b[_].p1;f.lineTo(S.x,S.y)}f.setAttr("lineWidth",this.fontSize()),f.setAttr("strokeStyle",this.colorKey),f.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(f){return i.Text.prototype.setText.call(this,f)}_getContextFont(){return i.Text.prototype._getContextFont.call(this)}_getTextSize(f){const _=this.dummyCanvas.getContext("2d");_.save(),_.font=this._getContextFont();const S=_.measureText(f);return _.restore(),{width:S.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:f,height:b}=this._getTextSize(this.attrs.text);if(this.textWidth=f,this.textHeight=b,this.glyphInfo=[],!this.attrs.data)return null;const _=this.letterSpacing(),S=this.align(),x=this.kerningFunc(),m=Math.max(this.textWidth+((this.attrs.text||"").length-1)*_,0);let w=0;S==="center"&&(w=Math.max(0,this.pathLength/2-m/2)),S==="right"&&(w=Math.max(0,this.pathLength-m));const E=(0,i.stringToArray)(this.text());let P=w;for(let R=0;R<E.length;R++){const k=this._getPointAtLength(P);if(!k)return;let N=this._getTextSize(E[R]).width+_;if(E[R]===" "&&S==="justify"){const G=this.text().split(" ").length-1;N+=(this.pathLength-m)/G}const M=this._getPointAtLength(P+N);if(!M)return;const T=n.Path.getLineLength(k.x,k.y,M.x,M.y);let C=0;if(x)try{C=x(E[R-1],E[R])*this.fontSize()}catch{C=0}k.x+=C,M.x+=C,this.textWidth+=C;const L=n.Path.getPointOnLine(C+T/2,k.x,k.y,M.x,M.y),H=Math.atan2(M.y-k.y,M.x-k.x);this.glyphInfo.push({transposeX:L.x,transposeY:L.y,text:E[R],rotation:H,p0:k,p1:M}),P+=N}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const f=[];this.glyphInfo.forEach(function(P){f.push(P.p0.x),f.push(P.p0.y),f.push(P.p1.x),f.push(P.p1.y)});let b=f[0]||0,_=f[0]||0,S=f[1]||0,x=f[1]||0,m,w;for(let P=0;P<f.length/2;P++)m=f[P*2],w=f[P*2+1],b=Math.min(b,m),_=Math.max(_,m),S=Math.min(S,w),x=Math.max(x,w);const E=this.fontSize();return{x:b-E/2,y:S-E/2,width:_-b+E,height:x-S+E}}destroy(){return e.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};return cd.TextPath=v,v.prototype._fillFunc=d,v.prototype._strokeFunc=h,v.prototype._fillFuncHit=d,v.prototype._strokeFuncHit=h,v.prototype.className="TextPath",v.prototype._attrsAffectingSize=["text","fontSize","data"],(0,o._registerNode)(v),t.Factory.addGetterSetter(v,"data"),t.Factory.addGetterSetter(v,"fontFamily","Arial"),t.Factory.addGetterSetter(v,"fontSize",12,(0,a.getNumberValidator)()),t.Factory.addGetterSetter(v,"fontStyle",u),t.Factory.addGetterSetter(v,"align","left"),t.Factory.addGetterSetter(v,"letterSpacing",0,(0,a.getNumberValidator)()),t.Factory.addGetterSetter(v,"textBaseline","middle"),t.Factory.addGetterSetter(v,"fontVariant",u),t.Factory.addGetterSetter(v,"text",l),t.Factory.addGetterSetter(v,"textDecoration",""),t.Factory.addGetterSetter(v,"kerningFunc",void 0),cd}var fd={},Gy;function R9(){if(Gy)return fd;Gy=1,Object.defineProperty(fd,"__esModule",{value:!0}),fd.Transformer=void 0;const e=Ni(),t=kr(),r=Qi(),n=ja(),i=vw(),a=Mv(),o=br(),l=Tr(),u=br(),d="tr-konva",h=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(N=>N+`.${d}`).join(" "),v="nodesRect",p=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],f={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},b="ontouchstart"in o.Konva._global;function _(N,M,T){if(N==="rotater")return T;M+=e.Util.degToRad(f[N]||0);const C=(e.Util.radToDeg(M)%360+360)%360;return e.Util._inRange(C,315+22.5,360)||e.Util._inRange(C,0,22.5)?"ns-resize":e.Util._inRange(C,45-22.5,45+22.5)?"nesw-resize":e.Util._inRange(C,90-22.5,90+22.5)?"ew-resize":e.Util._inRange(C,135-22.5,135+22.5)?"nwse-resize":e.Util._inRange(C,180-22.5,180+22.5)?"ns-resize":e.Util._inRange(C,225-22.5,225+22.5)?"nesw-resize":e.Util._inRange(C,270-22.5,270+22.5)?"ew-resize":e.Util._inRange(C,315-22.5,315+22.5)?"nwse-resize":(e.Util.error("Transformer has unknown angle for cursor detection: "+C),"pointer")}const S=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function x(N){return{x:N.x+N.width/2*Math.cos(N.rotation)+N.height/2*Math.sin(-N.rotation),y:N.y+N.height/2*Math.cos(N.rotation)+N.width/2*Math.sin(N.rotation)}}function m(N,M,T){const C=T.x+(N.x-T.x)*Math.cos(M)-(N.y-T.y)*Math.sin(M),L=T.y+(N.x-T.x)*Math.sin(M)+(N.y-T.y)*Math.cos(M);return{...N,rotation:N.rotation+M,x:C,y:L}}function w(N,M){const T=x(N);return m(N,M,T)}function E(N,M,T){let C=M;for(let L=0;L<N.length;L++){const H=o.Konva.getAngle(N[L]),G=Math.abs(H-M)%(Math.PI*2);Math.min(G,Math.PI*2-G)<T&&(C=H)}return C}let P=0;class R extends a.Group{constructor(M){super(M),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(h,this.update),this.getNode()&&this.update()}attachTo(M){return this.setNode(M),this}setNode(M){return e.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([M])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return d+this._id}setNodes(M=[]){this._nodes&&this._nodes.length&&this.detach();const T=M.filter(L=>L.isAncestorOf(this)?(e.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=M=T,M.length===1&&this.useSingleNodeRotation()?this.rotation(M[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(L=>{const H=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(L._attrsAffectingSize.length){const G=L._attrsAffectingSize.map(J=>J+"Change."+this._getEventNamespace()).join(" ");L.on(G,H)}L.on(p.map(G=>G+`.${this._getEventNamespace()}`).join(" "),H),L.on(`absoluteTransformChange.${this._getEventNamespace()}`,H),this._proxyDrag(L)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(M){let T;M.on(`dragstart.${this._getEventNamespace()}`,C=>{T=M.getAbsolutePosition(),!this.isDragging()&&M!==this.findOne(".back")&&this.startDrag(C,!1)}),M.on(`dragmove.${this._getEventNamespace()}`,C=>{if(!T)return;const L=M.getAbsolutePosition(),H=L.x-T.x,G=L.y-T.y;this.nodes().forEach(J=>{if(J===M||J.isDragging())return;const se=J.getAbsolutePosition();J.setAbsolutePosition({x:se.x+H,y:se.y+G}),J.startDrag(C)}),T=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(M=>{M.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(v),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(v,this.__getNodeRect)}__getNodeShape(M,T=this.rotation(),C){const L=M.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),H=M.getAbsoluteScale(C),G=M.getAbsolutePosition(C),J=L.x*H.x-M.offsetX()*H.x,se=L.y*H.y-M.offsetY()*H.y,U=(o.Konva.getAngle(M.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),V={x:G.x+J*Math.cos(U)+se*Math.sin(-U),y:G.y+se*Math.cos(U)+J*Math.sin(U),width:L.width*H.x,height:L.height*H.y,rotation:U};return m(V,-o.Konva.getAngle(T),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const T=[];this.nodes().map(U=>{const V=U.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),X=[{x:V.x,y:V.y},{x:V.x+V.width,y:V.y},{x:V.x+V.width,y:V.y+V.height},{x:V.x,y:V.y+V.height}],z=U.getAbsoluteTransform();X.forEach(function(D){const F=z.point(D);T.push(F)})});const C=new e.Transform;C.rotate(-o.Konva.getAngle(this.rotation()));let L=1/0,H=1/0,G=-1/0,J=-1/0;T.forEach(function(U){const V=C.point(U);L===void 0&&(L=G=V.x,H=J=V.y),L=Math.min(L,V.x),H=Math.min(H,V.y),G=Math.max(G,V.x),J=Math.max(J,V.y)}),C.invert();const se=C.point({x:L,y:H});return{x:se.x,y:se.y,width:G-L,height:J-H,rotation:o.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),S.forEach(M=>{this._createAnchor(M)}),this._createAnchor("rotater")}_createAnchor(M){const T=new i.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:M+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:b?10:"auto"}),C=this;T.on("mousedown touchstart",function(L){C._handleMouseDown(L)}),T.on("dragstart",L=>{T.stopDrag(),L.cancelBubble=!0}),T.on("dragend",L=>{L.cancelBubble=!0}),T.on("mouseenter",()=>{const L=o.Konva.getAngle(this.rotation()),H=this.rotateAnchorCursor(),G=_(M,L,H);T.getStage().content&&(T.getStage().content.style.cursor=G),this._cursorChange=!0}),T.on("mouseout",()=>{T.getStage().content&&(T.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(T)}_createBack(){const M=new n.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(T,C){const L=C.getParent(),H=L.padding();T.beginPath(),T.rect(-H,-H,C.width()+H*2,C.height()+H*2),T.moveTo(C.width()/2,-H),L.rotateEnabled()&&L.rotateLineVisible()&&T.lineTo(C.width()/2,-L.rotateAnchorOffset()*e.Util._sign(C.height())-H),T.fillStrokeShape(C)},hitFunc:(T,C)=>{if(!this.shouldOverdrawWholeArea())return;const L=this.padding();T.beginPath(),T.rect(-L,-L,C.width()+L*2,C.height()+L*2),T.fillStrokeShape(C)}});this.add(M),this._proxyDrag(M),M.on("dragstart",T=>{T.cancelBubble=!0}),M.on("dragmove",T=>{T.cancelBubble=!0}),M.on("dragend",T=>{T.cancelBubble=!0}),this.on("dragmove",T=>{this.update()})}_handleMouseDown(M){if(this._transforming)return;this._movingAnchorName=M.target.name().split(" ")[0];const T=this._getNodeRect(),C=T.width,L=T.height,H=Math.sqrt(Math.pow(C,2)+Math.pow(L,2));this.sin=Math.abs(L/H),this.cos=Math.abs(C/H),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 G=M.target.getAbsolutePosition(),J=M.target.getStage().getPointerPosition();this._anchorDragOffset={x:J.x-G.x,y:J.y-G.y},P++,this._fire("transformstart",{evt:M.evt,target:this.getNode()}),this._nodes.forEach(se=>{se._fire("transformstart",{evt:M.evt,target:se})})}_handleMouseMove(M){let T,C,L;const H=this.findOne("."+this._movingAnchorName),G=H.getStage();G.setPointersPositions(M);const J=G.getPointerPosition();let se={x:J.x-this._anchorDragOffset.x,y:J.y-this._anchorDragOffset.y};const U=H.getAbsolutePosition();this.anchorDragBoundFunc()&&(se=this.anchorDragBoundFunc()(U,se,M)),H.setAbsolutePosition(se);const V=H.getAbsolutePosition();if(U.x===V.x&&U.y===V.y)return;if(this._movingAnchorName==="rotater"){const Y=this._getNodeRect();T=H.x()-Y.width/2,C=-H.y()+Y.height/2;let ee=Math.atan2(-C,T)+Math.PI/2;Y.height<0&&(ee-=Math.PI);const ue=o.Konva.getAngle(this.rotation())+ee,ce=o.Konva.getAngle(this.rotationSnapTolerance()),Ae=E(this.rotationSnaps(),ue,ce)-Y.rotation,Ce=w(Y,Ae);this._fitNodesInto(Ce,M);return}const X=this.shiftBehavior();let z;X==="inverted"?z=this.keepRatio()&&!M.shiftKey:X==="none"?z=this.keepRatio():z=this.keepRatio()||M.shiftKey;let D=this.centeredScaling()||M.altKey;if(this._movingAnchorName==="top-left"){if(z){const Y=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};L=Math.sqrt(Math.pow(Y.x-H.x(),2)+Math.pow(Y.y-H.y(),2));const ee=this.findOne(".top-left").x()>Y.x?-1:1,ae=this.findOne(".top-left").y()>Y.y?-1:1;T=L*this.cos*ee,C=L*this.sin*ae,this.findOne(".top-left").x(Y.x-T),this.findOne(".top-left").y(Y.y-C)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(H.y());else if(this._movingAnchorName==="top-right"){if(z){const Y=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};L=Math.sqrt(Math.pow(H.x()-Y.x,2)+Math.pow(Y.y-H.y(),2));const ee=this.findOne(".top-right").x()<Y.x?-1:1,ae=this.findOne(".top-right").y()>Y.y?-1:1;T=L*this.cos*ee,C=L*this.sin*ae,this.findOne(".top-right").x(Y.x+T),this.findOne(".top-right").y(Y.y-C)}var F=H.position();this.findOne(".top-left").y(F.y),this.findOne(".bottom-right").x(F.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(H.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(H.x());else if(this._movingAnchorName==="bottom-left"){if(z){const Y=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};L=Math.sqrt(Math.pow(Y.x-H.x(),2)+Math.pow(H.y()-Y.y,2));const ee=Y.x<H.x()?-1:1,ae=H.y()<Y.y?-1:1;T=L*this.cos*ee,C=L*this.sin*ae,H.x(Y.x-T),H.y(Y.y+C)}F=H.position(),this.findOne(".top-left").x(F.x),this.findOne(".bottom-right").y(F.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(H.y());else if(this._movingAnchorName==="bottom-right"){if(z){const Y=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};L=Math.sqrt(Math.pow(H.x()-Y.x,2)+Math.pow(H.y()-Y.y,2));const ee=this.findOne(".bottom-right").x()<Y.x?-1:1,ae=this.findOne(".bottom-right").y()<Y.y?-1:1;T=L*this.cos*ee,C=L*this.sin*ae,this.findOne(".bottom-right").x(Y.x+T),this.findOne(".bottom-right").y(Y.y+C)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(D=this.centeredScaling()||M.altKey,D){const Y=this.findOne(".top-left"),ee=this.findOne(".bottom-right"),ae=Y.x(),ue=Y.y(),ce=this.getWidth()-ee.x(),pe=this.getHeight()-ee.y();ee.move({x:-ae,y:-ue}),Y.move({x:ce,y:pe})}const q=this.findOne(".top-left").getAbsolutePosition();T=q.x,C=q.y;const Q=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),re=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:T,y:C,width:Q,height:re,rotation:o.Konva.getAngle(this.rotation())},M)}_handleMouseUp(M){this._removeEvents(M)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(M){var T;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const C=this.getNode();P--,this._fire("transformend",{evt:M,target:C}),(T=this.getLayer())===null||T===void 0||T.batchDraw(),C&&this._nodes.forEach(L=>{var H;L._fire("transformend",{evt:M,target:L}),(H=L.getLayer())===null||H===void 0||H.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(M,T){const C=this._getNodeRect(),L=1;if(e.Util._inRange(M.width,-this.padding()*2-L,L)){this.update();return}if(e.Util._inRange(M.height,-this.padding()*2-L,L)){this.update();return}const H=new e.Transform;if(H.rotate(o.Konva.getAngle(this.rotation())),this._movingAnchorName&&M.width<0&&this._movingAnchorName.indexOf("left")>=0){const z=H.point({x:-this.padding()*2,y:0});M.x+=z.x,M.y+=z.y,M.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=z.x,this._anchorDragOffset.y-=z.y}else if(this._movingAnchorName&&M.width<0&&this._movingAnchorName.indexOf("right")>=0){const z=H.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=z.x,this._anchorDragOffset.y-=z.y,M.width+=this.padding()*2}if(this._movingAnchorName&&M.height<0&&this._movingAnchorName.indexOf("top")>=0){const z=H.point({x:0,y:-this.padding()*2});M.x+=z.x,M.y+=z.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=z.x,this._anchorDragOffset.y-=z.y,M.height+=this.padding()*2}else if(this._movingAnchorName&&M.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const z=H.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=z.x,this._anchorDragOffset.y-=z.y,M.height+=this.padding()*2}if(this.boundBoxFunc()){const z=this.boundBoxFunc()(C,M);z?M=z:e.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const G=1e7,J=new e.Transform;J.translate(C.x,C.y),J.rotate(C.rotation),J.scale(C.width/G,C.height/G);const se=new e.Transform,U=M.width/G,V=M.height/G;this.flipEnabled()===!1?(se.translate(M.x,M.y),se.rotate(M.rotation),se.translate(M.width<0?M.width:0,M.height<0?M.height:0),se.scale(Math.abs(U),Math.abs(V))):(se.translate(M.x,M.y),se.rotate(M.rotation),se.scale(U,V));const X=se.multiply(J.invert());this._nodes.forEach(z=>{var D;const F=z.getParent().getAbsoluteTransform(),q=z.getTransform().copy();q.translate(z.offsetX(),z.offsetY());const Q=new e.Transform;Q.multiply(F.copy().invert()).multiply(X).multiply(F).multiply(q);const re=Q.decompose();z.setAttrs(re),(D=z.getLayer())===null||D===void 0||D.batchDraw()}),this.rotation(e.Util._getRotation(M.rotation)),this._nodes.forEach(z=>{this._fire("transform",{evt:T,target:z}),z._fire("transform",{evt:T,target:z})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(M,T){this.findOne(M).setAttrs(T)}update(){var M;const T=this._getNodeRect();this.rotation(e.Util._getRotation(T.rotation));const C=T.width,L=T.height,H=this.enabledAnchors(),G=this.resizeEnabled(),J=this.padding(),se=this.anchorSize(),U=this.find("._anchor");U.forEach(X=>{X.setAttrs({width:se,height:se,offsetX:se/2,offsetY:se/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:se/2+J,offsetY:se/2+J,visible:G&&H.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:C/2,y:0,offsetY:se/2+J,visible:G&&H.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:C,y:0,offsetX:se/2-J,offsetY:se/2+J,visible:G&&H.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:L/2,offsetX:se/2+J,visible:G&&H.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:C,y:L/2,offsetX:se/2-J,visible:G&&H.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:L,offsetX:se/2+J,offsetY:se/2-J,visible:G&&H.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:C/2,y:L,offsetY:se/2-J,visible:G&&H.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:C,y:L,offsetX:se/2-J,offsetY:se/2-J,visible:G&&H.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:C/2,y:-this.rotateAnchorOffset()*e.Util._sign(L)-J,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:C,height:L,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const V=this.anchorStyleFunc();V&&U.forEach(X=>{V(X)}),(M=this.getLayer())===null||M===void 0||M.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const M=this.findOne("."+this._movingAnchorName);M&&M.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),a.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return r.Node.prototype.toObject.call(this)}clone(M){return r.Node.prototype.clone.call(this,M)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}fd.Transformer=R,R.isTransforming=()=>P>0;function k(N){return N instanceof Array||e.Util.warn("enabledAnchors value should be an array"),N instanceof Array&&N.forEach(function(M){S.indexOf(M)===-1&&e.Util.warn("Unknown anchor name: "+M+". Available names are: "+S.join(", "))}),N||[]}return R.prototype.className="Transformer",(0,u._registerNode)(R),t.Factory.addGetterSetter(R,"enabledAnchors",S,k),t.Factory.addGetterSetter(R,"flipEnabled",!0,(0,l.getBooleanValidator)()),t.Factory.addGetterSetter(R,"resizeEnabled",!0),t.Factory.addGetterSetter(R,"anchorSize",10,(0,l.getNumberValidator)()),t.Factory.addGetterSetter(R,"rotateEnabled",!0),t.Factory.addGetterSetter(R,"rotateLineVisible",!0),t.Factory.addGetterSetter(R,"rotationSnaps",[]),t.Factory.addGetterSetter(R,"rotateAnchorOffset",50,(0,l.getNumberValidator)()),t.Factory.addGetterSetter(R,"rotateAnchorCursor","crosshair"),t.Factory.addGetterSetter(R,"rotationSnapTolerance",5,(0,l.getNumberValidator)()),t.Factory.addGetterSetter(R,"borderEnabled",!0),t.Factory.addGetterSetter(R,"anchorStroke","rgb(0, 161, 255)"),t.Factory.addGetterSetter(R,"anchorStrokeWidth",1,(0,l.getNumberValidator)()),t.Factory.addGetterSetter(R,"anchorFill","white"),t.Factory.addGetterSetter(R,"anchorCornerRadius",0,(0,l.getNumberValidator)()),t.Factory.addGetterSetter(R,"borderStroke","rgb(0, 161, 255)"),t.Factory.addGetterSetter(R,"borderStrokeWidth",1,(0,l.getNumberValidator)()),t.Factory.addGetterSetter(R,"borderDash"),t.Factory.addGetterSetter(R,"keepRatio",!0),t.Factory.addGetterSetter(R,"shiftBehavior","default"),t.Factory.addGetterSetter(R,"centeredScaling",!1),t.Factory.addGetterSetter(R,"ignoreStroke",!1),t.Factory.addGetterSetter(R,"padding",0,(0,l.getNumberValidator)()),t.Factory.addGetterSetter(R,"nodes"),t.Factory.addGetterSetter(R,"node"),t.Factory.addGetterSetter(R,"boundBoxFunc"),t.Factory.addGetterSetter(R,"anchorDragBoundFunc"),t.Factory.addGetterSetter(R,"anchorStyleFunc"),t.Factory.addGetterSetter(R,"shouldOverdrawWholeArea",!1),t.Factory.addGetterSetter(R,"useSingleNodeRotation",!0),t.Factory.backCompat(R,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"}),fd}var hd={},$y;function M9(){if($y)return hd;$y=1,Object.defineProperty(hd,"__esModule",{value:!0}),hd.Wedge=void 0;const e=kr(),t=ja(),r=br(),n=Tr(),i=br();let a=class extends t.Shape{_sceneFunc(l){l.beginPath(),l.arc(0,0,this.radius(),0,r.Konva.getAngle(this.angle()),this.clockwise()),l.lineTo(0,0),l.closePath(),l.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(l){this.radius(l/2)}setHeight(l){this.radius(l/2)}};return hd.Wedge=a,a.prototype.className="Wedge",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radius"],(0,i._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(a,"angle",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(a,"clockwise",!1),e.Factory.backCompat(a,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"}),hd}var dd={},Wy;function I9(){if(Wy)return dd;Wy=1,Object.defineProperty(dd,"__esModule",{value:!0}),dd.Blur=void 0;const e=kr(),t=Qi(),r=Tr();function n(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const i=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],a=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function o(u,d){const h=u.data,v=u.width,p=u.height;let f,b,_,S,x,m,w,E,P,R,k,N,M,T,C,L,H,G,J,se;const U=d+d+1,V=v-1,X=p-1,z=d+1,D=z*(z+1)/2,F=new n,q=i[d],Q=a[d];let re=null,Y=F,ee=null,ae=null;for(let ue=1;ue<U;ue++)Y=Y.next=new n,ue===z&&(re=Y);Y.next=F,_=b=0;for(let ue=0;ue<p;ue++){N=M=T=C=S=x=m=w=0,E=z*(L=h[b]),P=z*(H=h[b+1]),R=z*(G=h[b+2]),k=z*(J=h[b+3]),S+=D*L,x+=D*H,m+=D*G,w+=D*J,Y=F;for(let ce=0;ce<z;ce++)Y.r=L,Y.g=H,Y.b=G,Y.a=J,Y=Y.next;for(let ce=1;ce<z;ce++)f=b+((V<ce?V:ce)<<2),S+=(Y.r=L=h[f])*(se=z-ce),x+=(Y.g=H=h[f+1])*se,m+=(Y.b=G=h[f+2])*se,w+=(Y.a=J=h[f+3])*se,N+=L,M+=H,T+=G,C+=J,Y=Y.next;ee=F,ae=re;for(let ce=0;ce<v;ce++)h[b+3]=J=w*q>>Q,J!==0?(J=255/J,h[b]=(S*q>>Q)*J,h[b+1]=(x*q>>Q)*J,h[b+2]=(m*q>>Q)*J):h[b]=h[b+1]=h[b+2]=0,S-=E,x-=P,m-=R,w-=k,E-=ee.r,P-=ee.g,R-=ee.b,k-=ee.a,f=_+((f=ce+d+1)<V?f:V)<<2,N+=ee.r=h[f],M+=ee.g=h[f+1],T+=ee.b=h[f+2],C+=ee.a=h[f+3],S+=N,x+=M,m+=T,w+=C,ee=ee.next,E+=L=ae.r,P+=H=ae.g,R+=G=ae.b,k+=J=ae.a,N-=L,M-=H,T-=G,C-=J,ae=ae.next,b+=4;_+=v}for(let ue=0;ue<v;ue++){M=T=C=N=x=m=w=S=0,b=ue<<2,E=z*(L=h[b]),P=z*(H=h[b+1]),R=z*(G=h[b+2]),k=z*(J=h[b+3]),S+=D*L,x+=D*H,m+=D*G,w+=D*J,Y=F;for(let pe=0;pe<z;pe++)Y.r=L,Y.g=H,Y.b=G,Y.a=J,Y=Y.next;let ce=v;for(let pe=1;pe<=d;pe++)b=ce+ue<<2,S+=(Y.r=L=h[b])*(se=z-pe),x+=(Y.g=H=h[b+1])*se,m+=(Y.b=G=h[b+2])*se,w+=(Y.a=J=h[b+3])*se,N+=L,M+=H,T+=G,C+=J,Y=Y.next,pe<X&&(ce+=v);b=ue,ee=F,ae=re;for(let pe=0;pe<p;pe++)f=b<<2,h[f+3]=J=w*q>>Q,J>0?(J=255/J,h[f]=(S*q>>Q)*J,h[f+1]=(x*q>>Q)*J,h[f+2]=(m*q>>Q)*J):h[f]=h[f+1]=h[f+2]=0,S-=E,x-=P,m-=R,w-=k,E-=ee.r,P-=ee.g,R-=ee.b,k-=ee.a,f=ue+((f=pe+z)<X?f:X)*v<<2,S+=N+=ee.r=h[f],x+=M+=ee.g=h[f+1],m+=T+=ee.b=h[f+2],w+=C+=ee.a=h[f+3],ee=ee.next,E+=L=ae.r,P+=H=ae.g,R+=G=ae.b,k+=J=ae.a,N-=L,M-=H,T-=G,C-=J,ae=ae.next,b+=v}}const l=function(d){const h=Math.round(this.blurRadius());h>0&&o(d,h)};return dd.Blur=l,e.Factory.addGetterSetter(t.Node,"blurRadius",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),dd}var pd={},Yy;function j9(){if(Yy)return pd;Yy=1,Object.defineProperty(pd,"__esModule",{value:!0}),pd.Brighten=void 0;const e=kr(),t=Qi(),r=Tr(),n=function(i){const a=this.brightness()*255,o=i.data,l=o.length;for(let u=0;u<l;u+=4)o[u]+=a,o[u+1]+=a,o[u+2]+=a};return pd.Brighten=n,e.Factory.addGetterSetter(t.Node,"brightness",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),pd}var gd={},Xy;function F9(){if(Xy)return gd;Xy=1,Object.defineProperty(gd,"__esModule",{value:!0}),gd.Contrast=void 0;const e=kr(),t=Qi(),r=Tr(),n=function(i){const a=Math.pow((this.contrast()+100)/100,2),o=i.data,l=o.length;let u=150,d=150,h=150;for(let v=0;v<l;v+=4)u=o[v],d=o[v+1],h=o[v+2],u/=255,u-=.5,u*=a,u+=.5,u*=255,d/=255,d-=.5,d*=a,d+=.5,d*=255,h/=255,h-=.5,h*=a,h+=.5,h*=255,u=u<0?0:u>255?255:u,d=d<0?0:d>255?255:d,h=h<0?0:h>255?255:h,o[v]=u,o[v+1]=d,o[v+2]=h};return gd.Contrast=n,e.Factory.addGetterSetter(t.Node,"contrast",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),gd}var vd={},Ky;function D9(){if(Ky)return vd;Ky=1,Object.defineProperty(vd,"__esModule",{value:!0}),vd.Emboss=void 0;const e=kr(),t=Qi(),r=Ni(),n=Tr(),i=function(a){const o=this.embossStrength()*10,l=this.embossWhiteLevel()*255,u=this.embossDirection(),d=this.embossBlend(),h=a.data,v=a.width,p=a.height,f=v*4;let b=0,_=0,S=p;switch(u){case"top-left":b=-1,_=-1;break;case"top":b=-1,_=0;break;case"top-right":b=-1,_=1;break;case"right":b=0,_=1;break;case"bottom-right":b=1,_=1;break;case"bottom":b=1,_=0;break;case"bottom-left":b=1,_=-1;break;case"left":b=0,_=-1;break;default:r.Util.error("Unknown emboss direction: "+u)}do{const x=(S-1)*f;let m=b;S+m<1&&(m=0),S+m>p&&(m=0);const w=(S-1+m)*v*4;let E=v;do{const P=x+(E-1)*4;let R=_;E+R<1&&(R=0),E+R>v&&(R=0);const k=w+(E-1+R)*4,N=h[P]-h[k],M=h[P+1]-h[k+1],T=h[P+2]-h[k+2];let C=N;const L=C>0?C:-C,H=M>0?M:-M,G=T>0?T:-T;if(H>L&&(C=M),G>L&&(C=T),C*=o,d){const J=h[P]+C,se=h[P+1]+C,U=h[P+2]+C;h[P]=J>255?255:J<0?0:J,h[P+1]=se>255?255:se<0?0:se,h[P+2]=U>255?255:U<0?0:U}else{let J=l-C;J<0?J=0:J>255&&(J=255),h[P]=h[P+1]=h[P+2]=J}}while(--E)}while(--S)};return vd.Emboss=i,e.Factory.addGetterSetter(t.Node,"embossStrength",.5,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"embossWhiteLevel",.5,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"embossDirection","top-left",void 0,e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"embossBlend",!1,void 0,e.Factory.afterSetFilter),vd}var md={},Zy;function B9(){if(Zy)return md;Zy=1,Object.defineProperty(md,"__esModule",{value:!0}),md.Enhance=void 0;const e=kr(),t=Qi(),r=Tr();function n(a,o,l,u,d){const h=l-o,v=d-u;if(h===0)return u+v/2;if(v===0)return u;let p=(a-o)/h;return p=v*p+u,p}const i=function(a){const o=a.data,l=o.length;let u=o[0],d=u,h,v=o[1],p=v,f,b=o[2],_=b,S;const x=this.enhance();if(x===0)return;for(let N=0;N<l;N+=4)h=o[N+0],h<u?u=h:h>d&&(d=h),f=o[N+1],f<v?v=f:f>p&&(p=f),S=o[N+2],S<b?b=S:S>_&&(_=S);d===u&&(d=255,u=0),p===v&&(p=255,v=0),_===b&&(_=255,b=0);let m,w,E,P,R,k;if(x>0)m=d+x*(255-d),w=u-x*(u-0),E=p+x*(255-p),P=v-x*(v-0),R=_+x*(255-_),k=b-x*(b-0);else{const N=(d+u)*.5;m=d+x*(d-N),w=u+x*(u-N);const M=(p+v)*.5;E=p+x*(p-M),P=v+x*(v-M);const T=(_+b)*.5;R=_+x*(_-T),k=b+x*(b-T)}for(let N=0;N<l;N+=4)o[N+0]=n(o[N+0],u,d,w,m),o[N+1]=n(o[N+1],v,p,P,E),o[N+2]=n(o[N+2],b,_,k,R)};return md.Enhance=i,e.Factory.addGetterSetter(t.Node,"enhance",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),md}var yd={},Qy;function z9(){if(Qy)return yd;Qy=1,Object.defineProperty(yd,"__esModule",{value:!0}),yd.Grayscale=void 0;const e=function(t){const r=t.data,n=r.length;for(let i=0;i<n;i+=4){const a=.34*r[i]+.5*r[i+1]+.16*r[i+2];r[i]=a,r[i+1]=a,r[i+2]=a}};return yd.Grayscale=e,yd}var bd={},Jy;function q9(){if(Jy)return bd;Jy=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.HSL=void 0;const e=kr(),t=Qi(),r=Tr();e.Factory.addGetterSetter(t.Node,"hue",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"saturation",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"luminance",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter);const n=function(i){const a=i.data,o=a.length,l=1,u=Math.pow(2,this.saturation()),d=Math.abs(this.hue()+360)%360,h=this.luminance()*127,v=l*u*Math.cos(d*Math.PI/180),p=l*u*Math.sin(d*Math.PI/180),f=.299*l+.701*v+.167*p,b=.587*l-.587*v+.33*p,_=.114*l-.114*v-.497*p,S=.299*l-.299*v-.328*p,x=.587*l+.413*v+.035*p,m=.114*l-.114*v+.293*p,w=.299*l-.3*v+1.25*p,E=.587*l-.586*v-1.05*p,P=.114*l+.886*v-.2*p;let R,k,N,M;for(let T=0;T<o;T+=4)R=a[T+0],k=a[T+1],N=a[T+2],M=a[T+3],a[T+0]=f*R+b*k+_*N+h,a[T+1]=S*R+x*k+m*N+h,a[T+2]=w*R+E*k+P*N+h,a[T+3]=M};return bd.HSL=n,bd}var wd={},e5;function U9(){if(e5)return wd;e5=1,Object.defineProperty(wd,"__esModule",{value:!0}),wd.HSV=void 0;const e=kr(),t=Qi(),r=Tr(),n=function(i){const a=i.data,o=a.length,l=Math.pow(2,this.value()),u=Math.pow(2,this.saturation()),d=Math.abs(this.hue()+360)%360,h=l*u*Math.cos(d*Math.PI/180),v=l*u*Math.sin(d*Math.PI/180),p=.299*l+.701*h+.167*v,f=.587*l-.587*h+.33*v,b=.114*l-.114*h-.497*v,_=.299*l-.299*h-.328*v,S=.587*l+.413*h+.035*v,x=.114*l-.114*h+.293*v,m=.299*l-.3*h+1.25*v,w=.587*l-.586*h-1.05*v,E=.114*l+.886*h-.2*v;for(let P=0;P<o;P+=4){const R=a[P+0],k=a[P+1],N=a[P+2],M=a[P+3];a[P+0]=p*R+f*k+b*N,a[P+1]=_*R+S*k+x*N,a[P+2]=m*R+w*k+E*N,a[P+3]=M}};return wd.HSV=n,e.Factory.addGetterSetter(t.Node,"hue",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"saturation",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"value",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),wd}var _d={},t5;function H9(){if(t5)return _d;t5=1,Object.defineProperty(_d,"__esModule",{value:!0}),_d.Invert=void 0;const e=function(t){const r=t.data,n=r.length;for(let i=0;i<n;i+=4)r[i]=255-r[i],r[i+1]=255-r[i+1],r[i+2]=255-r[i+2]};return _d.Invert=e,_d}var xd={},r5;function V9(){if(r5)return xd;r5=1,Object.defineProperty(xd,"__esModule",{value:!0}),xd.Kaleidoscope=void 0;const e=kr(),t=Qi(),r=Ni(),n=Tr(),i=function(l,u,d){const h=l.data,v=u.data,p=l.width,f=l.height,b=d.polarCenterX||p/2,_=d.polarCenterY||f/2;let S=Math.sqrt(b*b+_*_),x=p-b,m=f-_;const w=Math.sqrt(x*x+m*m);S=w>S?w:S;const E=f,P=p,R=360/P*Math.PI/180;for(let k=0;k<P;k+=1){const N=Math.sin(k*R),M=Math.cos(k*R);for(let T=0;T<E;T+=1){x=Math.floor(b+S*T/E*M),m=Math.floor(_+S*T/E*N);let C=(m*p+x)*4;const L=h[C+0],H=h[C+1],G=h[C+2],J=h[C+3];C=(k+T*p)*4,v[C+0]=L,v[C+1]=H,v[C+2]=G,v[C+3]=J}}},a=function(l,u,d){const h=l.data,v=u.data,p=l.width,f=l.height,b=d.polarCenterX||p/2,_=d.polarCenterY||f/2;let S=Math.sqrt(b*b+_*_),x=p-b,m=f-_;const w=Math.sqrt(x*x+m*m);S=w>S?w:S;const E=f,P=p,R=0;let k,N;for(x=0;x<p;x+=1)for(m=0;m<f;m+=1){const M=x-b,T=m-_,C=Math.sqrt(M*M+T*T)*E/S;let L=(Math.atan2(T,M)*180/Math.PI+360+R)%360;L=L*P/360,k=Math.floor(L),N=Math.floor(C);let H=(N*p+k)*4;const G=h[H+0],J=h[H+1],se=h[H+2],U=h[H+3];H=(m*p+x)*4,v[H+0]=G,v[H+1]=J,v[H+2]=se,v[H+3]=U}},o=function(l){const u=l.width,d=l.height;let h,v,p,f,b,_,S,x,m,w,E=Math.round(this.kaleidoscopePower());const P=Math.round(this.kaleidoscopeAngle()),R=Math.floor(u*(P%360)/360);if(E<1)return;const k=r.Util.createCanvasElement();k.width=u,k.height=d;const N=k.getContext("2d").getImageData(0,0,u,d);r.Util.releaseCanvas(k),i(l,N,{polarCenterX:u/2,polarCenterY:d/2});let M=u/Math.pow(2,E);for(;M<=8;)M=M*2,E-=1;M=Math.ceil(M);let T=M,C=0,L=T,H=1;for(R+M>u&&(C=T,L=0,H=-1),v=0;v<d;v+=1)for(h=C;h!==L;h+=H)p=Math.round(h+R)%u,m=(u*v+p)*4,b=N.data[m+0],_=N.data[m+1],S=N.data[m+2],x=N.data[m+3],w=(u*v+h)*4,N.data[w+0]=b,N.data[w+1]=_,N.data[w+2]=S,N.data[w+3]=x;for(v=0;v<d;v+=1)for(T=Math.floor(M),f=0;f<E;f+=1){for(h=0;h<T+1;h+=1)m=(u*v+h)*4,b=N.data[m+0],_=N.data[m+1],S=N.data[m+2],x=N.data[m+3],w=(u*v+T*2-h-1)*4,N.data[w+0]=b,N.data[w+1]=_,N.data[w+2]=S,N.data[w+3]=x;T*=2}a(N,l,{})};return xd.Kaleidoscope=o,e.Factory.addGetterSetter(t.Node,"kaleidoscopePower",2,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"kaleidoscopeAngle",0,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),xd}var Sd={},n5;function G9(){if(n5)return Sd;n5=1,Object.defineProperty(Sd,"__esModule",{value:!0}),Sd.Mask=void 0;const e=kr(),t=Qi(),r=Tr();function n(p,f,b){let _=(b*p.width+f)*4;const S=[];return S.push(p.data[_++],p.data[_++],p.data[_++],p.data[_++]),S}function i(p,f){return Math.sqrt(Math.pow(p[0]-f[0],2)+Math.pow(p[1]-f[1],2)+Math.pow(p[2]-f[2],2))}function a(p){const f=[0,0,0];for(let b=0;b<p.length;b++)f[0]+=p[b][0],f[1]+=p[b][1],f[2]+=p[b][2];return f[0]/=p.length,f[1]/=p.length,f[2]/=p.length,f}function o(p,f){const b=n(p,0,0),_=n(p,p.width-1,0),S=n(p,0,p.height-1),x=n(p,p.width-1,p.height-1),m=f||10;if(i(b,_)<m&&i(_,x)<m&&i(x,S)<m&&i(S,b)<m){const w=a([_,b,x,S]),E=[];for(let P=0;P<p.width*p.height;P++){const R=i(w,[p.data[P*4],p.data[P*4+1],p.data[P*4+2]]);E[P]=R<m?0:255}return E}}function l(p,f){for(let b=0;b<p.width*p.height;b++)p.data[4*b+3]=f[b]}function u(p,f,b){const _=[1,1,1,1,0,1,1,1,1],S=Math.round(Math.sqrt(_.length)),x=Math.floor(S/2),m=[];for(let w=0;w<b;w++)for(let E=0;E<f;E++){const P=w*f+E;let R=0;for(let k=0;k<S;k++)for(let N=0;N<S;N++){const M=w+k-x,T=E+N-x;if(M>=0&&M<b&&T>=0&&T<f){const C=M*f+T,L=_[k*S+N];R+=p[C]*L}}m[P]=R===255*8?255:0}return m}function d(p,f,b){const _=[1,1,1,1,1,1,1,1,1],S=Math.round(Math.sqrt(_.length)),x=Math.floor(S/2),m=[];for(let w=0;w<b;w++)for(let E=0;E<f;E++){const P=w*f+E;let R=0;for(let k=0;k<S;k++)for(let N=0;N<S;N++){const M=w+k-x,T=E+N-x;if(M>=0&&M<b&&T>=0&&T<f){const C=M*f+T,L=_[k*S+N];R+=p[C]*L}}m[P]=R>=255*4?255:0}return m}function h(p,f,b){const _=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],S=Math.round(Math.sqrt(_.length)),x=Math.floor(S/2),m=[];for(let w=0;w<b;w++)for(let E=0;E<f;E++){const P=w*f+E;let R=0;for(let k=0;k<S;k++)for(let N=0;N<S;N++){const M=w+k-x,T=E+N-x;if(M>=0&&M<b&&T>=0&&T<f){const C=M*f+T,L=_[k*S+N];R+=p[C]*L}}m[P]=R}return m}const v=function(p){const f=this.threshold();let b=o(p,f);return b&&(b=u(b,p.width,p.height),b=d(b,p.width,p.height),b=h(b,p.width,p.height),l(p,b)),p};return Sd.Mask=v,e.Factory.addGetterSetter(t.Node,"threshold",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Sd}var Ed={},i5;function $9(){if(i5)return Ed;i5=1,Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.Noise=void 0;const e=kr(),t=Qi(),r=Tr(),n=function(i){const a=this.noise()*255,o=i.data,l=o.length,u=a/2;for(let d=0;d<l;d+=4)o[d+0]+=u-2*u*Math.random(),o[d+1]+=u-2*u*Math.random(),o[d+2]+=u-2*u*Math.random()};return Ed.Noise=n,e.Factory.addGetterSetter(t.Node,"noise",.2,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Ed}var Pd={},a5;function W9(){if(a5)return Pd;a5=1,Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.Pixelate=void 0;const e=kr(),t=Ni(),r=Qi(),n=Tr(),i=function(a){let o=Math.ceil(this.pixelSize()),l=a.width,u=a.height,d=Math.ceil(l/o),h=Math.ceil(u/o),v=a.data;if(o<=0){t.Util.error("pixelSize value can not be <= 0");return}for(let p=0;p<d;p+=1)for(let f=0;f<h;f+=1){let b=0,_=0,S=0,x=0;const m=p*o,w=m+o,E=f*o,P=E+o;let R=0;for(let k=m;k<w;k+=1)if(!(k>=l))for(let N=E;N<P;N+=1){if(N>=u)continue;const M=(l*N+k)*4;b+=v[M+0],_+=v[M+1],S+=v[M+2],x+=v[M+3],R+=1}b=b/R,_=_/R,S=S/R,x=x/R;for(let k=m;k<w;k+=1)if(!(k>=l))for(let N=E;N<P;N+=1){if(N>=u)continue;const M=(l*N+k)*4;v[M+0]=b,v[M+1]=_,v[M+2]=S,v[M+3]=x}}};return Pd.Pixelate=i,e.Factory.addGetterSetter(r.Node,"pixelSize",8,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),Pd}var Ad={},o5;function Y9(){if(o5)return Ad;o5=1,Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.Posterize=void 0;const e=kr(),t=Qi(),r=Tr(),n=function(i){const a=Math.round(this.levels()*254)+1,o=i.data,l=o.length,u=255/a;for(let d=0;d<l;d+=1)o[d]=Math.floor(o[d]/u)*u};return Ad.Posterize=n,e.Factory.addGetterSetter(t.Node,"levels",.5,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Ad}var Od={},s5;function X9(){if(s5)return Od;s5=1,Object.defineProperty(Od,"__esModule",{value:!0}),Od.RGB=void 0;const e=kr(),t=Qi(),r=Tr(),n=function(i){const a=i.data,o=a.length,l=this.red(),u=this.green(),d=this.blue();for(let h=0;h<o;h+=4){const v=(.34*a[h]+.5*a[h+1]+.16*a[h+2])/255;a[h]=v*l,a[h+1]=v*u,a[h+2]=v*d,a[h+3]=a[h+3]}};return Od.RGB=n,e.Factory.addGetterSetter(t.Node,"red",0,function(i){return this._filterUpToDate=!1,i>255?255:i<0?0:Math.round(i)}),e.Factory.addGetterSetter(t.Node,"green",0,function(i){return this._filterUpToDate=!1,i>255?255:i<0?0:Math.round(i)}),e.Factory.addGetterSetter(t.Node,"blue",0,r.RGBComponent,e.Factory.afterSetFilter),Od}var Cd={},l5;function K9(){if(l5)return Cd;l5=1,Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.RGBA=void 0;const e=kr(),t=Qi(),r=Tr(),n=function(i){const a=i.data,o=a.length,l=this.red(),u=this.green(),d=this.blue(),h=this.alpha();for(let v=0;v<o;v+=4){const p=1-h;a[v]=l*h+a[v]*p,a[v+1]=u*h+a[v+1]*p,a[v+2]=d*h+a[v+2]*p}};return Cd.RGBA=n,e.Factory.addGetterSetter(t.Node,"red",0,function(i){return this._filterUpToDate=!1,i>255?255:i<0?0:Math.round(i)}),e.Factory.addGetterSetter(t.Node,"green",0,function(i){return this._filterUpToDate=!1,i>255?255:i<0?0:Math.round(i)}),e.Factory.addGetterSetter(t.Node,"blue",0,r.RGBComponent,e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"alpha",1,function(i){return this._filterUpToDate=!1,i>1?1:i<0?0:i}),Cd}var kd={},u5;function Z9(){if(u5)return kd;u5=1,Object.defineProperty(kd,"__esModule",{value:!0}),kd.Sepia=void 0;const e=function(t){const r=t.data,n=r.length;for(let i=0;i<n;i+=4){const a=r[i+0],o=r[i+1],l=r[i+2];r[i+0]=Math.min(255,a*.393+o*.769+l*.189),r[i+1]=Math.min(255,a*.349+o*.686+l*.168),r[i+2]=Math.min(255,a*.272+o*.534+l*.131)}};return kd.Sepia=e,kd}var Nd={},c5;function Q9(){if(c5)return Nd;c5=1,Object.defineProperty(Nd,"__esModule",{value:!0}),Nd.Solarize=void 0;const e=function(t){const r=t.data,n=t.width,i=t.height,a=n*4;let o=i;do{const l=(o-1)*a;let u=n;do{const d=l+(u-1)*4;let h=r[d],v=r[d+1],p=r[d+2];h>127&&(h=255-h),v>127&&(v=255-v),p>127&&(p=255-p),r[d]=h,r[d+1]=v,r[d+2]=p}while(--u)}while(--o)};return Nd.Solarize=e,Nd}var Ld={},f5;function J9(){if(f5)return Ld;f5=1,Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.Threshold=void 0;const e=kr(),t=Qi(),r=Tr(),n=function(i){const a=this.threshold()*255,o=i.data,l=o.length;for(let u=0;u<l;u+=1)o[u]=o[u]<a?0:255};return Ld.Threshold=n,e.Factory.addGetterSetter(t.Node,"threshold",.5,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Ld}var h5;function ex(){if(h5)return Gh;h5=1,Object.defineProperty(Gh,"__esModule",{value:!0}),Gh.Konva=void 0;const e=Q2(),t=_9(),r=S9(),n=E9(),i=P9(),a=A9(),o=O9(),l=gw(),u=jv(),d=vw(),h=C9(),v=k9(),p=N9(),f=L9(),b=mw(),_=T9(),S=R9(),x=M9(),m=I9(),w=j9(),E=F9(),P=D9(),R=B9(),k=z9(),N=q9(),M=U9(),T=H9(),C=V9(),L=G9(),H=$9(),G=W9(),J=Y9(),se=X9(),U=K9(),V=Z9(),X=Q9(),z=J9();return Gh.Konva=e.Konva.Util._assign(e.Konva,{Arc:t.Arc,Arrow:r.Arrow,Circle:n.Circle,Ellipse:i.Ellipse,Image:a.Image,Label:o.Label,Tag:o.Tag,Line:l.Line,Path:u.Path,Rect:d.Rect,RegularPolygon:h.RegularPolygon,Ring:v.Ring,Sprite:p.Sprite,Star:f.Star,Text:b.Text,TextPath:_.TextPath,Transformer:S.Transformer,Wedge:x.Wedge,Filters:{Blur:m.Blur,Brighten:w.Brighten,Contrast:E.Contrast,Emboss:P.Emboss,Enhance:R.Enhance,Grayscale:k.Grayscale,HSL:N.HSL,HSV:M.HSV,Invert:T.Invert,Kaleidoscope:C.Kaleidoscope,Mask:L.Mask,Noise:H.Noise,Pixelate:G.Pixelate,Posterize:J.Posterize,RGB:se.RGB,RGBA:U.RGBA,Sepia:V.Sepia,Solarize:X.Solarize,Threshold:z.Threshold}}),Gh}var tx=s1.exports,d5;function rx(){if(d5)return s1.exports;d5=1,Object.defineProperty(tx,"__esModule",{value:!0});const e=ex();return s1.exports=e.Konva,s1.exports}var nx=rx();const Kt=dc(nx);var Yp={exports:{}},p5;function ix(){return p5||(p5=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var r=Q2();Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return r.Konva}});const n=Q2();e.exports=n.Konva}(Yp,Yp.exports)),Yp.exports}var ax=ix();const Qd=dc(ax);var ig={exports:{}};/**
44
- * @license React
45
- * react-reconciler.production.min.js
46
- *
47
- * Copyright (c) Facebook, Inc. and its affiliates.
48
- *
49
- * This source code is licensed under the MIT license found in the
50
- * LICENSE file in the root directory of this source tree.
51
- */var ag,g5;function ox(){return g5||(g5=1,ag=function(t){var r={},n=op(),i=xv(),a=Object.assign;function o(g){for(var y="https://reactjs.org/docs/error-decoder.html?invariant="+g,I=1;I<arguments.length;I++)y+="&args[]="+encodeURIComponent(arguments[I]);return"Minified React error #"+g+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),d=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),b=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),P=Symbol.iterator;function R(g){return g===null||typeof g!="object"?null:(g=P&&g[P]||g["@@iterator"],typeof g=="function"?g:null)}function k(g){if(g==null)return null;if(typeof g=="function")return g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case h:return"Fragment";case d:return"Portal";case p:return"Profiler";case v:return"StrictMode";case S:return"Suspense";case x:return"SuspenseList"}if(typeof g=="object")switch(g.$$typeof){case b:return(g.displayName||"Context")+".Consumer";case f:return(g._context.displayName||"Context")+".Provider";case _:var y=g.render;return g=g.displayName,g||(g=y.displayName||y.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case m:return y=g.displayName||null,y!==null?y:k(g.type)||"Memo";case w:y=g._payload,g=g._init;try{return k(g(y))}catch{}}return null}function N(g){var y=g.type;switch(g.tag){case 24:return"Cache";case 9:return(y.displayName||"Context")+".Consumer";case 10:return(y._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return g=y.render,g=g.displayName||g.name||"",y.displayName||(g!==""?"ForwardRef("+g+")":"ForwardRef");case 7:return"Fragment";case 5:return y;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return k(y);case 8:return y===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 y=="function")return y.displayName||y.name||null;if(typeof y=="string")return y}return null}function M(g){var y=g,I=g;if(g.alternate)for(;y.return;)y=y.return;else{g=y;do y=g,(y.flags&4098)!==0&&(I=y.return),g=y.return;while(g)}return y.tag===3?I:null}function T(g){if(M(g)!==g)throw Error(o(188))}function C(g){var y=g.alternate;if(!y){if(y=M(g),y===null)throw Error(o(188));return y!==g?null:g}for(var I=g,W=y;;){var te=I.return;if(te===null)break;var oe=te.alternate;if(oe===null){if(W=te.return,W!==null){I=W;continue}break}if(te.child===oe.child){for(oe=te.child;oe;){if(oe===I)return T(te),g;if(oe===W)return T(te),y;oe=oe.sibling}throw Error(o(188))}if(I.return!==W.return)I=te,W=oe;else{for(var Pe=!1,$e=te.child;$e;){if($e===I){Pe=!0,I=te,W=oe;break}if($e===W){Pe=!0,W=te,I=oe;break}$e=$e.sibling}if(!Pe){for($e=oe.child;$e;){if($e===I){Pe=!0,I=oe,W=te;break}if($e===W){Pe=!0,W=oe,I=te;break}$e=$e.sibling}if(!Pe)throw Error(o(189))}}if(I.alternate!==W)throw Error(o(190))}if(I.tag!==3)throw Error(o(188));return I.stateNode.current===I?g:y}function L(g){return g=C(g),g!==null?H(g):null}function H(g){if(g.tag===5||g.tag===6)return g;for(g=g.child;g!==null;){var y=H(g);if(y!==null)return y;g=g.sibling}return null}function G(g){if(g.tag===5||g.tag===6)return g;for(g=g.child;g!==null;){if(g.tag!==4){var y=G(g);if(y!==null)return y}g=g.sibling}return null}var J=Array.isArray,se=t.getPublicInstance,U=t.getRootHostContext,V=t.getChildHostContext,X=t.prepareForCommit,z=t.resetAfterCommit,D=t.createInstance,F=t.appendInitialChild,q=t.finalizeInitialChildren,Q=t.prepareUpdate,re=t.shouldSetTextContent,Y=t.createTextInstance,ee=t.scheduleTimeout,ae=t.cancelTimeout,ue=t.noTimeout,ce=t.isPrimaryRenderer,pe=t.supportsMutation,Ae=t.supportsPersistence,Ce=t.supportsHydration,ke=t.getInstanceFromNode,Se=t.preparePortalMount,le=t.getCurrentEventPriority,Ee=t.detachDeletedInstance,xe=t.supportsMicrotasks,ye=t.scheduleMicrotask,Ne=t.supportsTestSelectors,Te=t.findFiberRoot,ge=t.getBoundingRect,Re=t.getTextContent,Be=t.isHiddenSubtree,Qe=t.matchAccessibilityRole,ct=t.setFocusIfFocusable,mt=t.setupIntersectionObserver,gt=t.appendChild,St=t.appendChildToContainer,pt=t.commitTextUpdate,ut=t.commitMount,Br=t.commitUpdate,rr=t.insertBefore,Nr=t.insertInContainerBefore,ur=t.removeChild,Ge=t.removeChildFromContainer,Ze=t.resetTextContent,Lt=t.hideInstance,gr=t.hideTextInstance,Wt=t.unhideInstance,Ut=t.unhideTextInstance,kn=t.clearContainer,Rr=t.cloneInstance,It=t.createContainerChildSet,lr=t.appendChildToContainerChildSet,so=t.finalizeContainerChildren,on=t.replaceContainerChildren,pn=t.cloneHiddenInstance,ca=t.cloneHiddenTextInstance,qt=t.canHydrateInstance,Ji=t.canHydrateTextInstance,Jn=t.canHydrateSuspenseInstance,ci=t.isSuspenseInstancePending,zr=t.isSuspenseInstanceFallback,sn=t.getSuspenseInstanceFallbackErrorDetails,ei=t.registerSuspenseInstanceRetry,xa=t.getNextHydratableSibling,lo=t.getFirstHydratableChild,fa=t.getFirstHydratableChildWithinContainer,Sa=t.getFirstHydratableChildWithinSuspenseInstance,Yn=t.hydrateInstance,Ea=t.hydrateTextInstance,ha=t.hydrateSuspenseInstance,Pa=t.getNextHydratableInstanceAfterSuspenseInstance,da=t.commitHydratedContainer,uo=t.commitHydratedSuspenseInstance,As=t.clearSuspenseBoundary,Ko=t.clearSuspenseBoundaryFromContainer,Zl=t.shouldDeleteUnhydratedTailInstances,gc=t.didNotMatchHydratedContainerTextInstance,Nn=t.didNotMatchHydratedTextInstance,Bu;function co(g){if(Bu===void 0)try{throw Error()}catch(I){var y=I.stack.trim().match(/\n( *(at )?)/);Bu=y&&y[1]||""}return`
52
- `+Bu+g}var ml=!1;function Ws(g,y){if(!g||ml)return"";ml=!0;var I=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(y)if(y=function(){throw Error()},Object.defineProperty(y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(y,[])}catch(yt){var W=yt}Reflect.construct(g,[],y)}else{try{y.call()}catch(yt){W=yt}g.call(y.prototype)}else{try{throw Error()}catch(yt){W=yt}g()}}catch(yt){if(yt&&W&&typeof yt.stack=="string"){for(var te=yt.stack.split(`
53
- `),oe=W.stack.split(`
54
- `),Pe=te.length-1,$e=oe.length-1;1<=Pe&&0<=$e&&te[Pe]!==oe[$e];)$e--;for(;1<=Pe&&0<=$e;Pe--,$e--)if(te[Pe]!==oe[$e]){if(Pe!==1||$e!==1)do if(Pe--,$e--,0>$e||te[Pe]!==oe[$e]){var nt=`
55
- `+te[Pe].replace(" at new "," at ");return g.displayName&&nt.includes("<anonymous>")&&(nt=nt.replace("<anonymous>",g.displayName)),nt}while(1<=Pe&&0<=$e);break}}}finally{ml=!1,Error.prepareStackTrace=I}return(g=g?g.displayName||g.name:"")?co(g):""}var zu=Object.prototype.hasOwnProperty,Ql=[],fo=-1;function fi(g){return{current:g}}function qr(g){0>fo||(g.current=Ql[fo],Ql[fo]=null,fo--)}function dr(g,y){fo++,Ql[fo]=g.current,g.current=y}var Qr={},hi=fi(Qr),Li=fi(!1),Fa=Qr;function Da(g,y){var I=g.type.contextTypes;if(!I)return Qr;var W=g.stateNode;if(W&&W.__reactInternalMemoizedUnmaskedChildContext===y)return W.__reactInternalMemoizedMaskedChildContext;var te={},oe;for(oe in I)te[oe]=y[oe];return W&&(g=g.stateNode,g.__reactInternalMemoizedUnmaskedChildContext=y,g.__reactInternalMemoizedMaskedChildContext=te),te}function ti(g){return g=g.childContextTypes,g!=null}function Ti(){qr(Li),qr(hi)}function yl(g,y,I){if(hi.current!==Qr)throw Error(o(168));dr(hi,y),dr(Li,I)}function pa(g,y,I){var W=g.stateNode;if(y=y.childContextTypes,typeof W.getChildContext!="function")return I;W=W.getChildContext();for(var te in W)if(!(te in y))throw Error(o(108,N(g)||"Unknown",te));return a({},I,W)}function Zo(g){return g=(g=g.stateNode)&&g.__reactInternalMemoizedMergedChildContext||Qr,Fa=hi.current,dr(hi,g),dr(Li,Li.current),!0}function Jl(g,y,I){var W=g.stateNode;if(!W)throw Error(o(169));I?(g=pa(g,y,Fa),W.__reactInternalMemoizedMergedChildContext=g,qr(Li),qr(hi),dr(hi,g)):qr(Li),dr(Li,I)}var ga=Math.clz32?Math.clz32:eu,Ys=Math.log,sf=Math.LN2;function eu(g){return g>>>=0,g===0?32:31-(Ys(g)/sf|0)|0}var wr=64,Os=4194304;function Xs(g){switch(g&-g){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 g&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return g&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return g}}function Ks(g,y){var I=g.pendingLanes;if(I===0)return 0;var W=0,te=g.suspendedLanes,oe=g.pingedLanes,Pe=I&268435455;if(Pe!==0){var $e=Pe&~te;$e!==0?W=Xs($e):(oe&=Pe,oe!==0&&(W=Xs(oe)))}else Pe=I&~te,Pe!==0?W=Xs(Pe):oe!==0&&(W=Xs(oe));if(W===0)return 0;if(y!==0&&y!==W&&(y&te)===0&&(te=W&-W,oe=y&-y,te>=oe||te===16&&(oe&4194240)!==0))return y;if((W&4)!==0&&(W|=I&16),y=g.entangledLanes,y!==0)for(g=g.entanglements,y&=W;0<y;)I=31-ga(y),te=1<<I,W|=g[I],y&=~te;return W}function vc(g,y){switch(g){case 1:case 2:case 4:return y+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 y+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 Qo(g,y){for(var I=g.suspendedLanes,W=g.pingedLanes,te=g.expirationTimes,oe=g.pendingLanes;0<oe;){var Pe=31-ga(oe),$e=1<<Pe,nt=te[Pe];nt===-1?(($e&I)===0||($e&W)!==0)&&(te[Pe]=vc($e,y)):nt<=y&&(g.expiredLanes|=$e),oe&=~$e}}function Cs(g){return g=g.pendingLanes&-1073741825,g!==0?g:g&1073741824?1073741824:0}function ks(){var g=wr;return wr<<=1,(wr&4194240)===0&&(wr=64),g}function Ns(g){for(var y=[],I=0;31>I;I++)y.push(g);return y}function ln(g,y,I){g.pendingLanes|=y,y!==536870912&&(g.suspendedLanes=0,g.pingedLanes=0),g=g.eventTimes,y=31-ga(y),g[y]=I}function Jo(g,y){var I=g.pendingLanes&~y;g.pendingLanes=y,g.suspendedLanes=0,g.pingedLanes=0,g.expiredLanes&=y,g.mutableReadLanes&=y,g.entangledLanes&=y,y=g.entanglements;var W=g.eventTimes;for(g=g.expirationTimes;0<I;){var te=31-ga(I),oe=1<<te;y[te]=0,W[te]=-1,g[te]=-1,I&=~oe}}function Ba(g,y){var I=g.entangledLanes|=y;for(g=g.entanglements;I;){var W=31-ga(I),te=1<<W;te&y|g[W]&y&&(g[W]|=y),I&=~te}}var _t=0;function Zs(g){return g&=-g,1<g?4<g?(g&268435455)!==0?16:536870912:4:1}var ho=i.unstable_scheduleCallback,No=i.unstable_cancelCallback,qu=i.unstable_shouldYield,Qs=i.unstable_requestPaint,Ln=i.unstable_now,Js=i.unstable_ImmediatePriority,tu=i.unstable_UserBlockingPriority,ru=i.unstable_NormalPriority,lf=i.unstable_IdlePriority,po=null,ri=null;function za(g){if(ri&&typeof ri.onCommitFiberRoot=="function")try{ri.onCommitFiberRoot(po,g,void 0,(g.current.flags&128)===128)}catch{}}function nu(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var Ri=typeof Object.is=="function"?Object.is:nu,qa=null,Lo=!1,Ls=!1;function bl(g){qa===null?qa=[g]:qa.push(g)}function Uu(g){Lo=!0,bl(g)}function ni(){if(!Ls&&qa!==null){Ls=!0;var g=0,y=_t;try{var I=qa;for(_t=1;g<I.length;g++){var W=I[g];do W=W(!0);while(W!==null)}qa=null,Lo=!1}catch(te){throw qa!==null&&(qa=qa.slice(g+1)),ho(Js,ni),te}finally{_t=y,Ls=!1}}return null}var Mi=[],Ii=0,wl=null,Aa=0,gn=[],ji=0,vn=null,ea=1,ta="";function Ua(g,y){Mi[Ii++]=Aa,Mi[Ii++]=wl,wl=g,Aa=y}function iu(g,y,I){gn[ji++]=ea,gn[ji++]=ta,gn[ji++]=vn,vn=g;var W=ea;g=ta;var te=32-ga(W)-1;W&=~(1<<te),I+=1;var oe=32-ga(y)+te;if(30<oe){var Pe=te-te%5;oe=(W&(1<<Pe)-1).toString(32),W>>=Pe,te-=Pe,ea=1<<32-ga(y)+te|I<<te|W,ta=oe+g}else ea=1<<oe|I<<te|W,ta=g}function Ts(g){g.return!==null&&(Ua(g,1),iu(g,1,0))}function el(g){for(;g===wl;)wl=Mi[--Ii],Mi[Ii]=null,Aa=Mi[--Ii],Mi[Ii]=null;for(;g===vn;)vn=gn[--ji],gn[ji]=null,ta=gn[--ji],gn[ji]=null,ea=gn[--ji],gn[ji]=null}var Un=null,di=null,$r=!1,tl=!1,Ha=null;function _l(g,y){var I=$o(5,null,null,0);I.elementType="DELETED",I.stateNode=y,I.return=g,y=g.deletions,y===null?(g.deletions=[I],g.flags|=16):y.push(I)}function es(g,y){switch(g.tag){case 5:return y=qt(y,g.type,g.pendingProps),y!==null?(g.stateNode=y,Un=g,di=lo(y),!0):!1;case 6:return y=Ji(y,g.pendingProps),y!==null?(g.stateNode=y,Un=g,di=null,!0):!1;case 13:if(y=Jn(y),y!==null){var I=vn!==null?{id:ea,overflow:ta}:null;return g.memoizedState={dehydrated:y,treeContext:I,retryLane:1073741824},I=$o(18,null,null,0),I.stateNode=y,I.return=g,g.child=I,Un=g,di=null,!0}return!1;default:return!1}}function xl(g){return(g.mode&1)!==0&&(g.flags&128)===0}function ts(g){if($r){var y=di;if(y){var I=y;if(!es(g,y)){if(xl(g))throw Error(o(418));y=xa(I);var W=Un;y&&es(g,y)?_l(W,I):(g.flags=g.flags&-4097|2,$r=!1,Un=g)}}else{if(xl(g))throw Error(o(418));g.flags=g.flags&-4097|2,$r=!1,Un=g}}}function au(g){for(g=g.return;g!==null&&g.tag!==5&&g.tag!==3&&g.tag!==13;)g=g.return;Un=g}function $(g){if(!Ce||g!==Un)return!1;if(!$r)return au(g),$r=!0,!1;if(g.tag!==3&&(g.tag!==5||Zl(g.type)&&!re(g.type,g.memoizedProps))){var y=di;if(y){if(xl(g))throw de(),Error(o(418));for(;y;)_l(g,y),y=xa(y)}}if(au(g),g.tag===13){if(!Ce)throw Error(o(316));if(g=g.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(o(317));di=Pa(g)}else di=Un?xa(g.stateNode):null;return!0}function de(){for(var g=di;g;)g=xa(g)}function Le(){Ce&&(di=Un=null,tl=$r=!1)}function je(g){Ha===null?Ha=[g]:Ha.push(g)}var Xe=l.ReactCurrentBatchConfig;function at(g,y){if(Ri(g,y))return!0;if(typeof g!="object"||g===null||typeof y!="object"||y===null)return!1;var I=Object.keys(g),W=Object.keys(y);if(I.length!==W.length)return!1;for(W=0;W<I.length;W++){var te=I[W];if(!zu.call(y,te)||!Ri(g[te],y[te]))return!1}return!0}function ft(g){switch(g.tag){case 5:return co(g.type);case 16:return co("Lazy");case 13:return co("Suspense");case 19:return co("SuspenseList");case 0:case 2:case 15:return g=Ws(g.type,!1),g;case 11:return g=Ws(g.type.render,!1),g;case 1:return g=Ws(g.type,!0),g;default:return""}}function Et(g,y,I){if(g=I.ref,g!==null&&typeof g!="function"&&typeof g!="object"){if(I._owner){if(I=I._owner,I){if(I.tag!==1)throw Error(o(309));var W=I.stateNode}if(!W)throw Error(o(147,g));var te=W,oe=""+g;return y!==null&&y.ref!==null&&typeof y.ref=="function"&&y.ref._stringRef===oe?y.ref:(y=function(Pe){var $e=te.refs;Pe===null?delete $e[oe]:$e[oe]=Pe},y._stringRef=oe,y)}if(typeof g!="string")throw Error(o(284));if(!I._owner)throw Error(o(290,g))}return g}function Dt(g,y){throw g=Object.prototype.toString.call(y),Error(o(31,g==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":g))}function tr(g){var y=g._init;return y(g._payload)}function Jt(g){function y(et,We){if(g){var ot=et.deletions;ot===null?(et.deletions=[We],et.flags|=16):ot.push(We)}}function I(et,We){if(!g)return null;for(;We!==null;)y(et,We),We=We.sibling;return null}function W(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 te(et,We){return et=wu(et,We),et.index=0,et.sibling=null,et}function oe(et,We,ot){return et.index=ot,g?(ot=et.alternate,ot!==null?(ot=ot.index,ot<We?(et.flags|=2,We):ot):(et.flags|=2,We)):(et.flags|=1048576,We)}function Pe(et){return g&&et.alternate===null&&(et.flags|=2),et}function $e(et,We,ot,Ct){return We===null||We.tag!==6?(We=Oc(ot,et.mode,Ct),We.return=et,We):(We=te(We,ot),We.return=et,We)}function nt(et,We,ot,Ct){var Gt=ot.type;return Gt===h?Tt(et,We,ot.props.children,Ct,ot.key):We!==null&&(We.elementType===Gt||typeof Gt=="object"&&Gt!==null&&Gt.$$typeof===w&&tr(Gt)===We.type)?(Ct=te(We,ot.props),Ct.ref=Et(et,We,ot),Ct.return=et,Ct):(Ct=Qf(ot.type,ot.key,ot.props,null,et.mode,Ct),Ct.ref=Et(et,We,ot),Ct.return=et,Ct)}function yt(et,We,ot,Ct){return We===null||We.tag!==4||We.stateNode.containerInfo!==ot.containerInfo||We.stateNode.implementation!==ot.implementation?(We=Jf(ot,et.mode,Ct),We.return=et,We):(We=te(We,ot.children||[]),We.return=et,We)}function Tt(et,We,ot,Ct,Gt){return We===null||We.tag!==7?(We=ba(ot,et.mode,Ct,Gt),We.return=et,We):(We=te(We,ot),We.return=et,We)}function or(et,We,ot){if(typeof We=="string"&&We!==""||typeof We=="number")return We=Oc(""+We,et.mode,ot),We.return=et,We;if(typeof We=="object"&&We!==null){switch(We.$$typeof){case u:return ot=Qf(We.type,We.key,We.props,null,et.mode,ot),ot.ref=Et(et,null,We),ot.return=et,ot;case d:return We=Jf(We,et.mode,ot),We.return=et,We;case w:var Ct=We._init;return or(et,Ct(We._payload),ot)}if(J(We)||R(We))return We=ba(We,et.mode,ot,null),We.return=et,We;Dt(et,We)}return null}function Ot(et,We,ot,Ct){var Gt=We!==null?We.key:null;if(typeof ot=="string"&&ot!==""||typeof ot=="number")return Gt!==null?null:$e(et,We,""+ot,Ct);if(typeof ot=="object"&&ot!==null){switch(ot.$$typeof){case u:return ot.key===Gt?nt(et,We,ot,Ct):null;case d:return ot.key===Gt?yt(et,We,ot,Ct):null;case w:return Gt=ot._init,Ot(et,We,Gt(ot._payload),Ct)}if(J(ot)||R(ot))return Gt!==null?null:Tt(et,We,ot,Ct,null);Dt(et,ot)}return null}function Cn(et,We,ot,Ct,Gt){if(typeof Ct=="string"&&Ct!==""||typeof Ct=="number")return et=et.get(ot)||null,$e(We,et,""+Ct,Gt);if(typeof Ct=="object"&&Ct!==null){switch(Ct.$$typeof){case u:return et=et.get(Ct.key===null?ot:Ct.key)||null,nt(We,et,Ct,Gt);case d:return et=et.get(Ct.key===null?ot:Ct.key)||null,yt(We,et,Ct,Gt);case w:var pr=Ct._init;return Cn(et,We,ot,pr(Ct._payload),Gt)}if(J(Ct)||R(Ct))return et=et.get(ot)||null,Tt(We,et,Ct,Gt,null);Dt(We,Ct)}return null}function cn(et,We,ot,Ct){for(var Gt=null,pr=null,sr=We,Lr=We=0,$i=null;sr!==null&&Lr<ot.length;Lr++){sr.index>Lr?($i=sr,sr=null):$i=sr.sibling;var Cr=Ot(et,sr,ot[Lr],Ct);if(Cr===null){sr===null&&(sr=$i);break}g&&sr&&Cr.alternate===null&&y(et,sr),We=oe(Cr,We,Lr),pr===null?Gt=Cr:pr.sibling=Cr,pr=Cr,sr=$i}if(Lr===ot.length)return I(et,sr),$r&&Ua(et,Lr),Gt;if(sr===null){for(;Lr<ot.length;Lr++)sr=or(et,ot[Lr],Ct),sr!==null&&(We=oe(sr,We,Lr),pr===null?Gt=sr:pr.sibling=sr,pr=sr);return $r&&Ua(et,Lr),Gt}for(sr=W(et,sr);Lr<ot.length;Lr++)$i=Cn(sr,et,Lr,ot[Lr],Ct),$i!==null&&(g&&$i.alternate!==null&&sr.delete($i.key===null?Lr:$i.key),We=oe($i,We,Lr),pr===null?Gt=$i:pr.sibling=$i,pr=$i);return g&&sr.forEach(function(Ta){return y(et,Ta)}),$r&&Ua(et,Lr),Gt}function no(et,We,ot,Ct){var Gt=R(ot);if(typeof Gt!="function")throw Error(o(150));if(ot=Gt.call(ot),ot==null)throw Error(o(151));for(var pr=Gt=null,sr=We,Lr=We=0,$i=null,Cr=ot.next();sr!==null&&!Cr.done;Lr++,Cr=ot.next()){sr.index>Lr?($i=sr,sr=null):$i=sr.sibling;var Ta=Ot(et,sr,Cr.value,Ct);if(Ta===null){sr===null&&(sr=$i);break}g&&sr&&Ta.alternate===null&&y(et,sr),We=oe(Ta,We,Lr),pr===null?Gt=Ta:pr.sibling=Ta,pr=Ta,sr=$i}if(Cr.done)return I(et,sr),$r&&Ua(et,Lr),Gt;if(sr===null){for(;!Cr.done;Lr++,Cr=ot.next())Cr=or(et,Cr.value,Ct),Cr!==null&&(We=oe(Cr,We,Lr),pr===null?Gt=Cr:pr.sibling=Cr,pr=Cr);return $r&&Ua(et,Lr),Gt}for(sr=W(et,sr);!Cr.done;Lr++,Cr=ot.next())Cr=Cn(sr,et,Lr,Cr.value,Ct),Cr!==null&&(g&&Cr.alternate!==null&&sr.delete(Cr.key===null?Lr:Cr.key),We=oe(Cr,We,Lr),pr===null?Gt=Cr:pr.sibling=Cr,pr=Cr);return g&&sr.forEach(function(g0){return y(et,g0)}),$r&&Ua(et,Lr),Gt}function cl(et,We,ot,Ct){if(typeof ot=="object"&&ot!==null&&ot.type===h&&ot.key===null&&(ot=ot.props.children),typeof ot=="object"&&ot!==null){switch(ot.$$typeof){case u:e:{for(var Gt=ot.key,pr=We;pr!==null;){if(pr.key===Gt){if(Gt=ot.type,Gt===h){if(pr.tag===7){I(et,pr.sibling),We=te(pr,ot.props.children),We.return=et,et=We;break e}}else if(pr.elementType===Gt||typeof Gt=="object"&&Gt!==null&&Gt.$$typeof===w&&tr(Gt)===pr.type){I(et,pr.sibling),We=te(pr,ot.props),We.ref=Et(et,pr,ot),We.return=et,et=We;break e}I(et,pr);break}else y(et,pr);pr=pr.sibling}ot.type===h?(We=ba(ot.props.children,et.mode,Ct,ot.key),We.return=et,et=We):(Ct=Qf(ot.type,ot.key,ot.props,null,et.mode,Ct),Ct.ref=Et(et,We,ot),Ct.return=et,et=Ct)}return Pe(et);case d:e:{for(pr=ot.key;We!==null;){if(We.key===pr)if(We.tag===4&&We.stateNode.containerInfo===ot.containerInfo&&We.stateNode.implementation===ot.implementation){I(et,We.sibling),We=te(We,ot.children||[]),We.return=et,et=We;break e}else{I(et,We);break}else y(et,We);We=We.sibling}We=Jf(ot,et.mode,Ct),We.return=et,et=We}return Pe(et);case w:return pr=ot._init,cl(et,We,pr(ot._payload),Ct)}if(J(ot))return cn(et,We,ot,Ct);if(R(ot))return no(et,We,ot,Ct);Dt(et,ot)}return typeof ot=="string"&&ot!==""||typeof ot=="number"?(ot=""+ot,We!==null&&We.tag===6?(I(et,We.sibling),We=te(We,ot),We.return=et,et=We):(I(et,We),We=Oc(ot,et.mode,Ct),We.return=et,et=We),Pe(et)):I(et,We)}return cl}var cr=Jt(!0),En=Jt(!1),mn=fi(null),Tn=null,Xn=null,ii=null;function Va(){ii=Xn=Tn=null}function Oa(g,y,I){ce?(dr(mn,y._currentValue),y._currentValue=I):(dr(mn,y._currentValue2),y._currentValue2=I)}function Ca(g){var y=mn.current;qr(mn),ce?g._currentValue=y:g._currentValue2=y}function rs(g,y,I){for(;g!==null;){var W=g.alternate;if((g.childLanes&y)!==y?(g.childLanes|=y,W!==null&&(W.childLanes|=y)):W!==null&&(W.childLanes&y)!==y&&(W.childLanes|=y),g===I)break;g=g.return}}function ns(g,y){Tn=g,ii=Xn=null,g=g.dependencies,g!==null&&g.firstContext!==null&&((g.lanes&y)!==0&&(oi=!0),g.firstContext=null)}function Fi(g){var y=ce?g._currentValue:g._currentValue2;if(ii!==g)if(g={context:g,memoizedValue:y,next:null},Xn===null){if(Tn===null)throw Error(o(308));Xn=g,Tn.dependencies={lanes:0,firstContext:g}}else Xn=Xn.next=g;return y}var Ga=null;function rl(g){Ga===null?Ga=[g]:Ga.push(g)}function Sl(g,y,I,W){var te=y.interleaved;return te===null?(I.next=I,rl(y)):(I.next=te.next,te.next=I),y.interleaved=I,ra(g,W)}function ra(g,y){g.lanes|=y;var I=g.alternate;for(I!==null&&(I.lanes|=y),I=g,g=g.return;g!==null;)g.childLanes|=y,I=g.alternate,I!==null&&(I.childLanes|=y),I=g,g=g.return;return I.tag===3?I.stateNode:null}var Wr=!1;function nl(g){g.updateQueue={baseState:g.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function El(g,y){g=g.updateQueue,y.updateQueue===g&&(y.updateQueue={baseState:g.baseState,firstBaseUpdate:g.firstBaseUpdate,lastBaseUpdate:g.lastBaseUpdate,shared:g.shared,effects:g.effects})}function ka(g,y){return{eventTime:g,lane:y,tag:0,payload:null,callback:null,next:null}}function $a(g,y,I){var W=g.updateQueue;if(W===null)return null;if(W=W.shared,(nr&2)!==0){var te=W.pending;return te===null?y.next=y:(y.next=te.next,te.next=y),W.pending=y,ra(g,I)}return te=W.interleaved,te===null?(y.next=y,rl(W)):(y.next=te.next,te.next=y),W.interleaved=y,ra(g,I)}function xi(g,y,I){if(y=y.updateQueue,y!==null&&(y=y.shared,(I&4194240)!==0)){var W=y.lanes;W&=g.pendingLanes,I|=W,y.lanes=I,Ba(g,I)}}function il(g,y){var I=g.updateQueue,W=g.alternate;if(W!==null&&(W=W.updateQueue,I===W)){var te=null,oe=null;if(I=I.firstBaseUpdate,I!==null){do{var Pe={eventTime:I.eventTime,lane:I.lane,tag:I.tag,payload:I.payload,callback:I.callback,next:null};oe===null?te=oe=Pe:oe=oe.next=Pe,I=I.next}while(I!==null);oe===null?te=oe=y:oe=oe.next=y}else te=oe=y;I={baseState:W.baseState,firstBaseUpdate:te,lastBaseUpdate:oe,shared:W.shared,effects:W.effects},g.updateQueue=I;return}g=I.lastBaseUpdate,g===null?I.firstBaseUpdate=y:g.next=y,I.lastBaseUpdate=y}function go(g,y,I,W){var te=g.updateQueue;Wr=!1;var oe=te.firstBaseUpdate,Pe=te.lastBaseUpdate,$e=te.shared.pending;if($e!==null){te.shared.pending=null;var nt=$e,yt=nt.next;nt.next=null,Pe===null?oe=yt:Pe.next=yt,Pe=nt;var Tt=g.alternate;Tt!==null&&(Tt=Tt.updateQueue,$e=Tt.lastBaseUpdate,$e!==Pe&&($e===null?Tt.firstBaseUpdate=yt:$e.next=yt,Tt.lastBaseUpdate=nt))}if(oe!==null){var or=te.baseState;Pe=0,Tt=yt=nt=null,$e=oe;do{var Ot=$e.lane,Cn=$e.eventTime;if((W&Ot)===Ot){Tt!==null&&(Tt=Tt.next={eventTime:Cn,lane:0,tag:$e.tag,payload:$e.payload,callback:$e.callback,next:null});e:{var cn=g,no=$e;switch(Ot=y,Cn=I,no.tag){case 1:if(cn=no.payload,typeof cn=="function"){or=cn.call(Cn,or,Ot);break e}or=cn;break e;case 3:cn.flags=cn.flags&-65537|128;case 0:if(cn=no.payload,Ot=typeof cn=="function"?cn.call(Cn,or,Ot):cn,Ot==null)break e;or=a({},or,Ot);break e;case 2:Wr=!0}}$e.callback!==null&&$e.lane!==0&&(g.flags|=64,Ot=te.effects,Ot===null?te.effects=[$e]:Ot.push($e))}else Cn={eventTime:Cn,lane:Ot,tag:$e.tag,payload:$e.payload,callback:$e.callback,next:null},Tt===null?(yt=Tt=Cn,nt=or):Tt=Tt.next=Cn,Pe|=Ot;if($e=$e.next,$e===null){if($e=te.shared.pending,$e===null)break;Ot=$e,$e=Ot.next,Ot.next=null,te.lastBaseUpdate=Ot,te.shared.pending=null}}while(!0);if(Tt===null&&(nt=or),te.baseState=nt,te.firstBaseUpdate=yt,te.lastBaseUpdate=Tt,y=te.shared.interleaved,y!==null){te=y;do Pe|=te.lane,te=te.next;while(te!==y)}else oe===null&&(te.shared.lanes=0);Fs|=Pe,g.lanes=Pe,g.memoizedState=or}}function Hu(g,y,I){if(g=y.effects,y.effects=null,g!==null)for(y=0;y<g.length;y++){var W=g[y],te=W.callback;if(te!==null){if(W.callback=null,W=I,typeof te!="function")throw Error(o(191,te));te.call(W)}}}var pi={},Di=fi(pi),Rs=fi(pi),To=fi(pi);function gi(g){if(g===pi)throw Error(o(174));return g}function is(g,y){dr(To,y),dr(Rs,g),dr(Di,pi),g=U(y),qr(Di),dr(Di,g)}function ai(){qr(Di),qr(Rs),qr(To)}function Bi(g){var y=gi(To.current),I=gi(Di.current);y=V(I,g.type,y),I!==y&&(dr(Rs,g),dr(Di,y))}function as(g){Rs.current===g&&(qr(Di),qr(Rs))}var Mr=fi(0);function vo(g){for(var y=g;y!==null;){if(y.tag===13){var I=y.memoizedState;if(I!==null&&(I=I.dehydrated,I===null||ci(I)||zr(I)))return y}else if(y.tag===19&&y.memoizedProps.revealOrder!==void 0){if((y.flags&128)!==0)return y}else if(y.child!==null){y.child.return=y,y=y.child;continue}if(y===g)break;for(;y.sibling===null;){if(y.return===null||y.return===g)return null;y=y.return}y.sibling.return=y.return,y=y.sibling}return null}var al=[];function Ro(){for(var g=0;g<al.length;g++){var y=al[g];ce?y._workInProgressVersionPrimary=null:y._workInProgressVersionSecondary=null}al.length=0}var _r=l.ReactCurrentDispatcher,Mo=l.ReactCurrentBatchConfig,Hn=0,vr=null,yn=null,Vn=null,os=!1,Io=!1,jo=0,Wa=0;function Pn(){throw Error(o(321))}function mo(g,y){if(y===null)return!1;for(var I=0;I<y.length&&I<g.length;I++)if(!Ri(g[I],y[I]))return!1;return!0}function Fo(g,y,I,W,te,oe){if(Hn=oe,vr=y,y.memoizedState=null,y.updateQueue=null,y.lanes=0,_r.current=g===null||g.memoizedState===null?$u:Nl,g=I(W,te),Io){oe=0;do{if(Io=!1,jo=0,25<=oe)throw Error(o(301));oe+=1,Vn=yn=null,y.updateQueue=null,_r.current=ff,g=I(W,te)}while(Io)}if(_r.current=Is,y=yn!==null&&yn.next!==null,Hn=0,Vn=yn=vr=null,os=!1,y)throw Error(o(300));return g}function Do(){var g=jo!==0;return jo=0,g}function zi(){var g={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vn===null?vr.memoizedState=Vn=g:Vn=Vn.next=g,Vn}function Jr(){if(yn===null){var g=vr.alternate;g=g!==null?g.memoizedState:null}else g=yn.next;var y=Vn===null?vr.memoizedState:Vn.next;if(y!==null)Vn=y,yn=g;else{if(g===null)throw Error(o(310));yn=g,g={memoizedState:yn.memoizedState,baseState:yn.baseState,baseQueue:yn.baseQueue,queue:yn.queue,next:null},Vn===null?vr.memoizedState=Vn=g:Vn=Vn.next=g}return Vn}function Si(g,y){return typeof y=="function"?y(g):y}function Yr(g){var y=Jr(),I=y.queue;if(I===null)throw Error(o(311));I.lastRenderedReducer=g;var W=yn,te=W.baseQueue,oe=I.pending;if(oe!==null){if(te!==null){var Pe=te.next;te.next=oe.next,oe.next=Pe}W.baseQueue=te=oe,I.pending=null}if(te!==null){oe=te.next,W=W.baseState;var $e=Pe=null,nt=null,yt=oe;do{var Tt=yt.lane;if((Hn&Tt)===Tt)nt!==null&&(nt=nt.next={lane:0,action:yt.action,hasEagerState:yt.hasEagerState,eagerState:yt.eagerState,next:null}),W=yt.hasEagerState?yt.eagerState:g(W,yt.action);else{var or={lane:Tt,action:yt.action,hasEagerState:yt.hasEagerState,eagerState:yt.eagerState,next:null};nt===null?($e=nt=or,Pe=W):nt=nt.next=or,vr.lanes|=Tt,Fs|=Tt}yt=yt.next}while(yt!==null&&yt!==oe);nt===null?Pe=W:nt.next=$e,Ri(W,y.memoizedState)||(oi=!0),y.memoizedState=W,y.baseState=Pe,y.baseQueue=nt,I.lastRenderedState=W}if(g=I.interleaved,g!==null){te=g;do oe=te.lane,vr.lanes|=oe,Fs|=oe,te=te.next;while(te!==g)}else te===null&&(I.lanes=0);return[y.memoizedState,I.dispatch]}function Ir(g){var y=Jr(),I=y.queue;if(I===null)throw Error(o(311));I.lastRenderedReducer=g;var W=I.dispatch,te=I.pending,oe=y.memoizedState;if(te!==null){I.pending=null;var Pe=te=te.next;do oe=g(oe,Pe.action),Pe=Pe.next;while(Pe!==te);Ri(oe,y.memoizedState)||(oi=!0),y.memoizedState=oe,y.baseQueue===null&&(y.baseState=oe),I.lastRenderedState=oe}return[oe,W]}function Rn(){}function Kn(g,y){var I=vr,W=Jr(),te=y(),oe=!Ri(W.memoizedState,te);if(oe&&(W.memoizedState=te,oi=!0),W=W.queue,Cl(ol.bind(null,I,W,g),[g]),W.getSnapshot!==y||oe||Vn!==null&&Vn.memoizedState.tag&1){if(I.flags|=2048,vi(9,Pl.bind(null,I,W,te,y),void 0,null),Vr===null)throw Error(o(349));(Hn&30)!==0||Bo(I,y,te)}return te}function Bo(g,y,I){g.flags|=16384,g={getSnapshot:y,value:I},y=vr.updateQueue,y===null?(y={lastEffect:null,stores:null},vr.updateQueue=y,y.stores=[g]):(I=y.stores,I===null?y.stores=[g]:I.push(g))}function Pl(g,y,I,W){y.value=I,y.getSnapshot=W,ou(y)&&zo(g)}function ol(g,y,I){return I(function(){ou(y)&&zo(g)})}function ou(g){var y=g.getSnapshot;g=g.value;try{var I=y();return!Ri(g,I)}catch{return!0}}function zo(g){var y=ra(g,1);y!==null&&la(y,g,1,-1)}function Al(g){var y=zi();return typeof g=="function"&&(g=g()),y.memoizedState=y.baseState=g,g={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:g},y.queue=g,g=g.dispatch=Ih.bind(null,vr,g),[y.memoizedState,g]}function vi(g,y,I,W){return g={tag:g,create:y,destroy:I,deps:W,next:null},y=vr.updateQueue,y===null?(y={lastEffect:null,stores:null},vr.updateQueue=y,y.lastEffect=g.next=g):(I=y.lastEffect,I===null?y.lastEffect=g.next=g:(W=I.next,I.next=g,g.next=W,y.lastEffect=g)),g}function Ya(){return Jr().memoizedState}function Ol(g,y,I,W){var te=zi();vr.flags|=g,te.memoizedState=vi(1|y,I,void 0,W===void 0?null:W)}function qo(g,y,I,W){var te=Jr();W=W===void 0?null:W;var oe=void 0;if(yn!==null){var Pe=yn.memoizedState;if(oe=Pe.destroy,W!==null&&mo(W,Pe.deps)){te.memoizedState=vi(y,I,oe,W);return}}vr.flags|=g,te.memoizedState=vi(1|y,I,oe,W)}function uf(g,y){return Ol(8390656,8,g,y)}function Cl(g,y){return qo(2048,8,g,y)}function su(g,y){return qo(4,2,g,y)}function en(g,y){return qo(4,4,g,y)}function Vu(g,y){if(typeof y=="function")return g=g(),y(g),function(){y(null)};if(y!=null)return g=g(),y.current=g,function(){y.current=null}}function kl(g,y,I){return I=I!=null?I.concat([g]):null,qo(4,4,Vu.bind(null,y,g),I)}function Ms(){}function lu(g,y){var I=Jr();y=y===void 0?null:y;var W=I.memoizedState;return W!==null&&y!==null&&mo(y,W[1])?W[0]:(I.memoizedState=[g,y],g)}function uu(g,y){var I=Jr();y=y===void 0?null:y;var W=I.memoizedState;return W!==null&&y!==null&&mo(y,W[1])?W[0]:(g=g(),I.memoizedState=[g,y],g)}function cu(g,y,I){return(Hn&21)===0?(g.baseState&&(g.baseState=!1,oi=!0),g.memoizedState=I):(Ri(I,y)||(I=ks(),vr.lanes|=I,Fs|=I,g.baseState=!0),y)}function mc(g,y){var I=_t;_t=I!==0&&4>I?I:4,g(!0);var W=Mo.transition;Mo.transition={};try{g(!1),y()}finally{_t=I,Mo.transition=W}}function sl(){return Jr().memoizedState}function Vf(g,y,I){var W=ui(g);if(I={lane:W,action:I,hasEagerState:!1,eagerState:null,next:null},Gf(g))cf(y,I);else if(I=Sl(g,y,I,W),I!==null){var te=hn();la(I,g,W,te),Gu(I,y,W)}}function Ih(g,y,I){var W=ui(g),te={lane:W,action:I,hasEagerState:!1,eagerState:null,next:null};if(Gf(g))cf(y,te);else{var oe=g.alternate;if(g.lanes===0&&(oe===null||oe.lanes===0)&&(oe=y.lastRenderedReducer,oe!==null))try{var Pe=y.lastRenderedState,$e=oe(Pe,I);if(te.hasEagerState=!0,te.eagerState=$e,Ri($e,Pe)){var nt=y.interleaved;nt===null?(te.next=te,rl(y)):(te.next=nt.next,nt.next=te),y.interleaved=te;return}}catch{}finally{}I=Sl(g,y,te,W),I!==null&&(te=hn(),la(I,g,W,te),Gu(I,y,W))}}function Gf(g){var y=g.alternate;return g===vr||y!==null&&y===vr}function cf(g,y){Io=os=!0;var I=g.pending;I===null?y.next=y:(y.next=I.next,I.next=y),g.pending=y}function Gu(g,y,I){if((I&4194240)!==0){var W=y.lanes;W&=g.pendingLanes,I|=W,y.lanes=I,Ba(g,I)}}var Is={readContext:Fi,useCallback:Pn,useContext:Pn,useEffect:Pn,useImperativeHandle:Pn,useInsertionEffect:Pn,useLayoutEffect:Pn,useMemo:Pn,useReducer:Pn,useRef:Pn,useState:Pn,useDebugValue:Pn,useDeferredValue:Pn,useTransition:Pn,useMutableSource:Pn,useSyncExternalStore:Pn,useId:Pn,unstable_isNewReconciler:!1},$u={readContext:Fi,useCallback:function(g,y){return zi().memoizedState=[g,y===void 0?null:y],g},useContext:Fi,useEffect:uf,useImperativeHandle:function(g,y,I){return I=I!=null?I.concat([g]):null,Ol(4194308,4,Vu.bind(null,y,g),I)},useLayoutEffect:function(g,y){return Ol(4194308,4,g,y)},useInsertionEffect:function(g,y){return Ol(4,2,g,y)},useMemo:function(g,y){var I=zi();return y=y===void 0?null:y,g=g(),I.memoizedState=[g,y],g},useReducer:function(g,y,I){var W=zi();return y=I!==void 0?I(y):y,W.memoizedState=W.baseState=y,g={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:g,lastRenderedState:y},W.queue=g,g=g.dispatch=Vf.bind(null,vr,g),[W.memoizedState,g]},useRef:function(g){var y=zi();return g={current:g},y.memoizedState=g},useState:Al,useDebugValue:Ms,useDeferredValue:function(g){return zi().memoizedState=g},useTransition:function(){var g=Al(!1),y=g[0];return g=mc.bind(null,g[1]),zi().memoizedState=g,[y,g]},useMutableSource:function(){},useSyncExternalStore:function(g,y,I){var W=vr,te=zi();if($r){if(I===void 0)throw Error(o(407));I=I()}else{if(I=y(),Vr===null)throw Error(o(349));(Hn&30)!==0||Bo(W,y,I)}te.memoizedState=I;var oe={value:I,getSnapshot:y};return te.queue=oe,uf(ol.bind(null,W,oe,g),[g]),W.flags|=2048,vi(9,Pl.bind(null,W,oe,I,y),void 0,null),I},useId:function(){var g=zi(),y=Vr.identifierPrefix;if($r){var I=ta,W=ea;I=(W&~(1<<32-ga(W)-1)).toString(32)+I,y=":"+y+"R"+I,I=jo++,0<I&&(y+="H"+I.toString(32)),y+=":"}else I=Wa++,y=":"+y+"r"+I.toString(32)+":";return g.memoizedState=y},unstable_isNewReconciler:!1},Nl={readContext:Fi,useCallback:lu,useContext:Fi,useEffect:Cl,useImperativeHandle:kl,useInsertionEffect:su,useLayoutEffect:en,useMemo:uu,useReducer:Yr,useRef:Ya,useState:function(){return Yr(Si)},useDebugValue:Ms,useDeferredValue:function(g){var y=Jr();return cu(y,yn.memoizedState,g)},useTransition:function(){var g=Yr(Si)[0],y=Jr().memoizedState;return[g,y]},useMutableSource:Rn,useSyncExternalStore:Kn,useId:sl,unstable_isNewReconciler:!1},ff={readContext:Fi,useCallback:lu,useContext:Fi,useEffect:Cl,useImperativeHandle:kl,useInsertionEffect:su,useLayoutEffect:en,useMemo:uu,useReducer:Ir,useRef:Ya,useState:function(){return Ir(Si)},useDebugValue:Ms,useDeferredValue:function(g){var y=Jr();return yn===null?y.memoizedState=g:cu(y,yn.memoizedState,g)},useTransition:function(){var g=Ir(Si)[0],y=Jr().memoizedState;return[g,y]},useMutableSource:Rn,useSyncExternalStore:Kn,useId:sl,unstable_isNewReconciler:!1};function Xa(g,y){if(g&&g.defaultProps){y=a({},y),g=g.defaultProps;for(var I in g)y[I]===void 0&&(y[I]=g[I]);return y}return y}function yc(g,y,I,W){y=g.memoizedState,I=I(W,y),I=I==null?y:a({},y,I),g.memoizedState=I,g.lanes===0&&(g.updateQueue.baseState=I)}var Wu={isMounted:function(g){return(g=g._reactInternals)?M(g)===g:!1},enqueueSetState:function(g,y,I){g=g._reactInternals;var W=hn(),te=ui(g),oe=ka(W,te);oe.payload=y,I!=null&&(oe.callback=I),y=$a(g,oe,te),y!==null&&(la(y,g,te,W),xi(y,g,te))},enqueueReplaceState:function(g,y,I){g=g._reactInternals;var W=hn(),te=ui(g),oe=ka(W,te);oe.tag=1,oe.payload=y,I!=null&&(oe.callback=I),y=$a(g,oe,te),y!==null&&(la(y,g,te,W),xi(y,g,te))},enqueueForceUpdate:function(g,y){g=g._reactInternals;var I=hn(),W=ui(g),te=ka(I,W);te.tag=2,y!=null&&(te.callback=y),y=$a(g,te,W),y!==null&&(la(y,g,W,I),xi(y,g,W))}};function $f(g,y,I,W,te,oe,Pe){return g=g.stateNode,typeof g.shouldComponentUpdate=="function"?g.shouldComponentUpdate(W,oe,Pe):y.prototype&&y.prototype.isPureReactComponent?!at(I,W)||!at(te,oe):!0}function Wf(g,y,I){var W=!1,te=Qr,oe=y.contextType;return typeof oe=="object"&&oe!==null?oe=Fi(oe):(te=ti(y)?Fa:hi.current,W=y.contextTypes,oe=(W=W!=null)?Da(g,te):Qr),y=new y(I,oe),g.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Wu,g.stateNode=y,y._reactInternals=g,W&&(g=g.stateNode,g.__reactInternalMemoizedUnmaskedChildContext=te,g.__reactInternalMemoizedMaskedChildContext=oe),y}function bc(g,y,I,W){g=y.state,typeof y.componentWillReceiveProps=="function"&&y.componentWillReceiveProps(I,W),typeof y.UNSAFE_componentWillReceiveProps=="function"&&y.UNSAFE_componentWillReceiveProps(I,W),y.state!==g&&Wu.enqueueReplaceState(y,y.state,null)}function qi(g,y,I,W){var te=g.stateNode;te.props=I,te.state=g.memoizedState,te.refs={},nl(g);var oe=y.contextType;typeof oe=="object"&&oe!==null?te.context=Fi(oe):(oe=ti(y)?Fa:hi.current,te.context=Da(g,oe)),te.state=g.memoizedState,oe=y.getDerivedStateFromProps,typeof oe=="function"&&(yc(g,y,oe,I),te.state=g.memoizedState),typeof y.getDerivedStateFromProps=="function"||typeof te.getSnapshotBeforeUpdate=="function"||typeof te.UNSAFE_componentWillMount!="function"&&typeof te.componentWillMount!="function"||(y=te.state,typeof te.componentWillMount=="function"&&te.componentWillMount(),typeof te.UNSAFE_componentWillMount=="function"&&te.UNSAFE_componentWillMount(),y!==te.state&&Wu.enqueueReplaceState(te,te.state,null),go(g,I,te,W),te.state=g.memoizedState),typeof te.componentDidMount=="function"&&(g.flags|=4194308)}function Ui(g,y){try{var I="",W=y;do I+=ft(W),W=W.return;while(W);var te=I}catch(oe){te=`
56
- Error generating stack: `+oe.message+`
57
- `+oe.stack}return{value:g,source:y,stack:te,digest:null}}function na(g,y,I){return{value:g,source:null,stack:I??null,digest:y??null}}function yo(g,y){try{console.error(y.value)}catch(I){setTimeout(function(){throw I})}}var fu=typeof WeakMap=="function"?WeakMap:Map;function Hi(g,y,I){I=ka(-1,I),I.tag=3,I.payload={element:null};var W=y.value;return I.callback=function(){Fn||(Fn=!0,Dn=W),yo(g,y)},I}function va(g,y,I){I=ka(-1,I),I.tag=3;var W=g.type.getDerivedStateFromError;if(typeof W=="function"){var te=y.value;I.payload=function(){return W(te)},I.callback=function(){yo(g,y)}}var oe=g.stateNode;return oe!==null&&typeof oe.componentDidCatch=="function"&&(I.callback=function(){yo(g,y),typeof W!="function"&&(Ja===null?Ja=new Set([this]):Ja.add(this));var Pe=y.stack;this.componentDidCatch(y.value,{componentStack:Pe!==null?Pe:""})}),I}function Yf(g,y,I){var W=g.pingCache;if(W===null){W=g.pingCache=new fu;var te=new Set;W.set(y,te)}else te=W.get(y),te===void 0&&(te=new Set,W.set(y,te));te.has(I)||(te.add(I),g=bp.bind(null,g,y,I),y.then(g,g))}function Xf(g){do{var y;if((y=g.tag===13)&&(y=g.memoizedState,y=y!==null?y.dehydrated!==null:!0),y)return g;g=g.return}while(g!==null);return null}function js(g,y,I,W,te){return(g.mode&1)===0?(g===y?g.flags|=65536:(g.flags|=128,I.flags|=131072,I.flags&=-52805,I.tag===1&&(I.alternate===null?I.tag=17:(y=ka(-1,1),y.tag=2,$a(I,y,1))),I.lanes|=1),g):(g.flags|=65536,g.lanes=te,g)}var hu=l.ReactCurrentOwner,oi=!1;function mi(g,y,I,W){y.child=g===null?En(y,null,I,W):cr(y,g.child,I,W)}function wc(g,y,I,W,te){I=I.render;var oe=y.ref;return ns(y,te),W=Fo(g,y,I,W,oe,te),I=Do(),g!==null&&!oi?(y.updateQueue=g.updateQueue,y.flags&=-2053,g.lanes&=~te,Z(g,y,te)):($r&&I&&Ts(y),y.flags|=1,mi(g,y,W,te),y.child)}function ss(g,y,I,W,te){if(g===null){var oe=I.type;return typeof oe=="function"&&!Pc(oe)&&oe.defaultProps===void 0&&I.compare===null&&I.defaultProps===void 0?(y.tag=15,y.type=oe,bo(g,y,oe,W,te)):(g=Qf(I.type,null,W,y,y.mode,te),g.ref=y.ref,g.return=y,y.child=g)}if(oe=g.child,(g.lanes&te)===0){var Pe=oe.memoizedProps;if(I=I.compare,I=I!==null?I:at,I(Pe,W)&&g.ref===y.ref)return Z(g,y,te)}return y.flags|=1,g=wu(oe,W),g.ref=y.ref,g.return=y,y.child=g}function bo(g,y,I,W,te){if(g!==null){var oe=g.memoizedProps;if(at(oe,W)&&g.ref===y.ref)if(oi=!1,y.pendingProps=W=oe,(g.lanes&te)!==0)(g.flags&131072)!==0&&(oi=!0);else return y.lanes=g.lanes,Z(g,y,te)}return ls(g,y,I,W,te)}function Ur(g,y,I){var W=y.pendingProps,te=W.children,oe=g!==null?g.memoizedState:null;if(W.mode==="hidden")if((y.mode&1)===0)y.memoizedState={baseLanes:0,cachePool:null,transitions:null},dr(Vo,Zn),Zn|=I;else{if((I&1073741824)===0)return g=oe!==null?oe.baseLanes|I:I,y.lanes=y.childLanes=1073741824,y.memoizedState={baseLanes:g,cachePool:null,transitions:null},y.updateQueue=null,dr(Vo,Zn),Zn|=g,null;y.memoizedState={baseLanes:0,cachePool:null,transitions:null},W=oe!==null?oe.baseLanes:I,dr(Vo,Zn),Zn|=W}else oe!==null?(W=oe.baseLanes|I,y.memoizedState=null):W=I,dr(Vo,Zn),Zn|=W;return mi(g,y,te,I),y.child}function Xr(g,y){var I=y.ref;(g===null&&I!==null||g!==null&&g.ref!==I)&&(y.flags|=512,y.flags|=2097152)}function ls(g,y,I,W,te){var oe=ti(I)?Fa:hi.current;return oe=Da(y,oe),ns(y,te),I=Fo(g,y,I,W,oe,te),W=Do(),g!==null&&!oi?(y.updateQueue=g.updateQueue,y.flags&=-2053,g.lanes&=~te,Z(g,y,te)):($r&&W&&Ts(y),y.flags|=1,mi(g,y,I,te),y.child)}function Ei(g,y,I,W,te){if(ti(I)){var oe=!0;Zo(y)}else oe=!1;if(ns(y,te),y.stateNode===null)B(g,y),Wf(y,I,W),qi(y,I,W,te),W=!0;else if(g===null){var Pe=y.stateNode,$e=y.memoizedProps;Pe.props=$e;var nt=Pe.context,yt=I.contextType;typeof yt=="object"&&yt!==null?yt=Fi(yt):(yt=ti(I)?Fa:hi.current,yt=Da(y,yt));var Tt=I.getDerivedStateFromProps,or=typeof Tt=="function"||typeof Pe.getSnapshotBeforeUpdate=="function";or||typeof Pe.UNSAFE_componentWillReceiveProps!="function"&&typeof Pe.componentWillReceiveProps!="function"||($e!==W||nt!==yt)&&bc(y,Pe,W,yt),Wr=!1;var Ot=y.memoizedState;Pe.state=Ot,go(y,W,Pe,te),nt=y.memoizedState,$e!==W||Ot!==nt||Li.current||Wr?(typeof Tt=="function"&&(yc(y,I,Tt,W),nt=y.memoizedState),($e=Wr||$f(y,I,$e,W,Ot,nt,yt))?(or||typeof Pe.UNSAFE_componentWillMount!="function"&&typeof Pe.componentWillMount!="function"||(typeof Pe.componentWillMount=="function"&&Pe.componentWillMount(),typeof Pe.UNSAFE_componentWillMount=="function"&&Pe.UNSAFE_componentWillMount()),typeof Pe.componentDidMount=="function"&&(y.flags|=4194308)):(typeof Pe.componentDidMount=="function"&&(y.flags|=4194308),y.memoizedProps=W,y.memoizedState=nt),Pe.props=W,Pe.state=nt,Pe.context=yt,W=$e):(typeof Pe.componentDidMount=="function"&&(y.flags|=4194308),W=!1)}else{Pe=y.stateNode,El(g,y),$e=y.memoizedProps,yt=y.type===y.elementType?$e:Xa(y.type,$e),Pe.props=yt,or=y.pendingProps,Ot=Pe.context,nt=I.contextType,typeof nt=="object"&&nt!==null?nt=Fi(nt):(nt=ti(I)?Fa:hi.current,nt=Da(y,nt));var Cn=I.getDerivedStateFromProps;(Tt=typeof Cn=="function"||typeof Pe.getSnapshotBeforeUpdate=="function")||typeof Pe.UNSAFE_componentWillReceiveProps!="function"&&typeof Pe.componentWillReceiveProps!="function"||($e!==or||Ot!==nt)&&bc(y,Pe,W,nt),Wr=!1,Ot=y.memoizedState,Pe.state=Ot,go(y,W,Pe,te);var cn=y.memoizedState;$e!==or||Ot!==cn||Li.current||Wr?(typeof Cn=="function"&&(yc(y,I,Cn,W),cn=y.memoizedState),(yt=Wr||$f(y,I,yt,W,Ot,cn,nt)||!1)?(Tt||typeof Pe.UNSAFE_componentWillUpdate!="function"&&typeof Pe.componentWillUpdate!="function"||(typeof Pe.componentWillUpdate=="function"&&Pe.componentWillUpdate(W,cn,nt),typeof Pe.UNSAFE_componentWillUpdate=="function"&&Pe.UNSAFE_componentWillUpdate(W,cn,nt)),typeof Pe.componentDidUpdate=="function"&&(y.flags|=4),typeof Pe.getSnapshotBeforeUpdate=="function"&&(y.flags|=1024)):(typeof Pe.componentDidUpdate!="function"||$e===g.memoizedProps&&Ot===g.memoizedState||(y.flags|=4),typeof Pe.getSnapshotBeforeUpdate!="function"||$e===g.memoizedProps&&Ot===g.memoizedState||(y.flags|=1024),y.memoizedProps=W,y.memoizedState=cn),Pe.props=W,Pe.state=cn,Pe.context=nt,W=yt):(typeof Pe.componentDidUpdate!="function"||$e===g.memoizedProps&&Ot===g.memoizedState||(y.flags|=4),typeof Pe.getSnapshotBeforeUpdate!="function"||$e===g.memoizedProps&&Ot===g.memoizedState||(y.flags|=1024),W=!1)}return ia(g,y,I,W,oe,te)}function ia(g,y,I,W,te,oe){Xr(g,y);var Pe=(y.flags&128)!==0;if(!W&&!Pe)return te&&Jl(y,I,!1),Z(g,y,oe);W=y.stateNode,hu.current=y;var $e=Pe&&typeof I.getDerivedStateFromError!="function"?null:W.render();return y.flags|=1,g!==null&&Pe?(y.child=cr(y,g.child,null,oe),y.child=cr(y,null,$e,oe)):mi(g,y,$e,oe),y.memoizedState=W.state,te&&Jl(y,I,!0),y.child}function ll(g){var y=g.stateNode;y.pendingContext?yl(g,y.pendingContext,y.pendingContext!==y.context):y.context&&yl(g,y.context,!1),is(g,y.containerInfo)}function Ll(g,y,I,W,te){return Le(),je(te),y.flags|=256,mi(g,y,I,W),y.child}var aa={dehydrated:null,treeContext:null,retryLane:0};function du(g){return{baseLanes:g,cachePool:null,transitions:null}}function hf(g,y,I){var W=y.pendingProps,te=Mr.current,oe=!1,Pe=(y.flags&128)!==0,$e;if(($e=Pe)||($e=g!==null&&g.memoizedState===null?!1:(te&2)!==0),$e?(oe=!0,y.flags&=-129):(g===null||g.memoizedState!==null)&&(te|=1),dr(Mr,te&1),g===null)return ts(y),g=y.memoizedState,g!==null&&(g=g.dehydrated,g!==null)?((y.mode&1)===0?y.lanes=1:zr(g)?y.lanes=8:y.lanes=1073741824,null):(Pe=W.children,g=W.fallback,oe?(W=y.mode,oe=y.child,Pe={mode:"hidden",children:Pe},(W&1)===0&&oe!==null?(oe.childLanes=0,oe.pendingProps=Pe):oe=Ac(Pe,W,0,null),g=ba(g,W,I,null),oe.return=y,g.return=y,oe.sibling=g,y.child=oe,y.child.memoizedState=du(I),y.memoizedState=aa,g):Yu(y,Pe));if(te=g.memoizedState,te!==null&&($e=te.dehydrated,$e!==null))return Kf(g,y,Pe,W,$e,te,I);if(oe){oe=W.fallback,Pe=y.mode,te=g.child,$e=te.sibling;var nt={mode:"hidden",children:W.children};return(Pe&1)===0&&y.child!==te?(W=y.child,W.childLanes=0,W.pendingProps=nt,y.deletions=null):(W=wu(te,nt),W.subtreeFlags=te.subtreeFlags&14680064),$e!==null?oe=wu($e,oe):(oe=ba(oe,Pe,I,null),oe.flags|=2),oe.return=y,W.return=y,W.sibling=oe,y.child=W,W=oe,oe=y.child,Pe=g.child.memoizedState,Pe=Pe===null?du(I):{baseLanes:Pe.baseLanes|I,cachePool:null,transitions:Pe.transitions},oe.memoizedState=Pe,oe.childLanes=g.childLanes&~I,y.memoizedState=aa,W}return oe=g.child,g=oe.sibling,W=wu(oe,{mode:"visible",children:W.children}),(y.mode&1)===0&&(W.lanes=I),W.return=y,W.sibling=null,g!==null&&(I=y.deletions,I===null?(y.deletions=[g],y.flags|=16):I.push(g)),y.child=W,y.memoizedState=null,W}function Yu(g,y){return y=Ac({mode:"visible",children:y},g.mode,0,null),y.return=g,g.child=y}function us(g,y,I,W){return W!==null&&je(W),cr(y,g.child,null,I),g=Yu(y,y.pendingProps.children),g.flags|=2,y.memoizedState=null,g}function Kf(g,y,I,W,te,oe,Pe){if(I)return y.flags&256?(y.flags&=-257,W=na(Error(o(422))),us(g,y,Pe,W)):y.memoizedState!==null?(y.child=g.child,y.flags|=128,null):(oe=W.fallback,te=y.mode,W=Ac({mode:"visible",children:W.children},te,0,null),oe=ba(oe,te,Pe,null),oe.flags|=2,W.return=y,oe.return=y,W.sibling=oe,y.child=W,(y.mode&1)!==0&&cr(y,g.child,null,Pe),y.child.memoizedState=du(Pe),y.memoizedState=aa,oe);if((y.mode&1)===0)return us(g,y,Pe,null);if(zr(te))return W=sn(te).digest,oe=Error(o(419)),W=na(oe,W,void 0),us(g,y,Pe,W);if(I=(Pe&g.childLanes)!==0,oi||I){if(W=Vr,W!==null){switch(Pe&-Pe){case 4:te=2;break;case 16:te=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:te=32;break;case 536870912:te=268435456;break;default:te=0}te=(te&(W.suspendedLanes|Pe))!==0?0:te,te!==0&&te!==oe.retryLane&&(oe.retryLane=te,ra(g,te),la(W,g,te,-1))}return ro(),W=na(Error(o(421))),us(g,y,Pe,W)}return ci(te)?(y.flags|=128,y.child=g.child,y=_p.bind(null,g),ei(te,y),null):(g=oe.treeContext,Ce&&(di=Sa(te),Un=y,$r=!0,Ha=null,tl=!1,g!==null&&(gn[ji++]=ea,gn[ji++]=ta,gn[ji++]=vn,ea=g.id,ta=g.overflow,vn=y)),y=Yu(y,W.children),y.flags|=4096,y)}function cs(g,y,I){g.lanes|=y;var W=g.alternate;W!==null&&(W.lanes|=y),rs(g.return,y,I)}function Tl(g,y,I,W,te){var oe=g.memoizedState;oe===null?g.memoizedState={isBackwards:y,rendering:null,renderingStartTime:0,last:W,tail:I,tailMode:te}:(oe.isBackwards=y,oe.rendering=null,oe.renderingStartTime=0,oe.last=W,oe.tail=I,oe.tailMode=te)}function O(g,y,I){var W=y.pendingProps,te=W.revealOrder,oe=W.tail;if(mi(g,y,W.children,I),W=Mr.current,(W&2)!==0)W=W&1|2,y.flags|=128;else{if(g!==null&&(g.flags&128)!==0)e:for(g=y.child;g!==null;){if(g.tag===13)g.memoizedState!==null&&cs(g,I,y);else if(g.tag===19)cs(g,I,y);else if(g.child!==null){g.child.return=g,g=g.child;continue}if(g===y)break e;for(;g.sibling===null;){if(g.return===null||g.return===y)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}W&=1}if(dr(Mr,W),(y.mode&1)===0)y.memoizedState=null;else switch(te){case"forwards":for(I=y.child,te=null;I!==null;)g=I.alternate,g!==null&&vo(g)===null&&(te=I),I=I.sibling;I=te,I===null?(te=y.child,y.child=null):(te=I.sibling,I.sibling=null),Tl(y,!1,te,I,oe);break;case"backwards":for(I=null,te=y.child,y.child=null;te!==null;){if(g=te.alternate,g!==null&&vo(g)===null){y.child=te;break}g=te.sibling,te.sibling=I,I=te,te=g}Tl(y,!0,I,null,oe);break;case"together":Tl(y,!1,null,null,void 0);break;default:y.memoizedState=null}return y.child}function B(g,y){(y.mode&1)===0&&g!==null&&(g.alternate=null,y.alternate=null,y.flags|=2)}function Z(g,y,I){if(g!==null&&(y.dependencies=g.dependencies),Fs|=y.lanes,(I&y.childLanes)===0)return null;if(g!==null&&y.child!==g.child)throw Error(o(153));if(y.child!==null){for(g=y.child,I=wu(g,g.pendingProps),y.child=I,I.return=y;g.sibling!==null;)g=g.sibling,I=I.sibling=wu(g,g.pendingProps),I.return=y;I.sibling=null}return y.child}function ie(g,y,I){switch(y.tag){case 3:ll(y),Le();break;case 5:Bi(y);break;case 1:ti(y.type)&&Zo(y);break;case 4:is(y,y.stateNode.containerInfo);break;case 10:Oa(y,y.type._context,y.memoizedProps.value);break;case 13:var W=y.memoizedState;if(W!==null)return W.dehydrated!==null?(dr(Mr,Mr.current&1),y.flags|=128,null):(I&y.child.childLanes)!==0?hf(g,y,I):(dr(Mr,Mr.current&1),g=Z(g,y,I),g!==null?g.sibling:null);dr(Mr,Mr.current&1);break;case 19:if(W=(I&y.childLanes)!==0,(g.flags&128)!==0){if(W)return O(g,y,I);y.flags|=128}var te=y.memoizedState;if(te!==null&&(te.rendering=null,te.tail=null,te.lastEffect=null),dr(Mr,Mr.current),W)break;return null;case 22:case 23:return y.lanes=0,Ur(g,y,I)}return Z(g,y,I)}function he(g){g.flags|=4}function ve(g,y){if(g!==null&&g.child===y.child)return!0;if((y.flags&16)!==0)return!1;for(g=y.child;g!==null;){if((g.flags&12854)!==0||(g.subtreeFlags&12854)!==0)return!1;g=g.sibling}return!0}var be,we,_e,Oe;if(pe)be=function(g,y){for(var I=y.child;I!==null;){if(I.tag===5||I.tag===6)F(g,I.stateNode);else if(I.tag!==4&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===y)break;for(;I.sibling===null;){if(I.return===null||I.return===y)return;I=I.return}I.sibling.return=I.return,I=I.sibling}},we=function(){},_e=function(g,y,I,W,te){if(g=g.memoizedProps,g!==W){var oe=y.stateNode,Pe=gi(Di.current);I=Q(oe,I,g,W,te,Pe),(y.updateQueue=I)&&he(y)}},Oe=function(g,y,I,W){I!==W&&he(y)};else if(Ae){be=function(g,y,I,W){for(var te=y.child;te!==null;){if(te.tag===5){var oe=te.stateNode;I&&W&&(oe=pn(oe,te.type,te.memoizedProps,te)),F(g,oe)}else if(te.tag===6)oe=te.stateNode,I&&W&&(oe=ca(oe,te.memoizedProps,te)),F(g,oe);else if(te.tag!==4){if(te.tag===22&&te.memoizedState!==null)oe=te.child,oe!==null&&(oe.return=te),be(g,te,!0,!0);else if(te.child!==null){te.child.return=te,te=te.child;continue}}if(te===y)break;for(;te.sibling===null;){if(te.return===null||te.return===y)return;te=te.return}te.sibling.return=te.return,te=te.sibling}};var Fe=function(g,y,I,W){for(var te=y.child;te!==null;){if(te.tag===5){var oe=te.stateNode;I&&W&&(oe=pn(oe,te.type,te.memoizedProps,te)),lr(g,oe)}else if(te.tag===6)oe=te.stateNode,I&&W&&(oe=ca(oe,te.memoizedProps,te)),lr(g,oe);else if(te.tag!==4){if(te.tag===22&&te.memoizedState!==null)oe=te.child,oe!==null&&(oe.return=te),Fe(g,te,!0,!0);else if(te.child!==null){te.child.return=te,te=te.child;continue}}if(te===y)break;for(;te.sibling===null;){if(te.return===null||te.return===y)return;te=te.return}te.sibling.return=te.return,te=te.sibling}};we=function(g,y){var I=y.stateNode;if(!ve(g,y)){g=I.containerInfo;var W=It(g);Fe(W,y,!1,!1),I.pendingChildren=W,he(y),so(g,W)}},_e=function(g,y,I,W,te){var oe=g.stateNode,Pe=g.memoizedProps;if((g=ve(g,y))&&Pe===W)y.stateNode=oe;else{var $e=y.stateNode,nt=gi(Di.current),yt=null;Pe!==W&&(yt=Q($e,I,Pe,W,te,nt)),g&&yt===null?y.stateNode=oe:(oe=Rr(oe,yt,I,Pe,W,y,g,$e),q(oe,I,W,te,nt)&&he(y),y.stateNode=oe,g?he(y):be(oe,y,!1,!1))}},Oe=function(g,y,I,W){I!==W?(g=gi(To.current),I=gi(Di.current),y.stateNode=Y(W,g,I,y),he(y)):y.stateNode=g.stateNode}}else we=function(){},_e=function(){},Oe=function(){};function Ye(g,y){if(!$r)switch(g.tailMode){case"hidden":y=g.tail;for(var I=null;y!==null;)y.alternate!==null&&(I=y),y=y.sibling;I===null?g.tail=null:I.sibling=null;break;case"collapsed":I=g.tail;for(var W=null;I!==null;)I.alternate!==null&&(W=I),I=I.sibling;W===null?y||g.tail===null?g.tail=null:g.tail.sibling=null:W.sibling=null}}function Ve(g){var y=g.alternate!==null&&g.alternate.child===g.child,I=0,W=0;if(y)for(var te=g.child;te!==null;)I|=te.lanes|te.childLanes,W|=te.subtreeFlags&14680064,W|=te.flags&14680064,te.return=g,te=te.sibling;else for(te=g.child;te!==null;)I|=te.lanes|te.childLanes,W|=te.subtreeFlags,W|=te.flags,te.return=g,te=te.sibling;return g.subtreeFlags|=W,g.childLanes=I,y}function He(g,y,I){var W=y.pendingProps;switch(el(y),y.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ve(y),null;case 1:return ti(y.type)&&Ti(),Ve(y),null;case 3:return I=y.stateNode,ai(),qr(Li),qr(hi),Ro(),I.pendingContext&&(I.context=I.pendingContext,I.pendingContext=null),(g===null||g.child===null)&&($(y)?he(y):g===null||g.memoizedState.isDehydrated&&(y.flags&256)===0||(y.flags|=1024,Ha!==null&&(Ku(Ha),Ha=null))),we(g,y),Ve(y),null;case 5:as(y),I=gi(To.current);var te=y.type;if(g!==null&&y.stateNode!=null)_e(g,y,te,W,I),g.ref!==y.ref&&(y.flags|=512,y.flags|=2097152);else{if(!W){if(y.stateNode===null)throw Error(o(166));return Ve(y),null}if(g=gi(Di.current),$(y)){if(!Ce)throw Error(o(175));g=Yn(y.stateNode,y.type,y.memoizedProps,I,g,y,!tl),y.updateQueue=g,g!==null&&he(y)}else{var oe=D(te,W,I,g,y);be(oe,y,!1,!1),y.stateNode=oe,q(oe,te,W,I,g)&&he(y)}y.ref!==null&&(y.flags|=512,y.flags|=2097152)}return Ve(y),null;case 6:if(g&&y.stateNode!=null)Oe(g,y,g.memoizedProps,W);else{if(typeof W!="string"&&y.stateNode===null)throw Error(o(166));if(g=gi(To.current),I=gi(Di.current),$(y)){if(!Ce)throw Error(o(176));if(g=y.stateNode,I=y.memoizedProps,(W=Ea(g,I,y,!tl))&&(te=Un,te!==null))switch(te.tag){case 3:gc(te.stateNode.containerInfo,g,I,(te.mode&1)!==0);break;case 5:Nn(te.type,te.memoizedProps,te.stateNode,g,I,(te.mode&1)!==0)}W&&he(y)}else y.stateNode=Y(W,g,I,y)}return Ve(y),null;case 13:if(qr(Mr),W=y.memoizedState,g===null||g.memoizedState!==null&&g.memoizedState.dehydrated!==null){if($r&&di!==null&&(y.mode&1)!==0&&(y.flags&128)===0)de(),Le(),y.flags|=98560,te=!1;else if(te=$(y),W!==null&&W.dehydrated!==null){if(g===null){if(!te)throw Error(o(318));if(!Ce)throw Error(o(344));if(te=y.memoizedState,te=te!==null?te.dehydrated:null,!te)throw Error(o(317));ha(te,y)}else Le(),(y.flags&128)===0&&(y.memoizedState=null),y.flags|=4;Ve(y),te=!1}else Ha!==null&&(Ku(Ha),Ha=null),te=!0;if(!te)return y.flags&65536?y:null}return(y.flags&128)!==0?(y.lanes=I,y):(I=W!==null,I!==(g!==null&&g.memoizedState!==null)&&I&&(y.child.flags|=8192,(y.mode&1)!==0&&(g===null||(Mr.current&1)!==0?tn===0&&(tn=3):ro())),y.updateQueue!==null&&(y.flags|=4),Ve(y),null);case 4:return ai(),we(g,y),g===null&&Se(y.stateNode.containerInfo),Ve(y),null;case 10:return Ca(y.type._context),Ve(y),null;case 17:return ti(y.type)&&Ti(),Ve(y),null;case 19:if(qr(Mr),te=y.memoizedState,te===null)return Ve(y),null;if(W=(y.flags&128)!==0,oe=te.rendering,oe===null)if(W)Ye(te,!1);else{if(tn!==0||g!==null&&(g.flags&128)!==0)for(g=y.child;g!==null;){if(oe=vo(g),oe!==null){for(y.flags|=128,Ye(te,!1),g=oe.updateQueue,g!==null&&(y.updateQueue=g,y.flags|=4),y.subtreeFlags=0,g=I,I=y.child;I!==null;)W=I,te=g,W.flags&=14680066,oe=W.alternate,oe===null?(W.childLanes=0,W.lanes=te,W.child=null,W.subtreeFlags=0,W.memoizedProps=null,W.memoizedState=null,W.updateQueue=null,W.dependencies=null,W.stateNode=null):(W.childLanes=oe.childLanes,W.lanes=oe.lanes,W.child=oe.child,W.subtreeFlags=0,W.deletions=null,W.memoizedProps=oe.memoizedProps,W.memoizedState=oe.memoizedState,W.updateQueue=oe.updateQueue,W.type=oe.type,te=oe.dependencies,W.dependencies=te===null?null:{lanes:te.lanes,firstContext:te.firstContext}),I=I.sibling;return dr(Mr,Mr.current&1|2),y.child}g=g.sibling}te.tail!==null&&Ln()>mu&&(y.flags|=128,W=!0,Ye(te,!1),y.lanes=4194304)}else{if(!W)if(g=vo(oe),g!==null){if(y.flags|=128,W=!0,g=g.updateQueue,g!==null&&(y.updateQueue=g,y.flags|=4),Ye(te,!0),te.tail===null&&te.tailMode==="hidden"&&!oe.alternate&&!$r)return Ve(y),null}else 2*Ln()-te.renderingStartTime>mu&&I!==1073741824&&(y.flags|=128,W=!0,Ye(te,!1),y.lanes=4194304);te.isBackwards?(oe.sibling=y.child,y.child=oe):(g=te.last,g!==null?g.sibling=oe:y.child=oe,te.last=oe)}return te.tail!==null?(y=te.tail,te.rendering=y,te.tail=y.sibling,te.renderingStartTime=Ln(),y.sibling=null,g=Mr.current,dr(Mr,W?g&1|2:g&1),y):(Ve(y),null);case 22:case 23:return bu(),I=y.memoizedState!==null,g!==null&&g.memoizedState!==null!==I&&(y.flags|=8192),I&&(y.mode&1)!==0?(Zn&1073741824)!==0&&(Ve(y),pe&&y.subtreeFlags&6&&(y.flags|=8192)):Ve(y),null;case 24:return null;case 25:return null}throw Error(o(156,y.tag))}function lt(g,y){switch(el(y),y.tag){case 1:return ti(y.type)&&Ti(),g=y.flags,g&65536?(y.flags=g&-65537|128,y):null;case 3:return ai(),qr(Li),qr(hi),Ro(),g=y.flags,(g&65536)!==0&&(g&128)===0?(y.flags=g&-65537|128,y):null;case 5:return as(y),null;case 13:if(qr(Mr),g=y.memoizedState,g!==null&&g.dehydrated!==null){if(y.alternate===null)throw Error(o(340));Le()}return g=y.flags,g&65536?(y.flags=g&-65537|128,y):null;case 19:return qr(Mr),null;case 4:return ai(),null;case 10:return Ca(y.type._context),null;case 22:case 23:return bu(),null;case 24:return null;default:return null}}var rt=!1,Ie=!1,ze=typeof WeakSet=="function"?WeakSet:Set,qe=null;function it(g,y){var I=g.ref;if(I!==null)if(typeof I=="function")try{I(null)}catch(W){zn(g,y,W)}else I.current=null}function st(g,y,I){try{I()}catch(W){zn(g,y,W)}}var At=!1;function xt(g,y){for(X(g.containerInfo),qe=y;qe!==null;)if(g=qe,y=g.child,(g.subtreeFlags&1028)!==0&&y!==null)y.return=g,qe=y;else for(;qe!==null;){g=qe;try{var I=g.alternate;if((g.flags&1024)!==0)switch(g.tag){case 0:case 11:case 15:break;case 1:if(I!==null){var W=I.memoizedProps,te=I.memoizedState,oe=g.stateNode,Pe=oe.getSnapshotBeforeUpdate(g.elementType===g.type?W:Xa(g.type,W),te);oe.__reactInternalSnapshotBeforeUpdate=Pe}break;case 3:pe&&kn(g.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch($e){zn(g,g.return,$e)}if(y=g.sibling,y!==null){y.return=g.return,qe=y;break}qe=g.return}return I=At,At=!1,I}function Bt(g,y,I){var W=y.updateQueue;if(W=W!==null?W.lastEffect:null,W!==null){var te=W=W.next;do{if((te.tag&g)===g){var oe=te.destroy;te.destroy=void 0,oe!==void 0&&st(y,I,oe)}te=te.next}while(te!==W)}}function wt(g,y){if(y=y.updateQueue,y=y!==null?y.lastEffect:null,y!==null){var I=y=y.next;do{if((I.tag&g)===g){var W=I.create;I.destroy=W()}I=I.next}while(I!==y)}}function xr(g){var y=g.ref;if(y!==null){var I=g.stateNode;switch(g.tag){case 5:g=se(I);break;default:g=I}typeof y=="function"?y(g):y.current=g}}function Ar(g){var y=g.alternate;y!==null&&(g.alternate=null,Ar(y)),g.child=null,g.deletions=null,g.sibling=null,g.tag===5&&(y=g.stateNode,y!==null&&Ee(y)),g.stateNode=null,g.return=null,g.dependencies=null,g.memoizedProps=null,g.memoizedState=null,g.pendingProps=null,g.stateNode=null,g.updateQueue=null}function mr(g){return g.tag===5||g.tag===3||g.tag===4}function ar(g){e:for(;;){for(;g.sibling===null;){if(g.return===null||mr(g.return))return null;g=g.return}for(g.sibling.return=g.return,g=g.sibling;g.tag!==5&&g.tag!==6&&g.tag!==18;){if(g.flags&2||g.child===null||g.tag===4)continue e;g.child.return=g,g=g.child}if(!(g.flags&2))return g.stateNode}}function jr(g,y,I){var W=g.tag;if(W===5||W===6)g=g.stateNode,y?Nr(I,g,y):St(I,g);else if(W!==4&&(g=g.child,g!==null))for(jr(g,y,I),g=g.sibling;g!==null;)jr(g,y,I),g=g.sibling}function Hr(g,y,I){var W=g.tag;if(W===5||W===6)g=g.stateNode,y?rr(I,g,y):gt(I,g);else if(W!==4&&(g=g.child,g!==null))for(Hr(g,y,I),g=g.sibling;g!==null;)Hr(g,y,I),g=g.sibling}var Rt=null,Or=!1;function An(g,y,I){for(I=I.child;I!==null;)Mn(g,y,I),I=I.sibling}function Mn(g,y,I){if(ri&&typeof ri.onCommitFiberUnmount=="function")try{ri.onCommitFiberUnmount(po,I)}catch{}switch(I.tag){case 5:Ie||it(I,y);case 6:if(pe){var W=Rt,te=Or;Rt=null,An(g,y,I),Rt=W,Or=te,Rt!==null&&(Or?Ge(Rt,I.stateNode):ur(Rt,I.stateNode))}else An(g,y,I);break;case 18:pe&&Rt!==null&&(Or?Ko(Rt,I.stateNode):As(Rt,I.stateNode));break;case 4:pe?(W=Rt,te=Or,Rt=I.stateNode.containerInfo,Or=!0,An(g,y,I),Rt=W,Or=te):(Ae&&(W=I.stateNode.containerInfo,te=It(W),on(W,te)),An(g,y,I));break;case 0:case 11:case 14:case 15:if(!Ie&&(W=I.updateQueue,W!==null&&(W=W.lastEffect,W!==null))){te=W=W.next;do{var oe=te,Pe=oe.destroy;oe=oe.tag,Pe!==void 0&&((oe&2)!==0||(oe&4)!==0)&&st(I,y,Pe),te=te.next}while(te!==W)}An(g,y,I);break;case 1:if(!Ie&&(it(I,y),W=I.stateNode,typeof W.componentWillUnmount=="function"))try{W.props=I.memoizedProps,W.state=I.memoizedState,W.componentWillUnmount()}catch($e){zn(I,y,$e)}An(g,y,I);break;case 21:An(g,y,I);break;case 22:I.mode&1?(Ie=(W=Ie)||I.memoizedState!==null,An(g,y,I),Ie=W):An(g,y,I);break;default:An(g,y,I)}}function si(g){var y=g.updateQueue;if(y!==null){g.updateQueue=null;var I=g.stateNode;I===null&&(I=g.stateNode=new ze),y.forEach(function(W){var te=h0.bind(null,g,W);I.has(W)||(I.add(W),W.then(te,te))})}}function fr(g,y){var I=y.deletions;if(I!==null)for(var W=0;W<I.length;W++){var te=I[W];try{var oe=g,Pe=y;if(pe){var $e=Pe;e:for(;$e!==null;){switch($e.tag){case 5:Rt=$e.stateNode,Or=!1;break e;case 3:Rt=$e.stateNode.containerInfo,Or=!0;break e;case 4:Rt=$e.stateNode.containerInfo,Or=!0;break e}$e=$e.return}if(Rt===null)throw Error(o(160));Mn(oe,Pe,te),Rt=null,Or=!1}else Mn(oe,Pe,te);var nt=te.alternate;nt!==null&&(nt.return=null),te.return=null}catch(yt){zn(te,y,yt)}}if(y.subtreeFlags&12854)for(y=y.child;y!==null;)Vi(y,g),y=y.sibling}function Vi(g,y){var I=g.alternate,W=g.flags;switch(g.tag){case 0:case 11:case 14:case 15:if(fr(y,g),bn(g),W&4){try{Bt(3,g,g.return),wt(3,g)}catch(Ot){zn(g,g.return,Ot)}try{Bt(5,g,g.return)}catch(Ot){zn(g,g.return,Ot)}}break;case 1:fr(y,g),bn(g),W&512&&I!==null&&it(I,I.return);break;case 5:if(fr(y,g),bn(g),W&512&&I!==null&&it(I,I.return),pe){if(g.flags&32){var te=g.stateNode;try{Ze(te)}catch(Ot){zn(g,g.return,Ot)}}if(W&4&&(te=g.stateNode,te!=null)){var oe=g.memoizedProps;if(I=I!==null?I.memoizedProps:oe,W=g.type,y=g.updateQueue,g.updateQueue=null,y!==null)try{Br(te,y,W,I,oe,g)}catch(Ot){zn(g,g.return,Ot)}}}break;case 6:if(fr(y,g),bn(g),W&4&&pe){if(g.stateNode===null)throw Error(o(162));te=g.stateNode,oe=g.memoizedProps,I=I!==null?I.memoizedProps:oe;try{pt(te,I,oe)}catch(Ot){zn(g,g.return,Ot)}}break;case 3:if(fr(y,g),bn(g),W&4){if(pe&&Ce&&I!==null&&I.memoizedState.isDehydrated)try{da(y.containerInfo)}catch(Ot){zn(g,g.return,Ot)}if(Ae){te=y.containerInfo,oe=y.pendingChildren;try{on(te,oe)}catch(Ot){zn(g,g.return,Ot)}}}break;case 4:if(fr(y,g),bn(g),W&4&&Ae){oe=g.stateNode,te=oe.containerInfo,oe=oe.pendingChildren;try{on(te,oe)}catch(Ot){zn(g,g.return,Ot)}}break;case 13:fr(y,g),bn(g),te=g.child,te.flags&8192&&(oe=te.memoizedState!==null,te.stateNode.isHidden=oe,!oe||te.alternate!==null&&te.alternate.memoizedState!==null||(vu=Ln())),W&4&&si(g);break;case 22:var Pe=I!==null&&I.memoizedState!==null;if(g.mode&1?(Ie=(I=Ie)||Pe,fr(y,g),Ie=I):fr(y,g),bn(g),W&8192){if(I=g.memoizedState!==null,(g.stateNode.isHidden=I)&&!Pe&&(g.mode&1)!==0)for(qe=g,W=g.child;W!==null;){for(y=qe=W;qe!==null;){Pe=qe;var $e=Pe.child;switch(Pe.tag){case 0:case 11:case 14:case 15:Bt(4,Pe,Pe.return);break;case 1:it(Pe,Pe.return);var nt=Pe.stateNode;if(typeof nt.componentWillUnmount=="function"){var yt=Pe,Tt=Pe.return;try{var or=yt;nt.props=or.memoizedProps,nt.state=or.memoizedState,nt.componentWillUnmount()}catch(Ot){zn(yt,Tt,Ot)}}break;case 5:it(Pe,Pe.return);break;case 22:if(Pe.memoizedState!==null){ma(y);continue}}$e!==null?($e.return=Pe,qe=$e):ma(y)}W=W.sibling}if(pe){e:if(W=null,pe)for(y=g;;){if(y.tag===5){if(W===null){W=y;try{te=y.stateNode,I?Lt(te):Wt(y.stateNode,y.memoizedProps)}catch(Ot){zn(g,g.return,Ot)}}}else if(y.tag===6){if(W===null)try{oe=y.stateNode,I?gr(oe):Ut(oe,y.memoizedProps)}catch(Ot){zn(g,g.return,Ot)}}else if((y.tag!==22&&y.tag!==23||y.memoizedState===null||y===g)&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===g)break e;for(;y.sibling===null;){if(y.return===null||y.return===g)break e;W===y&&(W=null),y=y.return}W===y&&(W=null),y.sibling.return=y.return,y=y.sibling}}}break;case 19:fr(y,g),bn(g),W&4&&si(g);break;case 21:break;default:fr(y,g),bn(g)}}function bn(g){var y=g.flags;if(y&2){try{if(pe){e:{for(var I=g.return;I!==null;){if(mr(I)){var W=I;break e}I=I.return}throw Error(o(160))}switch(W.tag){case 5:var te=W.stateNode;W.flags&32&&(Ze(te),W.flags&=-33);var oe=ar(g);Hr(g,oe,te);break;case 3:case 4:var Pe=W.stateNode.containerInfo,$e=ar(g);jr(g,$e,Pe);break;default:throw Error(o(161))}}}catch(nt){zn(g,g.return,nt)}g.flags&=-3}y&4096&&(g.flags&=-4097)}function In(g,y,I){qe=g,li(g)}function li(g,y,I){for(var W=(g.mode&1)!==0;qe!==null;){var te=qe,oe=te.child;if(te.tag===22&&W){var Pe=te.memoizedState!==null||rt;if(!Pe){var $e=te.alternate,nt=$e!==null&&$e.memoizedState!==null||Ie;$e=rt;var yt=Ie;if(rt=Pe,(Ie=nt)&&!yt)for(qe=te;qe!==null;)Pe=qe,nt=Pe.child,Pe.tag===22&&Pe.memoizedState!==null?Ka(te):nt!==null?(nt.return=Pe,qe=nt):Ka(te);for(;oe!==null;)qe=oe,li(oe),oe=oe.sibling;qe=te,rt=$e,Ie=yt}Pi(g)}else(te.subtreeFlags&8772)!==0&&oe!==null?(oe.return=te,qe=oe):Pi(g)}}function Pi(g){for(;qe!==null;){var y=qe;if((y.flags&8772)!==0){var I=y.alternate;try{if((y.flags&8772)!==0)switch(y.tag){case 0:case 11:case 15:Ie||wt(5,y);break;case 1:var W=y.stateNode;if(y.flags&4&&!Ie)if(I===null)W.componentDidMount();else{var te=y.elementType===y.type?I.memoizedProps:Xa(y.type,I.memoizedProps);W.componentDidUpdate(te,I.memoizedState,W.__reactInternalSnapshotBeforeUpdate)}var oe=y.updateQueue;oe!==null&&Hu(y,oe,W);break;case 3:var Pe=y.updateQueue;if(Pe!==null){if(I=null,y.child!==null)switch(y.child.tag){case 5:I=se(y.child.stateNode);break;case 1:I=y.child.stateNode}Hu(y,Pe,I)}break;case 5:var $e=y.stateNode;I===null&&y.flags&4&&ut($e,y.type,y.memoizedProps,y);break;case 6:break;case 4:break;case 12:break;case 13:if(Ce&&y.memoizedState===null){var nt=y.alternate;if(nt!==null){var yt=nt.memoizedState;if(yt!==null){var Tt=yt.dehydrated;Tt!==null&&uo(Tt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Ie||y.flags&512&&xr(y)}catch(or){zn(y,y.return,or)}}if(y===g){qe=null;break}if(I=y.sibling,I!==null){I.return=y.return,qe=I;break}qe=y.return}}function ma(g){for(;qe!==null;){var y=qe;if(y===g){qe=null;break}var I=y.sibling;if(I!==null){I.return=y.return,qe=I;break}qe=y.return}}function Ka(g){for(;qe!==null;){var y=qe;try{switch(y.tag){case 0:case 11:case 15:var I=y.return;try{wt(4,y)}catch(nt){zn(y,I,nt)}break;case 1:var W=y.stateNode;if(typeof W.componentDidMount=="function"){var te=y.return;try{W.componentDidMount()}catch(nt){zn(y,te,nt)}}var oe=y.return;try{xr(y)}catch(nt){zn(y,oe,nt)}break;case 5:var Pe=y.return;try{xr(y)}catch(nt){zn(y,Pe,nt)}}}catch(nt){zn(y,y.return,nt)}if(y===g){qe=null;break}var $e=y.sibling;if($e!==null){$e.return=y.return,qe=$e;break}qe=y.return}}var fn=0,jn=1,oa=2,Uo=3,wo=4;if(typeof Symbol=="function"&&Symbol.for){var Sr=Symbol.for;fn=Sr("selector.component"),jn=Sr("selector.has_pseudo_class"),oa=Sr("selector.role"),Uo=Sr("selector.test_id"),wo=Sr("selector.text")}function _o(g){var y=ke(g);if(y!=null){if(typeof y.memoizedProps["data-testname"]!="string")throw Error(o(364));return y}if(g=Te(g),g===null)throw Error(o(362));return g.stateNode.current}function pu(g,y){switch(y.$$typeof){case fn:if(g.type===y.value)return!0;break;case jn:e:{y=y.value,g=[g,0];for(var I=0;I<g.length;){var W=g[I++],te=g[I++],oe=y[te];if(W.tag!==5||!Be(W)){for(;oe!=null&&pu(W,oe);)te++,oe=y[te];if(te===y.length){y=!0;break e}else for(W=W.child;W!==null;)g.push(W,te),W=W.sibling}}y=!1}return y;case oa:if(g.tag===5&&Qe(g.stateNode,y.value))return!0;break;case wo:if((g.tag===5||g.tag===6)&&(g=Re(g),g!==null&&0<=g.indexOf(y.value)))return!0;break;case Uo:if(g.tag===5&&(g=g.memoizedProps["data-testname"],typeof g=="string"&&g.toLowerCase()===y.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function Xu(g){switch(g.$$typeof){case fn:return"<"+(k(g.value)||"Unknown")+">";case jn:return":has("+(Xu(g)||"")+")";case oa:return'[role="'+g.value+'"]';case wo:return'"'+g.value+'"';case Uo:return'[data-testname="'+g.value+'"]';default:throw Error(o(365))}}function Za(g,y){var I=[];g=[g,0];for(var W=0;W<g.length;){var te=g[W++],oe=g[W++],Pe=y[oe];if(te.tag!==5||!Be(te)){for(;Pe!=null&&pu(te,Pe);)oe++,Pe=y[oe];if(oe===y.length)I.push(te);else for(te=te.child;te!==null;)g.push(te,oe),te=te.sibling}}return I}function Na(g,y){if(!Ne)throw Error(o(363));g=_o(g),g=Za(g,y),y=[],g=Array.from(g);for(var I=0;I<g.length;){var W=g[I++];if(W.tag===5)Be(W)||y.push(W.stateNode);else for(W=W.child;W!==null;)g.push(W),W=W.sibling}return y}var Rl=Math.ceil,ya=l.ReactCurrentDispatcher,Ho=l.ReactCurrentOwner,un=l.ReactCurrentBatchConfig,nr=0,Vr=null,wn=null,On=0,Zn=0,Vo=fi(0),tn=0,gu=null,Fs=0,rn=0,Qa=0,Ml=null,sa=null,vu=0,mu=1/0,Ai=null;function Kr(){mu=Ln()+500}var Fn=!1,Dn=null,Ja=null,xo=!1,eo=null,_c=0,Bn=0,yu=null,ul=-1,to=0;function hn(){return(nr&6)!==0?Ln():ul!==-1?ul:ul=Ln()}function ui(g){return(g.mode&1)===0?1:(nr&2)!==0&&On!==0?On&-On:Xe.transition!==null?(to===0&&(to=ks()),to):(g=_t,g!==0?g:le())}function la(g,y,I,W){if(50<Bn)throw Bn=0,yu=null,Error(o(185));ln(g,I,W),((nr&2)===0||g!==Vr)&&(g===Vr&&((nr&2)===0&&(rn|=I),tn===4&&fs(g,On)),Gi(g,W),I===1&&nr===0&&(y.mode&1)===0&&(Kr(),Lo&&ni()))}function Gi(g,y){var I=g.callbackNode;Qo(g,y);var W=Ks(g,g===Vr?On:0);if(W===0)I!==null&&No(I),g.callbackNode=null,g.callbackPriority=0;else if(y=W&-W,g.callbackPriority!==y){if(I!=null&&No(I),y===1)g.tag===0?Uu(df.bind(null,g)):bl(df.bind(null,g)),xe?ye(function(){(nr&6)===0&&ni()}):ho(Js,ni),I=null;else{switch(Zs(W)){case 1:I=Js;break;case 4:I=tu;break;case 16:I=ru;break;case 536870912:I=lf;break;default:I=ru}I=Fh(I,Ds.bind(null,g))}g.callbackPriority=y,g.callbackNode=I}}function Ds(g,y){if(ul=-1,to=0,(nr&6)!==0)throw Error(o(327));var I=g.callbackNode;if(jl()&&g.callbackNode!==I)return null;var W=Ks(g,g===Vr?On:0);if(W===0)return null;if((W&30)!==0||(W&g.expiredLanes)!==0||y)y=ds(g,W);else{y=W;var te=nr;nr|=2;var oe=hs();(Vr!==g||On!==y)&&(Ai=null,Kr(),Go(g,y));do try{Ec();break}catch($e){La(g,$e)}while(!0);Va(),ya.current=oe,nr=te,wn!==null?y=0:(Vr=null,On=0,y=tn)}if(y!==0){if(y===2&&(te=Cs(g),te!==0&&(W=te,y=xc(g,te))),y===1)throw I=gu,Go(g,0),fs(g,W),Gi(g,Ln()),I;if(y===6)fs(g,W);else{if(te=g.current.alternate,(W&30)===0&&!Zf(te)&&(y=ds(g,W),y===2&&(oe=Cs(g),oe!==0&&(W=oe,y=xc(g,oe))),y===1))throw I=gu,Go(g,0),fs(g,W),Gi(g,Ln()),I;switch(g.finishedWork=te,g.finishedLanes=W,y){case 0:case 1:throw Error(o(345));case 2:ps(g,sa,Ai);break;case 3:if(fs(g,W),(W&130023424)===W&&(y=vu+500-Ln(),10<y)){if(Ks(g,0)!==0)break;if(te=g.suspendedLanes,(te&W)!==W){hn(),g.pingedLanes|=g.suspendedLanes&te;break}g.timeoutHandle=ee(ps.bind(null,g,sa,Ai),y);break}ps(g,sa,Ai);break;case 4:if(fs(g,W),(W&4194240)===W)break;for(y=g.eventTimes,te=-1;0<W;){var Pe=31-ga(W);oe=1<<Pe,Pe=y[Pe],Pe>te&&(te=Pe),W&=~oe}if(W=te,W=Ln()-W,W=(120>W?120:480>W?480:1080>W?1080:1920>W?1920:3e3>W?3e3:4320>W?4320:1960*Rl(W/1960))-W,10<W){g.timeoutHandle=ee(ps.bind(null,g,sa,Ai),W);break}ps(g,sa,Ai);break;case 5:ps(g,sa,Ai);break;default:throw Error(o(329))}}}return Gi(g,Ln()),g.callbackNode===I?Ds.bind(null,g):null}function xc(g,y){var I=Ml;return g.current.memoizedState.isDehydrated&&(Go(g,y).flags|=256),g=ds(g,y),g!==2&&(y=sa,sa=I,y!==null&&Ku(y)),g}function Ku(g){sa===null?sa=g:sa.push.apply(sa,g)}function Zf(g){for(var y=g;;){if(y.flags&16384){var I=y.updateQueue;if(I!==null&&(I=I.stores,I!==null))for(var W=0;W<I.length;W++){var te=I[W],oe=te.getSnapshot;te=te.value;try{if(!Ri(oe(),te))return!1}catch{return!1}}}if(I=y.child,y.subtreeFlags&16384&&I!==null)I.return=y,y=I;else{if(y===g)break;for(;y.sibling===null;){if(y.return===null||y.return===g)return!0;y=y.return}y.sibling.return=y.return,y=y.sibling}}return!0}function fs(g,y){for(y&=~Qa,y&=~rn,g.suspendedLanes|=y,g.pingedLanes&=~y,g=g.expirationTimes;0<y;){var I=31-ga(y),W=1<<I;g[I]=-1,y&=~W}}function df(g){if((nr&6)!==0)throw Error(o(327));jl();var y=Ks(g,0);if((y&1)===0)return Gi(g,Ln()),null;var I=ds(g,y);if(g.tag!==0&&I===2){var W=Cs(g);W!==0&&(y=W,I=xc(g,W))}if(I===1)throw I=gu,Go(g,0),fs(g,y),Gi(g,Ln()),I;if(I===6)throw Error(o(345));return g.finishedWork=g.current.alternate,g.finishedLanes=y,ps(g,sa,Ai),Gi(g,Ln()),null}function Il(g){eo!==null&&eo.tag===0&&(nr&6)===0&&jl();var y=nr;nr|=1;var I=un.transition,W=_t;try{if(un.transition=null,_t=1,g)return g()}finally{_t=W,un.transition=I,nr=y,(nr&6)===0&&ni()}}function bu(){Zn=Vo.current,qr(Vo)}function Go(g,y){g.finishedWork=null,g.finishedLanes=0;var I=g.timeoutHandle;if(I!==ue&&(g.timeoutHandle=ue,ae(I)),wn!==null)for(I=wn.return;I!==null;){var W=I;switch(el(W),W.tag){case 1:W=W.type.childContextTypes,W!=null&&Ti();break;case 3:ai(),qr(Li),qr(hi),Ro();break;case 5:as(W);break;case 4:ai();break;case 13:qr(Mr);break;case 19:qr(Mr);break;case 10:Ca(W.type._context);break;case 22:case 23:bu()}I=I.return}if(Vr=g,wn=g=wu(g.current,null),On=Zn=y,tn=0,gu=null,Qa=rn=Fs=0,sa=Ml=null,Ga!==null){for(y=0;y<Ga.length;y++)if(I=Ga[y],W=I.interleaved,W!==null){I.interleaved=null;var te=W.next,oe=I.pending;if(oe!==null){var Pe=oe.next;oe.next=te,W.next=Pe}I.pending=W}Ga=null}return g}function La(g,y){do{var I=wn;try{if(Va(),_r.current=Is,os){for(var W=vr.memoizedState;W!==null;){var te=W.queue;te!==null&&(te.pending=null),W=W.next}os=!1}if(Hn=0,Vn=yn=vr=null,Io=!1,jo=0,Ho.current=null,I===null||I.return===null){tn=1,gu=y,wn=null;break}e:{var oe=g,Pe=I.return,$e=I,nt=y;if(y=On,$e.flags|=32768,nt!==null&&typeof nt=="object"&&typeof nt.then=="function"){var yt=nt,Tt=$e,or=Tt.tag;if((Tt.mode&1)===0&&(or===0||or===11||or===15)){var Ot=Tt.alternate;Ot?(Tt.updateQueue=Ot.updateQueue,Tt.memoizedState=Ot.memoizedState,Tt.lanes=Ot.lanes):(Tt.updateQueue=null,Tt.memoizedState=null)}var Cn=Xf(Pe);if(Cn!==null){Cn.flags&=-257,js(Cn,Pe,$e,oe,y),Cn.mode&1&&Yf(oe,yt,y),y=Cn,nt=yt;var cn=y.updateQueue;if(cn===null){var no=new Set;no.add(nt),y.updateQueue=no}else cn.add(nt);break e}else{if((y&1)===0){Yf(oe,yt,y),ro();break e}nt=Error(o(426))}}else if($r&&$e.mode&1){var cl=Xf(Pe);if(cl!==null){(cl.flags&65536)===0&&(cl.flags|=256),js(cl,Pe,$e,oe,y),je(Ui(nt,$e));break e}}oe=nt=Ui(nt,$e),tn!==4&&(tn=2),Ml===null?Ml=[oe]:Ml.push(oe),oe=Pe;do{switch(oe.tag){case 3:oe.flags|=65536,y&=-y,oe.lanes|=y;var et=Hi(oe,nt,y);il(oe,et);break e;case 1:$e=nt;var We=oe.type,ot=oe.stateNode;if((oe.flags&128)===0&&(typeof We.getDerivedStateFromError=="function"||ot!==null&&typeof ot.componentDidCatch=="function"&&(Ja===null||!Ja.has(ot)))){oe.flags|=65536,y&=-y,oe.lanes|=y;var Ct=va(oe,$e,y);il(oe,Ct);break e}}oe=oe.return}while(oe!==null)}Zu(I)}catch(Gt){y=Gt,wn===I&&I!==null&&(wn=I=I.return);continue}break}while(!0)}function hs(){var g=ya.current;return ya.current=Is,g===null?Is:g}function ro(){(tn===0||tn===3||tn===2)&&(tn=4),Vr===null||(Fs&268435455)===0&&(rn&268435455)===0||fs(Vr,On)}function ds(g,y){var I=nr;nr|=2;var W=hs();(Vr!==g||On!==y)&&(Ai=null,Go(g,y));do try{Sc();break}catch(te){La(g,te)}while(!0);if(Va(),nr=I,ya.current=W,wn!==null)throw Error(o(261));return Vr=null,On=0,tn}function Sc(){for(;wn!==null;)pf(wn)}function Ec(){for(;wn!==null&&!qu();)pf(wn)}function pf(g){var y=xp(g.alternate,g,Zn);g.memoizedProps=g.pendingProps,y===null?Zu(g):wn=y,Ho.current=null}function Zu(g){var y=g;do{var I=y.alternate;if(g=y.return,(y.flags&32768)===0){if(I=He(I,y,Zn),I!==null){wn=I;return}}else{if(I=lt(I,y),I!==null){I.flags&=32767,wn=I;return}if(g!==null)g.flags|=32768,g.subtreeFlags=0,g.deletions=null;else{tn=6,wn=null;return}}if(y=y.sibling,y!==null){wn=y;return}wn=y=g}while(y!==null);tn===0&&(tn=5)}function ps(g,y,I){var W=_t,te=un.transition;try{un.transition=null,_t=1,yp(g,y,I,W)}finally{un.transition=te,_t=W}return null}function yp(g,y,I,W){do jl();while(eo!==null);if((nr&6)!==0)throw Error(o(327));I=g.finishedWork;var te=g.finishedLanes;if(I===null)return null;if(g.finishedWork=null,g.finishedLanes=0,I===g.current)throw Error(o(177));g.callbackNode=null,g.callbackPriority=0;var oe=I.lanes|I.childLanes;if(Jo(g,oe),g===Vr&&(wn=Vr=null,On=0),(I.subtreeFlags&2064)===0&&(I.flags&2064)===0||xo||(xo=!0,Fh(ru,function(){return jl(),null})),oe=(I.flags&15990)!==0,(I.subtreeFlags&15990)!==0||oe){oe=un.transition,un.transition=null;var Pe=_t;_t=1;var $e=nr;nr|=4,Ho.current=null,xt(g,I),Vi(I,g),z(g.containerInfo),g.current=I,In(I),Qs(),nr=$e,_t=Pe,un.transition=oe}else g.current=I;if(xo&&(xo=!1,eo=g,_c=te),oe=g.pendingLanes,oe===0&&(Ja=null),za(I.stateNode),Gi(g,Ln()),y!==null)for(W=g.onRecoverableError,I=0;I<y.length;I++)te=y[I],W(te.value,{componentStack:te.stack,digest:te.digest});if(Fn)throw Fn=!1,g=Dn,Dn=null,g;return(_c&1)!==0&&g.tag!==0&&jl(),oe=g.pendingLanes,(oe&1)!==0?g===yu?Bn++:(Bn=0,yu=g):Bn=0,ni(),null}function jl(){if(eo!==null){var g=Zs(_c),y=un.transition,I=_t;try{if(un.transition=null,_t=16>g?16:g,eo===null)var W=!1;else{if(g=eo,eo=null,_c=0,(nr&6)!==0)throw Error(o(331));var te=nr;for(nr|=4,qe=g.current;qe!==null;){var oe=qe,Pe=oe.child;if((qe.flags&16)!==0){var $e=oe.deletions;if($e!==null){for(var nt=0;nt<$e.length;nt++){var yt=$e[nt];for(qe=yt;qe!==null;){var Tt=qe;switch(Tt.tag){case 0:case 11:case 15:Bt(8,Tt,oe)}var or=Tt.child;if(or!==null)or.return=Tt,qe=or;else for(;qe!==null;){Tt=qe;var Ot=Tt.sibling,Cn=Tt.return;if(Ar(Tt),Tt===yt){qe=null;break}if(Ot!==null){Ot.return=Cn,qe=Ot;break}qe=Cn}}}var cn=oe.alternate;if(cn!==null){var no=cn.child;if(no!==null){cn.child=null;do{var cl=no.sibling;no.sibling=null,no=cl}while(no!==null)}}qe=oe}}if((oe.subtreeFlags&2064)!==0&&Pe!==null)Pe.return=oe,qe=Pe;else e:for(;qe!==null;){if(oe=qe,(oe.flags&2048)!==0)switch(oe.tag){case 0:case 11:case 15:Bt(9,oe,oe.return)}var et=oe.sibling;if(et!==null){et.return=oe.return,qe=et;break e}qe=oe.return}}var We=g.current;for(qe=We;qe!==null;){Pe=qe;var ot=Pe.child;if((Pe.subtreeFlags&2064)!==0&&ot!==null)ot.return=Pe,qe=ot;else e:for(Pe=We;qe!==null;){if($e=qe,($e.flags&2048)!==0)try{switch($e.tag){case 0:case 11:case 15:wt(9,$e)}}catch(Gt){zn($e,$e.return,Gt)}if($e===Pe){qe=null;break e}var Ct=$e.sibling;if(Ct!==null){Ct.return=$e.return,qe=Ct;break e}qe=$e.return}}if(nr=te,ni(),ri&&typeof ri.onPostCommitFiberRoot=="function")try{ri.onPostCommitFiberRoot(po,g)}catch{}W=!0}return W}finally{_t=I,un.transition=y}}return!1}function jh(g,y,I){y=Ui(I,y),y=Hi(g,y,1),g=$a(g,y,1),y=hn(),g!==null&&(ln(g,1,y),Gi(g,y))}function zn(g,y,I){if(g.tag===3)jh(g,g,I);else for(;y!==null;){if(y.tag===3){jh(y,g,I);break}else if(y.tag===1){var W=y.stateNode;if(typeof y.type.getDerivedStateFromError=="function"||typeof W.componentDidCatch=="function"&&(Ja===null||!Ja.has(W))){g=Ui(I,g),g=va(y,g,1),y=$a(y,g,1),g=hn(),y!==null&&(ln(y,1,g),Gi(y,g));break}}y=y.return}}function bp(g,y,I){var W=g.pingCache;W!==null&&W.delete(y),y=hn(),g.pingedLanes|=g.suspendedLanes&I,Vr===g&&(On&I)===I&&(tn===4||tn===3&&(On&130023424)===On&&500>Ln()-vu?Go(g,0):Qa|=I),Gi(g,y)}function wp(g,y){y===0&&((g.mode&1)===0?y=1:(y=Os,Os<<=1,(Os&130023424)===0&&(Os=4194304)));var I=hn();g=ra(g,y),g!==null&&(ln(g,y,I),Gi(g,I))}function _p(g){var y=g.memoizedState,I=0;y!==null&&(I=y.retryLane),wp(g,I)}function h0(g,y){var I=0;switch(g.tag){case 13:var W=g.stateNode,te=g.memoizedState;te!==null&&(I=te.retryLane);break;case 19:W=g.stateNode;break;default:throw Error(o(314))}W!==null&&W.delete(y),wp(g,I)}var xp;xp=function(g,y,I){if(g!==null)if(g.memoizedProps!==y.pendingProps||Li.current)oi=!0;else{if((g.lanes&I)===0&&(y.flags&128)===0)return oi=!1,ie(g,y,I);oi=(g.flags&131072)!==0}else oi=!1,$r&&(y.flags&1048576)!==0&&iu(y,Aa,y.index);switch(y.lanes=0,y.tag){case 2:var W=y.type;B(g,y),g=y.pendingProps;var te=Da(y,hi.current);ns(y,I),te=Fo(null,y,W,g,te,I);var oe=Do();return y.flags|=1,typeof te=="object"&&te!==null&&typeof te.render=="function"&&te.$$typeof===void 0?(y.tag=1,y.memoizedState=null,y.updateQueue=null,ti(W)?(oe=!0,Zo(y)):oe=!1,y.memoizedState=te.state!==null&&te.state!==void 0?te.state:null,nl(y),te.updater=Wu,y.stateNode=te,te._reactInternals=y,qi(y,W,g,I),y=ia(null,y,W,!0,oe,I)):(y.tag=0,$r&&oe&&Ts(y),mi(null,y,te,I),y=y.child),y;case 16:W=y.elementType;e:{switch(B(g,y),g=y.pendingProps,te=W._init,W=te(W._payload),y.type=W,te=y.tag=d0(W),g=Xa(W,g),te){case 0:y=ls(null,y,W,g,I);break e;case 1:y=Ei(null,y,W,g,I);break e;case 11:y=wc(null,y,W,g,I);break e;case 14:y=ss(null,y,W,Xa(W.type,g),I);break e}throw Error(o(306,W,""))}return y;case 0:return W=y.type,te=y.pendingProps,te=y.elementType===W?te:Xa(W,te),ls(g,y,W,te,I);case 1:return W=y.type,te=y.pendingProps,te=y.elementType===W?te:Xa(W,te),Ei(g,y,W,te,I);case 3:e:{if(ll(y),g===null)throw Error(o(387));W=y.pendingProps,oe=y.memoizedState,te=oe.element,El(g,y),go(y,W,null,I);var Pe=y.memoizedState;if(W=Pe.element,Ce&&oe.isDehydrated)if(oe={element:W,isDehydrated:!1,cache:Pe.cache,pendingSuspenseBoundaries:Pe.pendingSuspenseBoundaries,transitions:Pe.transitions},y.updateQueue.baseState=oe,y.memoizedState=oe,y.flags&256){te=Ui(Error(o(423)),y),y=Ll(g,y,W,I,te);break e}else if(W!==te){te=Ui(Error(o(424)),y),y=Ll(g,y,W,I,te);break e}else for(Ce&&(di=fa(y.stateNode.containerInfo),Un=y,$r=!0,Ha=null,tl=!1),I=En(y,null,W,I),y.child=I;I;)I.flags=I.flags&-3|4096,I=I.sibling;else{if(Le(),W===te){y=Z(g,y,I);break e}mi(g,y,W,I)}y=y.child}return y;case 5:return Bi(y),g===null&&ts(y),W=y.type,te=y.pendingProps,oe=g!==null?g.memoizedProps:null,Pe=te.children,re(W,te)?Pe=null:oe!==null&&re(W,oe)&&(y.flags|=32),Xr(g,y),mi(g,y,Pe,I),y.child;case 6:return g===null&&ts(y),null;case 13:return hf(g,y,I);case 4:return is(y,y.stateNode.containerInfo),W=y.pendingProps,g===null?y.child=cr(y,null,W,I):mi(g,y,W,I),y.child;case 11:return W=y.type,te=y.pendingProps,te=y.elementType===W?te:Xa(W,te),wc(g,y,W,te,I);case 7:return mi(g,y,y.pendingProps,I),y.child;case 8:return mi(g,y,y.pendingProps.children,I),y.child;case 12:return mi(g,y,y.pendingProps.children,I),y.child;case 10:e:{if(W=y.type._context,te=y.pendingProps,oe=y.memoizedProps,Pe=te.value,Oa(y,W,Pe),oe!==null)if(Ri(oe.value,Pe)){if(oe.children===te.children&&!Li.current){y=Z(g,y,I);break e}}else for(oe=y.child,oe!==null&&(oe.return=y);oe!==null;){var $e=oe.dependencies;if($e!==null){Pe=oe.child;for(var nt=$e.firstContext;nt!==null;){if(nt.context===W){if(oe.tag===1){nt=ka(-1,I&-I),nt.tag=2;var yt=oe.updateQueue;if(yt!==null){yt=yt.shared;var Tt=yt.pending;Tt===null?nt.next=nt:(nt.next=Tt.next,Tt.next=nt),yt.pending=nt}}oe.lanes|=I,nt=oe.alternate,nt!==null&&(nt.lanes|=I),rs(oe.return,I,y),$e.lanes|=I;break}nt=nt.next}}else if(oe.tag===10)Pe=oe.type===y.type?null:oe.child;else if(oe.tag===18){if(Pe=oe.return,Pe===null)throw Error(o(341));Pe.lanes|=I,$e=Pe.alternate,$e!==null&&($e.lanes|=I),rs(Pe,I,y),Pe=oe.sibling}else Pe=oe.child;if(Pe!==null)Pe.return=oe;else for(Pe=oe;Pe!==null;){if(Pe===y){Pe=null;break}if(oe=Pe.sibling,oe!==null){oe.return=Pe.return,Pe=oe;break}Pe=Pe.return}oe=Pe}mi(g,y,te.children,I),y=y.child}return y;case 9:return te=y.type,W=y.pendingProps.children,ns(y,I),te=Fi(te),W=W(te),y.flags|=1,mi(g,y,W,I),y.child;case 14:return W=y.type,te=Xa(W,y.pendingProps),te=Xa(W.type,te),ss(g,y,W,te,I);case 15:return bo(g,y,y.type,y.pendingProps,I);case 17:return W=y.type,te=y.pendingProps,te=y.elementType===W?te:Xa(W,te),B(g,y),y.tag=1,ti(W)?(g=!0,Zo(y)):g=!1,ns(y,I),Wf(y,W,te),qi(y,W,te,I),ia(null,y,W,!0,g,I);case 19:return O(g,y,I);case 22:return Ur(g,y,I)}throw Error(o(156,y.tag))};function Fh(g,y){return ho(g,y)}function Sp(g,y,I,W){this.tag=g,this.key=I,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=y,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=W,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $o(g,y,I,W){return new Sp(g,y,I,W)}function Pc(g){return g=g.prototype,!(!g||!g.isReactComponent)}function d0(g){if(typeof g=="function")return Pc(g)?1:0;if(g!=null){if(g=g.$$typeof,g===_)return 11;if(g===m)return 14}return 2}function wu(g,y){var I=g.alternate;return I===null?(I=$o(g.tag,y,g.key,g.mode),I.elementType=g.elementType,I.type=g.type,I.stateNode=g.stateNode,I.alternate=g,g.alternate=I):(I.pendingProps=y,I.type=g.type,I.flags=0,I.subtreeFlags=0,I.deletions=null),I.flags=g.flags&14680064,I.childLanes=g.childLanes,I.lanes=g.lanes,I.child=g.child,I.memoizedProps=g.memoizedProps,I.memoizedState=g.memoizedState,I.updateQueue=g.updateQueue,y=g.dependencies,I.dependencies=y===null?null:{lanes:y.lanes,firstContext:y.firstContext},I.sibling=g.sibling,I.index=g.index,I.ref=g.ref,I}function Qf(g,y,I,W,te,oe){var Pe=2;if(W=g,typeof g=="function")Pc(g)&&(Pe=1);else if(typeof g=="string")Pe=5;else e:switch(g){case h:return ba(I.children,te,oe,y);case v:Pe=8,te|=8;break;case p:return g=$o(12,I,y,te|2),g.elementType=p,g.lanes=oe,g;case S:return g=$o(13,I,y,te),g.elementType=S,g.lanes=oe,g;case x:return g=$o(19,I,y,te),g.elementType=x,g.lanes=oe,g;case E:return Ac(I,te,oe,y);default:if(typeof g=="object"&&g!==null)switch(g.$$typeof){case f:Pe=10;break e;case b:Pe=9;break e;case _:Pe=11;break e;case m:Pe=14;break e;case w:Pe=16,W=null;break e}throw Error(o(130,g==null?g:typeof g,""))}return y=$o(Pe,I,y,te),y.elementType=g,y.type=W,y.lanes=oe,y}function ba(g,y,I,W){return g=$o(7,g,W,y),g.lanes=I,g}function Ac(g,y,I,W){return g=$o(22,g,W,y),g.elementType=E,g.lanes=I,g.stateNode={isHidden:!1},g}function Oc(g,y,I){return g=$o(6,g,null,y),g.lanes=I,g}function Jf(g,y,I){return y=$o(4,g.children!==null?g.children:[],g.key,y),y.lanes=I,y.stateNode={containerInfo:g.containerInfo,pendingChildren:null,implementation:g.implementation},y}function Ep(g,y,I,W,te){this.tag=y,this.containerInfo=g,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ue,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ns(0),this.expirationTimes=Ns(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ns(0),this.identifierPrefix=W,this.onRecoverableError=te,Ce&&(this.mutableSourceEagerHydrationData=null)}function Dh(g,y,I,W,te,oe,Pe,$e,nt){return g=new Ep(g,y,I,$e,nt),y===1?(y=1,oe===!0&&(y|=8)):y=0,oe=$o(3,null,null,y),g.current=oe,oe.stateNode=g,oe.memoizedState={element:W,isDehydrated:I,cache:null,transitions:null,pendingSuspenseBoundaries:null},nl(oe),g}function eh(g){if(!g)return Qr;g=g._reactInternals;e:{if(M(g)!==g||g.tag!==1)throw Error(o(170));var y=g;do{switch(y.tag){case 3:y=y.stateNode.context;break e;case 1:if(ti(y.type)){y=y.stateNode.__reactInternalMemoizedMergedChildContext;break e}}y=y.return}while(y!==null);throw Error(o(171))}if(g.tag===1){var I=g.type;if(ti(I))return pa(g,I,y)}return y}function Qu(g){var y=g._reactInternals;if(y===void 0)throw typeof g.render=="function"?Error(o(188)):(g=Object.keys(g).join(","),Error(o(268,g)));return g=L(y),g===null?null:g.stateNode}function th(g,y){if(g=g.memoizedState,g!==null&&g.dehydrated!==null){var I=g.retryLane;g.retryLane=I!==0&&I<y?I:y}}function Cc(g,y){th(g,y),(g=g.alternate)&&th(g,y)}function p0(g){return g=L(g),g===null?null:g.stateNode}function Pp(){return null}return r.attemptContinuousHydration=function(g){if(g.tag===13){var y=ra(g,134217728);if(y!==null){var I=hn();la(y,g,134217728,I)}Cc(g,134217728)}},r.attemptDiscreteHydration=function(g){if(g.tag===13){var y=ra(g,1);if(y!==null){var I=hn();la(y,g,1,I)}Cc(g,1)}},r.attemptHydrationAtCurrentPriority=function(g){if(g.tag===13){var y=ui(g),I=ra(g,y);if(I!==null){var W=hn();la(I,g,y,W)}Cc(g,y)}},r.attemptSynchronousHydration=function(g){switch(g.tag){case 3:var y=g.stateNode;if(y.current.memoizedState.isDehydrated){var I=Xs(y.pendingLanes);I!==0&&(Ba(y,I|1),Gi(y,Ln()),(nr&6)===0&&(Kr(),ni()))}break;case 13:Il(function(){var W=ra(g,1);if(W!==null){var te=hn();la(W,g,1,te)}}),Cc(g,1)}},r.batchedUpdates=function(g,y){var I=nr;nr|=1;try{return g(y)}finally{nr=I,nr===0&&(Kr(),Lo&&ni())}},r.createComponentSelector=function(g){return{$$typeof:fn,value:g}},r.createContainer=function(g,y,I,W,te,oe,Pe){return Dh(g,y,!1,null,I,W,te,oe,Pe)},r.createHasPseudoClassSelector=function(g){return{$$typeof:jn,value:g}},r.createHydrationContainer=function(g,y,I,W,te,oe,Pe,$e,nt){return g=Dh(I,W,!0,g,te,oe,Pe,$e,nt),g.context=eh(null),I=g.current,W=hn(),te=ui(I),oe=ka(W,te),oe.callback=y??null,$a(I,oe,te),g.current.lanes=te,ln(g,te,W),Gi(g,W),g},r.createPortal=function(g,y,I){var W=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:W==null?null:""+W,children:g,containerInfo:y,implementation:I}},r.createRoleSelector=function(g){return{$$typeof:oa,value:g}},r.createTestNameSelector=function(g){return{$$typeof:Uo,value:g}},r.createTextSelector=function(g){return{$$typeof:wo,value:g}},r.deferredUpdates=function(g){var y=_t,I=un.transition;try{return un.transition=null,_t=16,g()}finally{_t=y,un.transition=I}},r.discreteUpdates=function(g,y,I,W,te){var oe=_t,Pe=un.transition;try{return un.transition=null,_t=1,g(y,I,W,te)}finally{_t=oe,un.transition=Pe,nr===0&&Kr()}},r.findAllNodes=Na,r.findBoundingRects=function(g,y){if(!Ne)throw Error(o(363));y=Na(g,y),g=[];for(var I=0;I<y.length;I++)g.push(ge(y[I]));for(y=g.length-1;0<y;y--){I=g[y];for(var W=I.x,te=W+I.width,oe=I.y,Pe=oe+I.height,$e=y-1;0<=$e;$e--)if(y!==$e){var nt=g[$e],yt=nt.x,Tt=yt+nt.width,or=nt.y,Ot=or+nt.height;if(W>=yt&&oe>=or&&te<=Tt&&Pe<=Ot){g.splice(y,1);break}else if(W!==yt||I.width!==nt.width||Ot<oe||or>Pe){if(!(oe!==or||I.height!==nt.height||Tt<W||yt>te)){yt>W&&(nt.width+=yt-W,nt.x=W),Tt<te&&(nt.width=te-yt),g.splice(y,1);break}}else{or>oe&&(nt.height+=or-oe,nt.y=oe),Ot<Pe&&(nt.height=Pe-or),g.splice(y,1);break}}}return g},r.findHostInstance=Qu,r.findHostInstanceWithNoPortals=function(g){return g=C(g),g=g!==null?G(g):null,g===null?null:g.stateNode},r.findHostInstanceWithWarning=function(g){return Qu(g)},r.flushControlled=function(g){var y=nr;nr|=1;var I=un.transition,W=_t;try{un.transition=null,_t=1,g()}finally{_t=W,un.transition=I,nr=y,nr===0&&(Kr(),ni())}},r.flushPassiveEffects=jl,r.flushSync=Il,r.focusWithin=function(g,y){if(!Ne)throw Error(o(363));for(g=_o(g),y=Za(g,y),y=Array.from(y),g=0;g<y.length;){var I=y[g++];if(!Be(I)){if(I.tag===5&&ct(I.stateNode))return!0;for(I=I.child;I!==null;)y.push(I),I=I.sibling}}return!1},r.getCurrentUpdatePriority=function(){return _t},r.getFindAllNodesFailureDescription=function(g,y){if(!Ne)throw Error(o(363));var I=0,W=[];g=[_o(g),0];for(var te=0;te<g.length;){var oe=g[te++],Pe=g[te++],$e=y[Pe];if((oe.tag!==5||!Be(oe))&&(pu(oe,$e)&&(W.push(Xu($e)),Pe++,Pe>I&&(I=Pe)),Pe<y.length))for(oe=oe.child;oe!==null;)g.push(oe,Pe),oe=oe.sibling}if(I<y.length){for(g=[];I<y.length;I++)g.push(Xu(y[I]));return`findAllNodes was able to match part of the selector:
58
- `+(W.join(" > ")+`
59
-
60
- No matching component was found for:
61
- `)+g.join(" > ")}return null},r.getPublicRootInstance=function(g){if(g=g.current,!g.child)return null;switch(g.child.tag){case 5:return se(g.child.stateNode);default:return g.child.stateNode}},r.injectIntoDevTools=function(g){if(g={bundleType:g.bundleType,version:g.version,rendererPackageName:g.rendererPackageName,rendererConfig:g.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:p0,findFiberByHostInstance:g.findFiberByHostInstance||Pp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")g=!1;else{var y=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(y.isDisabled||!y.supportsFiber)g=!0;else{try{po=y.inject(g),ri=y}catch{}g=!!y.checkDCE}}return g},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(g,y,I,W){if(!Ne)throw Error(o(363));g=Na(g,y);var te=mt(g,I,W).disconnect;return{disconnect:function(){te()}}},r.registerMutableSourceForHydration=function(g,y){var I=y._getVersion;I=I(y._source),g.mutableSourceEagerHydrationData==null?g.mutableSourceEagerHydrationData=[y,I]:g.mutableSourceEagerHydrationData.push(y,I)},r.runWithPriority=function(g,y){var I=_t;try{return _t=g,y()}finally{_t=I}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(g,y,I,W){var te=y.current,oe=hn(),Pe=ui(te);return I=eh(I),y.context===null?y.context=I:y.pendingContext=I,y=ka(oe,Pe),y.payload={element:g},W=W===void 0?null:W,W!==null&&(y.callback=W),g=$a(te,y,Pe),g!==null&&(la(g,te,Pe,oe),xi(g,te,Pe)),Pe},r}),ag}var v5;function sx(){return v5||(v5=1,ig.exports=ox()),ig.exports}var lx=sx();const ux=dc(lx);var og={exports:{}},Fc={};/**
62
- * @license React
63
- * react-reconciler-constants.production.min.js
64
- *
65
- * Copyright (c) Facebook, Inc. and its affiliates.
66
- *
67
- * This source code is licensed under the MIT license found in the
68
- * LICENSE file in the root directory of this source tree.
69
- */var m5;function cx(){return m5||(m5=1,Fc.ConcurrentRoot=1,Fc.ContinuousEventPriority=4,Fc.DefaultEventPriority=16,Fc.DiscreteEventPriority=1,Fc.IdleEventPriority=536870912,Fc.LegacyRoot=0),Fc}var y5;function fx(){return y5||(y5=1,og.exports=cx()),og.exports}var yw=fx(),hx=br();const b5={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let w5=!1,_5=!1;const Fv=".react-konva-event",dx=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
70
- Position of a node will be changed during drag&drop, so you should update state of the react app as well.
71
- Consider to add onDragMove or onDragEnd events.
72
- For more info see: https://github.com/konvajs/react-konva/issues/256
73
- `,px=`ReactKonva: You are using "zIndex" attribute for a Konva node.
74
- react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
75
- For more info see: https://github.com/konvajs/react-konva/issues/194
76
- `,gx={};function X1(e,t,r=gx){if(!w5&&"zIndex"in t&&(console.warn(px),w5=!0),!_5&&t.draggable){var n=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;n&&!i&&(console.warn(dx),_5=!0)}for(var a in r)if(!b5[a]){var o=a.slice(0,2)==="on",l=r[a]!==t[a];if(o&&l){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,r[a])}var d=!t.hasOwnProperty(a);d&&e.setAttr(a,void 0)}var h=t._useStrictMode,v={},p=!1;const f={};for(var a in t)if(!b5[a]){var o=a.slice(0,2)==="on",b=r[a]!==t[a];if(o&&b){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[a]&&(f[u]=t[a])}!o&&(t[a]!==r[a]||h&&t[a]!==e.getAttr(a))&&(p=!0,v[a]=t[a])}p&&(e.setAttrs(v),nf(e));for(var u in f)e.on(u+Fv,f[u])}function nf(e){if(!hx.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}var sg=xv();const bw={},vx={};Qd.Node.prototype._applyProps=X1;function mx(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),nf(e)}function yx(e,t,r){let n=Qd[e];n||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),n=Qd.Group);const i={},a={};for(var o in t){var l=o.slice(0,2)==="on";l?a[o]=t[o]:i[o]=t[o]}const u=new n(i);return X1(u,a),u}function bx(e,t,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function wx(e,t,r){return!1}function _x(e){return e}function xx(){return null}function Sx(){return null}function Ex(e,t,r,n){return vx}function Px(){}function Ax(e){}function Ox(e,t){return!1}function Cx(){return bw}function kx(){return bw}const Nx=setTimeout,Lx=clearTimeout,Tx=-1;function Rx(e,t){return!1}const Mx=!1,Ix=!0,jx=!0;function Fx(e,t){t.parent===e?t.moveToTop():e.add(t),nf(e)}function Dx(e,t){t.parent===e?t.moveToTop():e.add(t),nf(e)}function ww(e,t,r){t._remove(),e.add(t),t.setZIndex(r.getZIndex()),nf(e)}function Bx(e,t,r){ww(e,t,r)}function zx(e,t){t.destroy(),t.off(Fv),nf(e)}function qx(e,t){t.destroy(),t.off(Fv),nf(e)}function Ux(e,t,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function Hx(e,t,r){}function Vx(e,t,r,n,i){X1(e,i,n)}function Gx(e){e.hide(),nf(e)}function $x(e){}function Wx(e,t){(t.visible==null||t.visible)&&e.show()}function Yx(e,t){}function Xx(e){}function Kx(){}const Zx=()=>yw.DefaultEventPriority,Qx=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Fx,appendChildToContainer:Dx,appendInitialChild:mx,cancelTimeout:Lx,clearContainer:Xx,commitMount:Hx,commitTextUpdate:Ux,commitUpdate:Vx,createInstance:yx,createTextInstance:bx,detachDeletedInstance:Kx,finalizeInitialChildren:wx,getChildHostContext:kx,getCurrentEventPriority:Zx,getPublicInstance:_x,getRootHostContext:Cx,hideInstance:Gx,hideTextInstance:$x,idlePriority:sg.unstable_IdlePriority,insertBefore:ww,insertInContainerBefore:Bx,isPrimaryRenderer:Mx,noTimeout:Tx,now:sg.unstable_now,prepareForCommit:xx,preparePortalMount:Sx,prepareUpdate:Ex,removeChild:zx,removeChildFromContainer:qx,resetAfterCommit:Px,resetTextContent:Ax,run:sg.unstable_runWithPriority,scheduleTimeout:Nx,shouldDeprioritizeSubtree:Ox,shouldSetTextContent:Rx,supportsMutation:jx,unhideInstance:Wx,unhideTextInstance:Yx,warnsIfNotActing:Ix},Symbol.toStringTag,{value:"Module"}));var Jx=Object.defineProperty,eS=Object.defineProperties,tS=Object.getOwnPropertyDescriptors,x5=Object.getOwnPropertySymbols,rS=Object.prototype.hasOwnProperty,nS=Object.prototype.propertyIsEnumerable,S5=(e,t,r)=>t in e?Jx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,E5=(e,t)=>{for(var r in t||(t={}))rS.call(t,r)&&S5(e,r,t[r]);if(x5)for(var r of x5(t))nS.call(t,r)&&S5(e,r,t[r]);return e},iS=(e,t)=>eS(e,tS(t)),P5,A5;typeof window<"u"&&((P5=window.document)!=null&&P5.createElement||((A5=window.navigator)==null?void 0:A5.product)==="ReactNative")?wi.useLayoutEffect:wi.useEffect;function _w(e,t,r){if(!e)return;if(r(e)===!0)return e;let n=e.child;for(;n;){const i=_w(n,t,r);if(i)return i;n=n.sibling}}function xw(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const O5=console.error;console.error=function(){const e=[...arguments].join("");if(e?.startsWith("Warning:")&&e.includes("useContext")){console.error=O5;return}return O5.apply(this,arguments)};const Dv=xw(wi.createContext(null));class Sw extends wi.Component{render(){return wi.createElement(Dv.Provider,{value:this._reactInternals},this.props.children)}}function aS(){const e=wi.useContext(Dv);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=wi.useId();return wi.useMemo(()=>{for(const n of[e,e?.alternate]){if(!n)continue;const i=_w(n,!1,a=>{let o=a.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}});if(i)return i}},[e,t])}function oS(){const e=aS(),[t]=wi.useState(()=>new Map);t.clear();let r=e;for(;r;){if(r.type&&typeof r.type=="object"){const i=r.type._context===void 0&&r.type.Provider===r.type?r.type:r.type._context;i&&i!==Dv&&!t.has(i)&&t.set(i,wi.useContext(xw(i)))}r=r.return}return t}function Ew(){const e=oS();return wi.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>n=>wi.createElement(t,null,wi.createElement(r.Provider,iS(E5({},n),{value:e.get(r)}))),t=>wi.createElement(Sw,E5({},t))),[e])}function sS(e){const t=fe.useRef({});return fe.useLayoutEffect(()=>{t.current=e}),fe.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const lS=e=>{const t=fe.useRef(),r=fe.useRef(),n=fe.useRef(),i=sS(e),a=Ew(),o=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return fe.useLayoutEffect(()=>(r.current=new Qd.Stage({width:e.width,height:e.height,container:t.current}),o(r.current),n.current=Dd.createContainer(r.current,yw.LegacyRoot,!1,null),Dd.updateContainer(fe.createElement(a,{},e.children),n.current),()=>{Qd.isBrowser&&(o(null),Dd.updateContainer(null,n.current,null),r.current.destroy())}),[]),fe.useLayoutEffect(()=>{o(r.current),X1(r.current,e,i),Dd.updateContainer(fe.createElement(a,{},e.children),n.current,null)}),fe.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},uS="Layer",dn="Group",A1="Label",xn="Rect",cS="Circle",Vc="Line",Eu="Image",Nu="Text",Bv="Arc",O1="Tag",J2="Path",Jd="Transformer",Dd=ux(Qx);Dd.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:fe.version,rendererPackageName:"react-konva"});const fS=fe.forwardRef((e,t)=>fe.createElement(Sw,{},fe.createElement(lS,{...e,forwardedRef:t})));var lg,C5;function hS(){if(C5)return lg;C5=1;var e=op();return lg=function(r,n,i){const a=e.useRef("loading"),o=e.useRef(),[l,u]=e.useState(0),d=e.useRef(),h=e.useRef(),v=e.useRef();return(d.current!==r||h.current!==n||v.current!==i)&&(a.current="loading",o.current=void 0,d.current=r,h.current=n,v.current=i),e.useLayoutEffect(function(){if(!r)return;var p=document.createElement("img");function f(){p.decode().catch(()=>{}).finally(()=>{a.current="loaded",o.current=p,u(Math.random())})}function b(){a.current="failed",o.current=void 0,u(Math.random())}return p.addEventListener("load",f),p.addEventListener("error",b),n&&(p.crossOrigin=n),i&&(p.referrerPolicy=i),p.src=r,function(){p.removeEventListener("load",f),p.removeEventListener("error",b)}},[r,n,i]),[o.current,a.current]},lg}var dS=hS();const zv=dc(dS);var pS=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const gS=e=>{const t=window.getComputedStyle(e).position;return!(t==="absolute"||t==="relative")};function vS(e=()=>{}){const t=fe.useRef(e);return t.current=e,fe.useCallback((...r)=>t.current.apply(null,r),[])}const C1=({children:e,groupProps:t,divProps:r,transform:n,transformFunc:i,parentNodeFunc:a})=>{const o=Ew(),l=fe.useRef(null),[u]=fe.useState(()=>document.createElement("div")),d=fe.useMemo(()=>h4.createRoot(u),[u]),h=n??!0,v=vS(()=>{if(h&&l.current){let S=l.current.getAbsoluteTransform().decompose();i&&(S=i(S)),u.style.position="absolute",u.style.zIndex="10",u.style.top="0px",u.style.left="0px",u.style.transform=`translate(${S.x}px, ${S.y}px) rotate(${S.rotation}deg) scaleX(${S.scaleX}) scaleY(${S.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 p=r||{},{style:f}=p,b=pS(p,["style"]);Object.assign(u.style,f),Object.assign(u,b)});return fe.useLayoutEffect(()=>{var p;const f=l.current;if(!f)return;const b=a?a({stage:f.getStage()}):(p=f.getStage())===null||p===void 0?void 0:p.container();if(b)return b.appendChild(u),h&&gS(b)&&(b.style.position="relative"),f.on("absoluteTransformChange",v),v(),()=>{var _;f.off("absoluteTransformChange",v),(_=u.parentNode)===null||_===void 0||_.removeChild(u)}},[h,a]),fe.useLayoutEffect(()=>{v()},[r,i]),fe.useLayoutEffect(()=>{queueMicrotask(()=>{cw.flushSync(()=>{d.render(fe.createElement(o,null,e))})})}),fe.useLayoutEffect(()=>()=>{setTimeout(()=>{d.unmount()})},[]),fe.createElement(dn,Object.assign({ref:l},t))},qv=({selector:e,enabled:t,children:r})=>{const n=fe.useRef(null),i=fe.useRef(null),a=fe.useRef(null),o=t??!0;return fe.useLayoutEffect(()=>{if(!n.current||!i.current)return;a.current=i.current;const u=n.current.getStage().findOne(e);o&&u?i.current.moveTo(u):i.current.moveTo(n.current);const d=n.current.getLayer();if(d&&(d.batchDraw(),u)){const h=u.getLayer();if(!h)return;h.batchDraw()}},[e,o]),fe.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.destroy()},[]),fe.createElement(dn,{name:"_outer_portal",ref:n},fe.createElement(dn,{name:"_inner_portal",ref:i},r))};function Pw(e,t,r){const n=t-1,i=r[Ow(n,r.length)];return i.marker!=="Z"?i:Pw(e,n,r)}function Aw(e,t,r){const n=t+1,i=r[Ow(n,r.length)];return i.marker==="Z"?Aw(e,n,r):i}function mS(e,t,r){let n=r[t-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"L":case"A":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"H":e.marker="L",e.values.x+=n.values.x,e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x,e.values.y+=n.values.y;break;case"C":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"S":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"Q":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y;break;case"T":e.values.x+=n.values.x,e.values.y+=n.values.y;break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x;break}if(e.marker==="Z"){let i=function(o,l){return o[l].marker==="M"?o[l]:i(o,l-1)},a=i(r,t);e.values.x=a.values.x,e.values.y=a.values.y}return e}function yS(e,t){const r=[];switch(e.toUpperCase()){case"M":for(let n=0;n<t.length;n+=2){let i;e===e.toUpperCase()?i=n===0?"M":"L":i=n===0?"m":"l",r.push({marker:i,values:{x:t[n],y:t[n+1]}})}break;case"L":for(let n=0;n<t.length;n+=2)r.push({marker:e,values:{x:t[n],y:t[n+1]}});break;case"H":for(let n=0;n<t.length;n++)r.push({marker:e,values:{x:t[n],y:0}});break;case"V":for(let n=0;n<t.length;n++)r.push({marker:e,values:{x:0,y:t[n]}});break;case"C":for(let n=0;n<t.length;n+=6)r.push({marker:e,values:{x1:t[n],y1:t[n+1],x2:t[n+2],y2:t[n+3],x:t[n+4],y:t[n+5]}});break;case"S":for(let n=0;n<t.length;n+=4)r.push({marker:e,values:{x2:t[n],y2:t[n+1],x:t[n+2],y:t[n+3]}});break;case"Q":for(let n=0;n<t.length;n+=4)r.push({marker:e,values:{x1:t[n],y1:t[n+1],x:t[n+2],y:t[n+3]}});break;case"T":for(let n=0;n<t.length;n+=2)r.push({marker:e,values:{x:t[n],y:t[n+1]}});break;case"A":for(let n=0;n<t.length;n+=7)r.push({marker:e,values:{radiusX:t[n],radiusY:t[n+1],rotation:t[n+2],largeArc:t[n+3],sweep:t[n+4],x:t[n+5],y:t[n+6]}});break;case"Z":r.push({marker:e,values:{x:0,y:0}});break}return r}function Ow(e,t){return(e%t+t)%t}function bS(e,t,r){if(t!==0&&e.marker==="L"){let n=r[t-1];["x","y"].every(a=>Math.round(Math.abs(n.values[a]-e.values[a]))===0)&&(e.overlap=!0)}return e}function ev(e,t){const r=["x","y"].every(n=>Math.round(Math.abs(e[t].values[n]-e[0].values[n]))===0);e[t].marker==="L"&&r&&(e[t].overlap=!0,ev(e,t-1)),e[t].marker==="Z"&&ev(e,t-1)}function wS(e,t,r){const n=N5(e.values,r.values),i=N5(t.values,e.values);return Math.min(i,n)}function k5(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function N5(e,t){const r=e.x-t.x,n=e.y-t.y;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2))}function L5(e,t){return Math.sin(e)*t}function T5(e,t){return Math.cos(e)*t}function R5(e,t){const r=t/Math.tan(e);return r===1/0||r===-1/0||isNaN(r)?t:r}function _S(e,t){return t*Math.tan(e)}function xS(e,t){let r,n=0,i=e*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=R5(e/2,-t):(r=R5(e/2,t),n=1,r===1/0&&(r=t)),{offset:r,sweepFlag:n}}function SS(e){const t=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(r=>{let n="";if(r.marker!=="Z"){const i=Object.keys(r.values);n=t.filter(a=>i.indexOf(a)!==-1).map(a=>r.values[a]).join()}return`${r.marker}${n}`}).join("").trim()}function ES(e){const t=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,r=/-?[0-9]*\.?\d+/g;return[...e.matchAll(t)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,i)=>{const a=e.substring(i.index,n.length?n[n.length-1].index:e.length);return n.concat([{marker:i.marker,index:i.index,chunk:a.length>0?a.substr(1,a.length-1):a}])},[]).reverse().flatMap(n=>{const i=n.chunk.match(r),a=i?i.map(parseFloat):[];return yS(n.marker,a)}).map(mS)}function PS(e,t,r){let n=[],i=[];return e.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(bS),ev(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(l=>!l.overlap).map((l,u,d)=>{const v=Pw(l,u,d),p=Aw(l,u,d),f=k5(l.values,v.values),b=k5(l.values,p.values),_=b-f,S=_*(180/Math.PI),x=wS(l,v,p),m=Math.abs(_S(_/2,x/2)),w=Math.min(t,m),E=xS(_,w),P=E.offset,R=E.sweepFlag,k=(u==0||u==d.length-1)&&!o;switch(l.marker){case"M":case"L":const N=[l.values.x+L5(f,P),l.values.y+T5(f,P)],M=[l.values.x+L5(b,P),l.values.y+T5(b,P)];k?i.push({marker:l.marker,values:l.values}):i.push({marker:l.marker,values:{x:parseFloat(N[0].toFixed(3)),y:parseFloat(N[1].toFixed(3))}}),!k&&(p.marker==="L"||p.marker==="M")&&i.push({marker:"A",radius:w,values:{radiusX:parseFloat(w.toFixed(3)),radiusY:parseFloat(w.toFixed(3)),rotation:S,largeArc:0,sweep:R,x:parseFloat(M[0].toFixed(3)),y:parseFloat(M[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":i.push({marker:l.marker,values:l.values});break}})}),{path:SS(i),commands:i}}var Xp={},M5;function AS(){if(M5)return Xp;M5=1;var e=e||{};e.stringify=function(){var t={"visit_linear-gradient":function(r){return t.visit_gradient(r)},"visit_repeating-linear-gradient":function(r){return t.visit_gradient(r)},"visit_radial-gradient":function(r){return t.visit_gradient(r)},"visit_repeating-radial-gradient":function(r){return t.visit_gradient(r)},visit_gradient:function(r){var n=t.visit(r.orientation);return n&&(n+=", "),r.type+"("+n+t.visit(r.colorStops)+")"},visit_shape:function(r){var n=r.value,i=t.visit(r.at),a=t.visit(r.style);return a&&(n+=" "+a),i&&(n+=" at "+i),n},"visit_default-radial":function(r){var n="",i=t.visit(r.at);return i&&(n+=i),n},"visit_extent-keyword":function(r){var n=r.value,i=t.visit(r.at);return i&&(n+=" at "+i),n},"visit_position-keyword":function(r){return r.value},visit_position:function(r){return t.visit(r.value.x)+" "+t.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 t.visit_color(r.value,r)},visit_hex:function(r){return t.visit_color("#"+r.value,r)},visit_rgb:function(r){return t.visit_color("rgb("+r.value.join(", ")+")",r)},visit_rgba:function(r){return t.visit_color("rgba("+r.value.join(", ")+")",r)},visit_hsl:function(r){return t.visit_color("hsl("+r.value[0]+", "+r.value[1]+"%, "+r.value[2]+"%)",r)},visit_hsla:function(r){return t.visit_color("hsla("+r.value[0]+", "+r.value[1]+"%, "+r.value[2]+"%, "+r.value[3]+")",r)},visit_var:function(r){return t.visit_color("var("+r.value+")",r)},visit_color:function(r,n){var i=r,a=t.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+=t.visit(a),o<i-1&&(n+=", ")}),n},visit_object:function(r){return r.width&&r.height?t.visit(r.width)+" "+t.visit(r.height):""},visit:function(r){if(!r)return"";if(r instanceof Array)return t.visit_array(r);if(typeof r=="object"&&!r.type)return t.visit_object(r);if(r.type){var n=t["visit_"+r.type];if(n)return n(r);throw Error("Missing visitor visit_"+r.type)}else throw Error("Invalid node.")}};return function(r){return t.visit(r)}}();var e=e||{};return e.parse=function(){var t={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(q){var Q=new Error(r+": "+q);throw Q.source=r,Q}function i(){var q=a();return r.length>0&&n("Invalid input not EOF"),q}function a(){return E(o)}function o(){return l("linear-gradient",t.linearGradient,d)||l("repeating-linear-gradient",t.repeatingLinearGradient,d)||l("radial-gradient",t.radialGradient,p)||l("repeating-radial-gradient",t.repeatingRadialGradient,p)}function l(q,Q,re){return u(Q,function(Y){var ee=re();return ee&&(D(t.comma)||n("Missing comma before color stops")),{type:q,orientation:ee,colorStops:E(P)}})}function u(q,Q){var re=D(q);if(re){D(t.startCall)||n("Missing (");var Y=Q(re);return D(t.endCall)||n("Missing )"),Y}}function d(){var q=h();if(q)return q;var Q=z("position-keyword",t.positionKeywords,1);return Q?{type:"directional",value:Q.value}:v()}function h(){return z("directional",t.sideOrCorner,1)}function v(){return z("angular",t.angleValue,1)||z("angular",t.radianValue,1)}function p(){var q,Q=f(),re;return Q&&(q=[],q.push(Q),re=r,D(t.comma)&&(Q=f(),Q?q.push(Q):r=re)),q}function f(){var q=b()||_();if(q)q.at=x();else{var Q=S();if(Q){q=Q;var re=x();re&&(q.at=re)}else{var Y=x();if(Y)q={type:"default-radial",at:Y};else{var ee=m();ee&&(q={type:"default-radial",at:ee})}}}return q}function b(){var q=z("shape",/^(circle)/i,0);return q&&(q.style=X()||S()),q}function _(){var q=z("shape",/^(ellipse)/i,0);return q&&(q.style=m()||se()||S()),q}function S(){return z("extent-keyword",t.extentKeywords,1)}function x(){if(z("position",/^at/,0)){var q=m();return q||n("Missing positioning value"),q}}function m(){var q=w();if(q.x||q.y)return{type:"position",value:q}}function w(){return{x:se(),y:se()}}function E(q){var Q=q(),re=[];if(Q)for(re.push(Q);D(t.comma);)Q=q(),Q?re.push(Q):n("One extra comma");return re}function P(){var q=R();return q||n("Expected color definition"),q.length=se(),q}function R(){return N()||H()||L()||T()||M()||C()||k()}function k(){return z("literal",t.literalColor,0)}function N(){return z("hex",t.hexColor,1)}function M(){return u(t.rgbColor,function(){return{type:"rgb",value:E(J)}})}function T(){return u(t.rgbaColor,function(){return{type:"rgba",value:E(J)}})}function C(){return u(t.varColor,function(){return{type:"var",value:G()}})}function L(){return u(t.hslColor,function(){var q=D(t.percentageValue);q&&n("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var Q=J();D(t.comma);var re=D(t.percentageValue),Y=re?re[1]:null;D(t.comma),re=D(t.percentageValue);var ee=re?re[1]:null;return(!Y||!ee)&&n("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[Q,Y,ee]}})}function H(){return u(t.hslaColor,function(){var q=J();D(t.comma);var Q=D(t.percentageValue),re=Q?Q[1]:null;D(t.comma),Q=D(t.percentageValue);var Y=Q?Q[1]:null;D(t.comma);var ee=J();return(!re||!Y)&&n("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[q,re,Y,ee]}})}function G(){return D(t.variableName)[1]}function J(){return D(t.number)[1]}function se(){return z("%",t.percentageValue,1)||U()||V()||X()}function U(){return z("position-keyword",t.positionKeywords,1)}function V(){return u(t.calcValue,function(){for(var q=1,Q=0;q>0&&Q<r.length;){var re=r.charAt(Q);re==="("?q++:re===")"&&q--,Q++}q>0&&n("Missing closing parenthesis in calc() expression");var Y=r.substring(0,Q-1);return F(Q-1),{type:"calc",value:Y}})}function X(){return z("px",t.pixelValue,1)||z("em",t.emValue,1)}function z(q,Q,re){var Y=D(Q);if(Y)return{type:q,value:Y[re]}}function D(q){var Q,re;return re=/^[\n\r\t\s]+/.exec(r),re&&F(re[0].length),Q=q.exec(r),Q&&F(Q[0].length),Q}function F(q){r=r.substr(q)}return function(q){return r=q.toString().trim(),r.endsWith(";")&&(r=r.slice(0,-1)),i()}}(),Xp.parse=e.parse,Xp.stringify=e.stringify,Xp}var OS=AS();const CS=dc(OS),K1=e=>e.indexOf("linear-gradient")>=0,kS=e=>e.type==="hex"?"#"+e.value:e.type==="literal"?e.value:`${e.type}(${e.value.join(",")})`,Cw=e=>{if(!K1(e))return{rotation:0,stops:[{offset:0,color:e},{offset:1,color:e}]};const t=CS.parse(e)[0];return{rotation:parseFloat(t.orientation.value),stops:t.colorStops.map((r,n)=>({color:kS(r),offset:r.length?parseFloat(r.length.value)/100:n/(t.colorStops.length-1)}))}},Zc=(e,t=e.fill,r="fill")=>fe.useMemo(()=>{if(!K1(t))return{[r]:t};const{stops:n,rotation:i}=Cw(t),a=e.a.width/2,o=e.a.height/2,l=(i%180+180)%180,u=l>45&&l<135?e.a.width:e.a.height,d=Kt.Util.degToRad(i)-Math.PI/2,h=[];return n.forEach(({offset:v,color:p})=>{h.push(v,p)}),r==="fill"?{fillLinearGradientStartPointX:a-u/2*Math.cos(d),fillLinearGradientStartPointY:o-u/2*Math.sin(d),fillLinearGradientColorStops:h,fillLinearGradientEndPointX:a+u/2*Math.cos(d),fillLinearGradientEndPointY:o+u/2*Math.sin(d),fill:n[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:a-u/2*Math.cos(d),strokeLinearGradientStartPointY:o-u/2*Math.sin(d),strokeLinearGradientColorStops:h,strokeLinearGradientEndPointX:a+u/2*Math.cos(d),strokeLinearGradientEndPointY:o+u/2*Math.sin(d)}},[t,e.width,e.height]);let k1=!1;const NS=(e=!k1)=>{k1=e},LS=()=>k1;function hp(e,t){const r=fe.useRef();fe.useLayoutEffect(()=>{r.current&&r.current.destroy()},[t]),fe.useLayoutEffect(()=>{if(!k1)return;const n=e.current.opacity();return n?(e.current.opacity(0),r.current=new Kt.Tween({node:e.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 N1=0,tv=[],kw=3e4;const TS=e=>{kw=e};let Nw=6e3;const RS=e=>{Nw=e},MS=()=>Nw;function Ah(e){N1+=1;let t=!1,r=!1;const n=setTimeout(()=>{t||(dp(`Timeout loading asset ${e}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",e),t=!0,I5())},kw);return()=>{r?console.error("Finish called twice! That is not expected. id: ",e):(r=!0,t||(clearTimeout(n),I5()))}}function I5(){N1-=1,N1===0&&(tv.forEach(e=>e()),tv=[])}function IS(){return new Promise(e=>{return t=()=>{LS()?setTimeout(e,300):e(!0)},void(N1===0?t():tv.push(t));var t})}let Lw=[];function jS(e){Lw.push(e)}function dp(e){Lw.forEach(t=>t(e))}Fr(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]);Fr({value:!1});const Uv=Fr([]);function FS(e){Uv.push(e)}var DS="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1";let ug;function lh(e,t="Arial",r="normal",n="normal"){ug||(ug=document.createElement("canvas"));var i=ug.getContext("2d");return i.font=`${r} ${n} 40px '${e}', ${t}`,i.measureText(DS).width}const l1={Arial:!0},j5=e=>!!l1[e];async function BS(e,t,r){var n;if(l1[e])return;const i=!!(!((n=document.fonts)===null||n===void 0)&&n.load),a=lh("Arial","Arial",t,r);if(i)try{if(await document.fonts.load(`16px '${e}', ${t} ${r}`),a!==lh(e,"Arial",t,r))return void(l1[e]=!0)}catch{}const o=lh("Times","Times",t,r),l=lh(e,"Arial",t,r),u=Math.min(6e3,MS())/60;for(let d=0;d<u;d++){const h=lh(e,"Arial",t,r),v=lh(e,"Times",t,r);if(h!==l||h!==a||v!==o)return void(l1[e]=!0);await new Promise(p=>setTimeout(p,60))}console.warn(`Timeout for loading font "${e}". Looks like polotno can't load it. Is it a correct font family?`),dp(`Timeout for loading font "${e}"`)}const F5={};let Tw="400,400italic,700,700italic";function zS(){return Tw}function Rw(e){return`https://fonts.googleapis.com/css?family=${e.replace(/ /g,"+")}:${Tw}`}function qS(e){if(F5[e])return;const t=Rw(e),r=document.createElement("link");r.type="text/css",r.href=t,r.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(r),F5[e]=!0}const D5={};let _f;function US(e){const t=e.fontFamily;if(D5[t]||!e.url&&!e.styles)return;const r=e.styles||(e.url?[{src:`url("${e.url}")`}]:[]),n=(_f||(_f=document.getElementById("polotno-font-style"),_f||(_f=document.createElement("style"),_f.id="polotno-font-style",document.head.appendChild(_f)),_f)).sheet;r.forEach(i=>{n.insertRule(`
77
- @font-face{
78
- font-family:'${t}';
79
- src:${i.src};
80
- font-style:${i.fontStyle||"normal"};
81
- font-weight:${i.fontWeight||"normal"};
82
- font-display:swap; /* optional but recommended */
83
- }`,n.cssRules.length)}),D5[e.fontFamily]=!0}const bi=Fr({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1}),HS=Dr(e=>{bi.textVerticalResizeEnabled=e}),VS=Dr(e=>{bi.removeBackgroundEnabled=e}),GS=Dr(e=>{bi.htmlRenderEnabled=e}),$S=Dr(e=>{bi.imageDownScalingEnabled=e});Dr(e=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),$S(e)});Dr(e=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),bi.textOverflow="change-font-size"});const Mw=Dr(e=>{bi.textOverflow=e}),WS=Dr(e=>{bi.textSplitAllowed=e});Dr(e=>{bi.animationsEnabled=e});function Lu(e=""){return(e.match(/<\/p>/gi)||[]).length>1&&(e=e.replace(/<\/p>/gi,(t,r,n)=>(n.slice(r+t.length).match(/<\/p>/gi)||[]).length>0?`
84
- `:t)),e.replace(/(<([^>]+)>)/gi,"")}function YS(e){return e?/<[a-z][a-z0-9]*(\s[^>]*)?>[^<]*<\/[a-z][a-z0-9]*>/i.test(e)?e=(e=e.replace(/<(?![a-z/!])/gi,"&lt;")).replace(/([^a-z0-9"'\s/])>/gi,"$1&gt;"):e.replace(/</g,"&lt;").replace(/>/g,"&gt;"):""}const XS={warm:e=>t=>{const r=t.data;e=Math.max(0,Math.min(1,e));for(let n=0;n<r.length;n+=4)r[n]=Math.min(r[n]+30*e,255),r[n+1]=Math.min(r[n+1]+15*e,255);return t},cold:e=>t=>{const r=t.data;e=Math.max(0,Math.min(1,e));for(let n=0;n<r.length;n+=4)r[n]=Math.min(r[n]-15*e,255),r[n+1]=Math.min(r[n+1]-10*e,255),r[n+2]=Math.min(r[n+2]+15*e,255);return t},natural:e=>t=>{const r=t.data;e=Math.max(0,Math.min(1,e));for(let n=0;n<r.length;n+=4){r[n]=Math.min(r[n]*(1+.1*e),255),r[n+1]=Math.min(r[n+1]*(1+.1*e),255),r[n+2]=Math.min(r[n+2]*(1+.1*e),255);const i=(r[n]+r[n+1]+r[n+2])/3;r[n]=Math.min((r[n]-i)*(1+.2*e)+i,255),r[n+1]=Math.min((r[n+1]-i)*(1+.2*e)+i,255),r[n+2]=Math.min((r[n+2]-i)*(1+.2*e)+i,255)}return t},temperature:e=>t=>{const r=t.data;e=Math.max(-1,Math.min(1,e));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*e,0),255),r[n+2]=Math.min(Math.max(a-15*e,0),255)}return t},contrast:e=>t=>{const r=t.data,n=100*(e=Math.max(-1,Math.min(1,e))),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 t},shadows:e=>t=>{const r=t.data;e=Math.max(-1,Math.min(1,e));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+e*(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 t},white:e=>t=>{const r=t.data;e=Math.max(-1,Math.min(1,e));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],o=r[n+2],l=(i+a+o)/3;if(l>128){const u=1+e*((l-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 t},black:e=>t=>{const r=t.data;e=Math.max(-1,Math.min(1,e));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],o=r[n+2],l=(i+a+o)/3;if(l<128){const u=1+e*((128-l)/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 t},vibrance:e=>t=>{const r=t.data;e=Math.max(-1,Math.min(1,e));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],o=r[n+2],l=Math.max(i,a,o),u=e<0?(1-(l===0?0:(l-(i+a+o)/3)/l))*e*1.5:.5*e;r[n]=Math.min(Math.max(i-(l-i)*u,0),255),r[n+1]=Math.min(Math.max(a-(l-a)*u,0),255),r[n+2]=Math.min(Math.max(o-(l-o)*u,0),255)}return t},saturation:e=>t=>{const r=t.data;e=Math.max(-1,Math.min(1,e));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],o=r[n+2],l=.2126*i+.7152*a+.0722*o;r[n]=Math.min(Math.max(l+(i-l)*(1+e),0),255),r[n+1]=Math.min(Math.max(l+(a-l)*(1+e),0),255),r[n+2]=Math.min(Math.max(l+(o-l)*(1+e),0),255)}return t}};function _s(e,t){var r;const n={filters:[]},i={};t.brightnessEnabled&&(n.filters.push(Kt.Filters.Brighten),n.brightness=t.brightness),t.blurEnabled&&(n.filters.push(Kt.Filters.Blur),n.blurRadius=t.blurRadius,t.type==="text"&&t.lineHeight<1&&(i.offset=t.fontSize)),t.sepiaEnabled&&n.filters.push(Kt.Filters.Sepia),t.grayscaleEnabled&&n.filters.push(Kt.Filters.Grayscale),t.filters.forEach((a,o)=>{const l=XS[o];l&&n.filters.push(l(a.intensity))}),e.setAttrs(n),n.filters.length?e.cache(Object.assign(Object.assign({},i),{pixelRatio:t.store._elementsPixelRatio})):e.clearCache(),(r=e.getLayer())===null||r===void 0||r.batchDraw()}const af=()=>"ontouchstart"in window||navigator.maxTouchPoints>0;var B5={},Iw="warn";function KS(e){Iw=e}function ZS(){return Iw}var _a;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(_a||(_a={}));var rv=function(e,t){return rv=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])},rv(e,t)};function Wn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");rv(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var ju=function(){return ju=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},ju.apply(this,arguments)};function QS(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function Hd(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Qc(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function Ff(e,t,r){if(arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function jw(e){return Pr(e).type}function Fw(e,t){return Pr(e).onSnapshot(t)}function z5(e,t){Pr(e).applyPatches($w(t))}function nv(e,t){return Pr(e).applySnapshot(t)}function Pu(e,t){t===void 0&&(t=!0);var r=Pr(e);return t?r.snapshot:r.type.getSnapshot(r,!1)}function Kp(e,t){for(var r=Pr(e).parent;r;){if(t.is(r.storedValue))return!0;r=r.parent}return!1}function Pf(e,t){for(var r=Pr(e).parent;r;){if(t.is(r.storedValue))return r.storedValue;r=r.parent}throw new Vt("Failed to find the parent of ".concat(Pr(e)," of a given type"))}function JS(e){return Pr(e).root.storedValue}function eE(e){return Pr(e).path}function tE(e,t){var r=xE(Pr(e),t);return r?r.value:void 0}function rE(e){return Pr(e).identifier}function kf(e){return Pr(e).detach(),e}function cg(e){var t=Pr(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function q5(e){return Pr(e).observableIsAlive}var Dw=function(){function e(t,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:oo.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(r,n)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(t){var r=this.isAlive;this._state=t;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._hookSubscribers&&this._hookSubscribers.emit(t,this,t)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._hookSubscribers||(this._hookSubscribers=new Xw),this._hookSubscribers.register(t,r)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this._parent=t,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.pathAtom||(this.pathAtom=y1("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Lf(this._subpath):""),this.parent.getEscapedPath(t)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==oo.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===oo.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=y1("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.state===oo.CREATED){if(this.parent){if(this.parent.state!==oo.FINALIZED)return;this.fireHook(_a.afterAttach)}this.state=oo.FINALIZED,t&&t()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=oo.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(_a.beforeDestroy)}}),e}(),ep=function(e){Wn(t,e);function t(r,n,i,a,o){var l=e.call(this,r,n,i,a)||this;try{l.storedValue=r.createNewInstance(o)}catch(u){throw l.state=oo.DEAD,u}return l.state=oo.CREATED,l.finalizeCreation(),l}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw new Vt("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.parent!==r,a=this.subpath!==n;!i&&!a||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===oo.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),t}(Dw);ep.prototype.die=Dr(ep.prototype.die);var nE=1,Ul;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(Ul||(Ul={}));var zs;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(zs||(zs={}));var iE={onError:function(e){throw e}},xs=function(e){Wn(t,e);function t(r,n,i,a,o){var l=e.call(this,r,n,i,a)||this;if(Object.defineProperty(l,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++nE}),Object.defineProperty(l,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(l,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:Ul.UNINITIALIZED}),Object.defineProperty(l,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(l,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(l,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),l._snapshotComputed=Df(function(){return l.getSnapshot()}),l.unbox=l.unbox.bind(l),l._initialSnapshot=o,l.identifierAttribute=r.identifierAttribute,n||(l.identifierCache=new bE),l._childNodes=r.initializeChildNodes(l,l._initialSnapshot),l.identifier=null,l.unnormalizedIdentifier=null,l.identifierAttribute&&l._initialSnapshot){var u=l._initialSnapshot[l.identifierAttribute];if(u===void 0){var d=l._childNodes[l.identifierAttribute];d&&(u=d.value)}if(typeof u!="string"&&typeof u!="number")throw new Vt("Instance identifier '".concat(l.identifierAttribute,"' for type '").concat(l.type.name,"' must be a string or a number"));l.identifier=pp(u),l.unnormalizedIdentifier=u}return n?n.root.identifierCache.addNodeToCache(l):l.identifierCache.addNodeToCache(l),l}return Object.defineProperty(t.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applyPatches(r)}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applySnapshot(r)}}),Object.defineProperty(t.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=!0),this._observableInstanceState===Ul.UNINITIALIZED&&this.createObservableInstance(r)}}),Object.defineProperty(t.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n,i,a,o;r===void 0&&(r=!0),this._observableInstanceState=Ul.CREATING;for(var l=[],u=this.parent;u&&u._observableInstanceState===Ul.UNINITIALIZED;)l.unshift(u),u=u.parent;try{for(var d=Hd(l),h=d.next();!h.done;h=d.next()){var v=h.value;v.createObservableInstanceIfNeeded(!1)}}catch(_){n={error:_}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}var p=this.type;try{this.storedValue=p.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,p.finalizeNewInstance(this,this.storedValue)}catch(_){throw this.state=oo.DEAD,_}finally{this._isRunningAction=!1}if(this._observableInstanceState=Ul.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=kh,this.state=oo.CREATED,r){this.fireHook(_a.afterCreate),this.finalizeCreation();try{for(var f=Hd(l.reverse()),b=f.next();!b.done;b=f.next()){var v=b.value;v.fireHook(_a.afterCreate),v.finalizeCreation()}}catch(_){a={error:_}}finally{try{b&&!b.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(_a.beforeDetach);var r=this.state;this.state=oo.DETACHING;var n=this.root,i=n.environment,a=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=r}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,a=n!==this.subpath;!i&&!a||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(_a.afterAttach)):a&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.fireInternalHook(r);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[r];typeof i=="function"&&(oc?oc(function(){i.apply(n.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===Ul.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(t.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var r=this.type,n=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=r.processInitialSnapshot(n,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(t.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(t.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=ZS();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw new Vt(i);case"warn":TE(i)}}}}),Object.defineProperty(t.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",i=r.subpath&&Lf(r.subpath)||"",a=r.actionContext||sE();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var l=a&&a.context&&eE(a.context)||n;o="".concat(l,".").concat(a.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(n,"', Subpath: '").concat(i,"', Action: '").concat(o,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertAlive({subpath:r}),this._autoUnbox=!1;try{return this._observableInstanceState===Ul.CREATED?this.type.getChildNode(this,r):this._childNodes[r]}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(kh),this._autoUnbox=!1;try{return this._observableInstanceState===Ul.CREATED?this.type.getChildren(this):Vw(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.type.getChildType(r)}}),Object.defineProperty(t.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.assertAlive(r),!this.isRunningAction()&&this.isProtected)throw new Vt("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.type.removeChild(this,r)}}),Object.defineProperty(t.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.assertAlive({subpath:r.subpath||r.subpathUponDeath}),this._autoUnbox?r.value:r)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(r).concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this.baseFinalizeCreation(function(){var n,i;try{for(var a=Hd(r.getChildren()),o=a.next();!o.done;o=a.next()){var l=o.value;l.finalizeCreation()}}catch(u){n={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}r.fireInternalHook(_a.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new Vt("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(t.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=tp(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=Kw(i.path),o=Hw(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=tp(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),Nf(this.storedValue,"$treenode",this),Nf(this.storedValue,"toJSON",_E)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===oo.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==Ul.UNINITIALIZED&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(zs.Dispose),this._internalEventsClear(zs.Dispose))}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var r=this.snapshot;this._snapshotUponDeath=r,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._addSnapshotReaction(),this._internalEventsRegister(zs.Snapshot,r)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit(zs.Snapshot,r)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister(zs.Patch,r)}}),Object.defineProperty(t.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=CE({},r,{path:i}),o=Qc(ME(a),2),l=o[0],u=o[1];this._internalEventsEmit(zs.Patch,l,u)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas(zs.Dispose,r)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister(zs.Dispose,r,!0);return}throw new Vt("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(t.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas(zs.Dispose,r))throw new Vt("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(zs.Dispose,r)}}),Object.defineProperty(t.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.middlewares){var n=this.middlewares.indexOf(r);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(t.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={handler:r,includeHooks:n};return this.middlewares?this.middlewares.push(a):this.middlewares=[a],function(){i.removeMiddleware(a)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this.assertWritable({subpath:r}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,r,n)}}),Object.defineProperty(t.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;if(!this._hasSnapshotReaction){var n=G4(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},iE);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(t.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return!!this._internalEvents&&this._internalEvents.hasSubscribers(r)}}),Object.defineProperty(t.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new Xw),this._internalEvents.register(r,n,i)}}),Object.defineProperty(t.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!!this._internalEvents&&this._internalEvents.has(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this._internalEvents&&this._internalEvents.unregister(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var n,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];this._internalEvents&&(n=this._internalEvents).emit.apply(n,Ff([r],Qc(i),!1))}}),Object.defineProperty(t.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEvents&&this._internalEvents.clear(r)}}),Object.defineProperty(t.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),t}(Dw);xs.prototype.createObservableInstance=Dr(xs.prototype.createObservableInstance);xs.prototype.detach=Dr(xs.prototype.detach);xs.prototype.die=Dr(xs.prototype.die);var Bw,Gr;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(Gr||(Gr={}));var zw="cannotDetermine",aE=Symbol("$type"),fc=function(){function e(t){Object.defineProperty(this,Bw,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return cc(this,t),this.instantiate(null,"",r,t).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){throw new Vt("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=Uw(t);if(n){var i=jw(t);return this.isAssignableFrom(i)?Ss():Es(r,t)}return this.isValidSnapshot(t,r)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.validate(t,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new Vt("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new Vt("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new Vt("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new Vt("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();Bw=aE;fc.prototype.create=Dr(fc.prototype.create);var Oh=function(e){Wn(t,e);function t(r){var n=e.call(this,r)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r===void 0&&(r=this.getDefaultSnapshot()),e.prototype.create.call(this,r,n)}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.createObservableInstanceIfNeeded(),r.storedValue}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!r.identifierAttribute||r.identifier===pp(n[r.identifierAttribute])}}),Object.defineProperty(t.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r.isDetaching?!1:r.snapshot===n||_i(n)&&Pr(n)===r?!0:r.type===this&&Ww(n)&&!_i(n)&&this.isMatchingSnapshotId(r,n)?(r.applySnapshot(n),!0):!1}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.tryToReconcileNode(r,n);if(o)return r.setParent(i,a),r;if(r.die(),_i(n)&&this.isAssignableFrom(jw(n))){var l=Pr(n);return l.setParent(i,a),l}return this.instantiate(i,a,void 0,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(fc);Oh.prototype.create=Dr(Oh.prototype.create);var qf=function(e){Wn(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this&&r.storedValue===n)return r;var o=this.instantiate(i,a,void 0,n);return r.die(),o}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(fc);function hc(e){return typeof e=="object"&&e&&e.isType===!0}var oE=1,Vd;function sE(){return Vd}function lE(){return oE++}function uE(e,t){var r=Pr(e.context);e.type==="action"&&r.assertAlive({actionContext:e});var n=r._isRunningAction;r._isRunningAction=!0;var i=Vd;Vd=e;try{return hE(r,e,t)}finally{Vd=i,r._isRunningAction=n}}function cE(e){if(e)return e.type==="action"?e:e.parentActionEvent}function tp(e,t,r){var n=function(){var i=lE(),a=Vd,o=cE(a);return uE({type:"action",name:t,id:i,args:LE(arguments),context:e,tree:JS(e),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?Ff(Ff([],Qc(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:o},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}var fE=function(){function e(t,r){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),r.$mst_middleware&&this.middlewares.push(r.$mst_middleware);for(var n=t;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.middlewares[this.arrayIndex];if(t){var r=t[this.inArrayIndex++];return r||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function hE(e,t,r){var n=new fE(e,r);if(n.isEmpty)return Dr(r).apply(null,t.args);var i=null;function a(o){var l=n.getNextMiddleware(),u=l&&l.handler;if(!u)return Dr(r).apply(null,o.args);if(!l.includeHooks&&_a[o.name])return a(o);function d(v,p){i=a(v),p&&(i=p(i))}function h(v){i=v}return u(o,d,h),i}return a(t)}function dE(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: ".concat(t,">")}}function qw(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):_i(e)?"<".concat(e,">"):"`".concat(dE(e),"`")}function pE(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function gE(e){var t=e.value,r=e.context[e.context.length-1].type,n=e.context.map(function(l){var u=l.path;return u}).filter(function(l){return l.length>0}).join("/"),i=n.length>0?'at path "/'.concat(n,'" '):"",a=_i(t)?"value of type ".concat(Pr(t).type.name,":"):rp(t)?"value":"snapshot",o=r&&_i(t)&&r.is(Pr(t).snapshot);return"".concat(i).concat(a," ").concat(qw(t)," is not assignable ").concat(r?"to type: `".concat(r.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(r?eP(r)||rp(t)?".":", expected an instance of `".concat(r.name,"` or a snapshot like `").concat(r.describe(),"` instead.")+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function Hv(e,t,r){return e.concat([{path:t,type:r}])}function Ss(){return Ch}function Es(e,t,r){return[{context:e,value:t,message:r}]}function Z1(e){return e.reduce(function(t,r){return t.concat(r)},[])}function cc(e,t){RE()&&vE(e,t)}function vE(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw new Vt(mE(e,t,r))}function mE(e,t,r){if(r.length!==0)return"Error while converting ".concat(pE(qw(t))," to `").concat(e.name,`\`:
85
-
86
- `)+r.map(gE).join(`
87
- `)}var yE=0,bE=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:yE++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:Fr.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:Fr.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t);this.lastCacheModificationPerId.set(t,r===void 0?1:r+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t)||0;return"".concat(this.cacheId,"-").concat(r)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(r===void 0&&(r=!0),t.identifierAttribute){var n=t.identifier;this.cache.has(n)||this.cache.set(n,Fr.array([],Q1));var i=this.cache.get(n);if(i.indexOf(t)!==-1)throw new Vt("Already registered");i.push(t),r&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;Q4(t.identifierCache.cache).forEach(function(n){return n.forEach(function(i){r.addNodeToCache(i)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.identifierAttribute){var r=t.identifier,n=this.cache.get(r);n&&(n.remove(t),n.length||this.cache.delete(r),this.updateLastCacheModificationPerId(t.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,n=new e,i=t.path+"/";return j_(this.cache).forEach(function(a){for(var o=Qc(a,2),l=o[0],u=o[1],d=!1,h=u.length-1;h>=0;h--){var v=u[h];(v===t||v.path.indexOf(i)===0)&&(n.addNodeToCache(v,!1),u.splice(h,1),u.length||r.cache.delete(l),d=!0)}d&&r.updateLastCacheModificationPerId(l)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);return n?n.some(function(i){return t.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);if(!n)return null;var i=n.filter(function(a){return t.isAssignableFrom(a.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw new Vt("Cannot resolve a reference to type '".concat(t.name,"' with id: '").concat(r,"' unambigously, there are multiple candidates: ").concat(i.map(function(a){return a.path}).join(", ")))}}}),e}();function Vv(e,t,r,n,i){var a=Uw(i);if(a){if(a.parent)throw new Vt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(t?t.path:"","/").concat(r,"', but it lives already at '").concat(a.path,"'"));return t&&a.setParent(t,r),a}return new xs(e,t,r,n,i)}function of(e,t,r,n,i){return new ep(e,t,r,n,i)}function wE(e){return e instanceof ep||e instanceof xs}var oo;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"})(oo||(oo={}));function _i(e){return!!(e&&e.$treenode)}function Pr(e){if(!_i(e))throw new Vt("Value ".concat(e," is no MST Node"));return e.$treenode}function Uw(e){return e&&e.$treenode||null}function _E(){return Pr(this).snapshot}function xE(e,t,r){return r===void 0&&(r=!0),Hw(e,Kw(t),r)}function Hw(e,t,r){r===void 0&&(r=!0);var n=e;try{for(var i=0;i<t.length;i++){var a=t[i];if(a===".."){if(n=n.parent,n)continue}else{if(a===".")continue;if(n){if(n instanceof ep){var o=n.value;_i(o)&&(n=Pr(o))}if(n instanceof xs){var l=n.getChildType(a);if(l&&(n=n.getChildNode(a),n))continue}}}throw new Vt("Could not resolve '".concat(a,"' in path '").concat(U5(t.slice(0,i))||"/","' while resolving '").concat(U5(t),"'"))}}catch(u){if(!r)return;throw u}return n}function Vw(e){if(!e)return Ch;var t=Object.keys(e);if(!t.length)return Ch;var r=new Array(t.length);return t.forEach(function(n,i){r[i]=e[n]}),r}var SE=Object.toString(),Ch=Object.freeze([]),kh=Object.freeze({}),Q1=l_().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(Q1);var Vt=function(e){Wn(t,e);function t(r){return r===void 0&&(r="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(r))||this}return t}(Error);function EE(e){return e}var PE=Number.isInteger;function AE(e){return Number(e)===e&&e%1!==0}function OE(e){return Number.isFinite(e)}function Gw(e){return Array.isArray(e)||Fu(e)}function $w(e){return e?Gw(e)?e:[e]:Ch}function CE(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n];for(var a in i)e[a]=i[a]}return e}function gh(e){var t;if(e===null||typeof e!="object")return!1;var r=Object.getPrototypeOf(e);return r==null?!0:((t=r.constructor)===null||t===void 0?void 0:t.toString())===SE}function Ww(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function rp(e,t){return t===void 0&&(t=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||t&&e instanceof Date}function Yw(e){return typeof e!="function"}function kE(e,t,r){Yl(e)?ew(e,t,r):Object.defineProperty(e,t,r)}function Nf(e,t,r){kE(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}var NE=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this;return r===void 0&&(r=!1),r?this.handlers.unshift(t):this.handlers.push(t),function(){n.unregister(t)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.handlers.indexOf(t)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.handlers.indexOf(t);r>=0&&this.handlers.splice(r,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this.handlers.slice();n.forEach(function(i){return i.apply(void 0,Ff([],Qc(t),!1))})}}),e}(),Xw=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.eventHandlers&&this.eventHandlers[t];return!!r&&r.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[t];return i||(i=this.eventHandlers[t]=new NE),i.register(r,n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];return!!n&&n.has(r)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];n&&n.unregister(r)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.eventHandlers&&delete this.eventHandlers[t]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this.eventHandlers&&this.eventHandlers[t];a&&(r=a).emit.apply(r,Ff([],Qc(n),!1))}}),e}();function LE(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}function fg(e,t){return e.indexOf(t)===0}function TE(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function RE(){return typeof process<"u"&&B5&&B5.ENABLE_TYPE_CHECK==="true"}function ME(e){if(!("oldValue"in e))throw new Vt("Patches without `oldValue` field cannot be inversed");return[IE(e),jE(e)]}function IE(e){switch(e.op){case"add":return{op:"add",path:e.path,value:e.value};case"remove":return{op:"remove",path:e.path};case"replace":return{op:"replace",path:e.path,value:e.value}}}function jE(e){switch(e.op){case"add":return{op:"remove",path:e.path};case"remove":return{op:"add",path:e.path,value:e.oldValue};case"replace":return{op:"replace",path:e.path,value:e.oldValue}}}function FE(e){return typeof e=="number"}function Lf(e){return FE(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function DE(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function U5(e){if(e.length===0)return"";var t=function(r){return r.map(Lf).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function Kw(e){var t=e.split("/").map(DE),r=e===""||e==="."||e===".."||fg(e,"/")||fg(e,"./")||fg(e,"../");if(!r)throw new Vt("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return t[0]===""&&t.shift(),t}var hg=Symbol("$preProcessorFailed"),BE=function(e){Wn(t,e);function t(r,n,i){var a=e.call(this,i||r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|Gr.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(t.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._processors.preProcessor?this._processors.preProcessor.call(null,r):r}}),Object.defineProperty(t.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(r){try{return this.preProcessSnapshot(r)}catch{return hg}}}),Object.defineProperty(t.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,r,n.storedValue):r}}),Object.defineProperty(t.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;zE(r.type,this,"create"),r instanceof xs&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},oP(this._subtype)||(r.getReconciliationType=function(){return n})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=_i(a)?a:this.preProcessSnapshot(a),l=this._subtype.instantiate(r,n,i,o);return this._fixNode(l),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this._subtype.reconcile(r,_i(n)?n:this.preProcessSnapshot(n),i,a);return o!==r&&this._fixNode(o),o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=!0);var i=this._subtype.getSnapshot(r);return n?this.postProcessSnapshot(i,r):i}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.preProcessSnapshotSafe(r);return i===hg?Es(n,r,"Failed to preprocess value"):this._subtype.validate(i,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=hc(r)?this._subtype:_i(r)?Pu(r,!1):this.preProcessSnapshotSafe(r);return n===hg?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!(this._subtype instanceof Oh))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),t}(fc);function zE(e,t){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=Hd(i),l=o.next();!l.done;l=o.next()){var u=l.value;e[u]=t[u].bind(t)}}catch(d){r={error:d}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}function qE(e,t,r){return new BE(e,t,r)}var H5="Map.put can only be used to store complex values that have an identifier type attribute";function Zw(e,t){var r,n,i=e.getSubTypes();if(i===zw)return!1;if(i){var a=$w(i);try{for(var o=Hd(a),l=o.next();!l.done;l=o.next()){var u=l.value;if(!Zw(u,t))return!1}}catch(d){r={error:d}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}return e instanceof np&&t.push(e),!0}var qc;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(qc||(qc={}));var UE=function(e){Wn(t,e);function t(r,n){return e.call(this,r,Fr.ref.enhancer,n)||this}return Object.defineProperty(t.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.get.call(this,""+r)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.has.call(this,""+r)}}),Object.defineProperty(t.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.delete.call(this,""+r)}}),Object.defineProperty(t.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return e.prototype.set.call(this,""+r,n)}}),Object.defineProperty(t.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!r)throw new Vt("Map.put cannot be used to set empty values");if(_i(r)){var n=Pr(r);if(n.identifier===null)throw new Vt(H5);return this.set(n.identifier,r),r}else if(Ww(r)){var i=Pr(this),a=i.type;if(a.identifierMode!==qc.YES)throw new Vt(H5);var o=a.mapIdentifierAttribute,l=r[o];if(!Gv(l)){var u=this.put(a.getChildType().create(r,i.environment));return this.put(Pu(u))}var d=pp(l);return this.set(d,r),this.get(d)}else throw new Vt("Map.put can only be used to store complex values")}}),t}(Nv),L1=function(e){Wn(t,e);function t(r,n,i){i===void 0&&(i=[]);var a=e.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:qc.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:Gr.Map}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a._determineIdentifierMode(),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._determineIdentifierMode(),Vv(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===qc.UNKNOWN){var r=[];if(Zw(this._subType,r)){var n=r.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw new Vt("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=qc.YES,this.mapIdentifierAttribute=n):this.identifierMode=qc.NO}}}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type._subType,a={};return Object.keys(n).forEach(function(o){a[o]=i.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new UE(r,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){K4(n,r.unbox);var i=r.type;i.hookInitializers.forEach(function(a){var o=a(n);Object.keys(o).forEach(function(l){var u=o[l],d=tp(n,l,u);Nf(n,l,d)})}),Ov(n,this.willChange),Cv(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return Q4(r.storedValue)}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r.storedValue.get(""+n);if(!i)throw new Vt("Not a child "+n);return i}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Pr(r.object),i=r.name;n.assertWritable({subpath:i});var a=n.type,o=a._subType;switch(r.type){case"update":{var l=r.newValue,u=r.object.get(i);if(l===u)return null;cc(o,l),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":cc(o,r.newValue),r.newValue=o.instantiate(n,i,void 0,r.newValue),a.processIdentifier(i,r.newValue);break}return r}}),Object.defineProperty(t.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.identifierMode===qc.YES&&n instanceof xs){var i=n.identifier;if(i!==r)throw new Vt("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(i,"', but expected: '").concat(r,"'"))}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return r.getChildren().forEach(function(i){n[i.subpath]=i.snapshot}),n}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Pr(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:Lf(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:Lf(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:Lf(r.name),oldValue:i},n)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue;switch(i.op){case"add":case"replace":a.set(n,i.value);break;case"remove":a.delete(n);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){cc(this,n);var i=r.storedValue,a={};if(Array.from(i.keys()).forEach(function(l){a[l]=!1}),n)for(var o in n)i.set(o,n[o]),a[""+o]=!0;Object.keys(a).forEach(function(l){a[l]===!1&&i.delete(l)})}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return gh(r)?Z1(Object.keys(r).map(function(a){return i._subType.validate(r[a],Hv(n,a,i._subType))})):Es(n,r,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return kh}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),t}(Oh);L1.prototype.applySnapshot=Dr(L1.prototype.applySnapshot);function HE(e){return new L1("Map<string, ".concat(e.name,">"),e)}var T1=function(e){Wn(t,e);function t(r,n,i){i===void 0&&(i=[]);var a=e.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Gr.Array}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Vv(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=[]);var i=r.type._subType,a={};return n.forEach(function(o,l){var u=""+l;a[u]=i.instantiate(r,u,void 0,o)}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=ju(ju({},Q1),{name:this.name});return Fr.array(Vw(r),n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Iu(n).dehancer=r.unbox;var i=r.type;i.hookInitializers.forEach(function(a){var o=a(n);Object.keys(o).forEach(function(l){var u=o[l],d=tp(n,l,u);Nf(n,l,d)})}),Ov(n,this.willChange),Cv(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue.slice()}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=Number(n);if(i<r.storedValue.length)return r.storedValue[i];throw new Vt("Not a child: "+n)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Pr(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=V5(n,i,[a[r.index]],[r.newValue],[r.index]);if(!o)return null;r.newValue=o[0]}break;case"splice":{var l=r.index,u=r.removedCount,d=r.added,h=V5(n,i,a.slice(l,l+u),d,d.map(function(p,f){return l+f}));if(!h)return null;r.added=h;for(var v=l+u;v<a.length;v++)a[v].setParent(n,""+(v+d.length-u))}break}return r}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=[];return Object.keys(r).forEach(function(i){n.push(r[i].getSnapshot())}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Pr(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:""+r.index,value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"splice":if(r.removedCount&&r.addedCount===r.object.length)return void n.emitPatch({op:"replace",path:"",value:n.snapshot,oldValue:r.removed.map(function(a){return a.snapshot})},n);for(var i=r.removedCount-1;i>=0;i--)n.emitPatch({op:"remove",path:""+(r.index+i),oldValue:r.removed[i].snapshot},n);for(var i=0;i<r.addedCount;i++)n.emitPatch({op:"add",path:""+(r.index+i),value:r.added[i].snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue,o=n==="-"?a.length:Number(n);switch(i.op){case"replace":a[o]=i.value;break;case"add":a.splice(o,0,i.value);break;case"remove":a.splice(o,1);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){cc(this,n);var i=r.storedValue;i.replace(n)}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return Gw(r)?Z1(r.map(function(a,o){return i._subType.validate(a,Hv(n,""+o,i._subType))})):Es(n,r,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ch}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),t}(Oh);T1.prototype.applySnapshot=Dr(T1.prototype.applySnapshot);function VE(e){return new T1("".concat(e.name,"[]"),e)}function V5(e,t,r,n,i){for(var a=!0,o=0;;o++){var l=o<=n.length-1,u=r[o],d=l?n[o]:void 0,h=""+i[o];if(wE(d)&&(d=d.storedValue),!u&&!l)break;if(!l)a=!1,r.splice(o,1),u instanceof xs&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(G5(u,d))r[o]=dg(t,e,h,d,u);else{for(var p=void 0,f=o;f<r.length;f++)if(G5(r[f],d)){p=r.splice(f,1)[0];break}a=!1;var v=dg(t,e,h,d,p);r.splice(o,0,v)}else{if(_i(d)&&Pr(d).parent===e)throw new Vt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e.path,"/").concat(h,"', but it lives already at '").concat(Pr(d).path,"'"));a=!1;var v=dg(t,e,h,d);r.splice(o,0,v)}}return a?null:r}function dg(e,t,r,n,i){cc(e,n);function a(){if(_i(n)){var l=Pr(n);if(l.assertAlive(kh),l.parent!==null&&l.parent===t)return l.setParent(t,r),l}return i?e.reconcile(i,n,t,r):e.instantiate(t,r,void 0,n)}var o=a();return i&&i!==o&&(i instanceof xs&&i.createObservableInstanceIfNeeded(),i.die()),o}function G5(e,t){if(!e.isAlive)return!1;if(_i(t)){var r=Pr(t);return r.isAlive&&r===e}if(e.snapshot===t)return!0;if(!(e instanceof xs))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&gh(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}var $5="preProcessSnapshot",W5="postProcessSnapshot";function GE(){return Pr(this).toString()}var Y5={name:"AnonymousModel",properties:{},initializers:Ch};function $E(e){var t=Object.keys(e),r=new Set;return t.forEach(function(n){if(r.has(n))throw new Vt("".concat(n," is declared twice in the model. Model should not contain the same keys"));r.add(n)}),t.reduce(function(n,i){if(i in _a)throw new Vt("Hook '".concat(i,"' was defined as property. Hooks should be defined as part of the actions"));var a=Object.getOwnPropertyDescriptor(e,i);if("get"in a)throw new Vt("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw new Vt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(rp(o))n[i]=Tf(JE(o),o);else if(o instanceof L1)n[i]=Tf(o,{});else if(o instanceof T1)n[i]=Tf(o,[]);else if(!hc(o))throw new Vt("Invalid type definition for property '".concat(i,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return n},ju({},e))}var np=function(e){Wn(t,e);function t(r){var n=e.call(this,r.name||Y5.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Gr.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,Y5,r),n.properties=$E(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(t.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=void 0;return this.forAllProps(function(n,i){if(i.flags&Gr.Identifier){if(r)throw new Vt("Cannot define property '".concat(n,"' as object identifier, property '").concat(r,"' is already defined as identifier property"));r=n}}),r}}),Object.defineProperty(t.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new t({name:r.name||this.name,properties:Object.assign({},this.properties,r.properties),initializers:this.initializers.concat(r.initializers||[]),preProcessor:r.preProcessor||this.preProcessor,postProcessor:r.postProcessor||this.postProcessor})}}),Object.defineProperty(t.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateActions(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!gh(n))throw new Vt("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===$5)throw new Vt("Cannot define action '".concat($5,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(i===W5)throw new Vt("Cannot define action '".concat(W5,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var a=n[i],o=r[i];if(i in _a&&o){var l=a;a=function(){o.apply(null,arguments),l.apply(null,arguments)}}var u=a.$mst_middleware,d=a.bind(n);d._isFlowAction=a._isFlowAction||!1,d.$mst_middleware=u;var h=tp(r,i,d);n[i]=h,Nf(r,i,h)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw new Vt("You passed an ".concat(typeof r," to volatile state as an argument, when function is expected"));var i=function(a){return n.instantiateVolatileState(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!gh(n))throw new Vt("volatile state initializer should return a plain object containing state");J4(r,n)}}),Object.defineProperty(t.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){var o=r(a),l=o.actions,u=o.views,d=o.state,h=QS(o,["actions","views","state"]);for(var v in h)throw new Vt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(v,"'"));return d&&n.instantiateVolatileState(a,d),u&&n.instantiateViews(a,u),l&&n.instantiateActions(a,l),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateViews(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!gh(n))throw new Vt("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)ew(r,i,o),rw(r,(a={},a[i]=Df,a));else if(typeof o.value=="function")Nf(r,i,o.value);else throw new Vt("A view member should either be a function or getter based property")})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=_i(a)?a:this.applySnapshotPreProcessor(a);return Vv(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type,a={};return i.forAllProps(function(o,l){a[o]=l.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=ju(ju({},Q1),{name:this.name});return Fr.object(r,kh,n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Nf(n,"toString",GE),this.forAllProps(function(i){K4(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),Ov(n,this.willChange),Cv(n,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Pr(n.object),a=n.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(cc(o,n.newValue),n.newValue=o.reconcile(i.getChildNode(a),n.newValue,i,a)),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Pr(n.object),a=i.type.properties[n.name];if(a){var o=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:Lf(n.name),value:n.newValue.snapshot,oldValue:o},i)}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=[];return this.forAllProps(function(a){i.push(n.getChildNode(r,a))}),i}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i;if(!(n in this.properties))throw new Vt("Not a value property: "+n);var a=Iu(r.storedValue,n),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw new Vt("Node not available for property "+n);return o}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={};return this.forAllProps(function(o,l){try{var u=Ph(r.storedValue,o);u.reportObserved()}catch{throw new Vt("".concat(o," property is declared twice"))}a[o]=i.getChildNode(r,o).snapshot}),n?this.applySnapshotPostProcessor(a):a}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){if(!(i.op==="replace"||i.op==="add"))throw new Vt("object does not support operation ".concat(i.op));r.storedValue[n]=i.value}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){cc(this,n);var i=this.applySnapshotPreProcessor(n);this.forAllProps(function(a){r.storedValue[a]=i[a]})}}),Object.defineProperty(t.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.preProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.postProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.properties[r]}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.applySnapshotPreProcessor(r);return gh(a)?Z1(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],Hv(n,o,i.properties[o]))})):Es(n,a,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.propertyNames.forEach(function(i){return r(i,n.properties[i])})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;return"{ "+this.propertyNames.map(function(n){return n+": "+r.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return kh}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),t}(Oh);np.prototype.applySnapshot=Dr(np.prototype.applySnapshot);function WE(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():"AnonymousModel",n=e.shift()||{};return new np({name:r,properties:n})}function YE(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string",n=r?e[0]:"AnonymousModel";return r&&e.shift(),e.reduce(function(i,a){return i.cloneAndEnhance({name:i.name+"_"+a.name,properties:a.properties,initializers:a.initializers,preProcessor:function(o){return a.applySnapshotPreProcessor(i.applySnapshotPreProcessor(o))},postProcessor:function(o){return a.applySnapshotPostProcessor(i.applySnapshotPostProcessor(o))}})}).named(n)}function XE(e){return hc(e)&&(e.flags&Gr.Object)>0}var pc=function(e){Wn(t,e);function t(r,n,i,a){a===void 0&&(a=EE);var o=e.call(this,r)||this;return Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:a}),o.flags=n,o}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return of(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.initializer(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(rp(r)&&this.checker(r))return Ss();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return Es(n,r,"Value is not a ".concat(i))}}),t}(qf),Qw=new pc("string",Gr.String,function(e){return typeof e=="string"}),Jw=new pc("number",Gr.Number,function(e){return typeof e=="number"}),KE=new pc("integer",Gr.Integer,function(e){return PE(e)}),ZE=new pc("float",Gr.Float,function(e){return AE(e)}),QE=new pc("finite",Gr.Finite,function(e){return OE(e)}),e6=new pc("boolean",Gr.Boolean,function(e){return typeof e=="boolean"}),t6=new pc("null",Gr.Null,function(e){return e===null}),r6=new pc("undefined",Gr.Undefined,function(e){return e===void 0}),n6=new pc("Date",Gr.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});n6.getSnapshot=function(e){return e.storedValue.getTime()};var i6=n6;function JE(e){switch(typeof e){case"string":return Qw;case"number":return Jw;case"boolean":return e6;case"object":if(e instanceof Date)return i6}throw new Vt("Cannot determine primitive type from value "+e)}function eP(e){return hc(e)&&(e.flags&(Gr.String|Gr.Number|Gr.Integer|Gr.Boolean|Gr.Date))>0}var tP=function(e){Wn(t,e);function t(r){var n=e.call(this,JSON.stringify(r))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Gr.Literal}),n.value=r,n}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return of(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return rp(r)&&r===this.value?Ss():Es(n,r,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),t}(qf);function a6(e){return new tP(e)}var rP=function(e){Wn(t,e);function t(r,n,i,a){var o=e.call(this,r)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"_message",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|Gr.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this._subtype.validate(r,n);if(i.length>0)return i;var a=_i(r)?Pr(r).snapshot:r;return this._predicate(a)?Ss():Es(n,r,this._message(r))}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(fc);function nP(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():hc(e[0])?e[0].name:null,n=e[0],i=e[1],a=e[2]?e[2]:function(o){return"Value does not respect the refinement predicate"};return new rP(r,n,i,a)}function iP(e,t){var r=typeof e=="string"?t:e,n=J1.apply(void 0,Ff([],Qc(r.map(function(i){return a6(""+i)})),!1));return typeof e=="string"&&(n.name=e),n}var aP=function(e){Wn(t,e);function t(r,n,i){var a=e.call(this,r)||this;return Object.defineProperty(a,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=ju({eager:!0,dispatcher:void 0},i),a._dispatcher=i.dispatcher,i.eager||(a._eager=!1),a}return Object.defineProperty(t.prototype,"flags",{get:function(){var r=Gr.Union;return this._types.forEach(function(n){r|=n.flags}),r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._types.some(function(n){return n.isAssignableFrom(r)})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(r){return r.describe()}).join(" | ")+")"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(a,void 0);if(!o)throw new Vt("No matching type for union "+this.describe());return o.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(n,r.getReconciliationType());if(!o)throw new Vt("No matching type for union "+this.describe());return o.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._dispatcher?this._dispatcher(r):n?n.is(r)?n:this._types.filter(function(i){return i!==n}).find(function(i){return i.is(r)}):this._types.find(function(i){return i.is(r)})}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._dispatcher)return this._dispatcher(r).validate(r,n);for(var i=[],a=0,o=0;o<this._types.length;o++){var l=this._types[o],u=l.validate(r,n);if(u.length===0){if(this._eager)return Ss();a++}else i.push(u)}return a===1?Ss():Es(n,r,"No type is applicable for the union").concat(Z1(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(fc);function J1(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=hc(e)?void 0:e,i=hc(e)?Ff([e],Qc(t),!1):t,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new aP(a,i,n)}function oP(e){return hc(e)&&(e.flags&Gr.Union)>0}var sP=function(e){Wn(t,e);function t(r,n,i){var a=e.call(this,r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|Gr.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(this.optionalValues.indexOf(a)>=0){var o=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(r,n,i,o)}return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),i,a)}}),Object.defineProperty(t.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&cc(this,r),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?Ss():this._subtype.validate(r,n)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(fc);function lP(e,t){if(typeof t!="function"&&_i(t))throw new Vt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Tf(e,t,r){return lP(e,t),new sP(e,t,r||uP)}var uP=[void 0],cP=Tf(r6,void 0),fP=Tf(t6,null);function o6(e){return J1(e,cP)}function hP(e){return J1(e,fP)}var dP=function(e){Wn(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|Gr.Late},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._subType){var n=void 0;try{n=this._definition()}catch(i){if(i instanceof ReferenceError)n=void 0;else throw i}if(r&&n===void 0)throw new Vt("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r?r.name:"<uknown late type>"}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.getSubType(!1);return i?i.validate(r,n):Ss()}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getSubType(!1);return n?n.isAssignableFrom(r):!1}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r||zw}}),t}(fc);function pP(e,t){var r=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?t:e;return new dP(r,n)}function gP(e,t){return new vP(e,t)}var vP=function(e){Wn(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Gr.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:Fr.array()}),Xm(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(Dr(function(a){i.loadedType=a,i.pendingNodeList.forEach(function(o){o.parent&&i.loadedType&&o.parent.applyPatches([{op:"replace",path:"/".concat(o.subpath),value:o.snapshot}])})}))}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this;if(this.loadedType)return this.loadedType.instantiate(r,n,i,a);var l=of(this,r,n,i,a);return this.pendingNodeList.push(l),Xm(function(){return!l.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(l),1)}),l}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.loadedType?this.loadedType.validate(r,n):Yw(r)?Ss():Es(n,r,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.loadedType?(r.die(),this.loadedType.instantiate(i,a,i.environment,n)):e.prototype.reconcile.call(this,r,n,i,a)}}),t}(qf),s6=function(e){Wn(t,e);function t(r){var n=e.call(this,r?"frozen(".concat(r.name,")"):"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Gr.Frozen}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return of(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return Yw(r)?this.subType?this.subType.validate(r,n):Ss():Es(n,r,"Value is not serializable and cannot be frozen")}}),t}(qf),X5=new s6;function mP(e){return arguments.length===0?X5:hc(e)?new s6(e):Tf(X5,e)}function yP(e){switch(e){case _a.beforeDestroy:return"destroy";case _a.beforeDetach:return"detach";default:return}}var bP=function(){function e(t,r){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Gv(t))this.identifier=t;else if(_i(t)){var n=Pr(t);if(!n.identifierAttribute)throw new Vt("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw new Vt("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new Vt("Can only store references to tree nodes or identifiers, got: '".concat(t,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=pp(this.identifier),n=t.root,i=n.identifierCache.getLastCacheModificationPerId(r);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var a=this.targetType,o=n.identifierCache.resolve(a,r);if(!o)throw new wP("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(t.path,")"));this.resolvedReference={node:o,lastCacheModification:i}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),wP=function(e){Wn(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return t}(Error),l6=function(e){Wn(t,e);function t(r,n){var i=e.call(this,"reference(".concat(r.name,")"))||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Gr.Reference}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.targetType.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return Gv(r)?Ss():Es(n,r,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(t.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=n.parent;if(!(!o||!o.isAlive)){var l=o.storedValue;l&&this.onInvalidated({cause:r,parent:l,invalidTarget:a?a.storedValue:void 0,invalidId:i,replaceRef:function(u){z5(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){XE(o.type)?this.replaceRef(void 0):z5(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(t.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.getValue(r);if(a){var o=Pr(a),l=function(h,v){var p=yP(v);p&&i.fireInvalidated(p,r,n,o)},u=o.registerHook(_a.beforeDetach,l),d=o.registerHook(_a.beforeDestroy,l);return function(){u(),d()}}}}),Object.defineProperty(t.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=this;if(this.onInvalidated){var o;r.registerHook(_a.beforeDestroy,function(){o&&o()});var l=function(u){o&&o();var d=r.parent,h=d&&d.storedValue;if(d&&d.isAlive&&h){var v=void 0;i?v=!!i.get(n,h):v=r.root.identifierCache.has(a.targetType,pp(n)),v?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===oo.FINALIZED?l(!0):(r.isRoot||r.root.registerHook(_a.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(_a.afterAttach,function(){l(!1)}))}}}),t}(qf),_P=function(e){Wn(t,e);function t(r,n){return e.call(this,r,n)||this}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=r.storedValue;return n.resolvedValue}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r.storedValue;return n.identifier}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=_i(a)?rE(a):a,l=new bP(a,this.targetType),u=of(this,r,n,i,l);return l.node=u,this.watchTargetNodeForInvalidations(u,o,void 0),u}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this){var o=_i(n),l=r.storedValue;if(!o&&l.identifier===n||o&&l.resolvedValue===n)return r.setParent(i,a),r}var u=this.instantiate(i,a,void 0,n);return r.die(),u}}),t}(l6),xP=function(e){Wn(t,e);function t(r,n,i){var a=e.call(this,r,i)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=this.options.get(r.storedValue,r.parent?r.parent.storedValue:null);return n}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=_i(a)?this.options.set(a,r?r.storedValue:null):a,l=of(this,r,n,i,o);return this.watchTargetNodeForInvalidations(l,o,this.options),l}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=_i(n)?this.options.set(n,r?r.storedValue:null):n;if(!r.isDetaching&&r.type===this&&r.storedValue===o)return r.setParent(i,a),r;var l=this.instantiate(i,a,void 0,o);return r.die(),l}}),t}(l6);function u6(e,t){var r=t||void 0,n=t?t.onInvalidated:void 0;return r&&(r.get||r.set)?new xP(e,{get:r.get,set:r.set},n):new _P(e,n)}function SP(e,t){var r=u6(e,ju(ju({},t),{onInvalidated:function(n){t&&t.onInvalidated&&t.onInvalidated(n),n.removeRef()}}));return t&&t.acceptsUndefined===!1?r:o6(r)}var c6=function(e){Wn(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Gr.Identifier}),i}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r||!(r.type instanceof np))throw new Vt("Identifier types can only be instantiated as direct child of a model type");return of(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(r.storedValue!==n)throw new Vt("Tried to change identifier from '".concat(r.storedValue,"' to '").concat(n,"'. Changing identifiers is not allowed."));return r.setParent(i,a),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return typeof r!==this.validType?Es(n,r,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):Ss()}}),t}(qf),EP=function(e){Wn(t,e);function t(){var r=e.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Gr.Identifier}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t}(c6),PP=function(e){Wn(t,e);function t(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),t}(c6),AP=new EP,OP=new PP;function pp(e){return""+e}function Gv(e){return typeof e=="string"||typeof e=="number"}function CP(e){return new kP(e)}var kP=function(e){Wn(t,e);function t(r){var n=e.call(this,r.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Gr.Custom}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.options.isTargetType(r))return Ss();var i=this.options.getValidationMessage(r);return i?Es(n,r,"Invalid value for type '".concat(this.name,"': ").concat(i)):Ss()}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.options.toSnapshot(r.storedValue)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.options.isTargetType(a)?a:this.options.fromSnapshot(a,r&&r.root.environment);return of(this,r,n,i,o)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=!this.options.isTargetType(n);if(!r.isDetaching){var l=r.type===this&&(o?n===r.snapshot:n===r.storedValue);if(l)return r.setParent(i,a),r}var u=o?this.options.fromSnapshot(n,i.root.environment):n,d=this.instantiate(i,a,void 0,u);return r.die(),d}}),t}(qf),$t={enumeration:iP,model:WE,compose:YE,custom:CP,reference:u6,safeReference:SP,union:J1,optional:Tf,literal:a6,maybe:o6,maybeNull:hP,refinement:nP,string:Qw,boolean:e6,number:Jw,integer:KE,float:ZE,finite:QE,Date:i6,map:HE,array:VE,frozen:mP,identifier:AP,identifierNumber:OP,late:pP,lazy:gP,undefined:r6,null:t6,snapshotProcessor:qE};function f6({oldText:e,newText:t,element:r}){if(!(t.length/Math.max(20,e.length)>=4))return r.fontSize;const n=r.width*r.page.computedHeight/t.length,i=1.5*Math.sqrt(n),a=r.fontSize;return Math.min(a,Math.max(5,Math.round(i)))}let xf;function NP(){return xf||(xf=document.getElementById("polotno-text-style"),xf||(xf=document.createElement("style"),xf.id="polotno-text-style",document.head.appendChild(xf)),xf)}Kt._fixTextRendering=!0;const K5={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 LP(e){var t="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+t+"]*?["+t+"]").test(e)}function TP(e){e=e.replace(/\s/g,"");let t=0;for(var r=0;r<e.length;r++)LP(e[r])&&(t+=1);return t>e.length/2}function e0(e){return TP(e)?"rtl":"ltr"}const RP=Gn(({textNodeRef:e,element:t,onBlur:r,selectAll:n,cursorPosition:i})=>{const[a,o]=fe.useState(K5),l=e.current;fe.useLayoutEffect(()=>{const p={};p.width=l.width()-2*l.padding()+"px",p.height=l.height()-2*l.padding()+l.fontSize()*l.lineHeight()+"px",p.fontSize=l.fontSize()+"px",p.lineHeight=l.lineHeight()+.01,p.fontFamily=l.fontFamily(),p.textAlign=l.align(),p.color=l.fill(),p.fontWeight=t.fontWeight,p.fontStyle=t.fontStyle,p.letterSpacing=t.letterSpacing+"em",p.opacity=Math.max(t.a.opacity,.2),p.textTransform=t.textTransform;const f=`
88
- .polotno-input::placeholder {
89
- color: ${a.color};
90
- opacity: 0.6;
91
- }
92
- `,b=NP();b.innerHTML="",b.appendChild(document.createTextNode(f)),JSON.stringify(p)!==JSON.stringify(a)&&o(p)});const u=fe.useRef(null);fe.useLayoutEffect(()=>{var p;const f=u.current;if(!f)return;(p=u.current)===null||p===void 0||p.focus();const b=i||f.value.length;f.selectionStart=f.selectionEnd=b,n&&(f?.select(),document.execCommand("selectAll",!1,null))},[]),fe.useEffect(()=>{window.addEventListener("blur",r);const p=f=>{var b;!((b=u.current)===null||b===void 0)&&b.contains(f.target)||r()};return window.addEventListener("touchstart",p),()=>{window.removeEventListener("blur",r),window.removeEventListener("touchstart",p)}},[]);let d=0;const h=l.textArr.length*l.lineHeight()*l.fontSize();t.verticalAlign==="middle"&&(d=(t.a.height-h)/2),t.verticalAlign==="bottom"&&(d=t.a.height-h);const v=Lu(t.text);return fe.createElement("textarea",{className:"polotno-input",ref:u,dir:e0(v),style:Object.assign(Object.assign(Object.assign({},K5),a),{paddingTop:d+"px"}),value:v,onChange:p=>{const f=f6({oldText:t.text,newText:p.target.value,element:t});t.set({text:p.target.value,fontSize:f})},placeholder:t.placeholder,onBlur:r})}),MP=e=>fe.createElement(C1,null,fe.createElement(RP,Object.assign({},e))),h6=(e,t)=>{const[r,n]=fe.useReducer(a=>a+1,0),i=fe.useRef(j5(t));return fe.useLayoutEffect(()=>{if(i.current=j5(t),i.current)return;let a=!0;return(async()=>{i.current=!1,n();const o=Ah(`text ${t}`);await e.loadFont(t),setTimeout(o,100),a&&(i.current=!0,n())})(),()=>{a=!1}},[t]),[i.current]},d6=({fontLoaded:e,fontFamily:t,fontSize:r,lineHeight:n})=>fe.useMemo(()=>{if(typeof n=="number")return n;const i=document.createElement("div");i.style.fontFamily=t,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},[e,t,r,n]);function p6(e){const t=fe.useRef(e),r=fe.useRef(e);return fe.useMemo(()=>{r.current=t.current,t.current=e},[e]),r.current}const IP=Gn(({element:e,store:t})=>{const r=fe.useRef(null),n=fe.useRef(null),{editorEnabled:i,selectAll:a}=(C=>{const[L,H]=fe.useState(!1),G=fe.useRef(!1);return fe.useEffect(()=>{var J=!0;return setTimeout(()=>{J&&(C._editModeEnabled&&(G.current=!0),H(!0),setTimeout(()=>{G.current=!1},50))},50),()=>{J=!1}},[]),{editorEnabled:L&&C._editModeEnabled,selectAll:G.current}})(e),[o,l]=fe.useState(!1),u=fe.useRef(e.a.height),d=t.selectedShapes.indexOf(e)>=0&&e.selectable,{textVerticalResizeEnabled:h}=bi,v=p6(e.fontFamily),[p,f]=fe.useState([]);fe.useEffect(()=>{var C,L;const H=(L=(C=r.current)===null||C===void 0?void 0:C.textArr)!==null&&L!==void 0?L:[];JSON.stringify(H)!==JSON.stringify(p)&&f(H)}),fe.useEffect(()=>{if(e.a.width)return;const C=r.current;C.width(600),e.set({width:1.4*C.getTextWidth()})},[]),fe.useLayoutEffect(()=>Mu(()=>{const C=r.current;_s(C,e)}));const[b]=h6(t,e.fontFamily);let _=Lu(e.text);e.textTransform==="uppercase"&&(_=_.toUpperCase());const S=()=>{const C=r.current.clone({height:void 0}),L=Math.ceil(C.fontSize()*C.lineHeight()*C.textArr.length+1);return C.destroy(),L};fe.useLayoutEffect(()=>{if(!b)return;const{textOverflow:C,textSplitAllowed:L}=bi;if(!e.a.height){const H=S();return void t.history.ignore(()=>{e.set({height:H})},!1,!0)}if(!t.isPlaying)if(C!=="change-font-size"||o){if(C==="resize"){const H=S();h&&e.a.height<H&&t.history.ignore(()=>{var G;q5(e)&&e.set({height:H}),(G=r.current)===null||G===void 0||G.height(H)},!1,!0),h||e.a.height===H||o||t.history.ignore(()=>{var G;q5(e)&&e.set({height:H}),(G=r.current)===null||G===void 0||G.height(H)},!1,!0)}}else{const H=function(J,se,U=!1){const V=J.fontSize(),X=J.height(),z=Lu(se.text);let D=se.a.fontSize;J.height(void 0);const F=Math.round(2*se.a.fontSize)-1;for(let q=1;q<F;q++){const Q=se.a.height&&J.height()>se.a.height;let re=z.split(`
93
- `).join(" ").split(/[\s-]+/).reduce((ae,ue)=>/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(ue)?ae.concat(ue.split("")):ae.concat(ue),[]),Y=J.textArr.map(ae=>ae.text).join(";");const ee=re.find(ae=>!Y.includes(ae)||(Y=Y.replace(ae,""),!1));if(!(Q||ee&&!U))break;D-=.5,J.fontSize(D)}return J.fontSize(V),J.height(X),D}(r.current,e,L);if(H!==e.a.fontSize)return void t.history.ignore(()=>{e.set({fontSize:H})},!1,!0);const G=S();e.a.height===G||h||t.history.ignore(()=>{e.set({height:G})},!1,!0)}}),fe.useLayoutEffect(()=>{const C=r.current;C&&(C.width(C.width()+1e-8),C._setTextData(),_s(C,e))},[b]);const x=fe.useRef(null),m=fe.useRef(0),w=C=>{C.evt.preventDefault(),t.selectedShapes.find(H=>H===e)&&e.contentEditable&&(m.current=function(H){var G;const J=H.target,se=function(F){var q=F.getAbsoluteTransform().copy();q.invert();var Q=F.getStage().getPointerPosition();return q.point(Q)}(J),U=J.textArr,V=Math.floor(se.y/(J.fontSize()*J.lineHeight())),X=U.slice(0,V).reduce((F,q)=>F+q.text.length,V),z=(G=U[V])!==null&&G!==void 0?G:U[0];let D=0;return J.align()==="right"?D=J.width()-z.width:J.align()==="center"&&(D=J.width()/2-z.width/2),X+Math.round((se.x-D)/z.width*z.text.length)}(C),e.toggleEditMode())},E=!_&&e.placeholder?.6:e.a.opacity;hp(r,E);const P=d6({fontLoaded:b,fontFamily:e.fontFamily,fontSize:e.a.fontSize,lineHeight:e.lineHeight}),R=e.selectable||t.role==="admin",k=Zc(e),N=fe.useMemo(()=>e.backgroundEnabled?function({lines:C,lineHeight:L,width:H,align:G="left",padding:J=0,cornerRadius:se=0}){var U;C.forEach((D,F)=>{D.cx=H/2,G==="right"?D.cx=H-D.width/2:G==="left"&&(D.cx=D.width/2),G!=="justify"||D.lastInParagraph||(D.width=H),G==="justify"&&(D.cx=D.width/2)});let V=`M ${(U=C[0])===null||U===void 0?void 0:U.cx} ${-J}`;C.forEach((D,F)=>{const{cx:q}=D,Q=C[F-1];Q&&Q.width>D.width?V+=` L ${q+D.width/2+J} ${F*L+J}`:V+=` L ${q+D.width/2+J} ${F*L-J}`;const re=C[F+1];re&&re.width>D.width?V+=` L ${q+D.width/2+J} ${(F+1)*L-J}`:V+=` L ${q+D.width/2+J} ${(F+1)*L+J}`});for(var X=C.length-1;X>=0;X--){const D=C[X],{cx:F}=D,q=C[X+1];q&&q.width>D.width?V+=` L ${F-D.width/2-J} ${(X+1)*L-J}`:V+=` L ${F-D.width/2-J} ${(X+1)*L+J}`;const Q=C[X-1];Q&&Q.width>D.width?V+=` L ${F-D.width/2-J} ${X*L+J}`:V+=` L ${F-D.width/2-J} ${X*L-J}`}V+=" Z";const z=ES(V);return PS(z,se).path}({lines:JSON.parse(JSON.stringify(p)),cornerRadius:e.backgroundCornerRadius*(e.a.fontSize*P*.5),lineHeight:P*e.a.fontSize,padding:e.backgroundPadding*(e.a.fontSize*P*.5),width:e.a.width,align:e.align}):"",[e.backgroundEnabled,e.backgroundCornerRadius,e.a.fontSize,P,e.backgroundPadding,e.a.width,e.align,p]),M=af();let T=0;return e.verticalAlign==="middle"?T=(e.a.height-p.length*P*e.a.fontSize)/2:e.verticalAlign==="bottom"&&(T=e.a.height-p.length*P*e.a.fontSize),fe.createElement(fe.Fragment,null,fe.createElement(J2,{ref:n,x:e.a.x,y:e.a.y,rotation:e.a.rotation,hideInExport:!e.showInExport,listening:!1,visible:e.backgroundEnabled,opacity:e.backgroundOpacity*E,data:N,fill:e.backgroundColor,offsetY:-T}),fe.createElement(Nu,Object.assign({ref:r,id:e.id,name:"element",hideInExport:!e.showInExport,editModeEnabled:e._editModeEnabled,x:e.a.x,y:e.a.y,rotation:e.a.rotation,width:e.a.width,height:e.a.height,text:_||e.placeholder,direction:e0(_)},k,{stroke:e.stroke,lineJoin:"round",strokeWidth:e.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:e.a.fontSize,fontFamily:`"${e.fontFamily}", "${v}"`,fontStyle:e.fontStyle+" "+e.fontWeight,textDecoration:e.textDecoration,align:e.align,verticalAlign:e.verticalAlign,draggable:M?e.draggable&&d:e.draggable,preventDefault:!M||d,opacity:E,visible:!e._editModeEnabled,ellipsis:bi.textOverflow==="ellipsis",shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,lineHeight:P,letterSpacing:e.letterSpacing*e.a.fontSize,listening:R,onDragMove:C=>{e.set({x:C.target.x(),y:C.target.y()})},onDragEnd:C=>{e.set({x:C.target.x(),y:C.target.y()})},onClick:w,onTap:w,onTransformStart:()=>{l(!0),u.current=r.current.height()},onTransform:C=>{var L,H,G;const J=C.target;(L=n.current)===null||L===void 0||L.setAttrs({x:J.x(),y:J.y(),rotation:J.rotation(),scale:J.scale()});const se=((H=J.getStage())===null||H===void 0?void 0:H.findOne("Transformer")).getActiveAnchor();if(se==="middle-left"||se==="middle-right"){const V=J.scaleX(),X=J.width()*V,z=e.a.fontSize;let D=X;X<z&&(D=z,x.current&&J.position(x.current)),J.width(D),J.scaleX(1),J.scaleY(1);const F=S();if(bi.textOverflow!=="ellipsis"){const Q=Math.max(F,u.current);J.height(Q),e.set({height:J.height()})}const q=bi.textVerticalResizeEnabled?Math.max(F,u.current):S();e.set({x:J.x(),width:J.width(),rotation:J.rotation(),height:q}),_s(J,e)}if(se==="top-center"||se==="bottom-center"){let V=bi.textOverflow==="resize"?S():P*e.a.fontSize;C.target.height(Math.max(V,C.target.height()*C.target.scaleY())),C.target.scaleY(1)}x.current=C.target.position();const U=C.target.scaleX();(G=n.current)===null||G===void 0||G.setAttrs({scaleX:1,scaleY:1}),C.target.scaleX(1),C.target.scaleY(1),e.set({fontSize:e.a.fontSize*U,width:C.target.width()*U,x:C.target.x(),y:C.target.y(),rotation:C.target.rotation(),height:C.target.height()*U,shadowBlur:e.shadowBlur*U,shadowOffsetX:e.shadowOffsetX*U,shadowOffsetY:e.shadowOffsetY*U,strokeWidth:e.strokeWidth*U})},onTransformEnd:C=>{var L;const H=C.target.scaleX();C.target.scaleX(1),C.target.scaleY(1),e.set({fontSize:Math.round(e.a.fontSize*H),width:Math.ceil(C.target.width()*H),x:C.target.x(),y:C.target.y(),rotation:C.target.rotation(),height:C.target.height()*H,shadowBlur:e.shadowBlur*H,shadowOffsetX:e.shadowOffsetX*H,shadowOffsetY:e.shadowOffsetY*H,strokeWidth:e.strokeWidth*H}),(L=n.current)===null||L===void 0||L.setAttrs({scaleX:1,scaleY:1}),l(!1)}})),i&&fe.createElement(dn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation},fe.createElement(MP,{textNodeRef:r,element:e,selectAll:a,cursorPosition:m.current,onBlur:()=>{e.toggleEditMode(!1),e.text===""&&e.removable&&!e.placeholder&&t.deleteElements([e.id])}})))});var pg={exports:{}},gg={exports:{}},Z5;function $v(){return Z5||(Z5=1,function(e,t){e.exports=r;function r(i){return n.bind(null,i)}function n(i){var a=[].slice.call(arguments,1);a.unshift("["+i+"]"),process.stderr.write(a.join(" ")+`
94
- `)}}(gg)),gg.exports}var Q5;function g6(){return Q5||(Q5=1,function(e,t){$v()("lex"),e.exports=r;function r(n){var i="",a,o=0,l=-1,u=0,d=1,h="before-selector",v=[h],p={},f=[],b=["media","keyframes",{name:"-webkit-keyframes",type:"keyframes",prefix:"-webkit-"},{name:"-moz-keyframes",type:"keyframes",prefix:"-moz-"},{name:"-ms-keyframes",type:"keyframes",prefix:"-ms-"},{name:"-o-keyframes",type:"keyframes",prefix:"-o-"},"font-face",{name:"import",state:"before-at-value"},{name:"charset",state:"before-at-value"},"supports","viewport",{name:"namespace",state:"before-at-value"},"document",{name:"-moz-document",type:"document",prefix:"-moz-"},"page"];function _(){return N(),n[l]}function S(U){return U?v[v.length-1-U]:h}function x(U){var V=l+1;return U===n.slice(V,V+U.length)}function m(U){var V=n.slice(l).indexOf(U);return V>0?V:!1}function w(U){return U===E(1)}function E(U){return n[l+(U||1)]}function P(){var U=v.pop();return h=v[v.length-1],U}function R(U){return h=U,v.push(h),v.length}function k(U){var V=h;return v[v.length-1]=h=U,V}function N(U){if((U||1)==1)n[l]==`
95
- `?(d++,o=1):o++,l++;else{var V=n.slice(l,l+U).split(`
96
- `);V.length>1&&(d+=V.length-1,o=1),o+=V[V.length-1].length,l=l+U}}function M(){p.end={line:d,col:o},f.push(p),i="",p={}}function T(U){p={type:U,start:{line:d,col:o}}}for(;a=_();)switch(a){case" ":switch(S()){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`
97
- `:case" ":case"\r":case"\f":switch(S()){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===`
98
- `&&(p.value=i.trim(),M(),P());break}break;case":":switch(S()){case"name":p.name=i.trim(),i="",k("before-value");break;case"before-selector":i+=a,T("selector"),R("selector");break;case"before-value":k("value"),i+=a;break;default:i+=a;break}break;case";":switch(S()){case"name":case"before-value":case"value":i.trim().length>0&&(p.value=i.trim(),M()),k("before-name");break;case"value-paren":i+=a;break;case"at-value":p.value=i.trim(),M(),P();break;case"before-name":break;default:i+=a;break}break;case"{":switch(S()){case"selector":if(E(-1)==="\\"){i+=a;break}p.text=i.trim(),M(),k("before-name"),u=u+1;break;case"at-group":switch(p.name=i.trim(),p.type){case"font-face":case"viewport":case"page":R("before-name");break;default:R("before-selector")}M(),u=u+1;break;case"name":case"at-rule":p.name=i.trim(),M(),R("before-name"),u=u+1;break;case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":k("value"),i+=a;break}break;case"}":switch(S()){case"before-name":case"name":case"before-value":case"value":i&&(p.value=i.trim()),p.name&&p.value&&M(),T("end"),M(),P(),S()==="at-group"&&(T("at-group-end"),M(),P()),u>0&&(u=u-1);break;case"at-group":case"before-selector":case"selector":if(E(-1)==="\\"){i+=a;break}u>0&&S(1)==="at-group"&&(T("at-group-end"),M()),u>1&&P(),u>0&&(u=u-1);break;case"double-string":case"single-string":case"comment":i+=a;break}break;case'"':case"'":switch(S()){case"double-string":a==='"'&&E(-1)!=="\\"&&P();break;case"single-string":a==="'"&&E(-1)!=="\\"&&P();break;case"before-at-value":k("at-value"),R(a==='"'?"double-string":"single-string");break;case"before-value":k("value"),R(a==='"'?"double-string":"single-string");break;case"comment":break;default:E(-1)!=="\\"&&R(a==='"'?"double-string":"single-string")}i+=a;break;case"/":switch(S()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":case"selector":case"name":case"value":if(w("*")){var C=m("*/");C&&N(C+1)}else S()=="before-value"&&k("value"),i+=a;break;default:w("*")?(T("comment"),R("comment"),N()):i+=a;break}break;case"*":switch(S()){case"comment":w("/")?(p.text=i,N(),M(),P()):i+=a;break;case"before-selector":i+=a,T("selector"),R("selector");break;case"before-value":k("value"),i+=a;break;default:i+=a}break;case"@":switch(S()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":k("value"),i+=a;break;default:for(var L=!1,H,G,J=0,se=b.length;!L&&J<se;++J)G=b[J],H=G.name||G,x(H)&&(L=!0,T(H),R(G.state||"at-group"),N(H.length),G.prefix&&(p.prefix=G.prefix),G.type&&(p.type=G.type));L||(i+=a);break}break;case"(":switch(S()){case"value":R("value-paren");break;case"before-value":k("value");break}i+=a;break;case")":switch(S()){case"value-paren":P();break;case"before-value":k("value");break}i+=a;break;default:switch(S()){case"before-selector":T("selector"),R("selector");break;case"before-name":T("property"),k("name");break;case"before-value":k("value");break;case"before-at-value":k("at-value");break}i+=a;break}return f}}(pg)),pg.exports}var vg={exports:{}},J5;function jP(){return J5||(J5=1,function(e,t){$v()("parse");var r=g6();e.exports=l;var n,i,a,o;function l(P,R){R||(R={}),n=!!R.comments,a=!!R.position,i=0,o=Array.isArray(P)?P.slice():r(P);for(var k,N=[],M;M=d();)k=x(M),k&&N.push(k);return{type:"stylesheet",stylesheet:{rules:N}}}function u(P,R){R||(R={});for(var k,N=["type","name","value"],M={},T=0;T<N.length;++T)k=N[T],P[k]&&(M[k]=R[k]||P[k]);for(N=Object.keys(R),T=0;T<N.length;++T)k=N[T],M[k]||(M[k]=R[k]);return a&&(M.position={start:P.start,end:P.end}),M}function d(){var P=o.shift();return P}function h(P){i=i+1;var R={};switch(P.type){case"font-face":case"viewport":R.declarations=w();break;case"page":R.prefix=P.prefix,R.declarations=w();break;default:R.prefix=P.prefix,R.rules=E()}return u(P,R)}function v(P){return u(P)}function p(P){return u(P)}function f(P){return u(P,{text:P.text})}function b(P){return u(P)}function _(P){return u(P)}function S(P){function R(k){return k.trim()}return u(P,{type:"rule",selectors:P.text.split(",").map(R),declarations:w()})}function x(P){switch(P.type){case"property":return _(P);case"selector":return S(P);case"at-group-end":i=i-1;return;case"media":case"keyframes":return h(P);case"comment":if(n)return f(P);break;case"charset":return p(P);case"import":return v(P);case"namespace":return b(P);case"font-face":case"supports":case"viewport":case"document":case"page":return h(P)}}function m(P){for(var R,k=[],N;(N=d())&&P&&P(N);)R=x(N),R&&k.push(R);return N&&N.type!=="end"&&o.unshift(N),k}function w(){return m(function(P){return P.type==="property"||P.type==="comment"})}function E(){return m(function(){return i})}}(vg)),vg.exports}var mg={exports:{}},e3;function FP(){return e3||(e3=1,function(e,t){$v()("stringify");var r,n,i,a,o,l;e.exports=u;function u(E,P){P||(P={}),i=P.indentation||"",n=!!P.compress,r=!!P.comments,a=1,n?o=l="":(o=`
99
- `,l=" ");var R=b(E.stylesheet.rules,m).join(`
100
- `).trim();return R}function d(E){if(E){a+=E;return}return n?"":Array(a).join(i||"")}function h(E){return"@"+E.type+" "+E.value+";"+o}function v(E){var P="",R=E.prefix||"";E.name&&(P=" "+E.name);var k=E.type!=="page";return"@"+R+E.type+P+l+_(E,k)+o}function p(E){return r?"/*"+(E.text||"")+"*/"+o:""}function f(E){var P;return E.selectors?P=E.selectors.join(","+o):(P="@"+E.type,P+=E.name?" "+E.name:""),d()+P+l+_(E)+o}function b(E,P){return E.reduce(function(R,k){var N=k.type==="comment"?p(k):P(k);return N&&R.push(N),R},[])}function _(E,P){var R=E.declarations,k=x;return E.rules&&(R=E.rules,k=f),R=S(R,k),R&&(R=o+R+(P?"":o)),"{"+R+d()+"}"}function S(E,P){if(!E)return"";d(1);var R=b(E,P);return d(-1),R.length?R.join(o):""}function x(E){if(E.type==="property")return w(E)}function m(E){switch(E.type){case"rule":return f(E);case"media":case"keyframes":return v(E);case"comment":return p(E);case"import":case"charset":case"namespace":return h(E);case"font-face":case"supports":case"viewport":case"document":case"page":return v(E)}}function w(E){var P=E.name?E.name+":"+l:"";return d()+P+E.value+";"}}(mg)),mg.exports}var yg,t3;function DP(){return t3||(t3=1,yg={lex:g6(),parse:jP(),stringify:FP()}),yg}var BP=DP();const zP=dc(BP);function qP(e){for(;e.parentNode;){if(e.nodeName==="defs")return!0;e=e.parentNode}return!1}function UP(e){const t={};return e.querySelectorAll("style").forEach(r=>{const n=zP.parse(r.textContent).stylesheet.rules;for(let i of n)i.selectors&&i.selectors.forEach(a=>{const o=t[a]||{};i.declarations.forEach(l=>{o[l.name]=l.value}),t[a]=o})}),t}function v6(e,t){var r;const n={fill:"",stroke:""},i=((r=e.getAttribute("class"))===null||r===void 0?void 0:r.split(" "))||[],a=e.getAttribute("id");let o={};if(a&&t[`#${a}`]?o=t[`#${a}`]:i.forEach(l=>{t[`.${l}`]&&(o=Object.assign(Object.assign({},o),t[`.${l}`]))}),t[e.nodeName]&&(o=Object.assign(Object.assign({},o),t[e.nodeName])),e.getAttribute("fill")&&e.getAttribute("fill")!=="none"?n.fill=e.getAttribute("fill"):o.fill&&o.fill!=="none"&&(n.fill=o.fill),e.getAttribute("stroke")&&e.getAttribute("stroke")!=="none"?n.stroke=e.getAttribute("stroke"):o.stroke&&o.stroke!=="none"&&(n.stroke=o.stroke),!n.fill&&e.style.fill&&e.style.fill!=="none"&&(n.fill=e.style.fill),!n.stroke&&e.style.stroke&&e.style.stroke!=="none"&&(n.stroke=e.style.stroke),!n.stroke&&!n.fill){const l=e.ownerSVGElement,u=l&&l!==e&&v6(l,t);u?.fill==="currentColor"||u?.stroke==="currentColor"||(n.fill="black")}return n}const HP=["path","rect","circle","line","polygon","polyline","ellipse","text"];function VP(e){for(var t=[],r=e.getElementsByTagName("*"),n=0,i=r.length;n<i;n++){const a=r[n];qP(a)||(a.getAttribute("fill")!==null&&t.push(a),(a.getAttribute("stroke")!==null||a.style&&a.style.fill||HP.indexOf(a.nodeName)>=0)&&t.push(a))}return t}async function m6(e){const t=await fetch(e);return Uf(await t.text())}async function gp(e){return await(await fetch(e,{mode:"cors"})).text()}function Uf(e){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(e)))}function Wv(e){var t=new DOMParser().parseFromString(e,"image/svg+xml");const r=t.documentElement.getAttribute("viewBox"),[n,i,a,o]=r?.split(" ")||[],l=t.documentElement.getAttribute("width");!l&&t.documentElement.setAttribute("width",a+"px");const u=t.documentElement.getAttribute("height");if((!u||u.indexOf("%")>=0)&&t.documentElement.setAttribute("height",o+"px"),l&&l.indexOf("%")>=0&&u&&u.indexOf("%")===-1){const d=parseFloat(u)/parseFloat(o);t.documentElement.setAttribute("width",d*parseFloat(a)+"px")}if(u&&u.indexOf("%")>=0&&l&&l.indexOf("%")===-1){const d=parseFloat(l)/parseFloat(a);t.documentElement.setAttribute("height",d*parseFloat(o)+"px")}return l==="100%"&&u==="100%"&&(t.documentElement.setAttribute("width",a+"px"),t.documentElement.setAttribute("height",o+"px")),new XMLSerializer().serializeToString(t)}const GP=(e,t)=>{if(!e||!t)return!1;if(t==="currentColor"&&e==="black")return!0;const r=Kt.Util.colorToRGBA(e),n=Kt.Util.colorToRGBA(t);return r&&n?r.r===n.r&&r.g===n.g&&r.b===n.b&&r.a===n.a:void 0};function Yv(e,t){var r=new DOMParser().parseFromString(e,"image/svg+xml");const n=VP(r),i=Array.from(t.keys()),a=UP(r);return n.forEach(o=>{const{fill:l,stroke:u}=v6(o,a);[{prop:"fill",color:l},{prop:"stroke",color:u}].forEach(({prop:d,color:h})=>{const v=i.find(p=>GP(p,h));if(v){const p=t.get(v);if(K1(p)){const{rotation:f,stops:b}=Cw(p),_=b.map(x=>({offset:100*x.offset+"%","stop-color":x.color})),S="color"+Math.round(1e8*Math.random());(function(x,m,w,E){var P=x.namespaceURI,R=document.createElementNS(P,"linearGradient");const k=Kt.Util.degToRad(w+90),N=(Math.cos(k)+1)/2,M=(Math.sin(k)+1)/2,T=(Math.cos(k+Math.PI)+1)/2,C=(Math.sin(k+Math.PI)+1)/2;R.setAttribute("x1",100*N+"%"),R.setAttribute("y1",100*M+"%"),R.setAttribute("x2",100*T+"%"),R.setAttribute("y2",100*C+"%"),R.setAttribute("gradientUnits","userSpaceOnUse"),R.setAttribute("id",m);for(var L=0;L<E.length;L++){var H=E[L],G=document.createElementNS(P,"stop");for(var J in H)H.hasOwnProperty(J)&&G.setAttribute(J,H[J]);R.appendChild(G)}(x.querySelector("defs")||x.insertBefore(document.createElementNS(P,"defs"),x.firstChild)).appendChild(R)})(r.children[0],S,f,_),o.style[d]=null,o.setAttribute(d,`url('#${S}')`)}else o.style[d]=t.get(v)}})}),Uf(new XMLSerializer().serializeToString(r))}const Xv=(e,t,r)=>{let n=t,i=r,a=1;for(;n>0&&i>0;){e.width=n,e.height=i;const o=e.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,e.width,e.height);if(a*=.9,n=Math.floor(t*a),i=Math.floor(r*a),n=Math.max(n,1),i=Math.max(i,1),n<=1&&i<=1)return e.width=1,void(e.height=1)}},iv=(e,t=100,r=!1,n)=>{const i=fe.useRef(n??e),[,a]=fe.useReducer(u=>u+1,0),o=fe.useCallback(u=>{i.current!==u&&(i.current=u,a())},[i]),l=fe.useRef(null);return e===r&&(l.current&&(clearTimeout(l.current),l.current=null),i.current=r),fe.useEffect(()=>(l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{o(e),l.current=null},t),()=>{l.current&&clearTimeout(l.current)}),[e,t,r]),[i.current,o]};function Cf(){return document.createElement("canvas")}const y6=e=>e.indexOf("data:image/svg+xml")>=0||e.indexOf(".svg")>=0,r3=e=>{const[t,r]=fe.useState(e);return fe.useEffect(()=>{(async()=>{const n=await async function(i){if(!y6(i))return i;const a=await gp(i),o=Wv(a);return Uf(o)}(e);n!==t&&r(n)})()},[e]),t};function n3(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}const $P={boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2},WP={boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2},i3=(e,t,r)=>Math.max(t,Math.min(r,e)),YP=(e,t,r,n,i=0,a=!1,o=!0)=>{const l=Math.floor(i3(e.a.width*n,1,1e4)),u=Math.floor(i3(e.a.height*n,1,1e4)),d=Math.min(i*n,l/2,u/2),h=Math.max(e.a.width/r.width,e.a.height/r.height)*n,v=e.page._exportingOrRendering&&bi.imageDownScalingEnabled&&h<1&&!a,p=r.x===0&&r.y===0&&r.width===t?.width&&r.height===t?.height,f=fe.useMemo(()=>{if(t&&t.width&&t.height)return p&&d===0&&!v?void 0:Cf()},[t,d,v,p]);return fe.useLayoutEffect(()=>{if(!f||!t)return;Xv(f,l,u);const b=f.getContext("2d");if(!b)return;d&&(b.beginPath(),b.moveTo(d,0),b.lineTo(l-d,0),b.arc(l-d,d,d,3*Math.PI/2,0,!1),b.lineTo(l,u-d),b.arc(l-d,u-d,d,0,Math.PI/2,!1),b.lineTo(d,u),b.arc(d,u-d,d,Math.PI/2,Math.PI,!1),b.lineTo(0,d),b.arc(d,d,d,Math.PI,3*Math.PI/2,!1),b.clip());const _=v?function(x,m){var w,E;const P=Cf();P.width=x.width,P.height=x.height;const R=Math.max(1,Math.floor(P.width*m)),k=Math.max(1,Math.floor(P.height*m));(w=P.getContext("2d"))===null||w===void 0||w.drawImage(x,0,0,P.width,P.height);const N=function(M,T,C,L,H,G,J){for(var se=new ImageData(T,C),U=new Int32Array(M.data.buffer),V=M.width,X=new Int32Array(se.data.buffer),z=se.width,D=T/G,F=C/J,q=Math.round(1/D),Q=Math.round(1/F),re=q*Q,Y=0;Y<se.height;Y++)for(var ee=0;ee<z;ee++){for(var ae=0+Math.round(ee/D)+(0+Math.round(Y/F))*V,ue=0,ce=0,pe=0,Ae=0,Ce=0;Ce<Q;Ce++)for(var ke=0;ke<q;ke++){var Se=U[ae+ke+Ce*V];ue+=Se<<24>>>24,ce+=Se<<16>>>24,pe+=Se<<8>>>24,Ae+=Se>>>24}ue=Math.round(ue/re),ce=Math.round(ce/re),pe=Math.round(pe/re),Ae=Math.round(Ae/re),X[ee+Y*z]=Ae<<24|pe<<16|ce<<8|ue}return se}(P.getContext("2d").getImageData(0,0,P.width,P.height),R,k,0,0,P.width,P.height);return P.width=R,P.height=k,(E=P.getContext("2d"))===null||E===void 0||E.putImageData(N,0,0),P}(t,h):t,S=v?{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;b.drawImage(_,S.x,S.y,S.width,S.height,0,0,f.width,f.height)},[f,e.a.width,e.a.height,r.x,r.y,r.width,r.height,i,n,a,e.page._exportingOrRendering,v]),fe.useEffect(()=>()=>{f&&f.nodeName==="CANVAS"&&Kt.Util.releaseCanvas(f)},[f]),f||t},XP=Cf(),KP=Gn(({element:e})=>{const t=Math.min(30,e.a.width/4,e.a.height/4),r=fe.useRef(null);return fe.useEffect(()=>{const n=r.current;if(!n)return;const i=new Kt.Animation(a=>{n.rotate((a?.timeDiff||0)/2)},n.getLayer());return i.start(),()=>{i.stop()}}),fe.createElement(dn,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},fe.createElement(xn,{width:e.a.width,height:e.a.height,fill:"rgba(124, 173, 212, 0.8)"}),fe.createElement(Bv,{ref:r,x:e.a.width/2,y:e.a.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),ZP=Gn(({element:e})=>{const t=Math.max(10,Math.min(30,e.a.width/25));return fe.createElement(dn,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},fe.createElement(xn,{width:e.a.width,height:e.a.height,fill:"rgba(223, 102, 102, 0.8)"}),fe.createElement(Nu,{text:"Can not load the image...",fontSize:t,width:e.a.width,height:e.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let bg=zv;const Gd=(e,t="",r="")=>{const n=fe.useRef(),i=()=>{var a;(a=n.current)===null||a===void 0||a.call(n),n.current=void 0};fe.useEffect(()=>i,[]),fe.useLayoutEffect(()=>{const a=t.slice(0,200),o=`image with id ${r} url: ${a}`;e!=="loading"||n.current||(n.current=Ah(o)),e!=="loading"&&i(),e==="failed"&&dp(o)},[e])},a3=Gn(({element:e,store:t})=>{var r;const[n,i]=fe.useState(!1),a=fe.useRef(null),o=fe.useRef(null),l=t.selectedShapes.indexOf(e)>=0&&e.selectable,[u,d]=(le=>{const[Ee,xe]=fe.useReducer(Re=>Re+1,0),ye=fe.useRef("loading"),Ne=fe.useRef(le.src),Te=fe.useRef(le.src);Te.current!==le.src&&(Te.current=le.src,ye.current="loading");const ge=fe.useMemo(()=>y6(le.src)||le.type==="svg",[le.src,le.type]);return fe.useEffect(()=>{if(!ge||!le.src)return;let Re=!1;return(async()=>{ye.current="loading",xe();const Be=await gp(le.src),Qe=Wv(Be);let ct;ct=le.colorsReplace?Yv(Qe,le.colorsReplace||new Map):Uf(Qe),Re||(Ne.current=ct,ye.current="loaded",xe())})(),()=>{Re=!0}},[le.src,JSON.stringify(le.colorsReplace)]),ge?[Ne.current,ye.current]:[le.src,"loaded"]})(e),[h,v]=bg(u,"anonymous"),p=e.type!=="svg"||d==="loaded"?v:"loading";Gd(p,e.src,e.id);const f=e.page._exportingOrRendering?1:Math.max(1,t.scale),b=t._elementsPixelRatio*f,_=(({image:le,status:Ee,type:xe})=>{const ye=fe.useRef();return fe.useEffect(()=>{ye.current=le||ye.current},[le]),Ee!=="failed"||Ee!=="failed"&&xe==="svg"?ye.current:void 0})({image:h,status:v,type:e.type}),S=((le,Ee,xe)=>{const ye=fe.useMemo(()=>{var Ne,Te;const{flipX:ge,flipY:Re}=le,Be=le.type==="svg"||le.src.indexOf("data:image/svg+xml")>=0||le.src.indexOf(".svg")>=0,Qe=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,ct=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||Qe)&&Be||le.maskSrc;if(!ge&&!Re&&!ct)return Ee;if(!Ee||!Ee.width||!Ee.height)return null;const mt=Cf();let gt=1;le.type==="svg"&&(gt=Math.max(le.a.width/Ee.width*xe,le.a.height/Ee.height*xe)),Xv(mt,Math.max(Ee.width*gt,1),Math.max(Ee.height*gt,1));let St=ge?-mt.width:0,pt=Re?-mt.height:0;return(Ne=mt.getContext("2d"))===null||Ne===void 0||Ne.scale(ge?-1:1,Re?-1:1),(Te=mt.getContext("2d"))===null||Te===void 0||Te.drawImage(Ee,St,pt,mt.width,mt.height),mt},[le.maskSrc,le.flipX,le.flipY,Ee,le.a.width,le.a.height,xe]);return fe.useEffect(()=>()=>{ye&&ye.nodeName==="CANVAS"&&Kt.Util.releaseCanvas(ye)},[ye]),ye})(e,h||_,b),x=((le,Ee)=>{const xe=r3(le.maskSrc||""),[ye,Ne]=bg(xe,"anonymous");return Gd(xe?Ne:"loaded",xe||"",le.id),fe.useMemo(()=>{if(!ye||!Ee||!Ee.width||!Ee.height)return Ee;const Te=Cf();Te.width=Math.max(Ee.width,1),Te.height=Math.max(Ee.height,1);const ge=Te.getContext("2d");if(!ge)return Ee;ge.drawImage(Ee,0,0),ge.globalCompositeOperation="source-in";const Re=function(Be,Qe){const ct=Qe.width/Qe.height;let mt,gt;return ct>=Be.width/Be.height?(mt=Be.width,gt=Be.width/ct):(mt=Be.height*ct,gt=Be.height),{x:(Be.width-mt)/2,y:(Be.height-gt)/2,width:mt,height:gt}}(ye,le);return ge.drawImage(ye,Re.x,Re.y,Re.width,Re.height,0,0,Ee.width,Ee.height),Te},[Ee,ye,le.a.width,le.a.height])})(e,S)||XP;let{cropX:m,cropY:w,cropWidth:E,cropHeight:P}=e.a;v!=="loaded"&&(m=w=0,E=P=1);const R=x.width*E,k=x.height*P,N=e.a.width/e.a.height;let M,T;const C=R/k,L=e.stretchEnabled;L?(M=R,T=k):N>=C?(M=R,T=R/N):(M=k*N,T=k);const H={x:x.width*m,y:x.height*w,width:M,height:T},G=(r=e.cornerRadius)!==null&&r!==void 0?r:0,J=e.page._exportingOrRendering?1:Math.min(2,t.scale),se=t._elementsPixelRatio*J;let U=((le,Ee,xe,ye)=>{const Ne=r3(le.clipSrc||""),[Te,ge]=bg(Ne,"anonymous"),Re=le.clipSrc?ge:"loaded";Gd(Re,le.clipSrc,le.id);const Be=fe.useMemo(()=>{if(Ee&&Te)return Cf()},[Ee,Te]);return fe.useLayoutEffect(()=>{var Qe;if(!Te||!Ee||!Ee.width||!Ee.height||!Te||!Te.width||!Te.height||!Be)return;const ct=Cf(),mt=Math.max(le.a.width/Te.width*xe,le.a.height/Te.height*xe);ct.width=Math.max(Te.width*mt,1),ct.height=Math.max(Te.height*mt,1),(Qe=ct.getContext("2d"))===null||Qe===void 0||Qe.drawImage(Te,0,0,ct.width,ct.height),Be.width=Math.max(Ee.width,1),Be.height=Math.max(Ee.height,1);const gt=Be.getContext("2d");gt&&(gt.save(),gt.drawImage(ct,0,0,Ee.width,Ee.height),Kt.Util.releaseCanvas(ct),gt.globalCompositeOperation="source-in",gt.drawImage(Ee,0,0,Be.width,Be.height),gt.restore())},[Be,Ee,Te,le.a.width,le.a.height,xe,...ye]),le.clipSrc&&Te?Be:Ee})(e,YP(e,x,H,se,G,n||e._cropModeEnabled||e.type==="svg",!0),se,[H,G,se]);const V=Math.max(e.a.width/M,e.a.height/T);fe.useEffect(()=>{var le;if(!e._cropModeEnabled)return;const Ee=(le=a.current)===null||le===void 0?void 0:le.getStage();function xe(Ne){e._cropModeEnabled&&Ne.target!==o.current&&e.toggleCropMode(!1)}function ye(Ne){e._cropModeEnabled&&Ne.target.parentNode!==Ee.content&&e.toggleCropMode(!1)}return document.body.addEventListener("click",ye),Ee?.on("click",xe),Ee?.on("tap",xe),()=>{document.body.removeEventListener("click",ye),document.body.removeEventListener("touchstart",ye),Ee?.off("click",xe),Ee?.off("click",xe)}},[e._cropModeEnabled]),fe.useLayoutEffect(()=>{if(!n&&!e._cropModeEnabled)return _s(a.current,e),Mu(()=>{_s(a.current,e)},{delay:100})},[U,e.page._exportingOrRendering,n,E,P,e._cropModeEnabled]),fe.useLayoutEffect(()=>{var le;n||e._cropModeEnabled?(le=a.current)===null||le===void 0||le.clearCache():_s(a.current,e)},[n,e.a.width,e.a.height,e._cropModeEnabled]),fe.useEffect(()=>{_s(a.current,e)},[e.shadowEnabled,e.shadowBlur,e.cornerRadius,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]);const X=fe.useRef(null),z=fe.useRef(null),D=fe.useRef(null);fe.useLayoutEffect(()=>{e._cropModeEnabled&&(z.current.nodes([X.current]),D.current.nodes([o.current]))},[e._cropModeEnabled]);var F=fe.useRef(null),q=fe.useRef(0),Q=fe.useRef(!1);const re=le=>{var Ee;((Ee=le.evt.touches)===null||Ee===void 0?void 0:Ee.length)>2&&le.target.stopDrag(),Math.round(le.target.x())>0&&(le.target.x(0),le.target.scaleX(1)),Math.round(le.target.y())>0&&(le.target.y(0),le.target.scaleY(1));const xe=le.target.width()*le.target.scaleX(),ye=le.target.height()*le.target.scaleY(),Ne=Math.min(1,M/xe),Te=Math.min(1,T/ye),ge=1-Ne,Re=Math.min(ge,Math.max(0,Math.round(-le.target.x())/xe)),Be=1-Te,Qe=Math.min(Be,Math.max(0,Math.round(-le.target.y())/ye));le.target.setAttrs({x:-Re*x.width,y:-Qe*x.height,scaleX:1,scaleY:1}),e.set({cropX:Re,cropY:Qe,cropWidth:Ne,cropHeight:Te})},Y=()=>{e.type!=="svg"&&e.contentEditable&&(e.stretchEnabled||setTimeout(()=>{e.toggleCropMode(!0)}))},ee=e.type==="svg"&&_,ae=v==="loading"&&!ee,[ue]=iv(ae,100,!1,!1),ce=v==="failed",pe=!ue&&!ce,Ae=fe.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Ce=pe?e.a.opacity:0;hp(a,Ce);const ke=e.selectable||t.role==="admin",Se=af();return fe.createElement(fe.Fragment,null,ue&&fe.createElement(KP,{element:e}),ce&&fe.createElement(ZP,{element:e}),fe.createElement(Eu,{ref:a,name:"element",id:e.id,image:U,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:Ce,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:H,listening:ke,draggable:Se?e.draggable&&l:e.draggable,preventDefault:!Se||l,hideInExport:!e.showInExport,onDragMove:le=>{e.set({x:le.target.x(),y:le.target.y()})},onDragEnd:le=>{e.set({x:le.target.x(),y:le.target.y()})},onDblClick:Y,onDblTap:Y,onTransformStart:()=>{i(!0),Ae.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:le=>{var Ee;const xe=le.currentTarget,ye=Math.abs(xe.scaleX()-1)<1e-7?1:xe.scaleX(),Ne=Math.abs(xe.scaleY()-1)<1e-7?1:xe.scaleY();xe.scaleX(1),xe.scaleY(1);const Te=(Ee=le.target.getStage())===null||Ee===void 0?void 0:Ee.findOne("Transformer"),ge=1-M/x.width,Re=Math.min(ge,Math.max(0,e.cropX)),Be=1-T/x.height,Qe=Math.min(Be,Math.max(0,e.cropY)),ct=Te.getActiveAnchor(),mt=!(ct.indexOf("middle")>=0||ct.indexOf("center")>=0),gt=!mt&&ye<1&&Ae.current.cropHeight>T/x.height;let St=mt?e.cropWidth:e.cropWidth*ye;gt&&(St=e.cropWidth);const pt=!mt&&Ne<1&&Ae.current.cropWidth>M/x.width;let ut=mt?e.cropHeight:e.cropHeight*Ne;pt&&(ut=e.cropHeight),L&&(St=e.cropWidth,ut=e.cropHeight),e.set({cropX:Re,cropY:Qe,x:xe.x(),y:xe.y(),width:xe.width()*ye,height:xe.height()*Ne,rotation:le.target.rotation(),cropWidth:Math.min(St,1-Re),cropHeight:Math.min(ut,1-Qe)})},onTransformEnd:le=>{const Ee=le.currentTarget;e.set({width:Ee.width(),height:Ee.height(),x:Ee.x(),y:Ee.y(),rotation:le.target.rotation(),cropWidth:M/x.width,cropHeight:T/x.height}),i(!1)}}),fe.createElement(xn,{x:e.x,y:e.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:Ce,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,G-e.borderSize),hideInExport:!e.showInExport}),e._cropModeEnabled&&fe.createElement(qv,{selector:".page-abs-container",enabled:!0},fe.createElement(xn,{x:-window.innerWidth/t.scale,y:-window.innerWidth/t.scale,width:window.innerWidth/t.scale*3,height:window.innerWidth/t.scale*3,fill:"rgba(0,0,0,0.3)"}),fe.createElement(Eu,{listening:!1,image:U,x:e.x,y:e.y,width:e.a.width,height:e.a.height,rotation:e.rotation,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur}),fe.createElement(dn,{x:e.x,y:e.y,rotation:e.rotation,scaleX:V,scaleY:V},fe.createElement(Eu,{image:x,ref:o,opacity:.4,draggable:!0,x:-e.cropX*x.width,y:-e.cropY*x.height,onDragMove:re,onTransform:re,onTouchMove:le=>{le.evt.preventDefault();const Ee=le.target.getStage().getPointersPositions();var xe=Ee[0],ye=Ee[1];const Ne=le.target;if(xe&&!ye&&!Ne.isDragging()&&Q.current&&(Ne.startDrag(),Q.current=!1),xe&&ye){Kt.hitOnDragEnabled=!0,Ne.isDragging()&&(Q.current=!0,Ne.stopDrag());const pt=le.target.getAbsoluteTransform().copy();pt.invert();var Te={x:xe.x,y:xe.y},ge={x:ye.x,y:ye.y};if(!F.current)return void(F.current=n3(Te,ge));var Re=n3(Te,ge),Be=function(Nr,ur){return Math.sqrt(Math.pow(ur.x-Nr.x,2)+Math.pow(ur.y-Nr.y,2))}(Te,ge);q.current||(q.current=Be);const ut=Ne.position();var Qe={x:Re.x-ut.x,y:Re.y-ut.y},ct=Be/q.current;Ne.scaleX(ct),Ne.scaleY(ct);const Br=pt.point(Re),rr=pt.point(F.current);var mt=Br.x-rr.x,gt=Br.y-rr.y,St={x:Math.min(0,Re.x-Qe.x*ct+mt),y:Math.min(0,Re.y-Qe.y*ct+gt)};Ne.position(St),q.current=Be,F.current=Re,re(le)}},onTouchEnd:le=>{q.current=0,F.current=null,Kt.hitOnDragEnabled=!1}}),fe.createElement(Jd,Object.assign({ref:D},WP)),fe.createElement(xn,{width:M,height:T,ref:X,listening:!1,onTransform:le=>{if(e.cropX<Math.abs(le.target.x()/x.width)&&le.target.x()<0&&e.cropX>0){const Be=(e.cropWidth+e.cropX)*x.width;le.target.scaleX(1),le.target.width(Be)}if(e.cropY<Math.abs(le.target.y()/x.height)&&le.target.y()<0&&e.cropY>0){const Be=(e.cropHeight+e.cropY)*x.height;le.target.scaleY(1),le.target.height(Be)}le.target.x()<-e.cropX*x.width-1e-9&&(le.target.x(-e.cropX*x.width),le.target.scaleX(1)),le.target.y()<-e.cropY*x.height-1e-9&&(le.target.y(-e.cropY*x.height),le.target.scaleY(1));const Ee=Math.min(1,Math.max(0,e.cropX+le.target.x()/x.width)),xe=Math.min(1,Math.max(0,le.target.y()/x.height+e.cropY)),ye=le.target.width()*le.target.scaleX(),Ne=le.target.height()*le.target.scaleY(),Te=Math.min(1-Ee,ye/x.width),ge=Math.min(1-xe,Ne/x.height),Re=le.target.getAbsolutePosition(le.target.getParent().getParent());le.target.scale({x:1,y:1}),le.target.position({x:0,y:0}),e.set({x:Re.x,y:Re.y,cropX:Ee,cropY:xe,cropWidth:Te,cropHeight:ge,width:Math.min(ye*V,x.width*(1-Ee)*V),height:Math.min(Ne*V,x.height*(1-xe)*V)})}}),fe.createElement(Jd,Object.assign({ref:z},$P,{visible:e.resizable})))))});var u1={exports:{}};/*!
101
- * Quill Editor v1.3.7
102
- * https://quilljs.com/
103
- * Copyright (c) 2014, Jason Chen
104
- * Copyright (c) 2013, salesforce.com
105
- */var QP=u1.exports,o3;function JP(){return o3||(o3=1,function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:QP,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,l){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:l})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),o=i(18),l=i(19),u=i(45),d=i(46),h=i(47),v=i(48),p=i(49),f=i(12),b=i(32),_=i(33),S=i(31),x=i(1),m={Scope:x.Scope,create:x.create,find:x.find,query:x.query,register:x.register,Container:a.default,Format:o.default,Leaf:l.default,Embed:v.default,Scroll:u.default,Block:h.default,Inline:d.default,Text:p.default,Attributor:{Attribute:f.default,Class:b.default,Style:_.default,Store:S.default}};n.default=m},function(r,n,i){var a=this&&this.__extends||function(){var S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,m){x.__proto__=m}||function(x,m){for(var w in m)m.hasOwnProperty(w)&&(x[w]=m[w])};return function(x,m){S(x,m);function w(){this.constructor=x}x.prototype=m===null?Object.create(m):(w.prototype=m.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(S){a(x,S);function x(m){var w=this;return m="[Parchment] "+m,w=S.call(this,m)||this,w.message=m,w.name=w.constructor.name,w}return x}(Error);n.ParchmentError=o;var l={},u={},d={},h={};n.DATA_KEY="__blot";var v;(function(S){S[S.TYPE=3]="TYPE",S[S.LEVEL=12]="LEVEL",S[S.ATTRIBUTE=13]="ATTRIBUTE",S[S.BLOT=14]="BLOT",S[S.INLINE=7]="INLINE",S[S.BLOCK=11]="BLOCK",S[S.BLOCK_BLOT=10]="BLOCK_BLOT",S[S.INLINE_BLOT=6]="INLINE_BLOT",S[S.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",S[S.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",S[S.ANY=15]="ANY"})(v=n.Scope||(n.Scope={}));function p(S,x){var m=b(S);if(m==null)throw new o("Unable to create "+S+" blot");var w=m,E=S instanceof Node||S.nodeType===Node.TEXT_NODE?S:w.create(x);return new w(E,x)}n.create=p;function f(S,x){return x===void 0&&(x=!1),S==null?null:S[n.DATA_KEY]!=null?S[n.DATA_KEY].blot:x?f(S.parentNode,x):null}n.find=f;function b(S,x){x===void 0&&(x=v.ANY);var m;if(typeof S=="string")m=h[S]||l[S];else if(S instanceof Text||S.nodeType===Node.TEXT_NODE)m=h.text;else if(typeof S=="number")S&v.LEVEL&v.BLOCK?m=h.block:S&v.LEVEL&v.INLINE&&(m=h.inline);else if(S instanceof HTMLElement){var w=(S.getAttribute("class")||"").split(/\s+/);for(var E in w)if(m=u[w[E]],m)break;m=m||d[S.tagName]}return m==null?null:x&v.LEVEL&m.scope&&x&v.TYPE&m.scope?m:null}n.query=b;function _(){for(var S=[],x=0;x<arguments.length;x++)S[x]=arguments[x];if(S.length>1)return S.map(function(E){return _(E)});var m=S[0];if(typeof m.blotName!="string"&&typeof m.attrName!="string")throw new o("Invalid definition");if(m.blotName==="abstract")throw new o("Cannot register abstract class");if(h[m.blotName||m.attrName]=m,typeof m.keyName=="string")l[m.keyName]=m;else if(m.className!=null&&(u[m.className]=m),m.tagName!=null){Array.isArray(m.tagName)?m.tagName=m.tagName.map(function(E){return E.toUpperCase()}):m.tagName=m.tagName.toUpperCase();var w=Array.isArray(m.tagName)?m.tagName:[m.tagName];w.forEach(function(E){(d[E]==null||m.className==null)&&(d[E]=m)})}return m}n.register=_},function(r,n,i){var a=i(51),o=i(11),l=i(3),u=i(20),d="\0",h=function(v){Array.isArray(v)?this.ops=v:v!=null&&Array.isArray(v.ops)?this.ops=v.ops:this.ops=[]};h.prototype.insert=function(v,p){var f={};return v.length===0?this:(f.insert=v,p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(f.attributes=p),this.push(f))},h.prototype.delete=function(v){return v<=0?this:this.push({delete:v})},h.prototype.retain=function(v,p){if(v<=0)return this;var f={retain:v};return p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(f.attributes=p),this.push(f)},h.prototype.push=function(v){var p=this.ops.length,f=this.ops[p-1];if(v=l(!0,{},v),typeof f=="object"){if(typeof v.delete=="number"&&typeof f.delete=="number")return this.ops[p-1]={delete:f.delete+v.delete},this;if(typeof f.delete=="number"&&v.insert!=null&&(p-=1,f=this.ops[p-1],typeof f!="object"))return this.ops.unshift(v),this;if(o(v.attributes,f.attributes)){if(typeof v.insert=="string"&&typeof f.insert=="string")return this.ops[p-1]={insert:f.insert+v.insert},typeof v.attributes=="object"&&(this.ops[p-1].attributes=v.attributes),this;if(typeof v.retain=="number"&&typeof f.retain=="number")return this.ops[p-1]={retain:f.retain+v.retain},typeof v.attributes=="object"&&(this.ops[p-1].attributes=v.attributes),this}}return p===this.ops.length?this.ops.push(v):this.ops.splice(p,0,v),this},h.prototype.chop=function(){var v=this.ops[this.ops.length-1];return v&&v.retain&&!v.attributes&&this.ops.pop(),this},h.prototype.filter=function(v){return this.ops.filter(v)},h.prototype.forEach=function(v){this.ops.forEach(v)},h.prototype.map=function(v){return this.ops.map(v)},h.prototype.partition=function(v){var p=[],f=[];return this.forEach(function(b){var _=v(b)?p:f;_.push(b)}),[p,f]},h.prototype.reduce=function(v,p){return this.ops.reduce(v,p)},h.prototype.changeLength=function(){return this.reduce(function(v,p){return p.insert?v+u.length(p):p.delete?v-p.delete:v},0)},h.prototype.length=function(){return this.reduce(function(v,p){return v+u.length(p)},0)},h.prototype.slice=function(v,p){v=v||0,typeof p!="number"&&(p=1/0);for(var f=[],b=u.iterator(this.ops),_=0;_<p&&b.hasNext();){var S;_<v?S=b.next(v-_):(S=b.next(p-_),f.push(S)),_+=u.length(S)}return new h(f)},h.prototype.compose=function(v){var p=u.iterator(this.ops),f=u.iterator(v.ops),b=[],_=f.peek();if(_!=null&&typeof _.retain=="number"&&_.attributes==null){for(var S=_.retain;p.peekType()==="insert"&&p.peekLength()<=S;)S-=p.peekLength(),b.push(p.next());_.retain-S>0&&f.next(_.retain-S)}for(var x=new h(b);p.hasNext()||f.hasNext();)if(f.peekType()==="insert")x.push(f.next());else if(p.peekType()==="delete")x.push(p.next());else{var m=Math.min(p.peekLength(),f.peekLength()),w=p.next(m),E=f.next(m);if(typeof E.retain=="number"){var P={};typeof w.retain=="number"?P.retain=m:P.insert=w.insert;var R=u.attributes.compose(w.attributes,E.attributes,typeof w.retain=="number");if(R&&(P.attributes=R),x.push(P),!f.hasNext()&&o(x.ops[x.ops.length-1],P)){var k=new h(p.rest());return x.concat(k).chop()}}else typeof E.delete=="number"&&typeof w.retain=="number"&&x.push(E)}return x.chop()},h.prototype.concat=function(v){var p=new h(this.ops.slice());return v.ops.length>0&&(p.push(v.ops[0]),p.ops=p.ops.concat(v.ops.slice(1))),p},h.prototype.diff=function(v,p){if(this.ops===v.ops)return new h;var f=[this,v].map(function(m){return m.map(function(w){if(w.insert!=null)return typeof w.insert=="string"?w.insert:d;var E=m===v?"on":"with";throw new Error("diff() called "+E+" non-document")}).join("")}),b=new h,_=a(f[0],f[1],p),S=u.iterator(this.ops),x=u.iterator(v.ops);return _.forEach(function(m){for(var w=m[1].length;w>0;){var E=0;switch(m[0]){case a.INSERT:E=Math.min(x.peekLength(),w),b.push(x.next(E));break;case a.DELETE:E=Math.min(w,S.peekLength()),S.next(E),b.delete(E);break;case a.EQUAL:E=Math.min(S.peekLength(),x.peekLength(),w);var P=S.next(E),R=x.next(E);o(P.insert,R.insert)?b.retain(E,u.attributes.diff(P.attributes,R.attributes)):b.push(R).delete(E);break}w-=E}}),b.chop()},h.prototype.eachLine=function(v,p){p=p||`
106
- `;for(var f=u.iterator(this.ops),b=new h,_=0;f.hasNext();){if(f.peekType()!=="insert")return;var S=f.peek(),x=u.length(S)-f.peekLength(),m=typeof S.insert=="string"?S.insert.indexOf(p,x)-x:-1;if(m<0)b.push(f.next());else if(m>0)b.push(f.next(m));else{if(v(b,f.next(1).attributes||{},_)===!1)return;_+=1,b=new h}}b.length()>0&&v(b,{},_)},h.prototype.transform=function(v,p){if(p=!!p,typeof v=="number")return this.transformPosition(v,p);for(var f=u.iterator(this.ops),b=u.iterator(v.ops),_=new h;f.hasNext()||b.hasNext();)if(f.peekType()==="insert"&&(p||b.peekType()!=="insert"))_.retain(u.length(f.next()));else if(b.peekType()==="insert")_.push(b.next());else{var S=Math.min(f.peekLength(),b.peekLength()),x=f.next(S),m=b.next(S);if(x.delete)continue;m.delete?_.push(m):_.retain(S,u.attributes.transform(x.attributes,m.attributes,p))}return _.chop()},h.prototype.transformPosition=function(v,p){p=!!p;for(var f=u.iterator(this.ops),b=0;f.hasNext()&&b<=v;){var _=f.peekLength(),S=f.peekType();if(f.next(),S==="delete"){v-=Math.min(_,v-b);continue}else S==="insert"&&(b<v||!p)&&(v+=_);b+=_}return v},r.exports=h},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(f){return typeof Array.isArray=="function"?Array.isArray(f):a.call(f)==="[object Array]"},d=function(f){if(!f||a.call(f)!=="[object Object]")return!1;var b=i.call(f,"constructor"),_=f.constructor&&f.constructor.prototype&&i.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!b&&!_)return!1;var S;for(S in f);return typeof S>"u"||i.call(f,S)},h=function(f,b){o&&b.name==="__proto__"?o(f,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):f[b.name]=b.newValue},v=function(f,b){if(b==="__proto__")if(i.call(f,b)){if(l)return l(f,b).value}else return;return f[b]};r.exports=function p(){var f,b,_,S,x,m,w=arguments[0],E=1,P=arguments.length,R=!1;for(typeof w=="boolean"&&(R=w,w=arguments[1]||{},E=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});E<P;++E)if(f=arguments[E],f!=null)for(b in f)_=v(w,b),S=v(f,b),w!==S&&(R&&S&&(d(S)||(x=u(S)))?(x?(x=!1,m=_&&u(_)?_:[]):m=_&&d(_)?_:{},h(w,{name:b,newValue:p(R,m,S)})):typeof S<"u"&&h(w,{name:b,newValue:S}));return w}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var a=function(){function C(L,H){for(var G=0;G<H.length;G++){var J=H[G];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(L,J.key,J)}}return function(L,H,G){return H&&C(L.prototype,H),G&&C(L,G),L}}(),o=function C(L,H,G){L===null&&(L=Function.prototype);var J=Object.getOwnPropertyDescriptor(L,H);if(J===void 0){var se=Object.getPrototypeOf(L);return se===null?void 0:C(se,H,G)}else{if("value"in J)return J.value;var U=J.get;return U===void 0?void 0:U.call(G)}},l=i(3),u=w(l),d=i(2),h=w(d),v=i(0),p=w(v),f=i(16),b=w(f),_=i(6),S=w(_),x=i(7),m=w(x);function w(C){return C&&C.__esModule?C:{default:C}}function E(C,L){if(!(C instanceof L))throw new TypeError("Cannot call a class as a function")}function P(C,L){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:C}function R(C,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);C.prototype=Object.create(L&&L.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(C,L):C.__proto__=L)}var k=1,N=function(C){R(L,C);function L(){return E(this,L),P(this,(L.__proto__||Object.getPrototypeOf(L)).apply(this,arguments))}return a(L,[{key:"attach",value:function(){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"attach",this).call(this),this.attributes=new p.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new h.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(G,J){var se=p.default.query(G,p.default.Scope.BLOCK_ATTRIBUTE);se!=null&&this.attributes.attribute(se,J)}},{key:"formatAt",value:function(G,J,se,U){this.format(se,U)}},{key:"insertAt",value:function(G,J,se){if(typeof J=="string"&&J.endsWith(`
107
- `)){var U=p.default.create(M.blotName);this.parent.insertBefore(U,G===0?this:this.next),U.insertAt(0,J.slice(0,-1))}else o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,G,J,se)}}]),L}(p.default.Embed);N.scope=p.default.Scope.BLOCK_BLOT;var M=function(C){R(L,C);function L(H){E(this,L);var G=P(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,H));return G.cache={},G}return a(L,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(p.default.Leaf).reduce(function(G,J){return J.length()===0?G:G.insert(J.value(),T(J))},new h.default).insert(`
108
- `,T(this))),this.cache.delta}},{key:"deleteAt",value:function(G,J){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"deleteAt",this).call(this,G,J),this.cache={}}},{key:"formatAt",value:function(G,J,se,U){J<=0||(p.default.query(se,p.default.Scope.BLOCK)?G+J===this.length()&&this.format(se,U):o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"formatAt",this).call(this,G,Math.min(J,this.length()-G-1),se,U),this.cache={})}},{key:"insertAt",value:function(G,J,se){if(se!=null)return o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,G,J,se);if(J.length!==0){var U=J.split(`
109
- `),V=U.shift();V.length>0&&(G<this.length()-1||this.children.tail==null?o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,Math.min(G,this.length()-1),V):this.children.tail.insertAt(this.children.tail.length(),V),this.cache={});var X=this;U.reduce(function(z,D){return X=X.split(z,!0),X.insertAt(0,D),D.length},G+V.length)}}},{key:"insertBefore",value:function(G,J){var se=this.children.head;o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertBefore",this).call(this,G,J),se instanceof b.default&&se.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"length",this).call(this)+k),this.cache.length}},{key:"moveChildren",value:function(G,J){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"moveChildren",this).call(this,G,J),this.cache={}}},{key:"optimize",value:function(G){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"optimize",this).call(this,G),this.cache={}}},{key:"path",value:function(G){return o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"path",this).call(this,G,!0)}},{key:"removeChild",value:function(G){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"removeChild",this).call(this,G),this.cache={}}},{key:"split",value:function(G){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(J&&(G===0||G>=this.length()-k)){var se=this.clone();return G===0?(this.parent.insertBefore(se,this),this):(this.parent.insertBefore(se,this.next),se)}else{var U=o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"split",this).call(this,G,J);return this.cache={},U}}}]),L}(p.default.Block);M.blotName="block",M.tagName="P",M.defaultChild="break",M.allowedChildren=[S.default,p.default.Embed,m.default];function T(C){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return C==null||(typeof C.formats=="function"&&(L=(0,u.default)(L,C.formats())),C.parent==null||C.parent.blotName=="scroll"||C.parent.statics.scope!==C.statics.scope)?L:T(C.parent,L)}n.bubbleFormats=T,n.BlockEmbed=N,n.default=M},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(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X},o=function(){function X(z,D){var F=[],q=!0,Q=!1,re=void 0;try{for(var Y=z[Symbol.iterator](),ee;!(q=(ee=Y.next()).done)&&(F.push(ee.value),!(D&&F.length===D));q=!0);}catch(ae){Q=!0,re=ae}finally{try{!q&&Y.return&&Y.return()}finally{if(Q)throw re}}return F}return function(z,D){if(Array.isArray(z))return z;if(Symbol.iterator in Object(z))return X(z,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function X(z,D){for(var F=0;F<D.length;F++){var q=D[F];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(z,q.key,q)}}return function(z,D,F){return D&&X(z.prototype,D),F&&X(z,F),z}}();i(50);var u=i(2),d=T(u),h=i(14),v=T(h),p=i(8),f=T(p),b=i(9),_=T(b),S=i(0),x=T(S),m=i(15),w=T(m),E=i(3),P=T(E),R=i(10),k=T(R),N=i(34),M=T(N);function T(X){return X&&X.__esModule?X:{default:X}}function C(X,z,D){return z in X?Object.defineProperty(X,z,{value:D,enumerable:!0,configurable:!0,writable:!0}):X[z]=D,X}function L(X,z){if(!(X instanceof z))throw new TypeError("Cannot call a class as a function")}var H=(0,k.default)("quill"),G=function(){l(X,null,[{key:"debug",value:function(D){D===!0&&(D="log"),k.default.level(D)}},{key:"find",value:function(D){return D.__quill||x.default.find(D)}},{key:"import",value:function(D){return this.imports[D]==null&&H.error("Cannot import "+D+". Are you sure it was registered?"),this.imports[D]}},{key:"register",value:function(D,F){var q=this,Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof D!="string"){var re=D.attrName||D.blotName;typeof re=="string"?this.register("formats/"+re,D,F):Object.keys(D).forEach(function(Y){q.register(Y,D[Y],F)})}else this.imports[D]!=null&&!Q&&H.warn("Overwriting "+D+" with",F),this.imports[D]=F,(D.startsWith("blots/")||D.startsWith("formats/"))&&F.blotName!=="abstract"?x.default.register(F):D.startsWith("modules")&&typeof F.register=="function"&&F.register()}}]);function X(z){var D=this,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(L(this,X),this.options=J(z,F),this.container=this.options.container,this.container==null)return H.error("Invalid Quill container",z);this.options.debug&&X.debug(this.options.debug);var q=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new f.default,this.scroll=x.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new v.default(this.scroll),this.selection=new w.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(f.default.events.EDITOR_CHANGE,function(re){re===f.default.events.TEXT_CHANGE&&D.root.classList.toggle("ql-blank",D.editor.isBlank())}),this.emitter.on(f.default.events.SCROLL_UPDATE,function(re,Y){var ee=D.selection.lastRange,ae=ee&&ee.length===0?ee.index:void 0;se.call(D,function(){return D.editor.update(null,Y,ae)},re)});var Q=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+q+"<p><br></p></div>");this.setContents(Q),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(X,[{key:"addContainer",value:function(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof D=="string"){var q=D;D=document.createElement("div"),D.classList.add(q)}return this.container.insertBefore(D,F),D}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(D,F,q){var Q=this,re=U(D,F,q),Y=o(re,4);return D=Y[0],F=Y[1],q=Y[3],se.call(this,function(){return Q.editor.deleteText(D,F)},q,D,-1*F)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(D),this.container.classList.toggle("ql-disabled",!D)}},{key:"focus",value:function(){var D=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=D,this.scrollIntoView()}},{key:"format",value:function(D,F){var q=this,Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.default.sources.API;return se.call(this,function(){var re=q.getSelection(!0),Y=new d.default;if(re==null)return Y;if(x.default.query(D,x.default.Scope.BLOCK))Y=q.editor.formatLine(re.index,re.length,C({},D,F));else{if(re.length===0)return q.selection.format(D,F),Y;Y=q.editor.formatText(re.index,re.length,C({},D,F))}return q.setSelection(re,f.default.sources.SILENT),Y},Q)}},{key:"formatLine",value:function(D,F,q,Q,re){var Y=this,ee=void 0,ae=U(D,F,q,Q,re),ue=o(ae,4);return D=ue[0],F=ue[1],ee=ue[2],re=ue[3],se.call(this,function(){return Y.editor.formatLine(D,F,ee)},re,D,0)}},{key:"formatText",value:function(D,F,q,Q,re){var Y=this,ee=void 0,ae=U(D,F,q,Q,re),ue=o(ae,4);return D=ue[0],F=ue[1],ee=ue[2],re=ue[3],se.call(this,function(){return Y.editor.formatText(D,F,ee)},re,D,0)}},{key:"getBounds",value:function(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,q=void 0;typeof D=="number"?q=this.selection.getBounds(D,F):q=this.selection.getBounds(D.index,D.length);var Q=this.container.getBoundingClientRect();return{bottom:q.bottom-Q.top,height:q.height,left:q.left-Q.left,right:q.right-Q.left,top:q.top-Q.top,width:q.width}}},{key:"getContents",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-D,q=U(D,F),Q=o(q,2);return D=Q[0],F=Q[1],this.editor.getContents(D,F)}},{key:"getFormat",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof D=="number"?this.editor.getFormat(D,F):this.editor.getFormat(D.index,D.length)}},{key:"getIndex",value:function(D){return D.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(D){return this.scroll.leaf(D)}},{key:"getLine",value:function(D){return this.scroll.line(D)}},{key:"getLines",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof D!="number"?this.scroll.lines(D.index,D.length):this.scroll.lines(D,F)}},{key:"getModule",value:function(D){return this.theme.modules[D]}},{key:"getSelection",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return D&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-D,q=U(D,F),Q=o(q,2);return D=Q[0],F=Q[1],this.editor.getText(D,F)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(D,F,q){var Q=this,re=arguments.length>3&&arguments[3]!==void 0?arguments[3]:X.sources.API;return se.call(this,function(){return Q.editor.insertEmbed(D,F,q)},re,D)}},{key:"insertText",value:function(D,F,q,Q,re){var Y=this,ee=void 0,ae=U(D,0,q,Q,re),ue=o(ae,4);return D=ue[0],ee=ue[2],re=ue[3],se.call(this,function(){return Y.editor.insertText(D,F,ee)},re,D,F.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(D,F,q){this.clipboard.dangerouslyPasteHTML(D,F,q)}},{key:"removeFormat",value:function(D,F,q){var Q=this,re=U(D,F,q),Y=o(re,4);return D=Y[0],F=Y[1],q=Y[3],se.call(this,function(){return Q.editor.removeFormat(D,F)},q,D)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(D){var F=this,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API;return se.call(this,function(){D=new d.default(D);var Q=F.getLength(),re=F.editor.deleteText(0,Q),Y=F.editor.applyDelta(D),ee=Y.ops[Y.ops.length-1];ee!=null&&typeof ee.insert=="string"&&ee.insert[ee.insert.length-1]===`
110
- `&&(F.editor.deleteText(F.getLength()-1,1),Y.delete(1));var ae=re.compose(Y);return ae},q)}},{key:"setSelection",value:function(D,F,q){if(D==null)this.selection.setRange(null,F||X.sources.API);else{var Q=U(D,F,q),re=o(Q,4);D=re[0],F=re[1],q=re[3],this.selection.setRange(new m.Range(D,F),q),q!==f.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API,q=new d.default().insert(D);return this.setContents(q,F)}},{key:"update",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f.default.sources.USER,F=this.scroll.update(D);return this.selection.update(D),F}},{key:"updateContents",value:function(D){var F=this,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f.default.sources.API;return se.call(this,function(){return D=new d.default(D),F.editor.applyDelta(D,q)},q,!0)}}]),X}();G.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},G.events=f.default.events,G.sources=f.default.sources,G.version="1.3.7",G.imports={delta:d.default,parchment:x.default,"core/module":_.default,"core/theme":M.default};function J(X,z){if(z=(0,P.default)(!0,{container:X,modules:{clipboard:!0,keyboard:!0,history:!0}},z),!z.theme||z.theme===G.DEFAULTS.theme)z.theme=M.default;else if(z.theme=G.import("themes/"+z.theme),z.theme==null)throw new Error("Invalid theme "+z.theme+". Did you register it?");var D=(0,P.default)(!0,{},z.theme.DEFAULTS);[D,z].forEach(function(Q){Q.modules=Q.modules||{},Object.keys(Q.modules).forEach(function(re){Q.modules[re]===!0&&(Q.modules[re]={})})});var F=Object.keys(D.modules).concat(Object.keys(z.modules)),q=F.reduce(function(Q,re){var Y=G.import("modules/"+re);return Y==null?H.error("Cannot load "+re+" module. Are you sure you registered it?"):Q[re]=Y.DEFAULTS||{},Q},{});return z.modules!=null&&z.modules.toolbar&&z.modules.toolbar.constructor!==Object&&(z.modules.toolbar={container:z.modules.toolbar}),z=(0,P.default)(!0,{},G.DEFAULTS,{modules:q},D,z),["bounds","container","scrollingContainer"].forEach(function(Q){typeof z[Q]=="string"&&(z[Q]=document.querySelector(z[Q]))}),z.modules=Object.keys(z.modules).reduce(function(Q,re){return z.modules[re]&&(Q[re]=z.modules[re]),Q},{}),z}function se(X,z,D,F){if(this.options.strict&&!this.isEnabled()&&z===f.default.sources.USER)return new d.default;var q=D==null?null:this.getSelection(),Q=this.editor.delta,re=X();if(q!=null&&(D===!0&&(D=q.index),F==null?q=V(q,re,z):F!==0&&(q=V(q,D,F,z)),this.setSelection(q,f.default.sources.SILENT)),re.length()>0){var Y,ee=[f.default.events.TEXT_CHANGE,re,Q,z];if((Y=this.emitter).emit.apply(Y,[f.default.events.EDITOR_CHANGE].concat(ee)),z!==f.default.sources.SILENT){var ae;(ae=this.emitter).emit.apply(ae,ee)}}return re}function U(X,z,D,F,q){var Q={};return typeof X.index=="number"&&typeof X.length=="number"?typeof z!="number"?(q=F,F=D,D=z,z=X.length,X=X.index):(z=X.length,X=X.index):typeof z!="number"&&(q=F,F=D,D=z,z=0),(typeof D>"u"?"undefined":a(D))==="object"?(Q=D,q=F):typeof D=="string"&&(F!=null?Q[D]=F:q=D),q=q||f.default.sources.API,[X,z,Q,q]}function V(X,z,D,F){if(X==null)return null;var q=void 0,Q=void 0;if(z instanceof d.default){var re=[X.index,X.index+X.length].map(function(ue){return z.transformPosition(ue,F!==f.default.sources.USER)}),Y=o(re,2);q=Y[0],Q=Y[1]}else{var ee=[X.index,X.index+X.length].map(function(ue){return ue<z||ue===z&&F===f.default.sources.USER?ue:D>=0?ue+D:Math.max(z,ue+D)}),ae=o(ee,2);q=ae[0],Q=ae[1]}return new m.Range(q,Q-q)}n.expandConfig=J,n.overload=U,n.default=G},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(x,m){for(var w=0;w<m.length;w++){var E=m[w];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,m,w){return m&&S(x.prototype,m),w&&S(x,w),x}}(),o=function S(x,m,w){x===null&&(x=Function.prototype);var E=Object.getOwnPropertyDescriptor(x,m);if(E===void 0){var P=Object.getPrototypeOf(x);return P===null?void 0:S(P,m,w)}else{if("value"in E)return E.value;var R=E.get;return R===void 0?void 0:R.call(w)}},l=i(7),u=v(l),d=i(0),h=v(d);function v(S){return S&&S.__esModule?S:{default:S}}function p(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function f(S,x){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:S}function b(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(S,x):S.__proto__=x)}var _=function(S){b(x,S);function x(){return p(this,x),f(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"formatAt",value:function(w,E,P,R){if(x.compare(this.statics.blotName,P)<0&&h.default.query(P,h.default.Scope.BLOT)){var k=this.isolate(w,E);R&&k.wrap(P,R)}else o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"formatAt",this).call(this,w,E,P,R)}},{key:"optimize",value:function(w){if(o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,w),this.parent instanceof x&&x.compare(this.statics.blotName,this.parent.statics.blotName)>0){var E=this.parent.isolate(this.offset(),this.length());this.moveChildren(E),E.wrap(this)}}}],[{key:"compare",value:function(w,E){var P=x.order.indexOf(w),R=x.order.indexOf(E);return P>=0||R>=0?P-R:w===E?0:w<E?-1:1}}]),x}(h.default.Inline);_.allowedChildren=[_,h.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=l(a);function l(p){return p&&p.__esModule?p:{default:p}}function u(p,f){if(!(p instanceof f))throw new TypeError("Cannot call a class as a function")}function d(p,f){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:p}function h(p,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);p.prototype=Object.create(f&&f.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(p,f):p.__proto__=f)}var v=function(p){h(f,p);function f(){return u(this,f),d(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(o.default.Text);n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function m(w,E){for(var P=0;P<E.length;P++){var R=E[P];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(w,R.key,R)}}return function(w,E,P){return E&&m(w.prototype,E),P&&m(w,P),w}}(),o=function m(w,E,P){w===null&&(w=Function.prototype);var R=Object.getOwnPropertyDescriptor(w,E);if(R===void 0){var k=Object.getPrototypeOf(w);return k===null?void 0:m(k,E,P)}else{if("value"in R)return R.value;var N=R.get;return N===void 0?void 0:N.call(P)}},l=i(54),u=v(l),d=i(10),h=v(d);function v(m){return m&&m.__esModule?m:{default:m}}function p(m,w){if(!(m instanceof w))throw new TypeError("Cannot call a class as a function")}function f(m,w){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:m}function b(m,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);m.prototype=Object.create(w&&w.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(m,w):m.__proto__=w)}var _=(0,h.default)("quill:events"),S=["selectionchange","mousedown","mouseup","click"];S.forEach(function(m){document.addEventListener(m,function(){for(var w=arguments.length,E=Array(w),P=0;P<w;P++)E[P]=arguments[P];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(R){if(R.__quill&&R.__quill.emitter){var k;(k=R.__quill.emitter).handleDOM.apply(k,E)}})})});var x=function(m){b(w,m);function w(){p(this,w);var E=f(this,(w.__proto__||Object.getPrototypeOf(w)).call(this));return E.listeners={},E.on("error",_.error),E}return a(w,[{key:"emit",value:function(){_.log.apply(_,arguments),o(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(P){for(var R=arguments.length,k=Array(R>1?R-1:0),N=1;N<R;N++)k[N-1]=arguments[N];(this.listeners[P.type]||[]).forEach(function(M){var T=M.node,C=M.handler;(P.target===T||T.contains(P.target))&&C.apply(void 0,[P].concat(k))})}},{key:"listenDOM",value:function(P,R,k){this.listeners[P]||(this.listeners[P]=[]),this.listeners[P].push({node:R,handler:k})}}]),w}(u.default);x.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},x.sources={API:"api",SILENT:"silent",USER:"user"},n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function a(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function l(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,l),this.quill=u,this.options=d};o.DEFAULTS={},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=["error","warn","log","info"],o="warn";function l(d){if(a.indexOf(d)<=a.indexOf(o)){for(var h,v=arguments.length,p=Array(v>1?v-1:0),f=1;f<v;f++)p[f-1]=arguments[f];(h=console)[d].apply(h,p)}}function u(d){return a.reduce(function(h,v){return h[v]=l.bind(console,v,d),h},{})}l.level=u.level=function(d){o=d},n.default=u},function(r,n,i){var a=Array.prototype.slice,o=i(52),l=i(53),u=r.exports=function(p,f,b){return b||(b={}),p===f?!0:p instanceof Date&&f instanceof Date?p.getTime()===f.getTime():!p||!f||typeof p!="object"&&typeof f!="object"?b.strict?p===f:p==f:v(p,f,b)};function d(p){return p==null}function h(p){return!(!p||typeof p!="object"||typeof p.length!="number"||typeof p.copy!="function"||typeof p.slice!="function"||p.length>0&&typeof p[0]!="number")}function v(p,f,b){var _,S;if(d(p)||d(f)||p.prototype!==f.prototype)return!1;if(l(p))return l(f)?(p=a.call(p),f=a.call(f),u(p,f,b)):!1;if(h(p)){if(!h(f)||p.length!==f.length)return!1;for(_=0;_<p.length;_++)if(p[_]!==f[_])return!1;return!0}try{var x=o(p),m=o(f)}catch{return!1}if(x.length!=m.length)return!1;for(x.sort(),m.sort(),_=x.length-1;_>=0;_--)if(x[_]!=m[_])return!1;for(_=x.length-1;_>=0;_--)if(S=x[_],!u(p[S],f[S],b))return!1;return typeof p==typeof f}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u,d,h){h===void 0&&(h={}),this.attrName=u,this.keyName=d;var v=a.Scope.TYPE&a.Scope.ATTRIBUTE;h.scope!=null?this.scope=h.scope&a.Scope.LEVEL|v:this.scope=a.Scope.ATTRIBUTE,h.whitelist!=null&&(this.whitelist=h.whitelist)}return l.keys=function(u){return[].map.call(u.attributes,function(d){return d.name})},l.prototype.add=function(u,d){return this.canAdd(u,d)?(u.setAttribute(this.keyName,d),!0):!1},l.prototype.canAdd=function(u,d){var h=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return h==null?!1:this.whitelist==null?!0:typeof d=="string"?this.whitelist.indexOf(d.replace(/["']/g,""))>-1:this.whitelist.indexOf(d)>-1},l.prototype.remove=function(u){u.removeAttribute(this.keyName)},l.prototype.value=function(u){var d=u.getAttribute(this.keyName);return this.canAdd(u,d)&&d?d:""},l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var a=function(){function N(M,T){var C=[],L=!0,H=!1,G=void 0;try{for(var J=M[Symbol.iterator](),se;!(L=(se=J.next()).done)&&(C.push(se.value),!(T&&C.length===T));L=!0);}catch(U){H=!0,G=U}finally{try{!L&&J.return&&J.return()}finally{if(H)throw G}}return C}return function(M,T){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return N(M,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function N(M,T){for(var C=0;C<T.length;C++){var L=T[C];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(M,L.key,L)}}return function(M,T,C){return T&&N(M.prototype,T),C&&N(M,C),M}}(),l=function N(M,T,C){M===null&&(M=Function.prototype);var L=Object.getOwnPropertyDescriptor(M,T);if(L===void 0){var H=Object.getPrototypeOf(M);return H===null?void 0:N(H,T,C)}else{if("value"in L)return L.value;var G=L.get;return G===void 0?void 0:G.call(C)}},u=i(2),d=m(u),h=i(0),v=m(h),p=i(4),f=m(p),b=i(6),_=m(b),S=i(7),x=m(S);function m(N){return N&&N.__esModule?N:{default:N}}function w(N,M){if(!(N instanceof M))throw new TypeError("Cannot call a class as a function")}function E(N,M){if(!N)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:N}function P(N,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);N.prototype=Object.create(M&&M.prototype,{constructor:{value:N,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(N,M):N.__proto__=M)}var R=function(N){P(M,N);function M(){return w(this,M),E(this,(M.__proto__||Object.getPrototypeOf(M)).apply(this,arguments))}return M}(_.default);R.blotName="code",R.tagName="CODE";var k=function(N){P(M,N);function M(){return w(this,M),E(this,(M.__proto__||Object.getPrototypeOf(M)).apply(this,arguments))}return o(M,[{key:"delta",value:function(){var C=this,L=this.domNode.textContent;return L.endsWith(`
111
- `)&&(L=L.slice(0,-1)),L.split(`
112
- `).reduce(function(H,G){return H.insert(G).insert(`
113
- `,C.formats())},new d.default)}},{key:"format",value:function(C,L){if(!(C===this.statics.blotName&&L)){var H=this.descendant(x.default,this.length()-1),G=a(H,1),J=G[0];J?.deleteAt(J.length()-1,1),l(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"format",this).call(this,C,L)}}},{key:"formatAt",value:function(C,L,H,G){if(L!==0&&!(v.default.query(H,v.default.Scope.BLOCK)==null||H===this.statics.blotName&&G===this.statics.formats(this.domNode))){var J=this.newlineIndex(C);if(!(J<0||J>=C+L)){var se=this.newlineIndex(C,!0)+1,U=J-se+1,V=this.isolate(se,U),X=V.next;V.format(H,G),X instanceof M&&X.formatAt(0,C-se+L-U,H,G)}}}},{key:"insertAt",value:function(C,L,H){if(H==null){var G=this.descendant(x.default,C),J=a(G,2),se=J[0],U=J[1];se.insertAt(U,L)}}},{key:"length",value:function(){var C=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
114
- `)?C:C+1}},{key:"newlineIndex",value:function(C){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(L)return this.domNode.textContent.slice(0,C).lastIndexOf(`
115
- `);var H=this.domNode.textContent.slice(C).indexOf(`
116
- `);return H>-1?C+H:-1}},{key:"optimize",value:function(C){this.domNode.textContent.endsWith(`
117
- `)||this.appendChild(v.default.create("text",`
118
- `)),l(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"optimize",this).call(this,C);var L=this.next;L!=null&&L.prev===this&&L.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===L.statics.formats(L.domNode)&&(L.optimize(C),L.moveChildren(this),L.remove())}},{key:"replace",value:function(C){l(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"replace",this).call(this,C),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(L){var H=v.default.find(L);H==null?L.parentNode.removeChild(L):H instanceof v.default.Embed?H.remove():H.unwrap()})}}],[{key:"create",value:function(C){var L=l(M.__proto__||Object.getPrototypeOf(M),"create",this).call(this,C);return L.setAttribute("spellcheck",!1),L}},{key:"formats",value:function(){return!0}}]),M}(f.default);k.blotName="code-block",k.tagName="PRE",k.TAB=" ",n.Code=R,n.default=k},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(z,D){var F=[],q=!0,Q=!1,re=void 0;try{for(var Y=z[Symbol.iterator](),ee;!(q=(ee=Y.next()).done)&&(F.push(ee.value),!(D&&F.length===D));q=!0);}catch(ae){Q=!0,re=ae}finally{try{!q&&Y.return&&Y.return()}finally{if(Q)throw re}}return F}return function(z,D){if(Array.isArray(z))return z;if(Symbol.iterator in Object(z))return X(z,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function X(z,D){for(var F=0;F<D.length;F++){var q=D[F];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(z,q.key,q)}}return function(z,D,F){return D&&X(z.prototype,D),F&&X(z,F),z}}(),u=i(2),d=L(u),h=i(20),v=L(h),p=i(0),f=L(p),b=i(13),_=L(b),S=i(24),x=L(S),m=i(4),w=L(m),E=i(16),P=L(E),R=i(21),k=L(R),N=i(11),M=L(N),T=i(3),C=L(T);function L(X){return X&&X.__esModule?X:{default:X}}function H(X,z,D){return z in X?Object.defineProperty(X,z,{value:D,enumerable:!0,configurable:!0,writable:!0}):X[z]=D,X}function G(X,z){if(!(X instanceof z))throw new TypeError("Cannot call a class as a function")}var J=/^[ -~]*$/,se=function(){function X(z){G(this,X),this.scroll=z,this.delta=this.getDelta()}return l(X,[{key:"applyDelta",value:function(D){var F=this,q=!1;this.scroll.update();var Q=this.scroll.length();return this.scroll.batchStart(),D=V(D),D.reduce(function(re,Y){var ee=Y.retain||Y.delete||Y.insert.length||1,ae=Y.attributes||{};if(Y.insert!=null){if(typeof Y.insert=="string"){var ue=Y.insert;ue.endsWith(`
119
- `)&&q&&(q=!1,ue=ue.slice(0,-1)),re>=Q&&!ue.endsWith(`
120
- `)&&(q=!0),F.scroll.insertAt(re,ue);var ce=F.scroll.line(re),pe=o(ce,2),Ae=pe[0],Ce=pe[1],ke=(0,C.default)({},(0,m.bubbleFormats)(Ae));if(Ae instanceof w.default){var Se=Ae.descendant(f.default.Leaf,Ce),le=o(Se,1),Ee=le[0];ke=(0,C.default)(ke,(0,m.bubbleFormats)(Ee))}ae=v.default.attributes.diff(ke,ae)||{}}else if(a(Y.insert)==="object"){var xe=Object.keys(Y.insert)[0];if(xe==null)return re;F.scroll.insertAt(re,xe,Y.insert[xe])}Q+=ee}return Object.keys(ae).forEach(function(ye){F.scroll.formatAt(re,ee,ye,ae[ye])}),re+ee},0),D.reduce(function(re,Y){return typeof Y.delete=="number"?(F.scroll.deleteAt(re,Y.delete),re):re+(Y.retain||Y.insert.length||1)},0),this.scroll.batchEnd(),this.update(D)}},{key:"deleteText",value:function(D,F){return this.scroll.deleteAt(D,F),this.update(new d.default().retain(D).delete(F))}},{key:"formatLine",value:function(D,F){var q=this,Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(Q).forEach(function(re){if(!(q.scroll.whitelist!=null&&!q.scroll.whitelist[re])){var Y=q.scroll.lines(D,Math.max(F,1)),ee=F;Y.forEach(function(ae){var ue=ae.length();if(!(ae instanceof _.default))ae.format(re,Q[re]);else{var ce=D-ae.offset(q.scroll),pe=ae.newlineIndex(ce+ee)-ce+1;ae.formatAt(ce,pe,re,Q[re])}ee-=ue})}}),this.scroll.optimize(),this.update(new d.default().retain(D).retain(F,(0,k.default)(Q)))}},{key:"formatText",value:function(D,F){var q=this,Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(Q).forEach(function(re){q.scroll.formatAt(D,F,re,Q[re])}),this.update(new d.default().retain(D).retain(F,(0,k.default)(Q)))}},{key:"getContents",value:function(D,F){return this.delta.slice(D,D+F)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(D,F){return D.concat(F.delta())},new d.default)}},{key:"getFormat",value:function(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,q=[],Q=[];F===0?this.scroll.path(D).forEach(function(Y){var ee=o(Y,1),ae=ee[0];ae instanceof w.default?q.push(ae):ae instanceof f.default.Leaf&&Q.push(ae)}):(q=this.scroll.lines(D,F),Q=this.scroll.descendants(f.default.Leaf,D,F));var re=[q,Q].map(function(Y){if(Y.length===0)return{};for(var ee=(0,m.bubbleFormats)(Y.shift());Object.keys(ee).length>0;){var ae=Y.shift();if(ae==null)return ee;ee=U((0,m.bubbleFormats)(ae),ee)}return ee});return C.default.apply(C.default,re)}},{key:"getText",value:function(D,F){return this.getContents(D,F).filter(function(q){return typeof q.insert=="string"}).map(function(q){return q.insert}).join("")}},{key:"insertEmbed",value:function(D,F,q){return this.scroll.insertAt(D,F,q),this.update(new d.default().retain(D).insert(H({},F,q)))}},{key:"insertText",value:function(D,F){var q=this,Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return F=F.replace(/\r\n/g,`
121
- `).replace(/\r/g,`
122
- `),this.scroll.insertAt(D,F),Object.keys(Q).forEach(function(re){q.scroll.formatAt(D,F.length,re,Q[re])}),this.update(new d.default().retain(D).insert(F,(0,k.default)(Q)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var D=this.scroll.children.head;return D.statics.blotName!==w.default.blotName||D.children.length>1?!1:D.children.head instanceof P.default}},{key:"removeFormat",value:function(D,F){var q=this.getText(D,F),Q=this.scroll.line(D+F),re=o(Q,2),Y=re[0],ee=re[1],ae=0,ue=new d.default;Y!=null&&(Y instanceof _.default?ae=Y.newlineIndex(ee)-ee+1:ae=Y.length()-ee,ue=Y.delta().slice(ee,ee+ae-1).insert(`
123
- `));var ce=this.getContents(D,F+ae),pe=ce.diff(new d.default().insert(q).concat(ue)),Ae=new d.default().retain(D).concat(pe);return this.applyDelta(Ae)}},{key:"update",value:function(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,Q=this.delta;if(F.length===1&&F[0].type==="characterData"&&F[0].target.data.match(J)&&f.default.find(F[0].target)){var re=f.default.find(F[0].target),Y=(0,m.bubbleFormats)(re),ee=re.offset(this.scroll),ae=F[0].oldValue.replace(x.default.CONTENTS,""),ue=new d.default().insert(ae),ce=new d.default().insert(re.value()),pe=new d.default().retain(ee).concat(ue.diff(ce,q));D=pe.reduce(function(Ae,Ce){return Ce.insert?Ae.insert(Ce.insert,Y):Ae.push(Ce)},new d.default),this.delta=Q.compose(D)}else this.delta=this.getDelta(),(!D||!(0,M.default)(Q.compose(D),this.delta))&&(D=Q.diff(this.delta,q));return D}}]),X}();function U(X,z){return Object.keys(z).reduce(function(D,F){return X[F]==null||(z[F]===X[F]?D[F]=z[F]:Array.isArray(z[F])?z[F].indexOf(X[F])<0&&(D[F]=z[F].concat([X[F]])):D[F]=[z[F],X[F]]),D},{})}function V(X){return X.reduce(function(z,D){if(D.insert===1){var F=(0,k.default)(D.attributes);return delete F.image,z.insert({image:D.attributes.image},F)}if(D.attributes!=null&&(D.attributes.list===!0||D.attributes.bullet===!0)&&(D=(0,k.default)(D),D.attributes.list?D.attributes.list="ordered":(D.attributes.list="bullet",delete D.attributes.bullet)),typeof D.insert=="string"){var q=D.insert.replace(/\r\n/g,`
124
- `).replace(/\r/g,`
125
- `);return z.insert(q,D.attributes)}return z.push(D)},new d.default)}n.default=se},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function N(M,T){var C=[],L=!0,H=!1,G=void 0;try{for(var J=M[Symbol.iterator](),se;!(L=(se=J.next()).done)&&(C.push(se.value),!(T&&C.length===T));L=!0);}catch(U){H=!0,G=U}finally{try{!L&&J.return&&J.return()}finally{if(H)throw G}}return C}return function(M,T){if(Array.isArray(M))return M;if(Symbol.iterator in Object(M))return N(M,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function N(M,T){for(var C=0;C<T.length;C++){var L=T[C];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(M,L.key,L)}}return function(M,T,C){return T&&N(M.prototype,T),C&&N(M,C),M}}(),l=i(0),u=x(l),d=i(21),h=x(d),v=i(11),p=x(v),f=i(8),b=x(f),_=i(10),S=x(_);function x(N){return N&&N.__esModule?N:{default:N}}function m(N){if(Array.isArray(N)){for(var M=0,T=Array(N.length);M<N.length;M++)T[M]=N[M];return T}else return Array.from(N)}function w(N,M){if(!(N instanceof M))throw new TypeError("Cannot call a class as a function")}var E=(0,S.default)("quill:selection"),P=function N(M){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;w(this,N),this.index=M,this.length=T},R=function(){function N(M,T){var C=this;w(this,N),this.emitter=T,this.scroll=M,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new P(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){C.mouseDown||setTimeout(C.update.bind(C,b.default.sources.USER),1)}),this.emitter.on(b.default.events.EDITOR_CHANGE,function(L,H){L===b.default.events.TEXT_CHANGE&&H.length()>0&&C.update(b.default.sources.SILENT)}),this.emitter.on(b.default.events.SCROLL_BEFORE_UPDATE,function(){if(C.hasFocus()){var L=C.getNativeRange();L!=null&&L.start.node!==C.cursor.textNode&&C.emitter.once(b.default.events.SCROLL_UPDATE,function(){try{C.setNativeRange(L.start.node,L.start.offset,L.end.node,L.end.offset)}catch{}})}}),this.emitter.on(b.default.events.SCROLL_OPTIMIZE,function(L,H){if(H.range){var G=H.range,J=G.startNode,se=G.startOffset,U=G.endNode,V=G.endOffset;C.setNativeRange(J,se,U,V)}}),this.update(b.default.sources.SILENT)}return o(N,[{key:"handleComposition",value:function(){var T=this;this.root.addEventListener("compositionstart",function(){T.composing=!0}),this.root.addEventListener("compositionend",function(){if(T.composing=!1,T.cursor.parent){var C=T.cursor.restore();if(!C)return;setTimeout(function(){T.setNativeRange(C.startNode,C.startOffset,C.endNode,C.endOffset)},1)}})}},{key:"handleDragging",value:function(){var T=this;this.emitter.listenDOM("mousedown",document.body,function(){T.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){T.mouseDown=!1,T.update(b.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(T,C){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[T])){this.scroll.update();var L=this.getNativeRange();if(!(L==null||!L.native.collapsed||u.default.query(T,u.default.Scope.BLOCK))){if(L.start.node!==this.cursor.textNode){var H=u.default.find(L.start.node,!1);if(H==null)return;if(H instanceof u.default.Leaf){var G=H.split(L.start.offset);H.parent.insertBefore(this.cursor,G)}else H.insertBefore(this.cursor,L.start.node);this.cursor.attach()}this.cursor.format(T,C),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(T){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=this.scroll.length();T=Math.min(T,L-1),C=Math.min(T+C,L-1)-T;var H=void 0,G=this.scroll.leaf(T),J=a(G,2),se=J[0],U=J[1];if(se==null)return null;var V=se.position(U,!0),X=a(V,2);H=X[0],U=X[1];var z=document.createRange();if(C>0){z.setStart(H,U);var D=this.scroll.leaf(T+C),F=a(D,2);if(se=F[0],U=F[1],se==null)return null;var q=se.position(U,!0),Q=a(q,2);return H=Q[0],U=Q[1],z.setEnd(H,U),z.getBoundingClientRect()}else{var re="left",Y=void 0;return H instanceof Text?(U<H.data.length?(z.setStart(H,U),z.setEnd(H,U+1)):(z.setStart(H,U-1),z.setEnd(H,U),re="right"),Y=z.getBoundingClientRect()):(Y=se.domNode.getBoundingClientRect(),U>0&&(re="right")),{bottom:Y.top+Y.height,height:Y.height,left:Y[re],right:Y[re],top:Y.top,width:0}}}},{key:"getNativeRange",value:function(){var T=document.getSelection();if(T==null||T.rangeCount<=0)return null;var C=T.getRangeAt(0);if(C==null)return null;var L=this.normalizeNative(C);return E.info("getNativeRange",L),L}},{key:"getRange",value:function(){var T=this.getNativeRange();if(T==null)return[null,null];var C=this.normalizedToRange(T);return[C,T]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(T){var C=this,L=[[T.start.node,T.start.offset]];T.native.collapsed||L.push([T.end.node,T.end.offset]);var H=L.map(function(se){var U=a(se,2),V=U[0],X=U[1],z=u.default.find(V,!0),D=z.offset(C.scroll);return X===0?D:z instanceof u.default.Container?D+z.length():D+z.index(V,X)}),G=Math.min(Math.max.apply(Math,m(H)),this.scroll.length()-1),J=Math.min.apply(Math,[G].concat(m(H)));return new P(J,G-J)}},{key:"normalizeNative",value:function(T){if(!k(this.root,T.startContainer)||!T.collapsed&&!k(this.root,T.endContainer))return null;var C={start:{node:T.startContainer,offset:T.startOffset},end:{node:T.endContainer,offset:T.endOffset},native:T};return[C.start,C.end].forEach(function(L){for(var H=L.node,G=L.offset;!(H instanceof Text)&&H.childNodes.length>0;)if(H.childNodes.length>G)H=H.childNodes[G],G=0;else if(H.childNodes.length===G)H=H.lastChild,G=H instanceof Text?H.data.length:H.childNodes.length+1;else break;L.node=H,L.offset=G}),C}},{key:"rangeToNative",value:function(T){var C=this,L=T.collapsed?[T.index]:[T.index,T.index+T.length],H=[],G=this.scroll.length();return L.forEach(function(J,se){J=Math.min(G-1,J);var U=void 0,V=C.scroll.leaf(J),X=a(V,2),z=X[0],D=X[1],F=z.position(D,se!==0),q=a(F,2);U=q[0],D=q[1],H.push(U,D)}),H.length<2&&(H=H.concat(H)),H}},{key:"scrollIntoView",value:function(T){var C=this.lastRange;if(C!=null){var L=this.getBounds(C.index,C.length);if(L!=null){var H=this.scroll.length()-1,G=this.scroll.line(Math.min(C.index,H)),J=a(G,1),se=J[0],U=se;if(C.length>0){var V=this.scroll.line(Math.min(C.index+C.length,H)),X=a(V,1);U=X[0]}if(!(se==null||U==null)){var z=T.getBoundingClientRect();L.top<z.top?T.scrollTop-=z.top-L.top:L.bottom>z.bottom&&(T.scrollTop+=L.bottom-z.bottom)}}}}},{key:"setNativeRange",value:function(T,C){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:T,H=arguments.length>3&&arguments[3]!==void 0?arguments[3]:C,G=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(E.info("setNativeRange",T,C,L,H),!(T!=null&&(this.root.parentNode==null||T.parentNode==null||L.parentNode==null))){var J=document.getSelection();if(J!=null)if(T!=null){this.hasFocus()||this.root.focus();var se=(this.getNativeRange()||{}).native;if(se==null||G||T!==se.startContainer||C!==se.startOffset||L!==se.endContainer||H!==se.endOffset){T.tagName=="BR"&&(C=[].indexOf.call(T.parentNode.childNodes,T),T=T.parentNode),L.tagName=="BR"&&(H=[].indexOf.call(L.parentNode.childNodes,L),L=L.parentNode);var U=document.createRange();U.setStart(T,C),U.setEnd(L,H),J.removeAllRanges(),J.addRange(U)}}else J.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(T){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:b.default.sources.API;if(typeof C=="string"&&(L=C,C=!1),E.info("setRange",T),T!=null){var H=this.rangeToNative(T);this.setNativeRange.apply(this,m(H).concat([C]))}else this.setNativeRange(null);this.update(L)}},{key:"update",value:function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b.default.sources.USER,C=this.lastRange,L=this.getRange(),H=a(L,2),G=H[0],J=H[1];if(this.lastRange=G,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,p.default)(C,this.lastRange)){var se;!this.composing&&J!=null&&J.native.collapsed&&J.start.node!==this.cursor.textNode&&this.cursor.restore();var U=[b.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(C),T];if((se=this.emitter).emit.apply(se,[b.default.events.EDITOR_CHANGE].concat(U)),T!==b.default.sources.SILENT){var V;(V=this.emitter).emit.apply(V,U)}}}}]),N}();function k(N,M){try{M.parentNode}catch{return!1}return M instanceof Text&&(M=M.parentNode),N.contains(M)}n.Range=P,n.default=R},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function b(_,S){for(var x=0;x<S.length;x++){var m=S[x];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(_,m.key,m)}}return function(_,S,x){return S&&b(_.prototype,S),x&&b(_,x),_}}(),o=function b(_,S,x){_===null&&(_=Function.prototype);var m=Object.getOwnPropertyDescriptor(_,S);if(m===void 0){var w=Object.getPrototypeOf(_);return w===null?void 0:b(w,S,x)}else{if("value"in m)return m.value;var E=m.get;return E===void 0?void 0:E.call(x)}},l=i(0),u=d(l);function d(b){return b&&b.__esModule?b:{default:b}}function h(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function v(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function p(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var f=function(b){p(_,b);function _(){return h(this,_),v(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"insertInto",value:function(x,m){x.children.length===0?o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertInto",this).call(this,x,m):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),_}(u.default.Embed);f.blotName="break",f.tagName="BR",n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,f){p.__proto__=f}||function(p,f){for(var b in f)f.hasOwnProperty(b)&&(p[b]=f[b])};return function(p,f){v(p,f);function b(){this.constructor=p}p.prototype=f===null?Object.create(f):(b.prototype=f.prototype,new b)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(44),l=i(30),u=i(1),d=function(v){a(p,v);function p(f){var b=v.call(this,f)||this;return b.build(),b}return p.prototype.appendChild=function(f){this.insertBefore(f)},p.prototype.attach=function(){v.prototype.attach.call(this),this.children.forEach(function(f){f.attach()})},p.prototype.build=function(){var f=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(b){try{var _=h(b);f.insertBefore(_,f.children.head||void 0)}catch(S){if(S instanceof u.ParchmentError)return;throw S}})},p.prototype.deleteAt=function(f,b){if(f===0&&b===this.length())return this.remove();this.children.forEachAt(f,b,function(_,S,x){_.deleteAt(S,x)})},p.prototype.descendant=function(f,b){var _=this.children.find(b),S=_[0],x=_[1];return f.blotName==null&&f(S)||f.blotName!=null&&S instanceof f?[S,x]:S instanceof p?S.descendant(f,x):[null,-1]},p.prototype.descendants=function(f,b,_){b===void 0&&(b=0),_===void 0&&(_=Number.MAX_VALUE);var S=[],x=_;return this.children.forEachAt(b,_,function(m,w,E){(f.blotName==null&&f(m)||f.blotName!=null&&m instanceof f)&&S.push(m),m instanceof p&&(S=S.concat(m.descendants(f,w,x))),x-=E}),S},p.prototype.detach=function(){this.children.forEach(function(f){f.detach()}),v.prototype.detach.call(this)},p.prototype.formatAt=function(f,b,_,S){this.children.forEachAt(f,b,function(x,m,w){x.formatAt(m,w,_,S)})},p.prototype.insertAt=function(f,b,_){var S=this.children.find(f),x=S[0],m=S[1];if(x)x.insertAt(m,b,_);else{var w=_==null?u.create("text",b):u.create(b,_);this.appendChild(w)}},p.prototype.insertBefore=function(f,b){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(_){return f instanceof _}))throw new u.ParchmentError("Cannot insert "+f.statics.blotName+" into "+this.statics.blotName);f.insertInto(this,b)},p.prototype.length=function(){return this.children.reduce(function(f,b){return f+b.length()},0)},p.prototype.moveChildren=function(f,b){this.children.forEach(function(_){f.insertBefore(_,b)})},p.prototype.optimize=function(f){if(v.prototype.optimize.call(this,f),this.children.length===0)if(this.statics.defaultChild!=null){var b=u.create(this.statics.defaultChild);this.appendChild(b),b.optimize(f)}else this.remove()},p.prototype.path=function(f,b){b===void 0&&(b=!1);var _=this.children.find(f,b),S=_[0],x=_[1],m=[[this,f]];return S instanceof p?m.concat(S.path(x,b)):(S!=null&&m.push([S,x]),m)},p.prototype.removeChild=function(f){this.children.remove(f)},p.prototype.replace=function(f){f instanceof p&&f.moveChildren(this),v.prototype.replace.call(this,f)},p.prototype.split=function(f,b){if(b===void 0&&(b=!1),!b){if(f===0)return this;if(f===this.length())return this.next}var _=this.clone();return this.parent.insertBefore(_,this.next),this.children.forEachAt(f,this.length(),function(S,x,m){S=S.split(x,b),_.appendChild(S)}),_},p.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},p.prototype.update=function(f,b){var _=this,S=[],x=[];f.forEach(function(m){m.target===_.domNode&&m.type==="childList"&&(S.push.apply(S,m.addedNodes),x.push.apply(x,m.removedNodes))}),x.forEach(function(m){if(!(m.parentNode!=null&&m.tagName!=="IFRAME"&&document.body.compareDocumentPosition(m)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var w=u.find(m);w!=null&&(w.domNode.parentNode==null||w.domNode.parentNode===_.domNode)&&w.detach()}}),S.filter(function(m){return m.parentNode==_.domNode}).sort(function(m,w){return m===w?0:m.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(m){var w=null;m.nextSibling!=null&&(w=u.find(m.nextSibling));var E=h(m);(E.next!=w||E.next==null)&&(E.parent!=null&&E.parent.removeChild(_),_.insertBefore(E,w||void 0))})},p}(l.default);function h(v){var p=u.find(v);if(p==null)try{p=u.create(v)}catch{p=u.create(u.Scope.INLINE),[].slice.call(v.childNodes).forEach(function(b){p.domNode.appendChild(b)}),v.parentNode&&v.parentNode.replaceChild(p.domNode,v),p.attach()}return p}n.default=d},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,f){p.__proto__=f}||function(p,f){for(var b in f)f.hasOwnProperty(b)&&(p[b]=f[b])};return function(p,f){v(p,f);function b(){this.constructor=p}p.prototype=f===null?Object.create(f):(b.prototype=f.prototype,new b)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12),l=i(31),u=i(17),d=i(1),h=function(v){a(p,v);function p(f){var b=v.call(this,f)||this;return b.attributes=new l.default(b.domNode),b}return p.formats=function(f){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return f.tagName.toLowerCase()},p.prototype.format=function(f,b){var _=d.query(f);_ instanceof o.default?this.attributes.attribute(_,b):b&&_!=null&&(f!==this.statics.blotName||this.formats()[f]!==b)&&this.replaceWith(f,b)},p.prototype.formats=function(){var f=this.attributes.values(),b=this.statics.formats(this.domNode);return b!=null&&(f[this.statics.blotName]=b),f},p.prototype.replaceWith=function(f,b){var _=v.prototype.replaceWith.call(this,f,b);return this.attributes.copy(_),_},p.prototype.update=function(f,b){var _=this;v.prototype.update.call(this,f,b),f.some(function(S){return S.target===_.domNode&&S.type==="attributes"})&&this.attributes.build()},p.prototype.wrap=function(f,b){var _=v.prototype.wrap.call(this,f,b);return _ instanceof p&&_.statics.scope===this.statics.scope&&this.attributes.move(_),_},p}(u.default);n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var p in v)v.hasOwnProperty(p)&&(h[p]=v[p])};return function(h,v){d(h,v);function p(){this.constructor=h}h.prototype=v===null?Object.create(v):(p.prototype=v.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),l=i(1),u=function(d){a(h,d);function h(){return d!==null&&d.apply(this,arguments)||this}return h.value=function(v){return!0},h.prototype.index=function(v,p){return this.domNode===v||this.domNode.compareDocumentPosition(v)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(p,1):-1},h.prototype.position=function(v,p){var f=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return v>0&&(f+=1),[this.parent.domNode,f]},h.prototype.value=function(){var v;return v={},v[this.statics.blotName]=this.statics.value(this.domNode)||!0,v},h.scope=l.Scope.INLINE_BLOT,h}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),l={attributes:{compose:function(d,h,v){typeof d!="object"&&(d={}),typeof h!="object"&&(h={});var p=o(!0,{},h);v||(p=Object.keys(p).reduce(function(b,_){return p[_]!=null&&(b[_]=p[_]),b},{}));for(var f in d)d[f]!==void 0&&h[f]===void 0&&(p[f]=d[f]);return Object.keys(p).length>0?p:void 0},diff:function(d,h){typeof d!="object"&&(d={}),typeof h!="object"&&(h={});var v=Object.keys(d).concat(Object.keys(h)).reduce(function(p,f){return a(d[f],h[f])||(p[f]=h[f]===void 0?null:h[f]),p},{});return Object.keys(v).length>0?v:void 0},transform:function(d,h,v){if(typeof d!="object")return h;if(typeof h=="object"){if(!v)return h;var p=Object.keys(h).reduce(function(f,b){return d[b]===void 0&&(f[b]=h[b]),f},{});return Object.keys(p).length>0?p:void 0}}},iterator:function(d){return new u(d)},length:function(d){return typeof d.delete=="number"?d.delete:typeof d.retain=="number"?d.retain:typeof d.insert=="string"?d.insert.length:1}};function u(d){this.ops=d,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(d){d||(d=1/0);var h=this.ops[this.index];if(h){var v=this.offset,p=l.length(h);if(d>=p-v?(d=p-v,this.index+=1,this.offset=0):this.offset+=d,typeof h.delete=="number")return{delete:d};var f={};return h.attributes&&(f.attributes=h.attributes),typeof h.retain=="number"?f.retain=d:typeof h.insert=="string"?f.insert=h.insert.substr(v,d):f.insert=h.insert,f}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var d=this.offset,h=this.index,v=this.next(),p=this.ops.slice(this.index);return this.offset=d,this.index=h,[v].concat(p)}else return[]},r.exports=l},function(r,n){var i=function(){function a(_,S){return S!=null&&_ instanceof S}var o;try{o=Map}catch{o=function(){}}var l;try{l=Set}catch{l=function(){}}var u;try{u=Promise}catch{u=function(){}}function d(_,S,x,m,w){typeof S=="object"&&(x=S.depth,m=S.prototype,w=S.includeNonEnumerable,S=S.circular);var E=[],P=[],R=typeof Buffer<"u";typeof S>"u"&&(S=!0),typeof x>"u"&&(x=1/0);function k(N,M){if(N===null)return null;if(M===0)return N;var T,C;if(typeof N!="object")return N;if(a(N,o))T=new o;else if(a(N,l))T=new l;else if(a(N,u))T=new u(function(z,D){N.then(function(F){z(k(F,M-1))},function(F){D(k(F,M-1))})});else if(d.__isArray(N))T=[];else if(d.__isRegExp(N))T=new RegExp(N.source,b(N)),N.lastIndex&&(T.lastIndex=N.lastIndex);else if(d.__isDate(N))T=new Date(N.getTime());else{if(R&&Buffer.isBuffer(N))return Buffer.allocUnsafe?T=Buffer.allocUnsafe(N.length):T=new Buffer(N.length),N.copy(T),T;a(N,Error)?T=Object.create(N):typeof m>"u"?(C=Object.getPrototypeOf(N),T=Object.create(C)):(T=Object.create(m),C=m)}if(S){var L=E.indexOf(N);if(L!=-1)return P[L];E.push(N),P.push(T)}a(N,o)&&N.forEach(function(z,D){var F=k(D,M-1),q=k(z,M-1);T.set(F,q)}),a(N,l)&&N.forEach(function(z){var D=k(z,M-1);T.add(D)});for(var H in N){var G;C&&(G=Object.getOwnPropertyDescriptor(C,H)),!(G&&G.set==null)&&(T[H]=k(N[H],M-1))}if(Object.getOwnPropertySymbols)for(var J=Object.getOwnPropertySymbols(N),H=0;H<J.length;H++){var se=J[H],U=Object.getOwnPropertyDescriptor(N,se);U&&!U.enumerable&&!w||(T[se]=k(N[se],M-1),U.enumerable||Object.defineProperty(T,se,{enumerable:!1}))}if(w)for(var V=Object.getOwnPropertyNames(N),H=0;H<V.length;H++){var X=V[H],U=Object.getOwnPropertyDescriptor(N,X);U&&U.enumerable||(T[X]=k(N[X],M-1),Object.defineProperty(T,X,{enumerable:!1}))}return T}return k(_,x)}d.clonePrototype=function(S){if(S===null)return null;var x=function(){};return x.prototype=S,new x};function h(_){return Object.prototype.toString.call(_)}d.__objToStr=h;function v(_){return typeof _=="object"&&h(_)==="[object Date]"}d.__isDate=v;function p(_){return typeof _=="object"&&h(_)==="[object Array]"}d.__isArray=p;function f(_){return typeof _=="object"&&h(_)==="[object RegExp]"}d.__isRegExp=f;function b(_){var S="";return _.global&&(S+="g"),_.ignoreCase&&(S+="i"),_.multiline&&(S+="m"),S}return d.__getRegExpFlags=b,d}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function T(C,L){var H=[],G=!0,J=!1,se=void 0;try{for(var U=C[Symbol.iterator](),V;!(G=(V=U.next()).done)&&(H.push(V.value),!(L&&H.length===L));G=!0);}catch(X){J=!0,se=X}finally{try{!G&&U.return&&U.return()}finally{if(J)throw se}}return H}return function(C,L){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return T(C,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function T(C,L){for(var H=0;H<L.length;H++){var G=L[H];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(C,G.key,G)}}return function(C,L,H){return L&&T(C.prototype,L),H&&T(C,H),C}}(),l=function T(C,L,H){C===null&&(C=Function.prototype);var G=Object.getOwnPropertyDescriptor(C,L);if(G===void 0){var J=Object.getPrototypeOf(C);return J===null?void 0:T(J,L,H)}else{if("value"in G)return G.value;var se=G.get;return se===void 0?void 0:se.call(H)}},u=i(0),d=E(u),h=i(8),v=E(h),p=i(4),f=E(p),b=i(16),_=E(b),S=i(13),x=E(S),m=i(25),w=E(m);function E(T){return T&&T.__esModule?T:{default:T}}function P(T,C){if(!(T instanceof C))throw new TypeError("Cannot call a class as a function")}function R(T,C){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:T}function k(T,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);T.prototype=Object.create(C&&C.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(T,C):T.__proto__=C)}function N(T){return T instanceof f.default||T instanceof p.BlockEmbed}var M=function(T){k(C,T);function C(L,H){P(this,C);var G=R(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,L));return G.emitter=H.emitter,Array.isArray(H.whitelist)&&(G.whitelist=H.whitelist.reduce(function(J,se){return J[se]=!0,J},{})),G.domNode.addEventListener("DOMNodeInserted",function(){}),G.optimize(),G.enable(),G}return o(C,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(H,G){var J=this.line(H),se=a(J,2),U=se[0],V=se[1],X=this.line(H+G),z=a(X,1),D=z[0];if(l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"deleteAt",this).call(this,H,G),D!=null&&U!==D&&V>0){if(U instanceof p.BlockEmbed||D instanceof p.BlockEmbed){this.optimize();return}if(U instanceof x.default){var F=U.newlineIndex(U.length(),!0);if(F>-1&&(U=U.split(F+1),U===D)){this.optimize();return}}else if(D instanceof x.default){var q=D.newlineIndex(0);q>-1&&D.split(q+1)}var Q=D.children.head instanceof _.default?null:D.children.head;U.moveChildren(D,Q),U.remove()}this.optimize()}},{key:"enable",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",H)}},{key:"formatAt",value:function(H,G,J,se){this.whitelist!=null&&!this.whitelist[J]||(l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"formatAt",this).call(this,H,G,J,se),this.optimize())}},{key:"insertAt",value:function(H,G,J){if(!(J!=null&&this.whitelist!=null&&!this.whitelist[G])){if(H>=this.length())if(J==null||d.default.query(G,d.default.Scope.BLOCK)==null){var se=d.default.create(this.statics.defaultChild);this.appendChild(se),J==null&&G.endsWith(`
126
- `)&&(G=G.slice(0,-1)),se.insertAt(0,G,J)}else{var U=d.default.create(G,J);this.appendChild(U)}else l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,H,G,J);this.optimize()}}},{key:"insertBefore",value:function(H,G){if(H.statics.scope===d.default.Scope.INLINE_BLOT){var J=d.default.create(this.statics.defaultChild);J.appendChild(H),H=J}l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertBefore",this).call(this,H,G)}},{key:"leaf",value:function(H){return this.path(H).pop()||[null,-1]}},{key:"line",value:function(H){return H===this.length()?this.line(H-1):this.descendant(N,H)}},{key:"lines",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,J=function se(U,V,X){var z=[],D=X;return U.children.forEachAt(V,X,function(F,q,Q){N(F)?z.push(F):F instanceof d.default.Container&&(z=z.concat(se(F,q,D))),D-=Q}),z};return J(this,H,G)}},{key:"optimize",value:function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"optimize",this).call(this,H,G),H.length>0&&this.emitter.emit(v.default.events.SCROLL_OPTIMIZE,H,G))}},{key:"path",value:function(H){return l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"path",this).call(this,H).slice(1)}},{key:"update",value:function(H){if(this.batch!==!0){var G=v.default.sources.USER;typeof H=="string"&&(G=H),Array.isArray(H)||(H=this.observer.takeRecords()),H.length>0&&this.emitter.emit(v.default.events.SCROLL_BEFORE_UPDATE,G,H),l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"update",this).call(this,H.concat([])),H.length>0&&this.emitter.emit(v.default.events.SCROLL_UPDATE,G,H)}}}]),C}(d.default.Scroll);M.blotName="scroll",M.className="ql-editor",M.tagName="DIV",M.defaultChild="block",M.allowedChildren=[f.default,p.BlockEmbed,w.default],n.default=M},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(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y},o=function(){function Y(ee,ae){var ue=[],ce=!0,pe=!1,Ae=void 0;try{for(var Ce=ee[Symbol.iterator](),ke;!(ce=(ke=Ce.next()).done)&&(ue.push(ke.value),!(ae&&ue.length===ae));ce=!0);}catch(Se){pe=!0,Ae=Se}finally{try{!ce&&Ce.return&&Ce.return()}finally{if(pe)throw Ae}}return ue}return function(ee,ae){if(Array.isArray(ee))return ee;if(Symbol.iterator in Object(ee))return Y(ee,ae);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function Y(ee,ae){for(var ue=0;ue<ae.length;ue++){var ce=ae[ue];ce.enumerable=ce.enumerable||!1,ce.configurable=!0,"value"in ce&&(ce.writable=!0),Object.defineProperty(ee,ce.key,ce)}}return function(ee,ae,ue){return ae&&Y(ee.prototype,ae),ue&&Y(ee,ue),ee}}(),u=i(21),d=T(u),h=i(11),v=T(h),p=i(3),f=T(p),b=i(2),_=T(b),S=i(20),x=T(S),m=i(0),w=T(m),E=i(5),P=T(E),R=i(10),k=T(R),N=i(9),M=T(N);function T(Y){return Y&&Y.__esModule?Y:{default:Y}}function C(Y,ee,ae){return ee in Y?Object.defineProperty(Y,ee,{value:ae,enumerable:!0,configurable:!0,writable:!0}):Y[ee]=ae,Y}function L(Y,ee){if(!(Y instanceof ee))throw new TypeError("Cannot call a class as a function")}function H(Y,ee){if(!Y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ee&&(typeof ee=="object"||typeof ee=="function")?ee:Y}function G(Y,ee){if(typeof ee!="function"&&ee!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ee);Y.prototype=Object.create(ee&&ee.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}}),ee&&(Object.setPrototypeOf?Object.setPrototypeOf(Y,ee):Y.__proto__=ee)}var J=(0,k.default)("quill:keyboard"),se=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",U=function(Y){G(ee,Y),l(ee,null,[{key:"match",value:function(ue,ce){return ce=re(ce),["altKey","ctrlKey","metaKey","shiftKey"].some(function(pe){return!!ce[pe]!==ue[pe]&&ce[pe]!==null})?!1:ce.key===(ue.which||ue.keyCode)}}]);function ee(ae,ue){L(this,ee);var ce=H(this,(ee.__proto__||Object.getPrototypeOf(ee)).call(this,ae,ue));return ce.bindings={},Object.keys(ce.options.bindings).forEach(function(pe){pe==="list autofill"&&ae.scroll.whitelist!=null&&!ae.scroll.whitelist.list||ce.options.bindings[pe]&&ce.addBinding(ce.options.bindings[pe])}),ce.addBinding({key:ee.keys.ENTER,shiftKey:null},F),ce.addBinding({key:ee.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ce.addBinding({key:ee.keys.BACKSPACE},{collapsed:!0},X),ce.addBinding({key:ee.keys.DELETE},{collapsed:!0},z)):(ce.addBinding({key:ee.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},X),ce.addBinding({key:ee.keys.DELETE},{collapsed:!0,suffix:/^.?$/},z)),ce.addBinding({key:ee.keys.BACKSPACE},{collapsed:!1},D),ce.addBinding({key:ee.keys.DELETE},{collapsed:!1},D),ce.addBinding({key:ee.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},X),ce.listen(),ce}return l(ee,[{key:"addBinding",value:function(ue){var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ae=re(ue);if(Ae==null||Ae.key==null)return J.warn("Attempted to add invalid keyboard binding",Ae);typeof ce=="function"&&(ce={handler:ce}),typeof pe=="function"&&(pe={handler:pe}),Ae=(0,f.default)(Ae,ce,pe),this.bindings[Ae.key]=this.bindings[Ae.key]||[],this.bindings[Ae.key].push(Ae)}},{key:"listen",value:function(){var ue=this;this.quill.root.addEventListener("keydown",function(ce){if(!ce.defaultPrevented){var pe=ce.which||ce.keyCode,Ae=(ue.bindings[pe]||[]).filter(function(pt){return ee.match(ce,pt)});if(Ae.length!==0){var Ce=ue.quill.getSelection();if(!(Ce==null||!ue.quill.hasFocus())){var ke=ue.quill.getLine(Ce.index),Se=o(ke,2),le=Se[0],Ee=Se[1],xe=ue.quill.getLeaf(Ce.index),ye=o(xe,2),Ne=ye[0],Te=ye[1],ge=Ce.length===0?[Ne,Te]:ue.quill.getLeaf(Ce.index+Ce.length),Re=o(ge,2),Be=Re[0],Qe=Re[1],ct=Ne instanceof w.default.Text?Ne.value().slice(0,Te):"",mt=Be instanceof w.default.Text?Be.value().slice(Qe):"",gt={collapsed:Ce.length===0,empty:Ce.length===0&&le.length()<=1,format:ue.quill.getFormat(Ce),offset:Ee,prefix:ct,suffix:mt},St=Ae.some(function(pt){if(pt.collapsed!=null&&pt.collapsed!==gt.collapsed||pt.empty!=null&&pt.empty!==gt.empty||pt.offset!=null&&pt.offset!==gt.offset)return!1;if(Array.isArray(pt.format)){if(pt.format.every(function(ut){return gt.format[ut]==null}))return!1}else if(a(pt.format)==="object"&&!Object.keys(pt.format).every(function(ut){return pt.format[ut]===!0?gt.format[ut]!=null:pt.format[ut]===!1?gt.format[ut]==null:(0,v.default)(pt.format[ut],gt.format[ut])}))return!1;return pt.prefix!=null&&!pt.prefix.test(gt.prefix)||pt.suffix!=null&&!pt.suffix.test(gt.suffix)?!1:pt.handler.call(ue,Ce,gt)!==!0});St&&ce.preventDefault()}}}})}}]),ee}(M.default);U.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},U.DEFAULTS={bindings:{bold:Q("bold"),italic:Q("italic"),underline:Q("underline"),indent:{key:U.keys.TAB,format:["blockquote","indent","list"],handler:function(ee,ae){if(ae.collapsed&&ae.offset!==0)return!0;this.quill.format("indent","+1",P.default.sources.USER)}},outdent:{key:U.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(ee,ae){if(ae.collapsed&&ae.offset!==0)return!0;this.quill.format("indent","-1",P.default.sources.USER)}},"outdent backspace":{key:U.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(ee,ae){ae.format.indent!=null?this.quill.format("indent","-1",P.default.sources.USER):ae.format.list!=null&&this.quill.format("list",!1,P.default.sources.USER)}},"indent code-block":q(!0),"outdent code-block":q(!1),"remove tab":{key:U.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(ee){this.quill.deleteText(ee.index-1,1,P.default.sources.USER)}},tab:{key:U.keys.TAB,handler:function(ee){this.quill.history.cutoff();var ae=new _.default().retain(ee.index).delete(ee.length).insert(" ");this.quill.updateContents(ae,P.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(ee.index+1,P.default.sources.SILENT)}},"list empty enter":{key:U.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(ee,ae){this.quill.format("list",!1,P.default.sources.USER),ae.format.indent&&this.quill.format("indent",!1,P.default.sources.USER)}},"checklist enter":{key:U.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(ee){var ae=this.quill.getLine(ee.index),ue=o(ae,2),ce=ue[0],pe=ue[1],Ae=(0,f.default)({},ce.formats(),{list:"checked"}),Ce=new _.default().retain(ee.index).insert(`
127
- `,Ae).retain(ce.length()-pe-1).retain(1,{list:"unchecked"});this.quill.updateContents(Ce,P.default.sources.USER),this.quill.setSelection(ee.index+1,P.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:U.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(ee,ae){var ue=this.quill.getLine(ee.index),ce=o(ue,2),pe=ce[0],Ae=ce[1],Ce=new _.default().retain(ee.index).insert(`
128
- `,ae.format).retain(pe.length()-Ae-1).retain(1,{header:null});this.quill.updateContents(Ce,P.default.sources.USER),this.quill.setSelection(ee.index+1,P.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(ee,ae){var ue=ae.prefix.length,ce=this.quill.getLine(ee.index),pe=o(ce,2),Ae=pe[0],Ce=pe[1];if(Ce>ue)return!0;var ke=void 0;switch(ae.prefix.trim()){case"[]":case"[ ]":ke="unchecked";break;case"[x]":ke="checked";break;case"-":case"*":ke="bullet";break;default:ke="ordered"}this.quill.insertText(ee.index," ",P.default.sources.USER),this.quill.history.cutoff();var Se=new _.default().retain(ee.index-Ce).delete(ue+1).retain(Ae.length()-2-Ce).retain(1,{list:ke});this.quill.updateContents(Se,P.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(ee.index-ue,P.default.sources.SILENT)}},"code exit":{key:U.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(ee){var ae=this.quill.getLine(ee.index),ue=o(ae,2),ce=ue[0],pe=ue[1],Ae=new _.default().retain(ee.index+ce.length()-pe-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(Ae,P.default.sources.USER)}},"embed left":V(U.keys.LEFT,!1),"embed left shift":V(U.keys.LEFT,!0),"embed right":V(U.keys.RIGHT,!1),"embed right shift":V(U.keys.RIGHT,!0)}};function V(Y,ee){var ae,ue=Y===U.keys.LEFT?"prefix":"suffix";return ae={key:Y,shiftKey:ee,altKey:null},C(ae,ue,/^$/),C(ae,"handler",function(pe){var Ae=pe.index;Y===U.keys.RIGHT&&(Ae+=pe.length+1);var Ce=this.quill.getLeaf(Ae),ke=o(Ce,1),Se=ke[0];return Se instanceof w.default.Embed?(Y===U.keys.LEFT?ee?this.quill.setSelection(pe.index-1,pe.length+1,P.default.sources.USER):this.quill.setSelection(pe.index-1,P.default.sources.USER):ee?this.quill.setSelection(pe.index,pe.length+1,P.default.sources.USER):this.quill.setSelection(pe.index+pe.length+1,P.default.sources.USER),!1):!0}),ae}function X(Y,ee){if(!(Y.index===0||this.quill.getLength()<=1)){var ae=this.quill.getLine(Y.index),ue=o(ae,1),ce=ue[0],pe={};if(ee.offset===0){var Ae=this.quill.getLine(Y.index-1),Ce=o(Ae,1),ke=Ce[0];if(ke!=null&&ke.length()>1){var Se=ce.formats(),le=this.quill.getFormat(Y.index-1,1);pe=x.default.attributes.diff(Se,le)||{}}}var Ee=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(ee.prefix)?2:1;this.quill.deleteText(Y.index-Ee,Ee,P.default.sources.USER),Object.keys(pe).length>0&&this.quill.formatLine(Y.index-Ee,Ee,pe,P.default.sources.USER),this.quill.focus()}}function z(Y,ee){var ae=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(ee.suffix)?2:1;if(!(Y.index>=this.quill.getLength()-ae)){var ue={},ce=0,pe=this.quill.getLine(Y.index),Ae=o(pe,1),Ce=Ae[0];if(ee.offset>=Ce.length()-1){var ke=this.quill.getLine(Y.index+1),Se=o(ke,1),le=Se[0];if(le){var Ee=Ce.formats(),xe=this.quill.getFormat(Y.index,1);ue=x.default.attributes.diff(Ee,xe)||{},ce=le.length()}}this.quill.deleteText(Y.index,ae,P.default.sources.USER),Object.keys(ue).length>0&&this.quill.formatLine(Y.index+ce-1,ae,ue,P.default.sources.USER)}}function D(Y){var ee=this.quill.getLines(Y),ae={};if(ee.length>1){var ue=ee[0].formats(),ce=ee[ee.length-1].formats();ae=x.default.attributes.diff(ce,ue)||{}}this.quill.deleteText(Y,P.default.sources.USER),Object.keys(ae).length>0&&this.quill.formatLine(Y.index,1,ae,P.default.sources.USER),this.quill.setSelection(Y.index,P.default.sources.SILENT),this.quill.focus()}function F(Y,ee){var ae=this;Y.length>0&&this.quill.scroll.deleteAt(Y.index,Y.length);var ue=Object.keys(ee.format).reduce(function(ce,pe){return w.default.query(pe,w.default.Scope.BLOCK)&&!Array.isArray(ee.format[pe])&&(ce[pe]=ee.format[pe]),ce},{});this.quill.insertText(Y.index,`
129
- `,ue,P.default.sources.USER),this.quill.setSelection(Y.index+1,P.default.sources.SILENT),this.quill.focus(),Object.keys(ee.format).forEach(function(ce){ue[ce]==null&&(Array.isArray(ee.format[ce])||ce!=="link"&&ae.quill.format(ce,ee.format[ce],P.default.sources.USER))})}function q(Y){return{key:U.keys.TAB,shiftKey:!Y,format:{"code-block":!0},handler:function(ae){var ue=w.default.query("code-block"),ce=ae.index,pe=ae.length,Ae=this.quill.scroll.descendant(ue,ce),Ce=o(Ae,2),ke=Ce[0],Se=Ce[1];if(ke!=null){var le=this.quill.getIndex(ke),Ee=ke.newlineIndex(Se,!0)+1,xe=ke.newlineIndex(le+Se+pe),ye=ke.domNode.textContent.slice(Ee,xe).split(`
130
- `);Se=0,ye.forEach(function(Ne,Te){Y?(ke.insertAt(Ee+Se,ue.TAB),Se+=ue.TAB.length,Te===0?ce+=ue.TAB.length:pe+=ue.TAB.length):Ne.startsWith(ue.TAB)&&(ke.deleteAt(Ee+Se,ue.TAB.length),Se-=ue.TAB.length,Te===0?ce-=ue.TAB.length:pe-=ue.TAB.length),Se+=Ne.length+1}),this.quill.update(P.default.sources.USER),this.quill.setSelection(ce,pe,P.default.sources.SILENT)}}}}function Q(Y){return{key:Y[0].toUpperCase(),shortKey:!0,handler:function(ae,ue){this.quill.format(Y,!ue.format[Y],P.default.sources.USER)}}}function re(Y){if(typeof Y=="string"||typeof Y=="number")return re({key:Y});if((typeof Y>"u"?"undefined":a(Y))==="object"&&(Y=(0,d.default)(Y,!1)),typeof Y.key=="string")if(U.keys[Y.key.toUpperCase()]!=null)Y.key=U.keys[Y.key.toUpperCase()];else if(Y.key.length===1)Y.key=Y.key.toUpperCase().charCodeAt(0);else return null;return Y.shortKey&&(Y[se]=Y.shortKey,delete Y.shortKey),Y}n.default=U,n.SHORTKEY=se},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(m,w){var E=[],P=!0,R=!1,k=void 0;try{for(var N=m[Symbol.iterator](),M;!(P=(M=N.next()).done)&&(E.push(M.value),!(w&&E.length===w));P=!0);}catch(T){R=!0,k=T}finally{try{!P&&N.return&&N.return()}finally{if(R)throw k}}return E}return function(m,w){if(Array.isArray(m))return m;if(Symbol.iterator in Object(m))return x(m,w);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function x(m,w,E){m===null&&(m=Function.prototype);var P=Object.getOwnPropertyDescriptor(m,w);if(P===void 0){var R=Object.getPrototypeOf(m);return R===null?void 0:x(R,w,E)}else{if("value"in P)return P.value;var k=P.get;return k===void 0?void 0:k.call(E)}},l=function(){function x(m,w){for(var E=0;E<w.length;E++){var P=w[E];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(m,P.key,P)}}return function(m,w,E){return w&&x(m.prototype,w),E&&x(m,E),m}}(),u=i(0),d=p(u),h=i(7),v=p(h);function p(x){return x&&x.__esModule?x:{default:x}}function f(x,m){if(!(x instanceof m))throw new TypeError("Cannot call a class as a function")}function b(x,m){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:x}function _(x,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);x.prototype=Object.create(m&&m.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(x,m):x.__proto__=m)}var S=function(x){_(m,x),l(m,null,[{key:"value",value:function(){}}]);function m(w,E){f(this,m);var P=b(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,w));return P.selection=E,P.textNode=document.createTextNode(m.CONTENTS),P.domNode.appendChild(P.textNode),P._length=0,P}return l(m,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(E,P){if(this._length!==0)return o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"format",this).call(this,E,P);for(var R=this,k=0;R!=null&&R.statics.scope!==d.default.Scope.BLOCK_BLOT;)k+=R.offset(R.parent),R=R.parent;R!=null&&(this._length=m.CONTENTS.length,R.optimize(),R.formatAt(k,m.CONTENTS.length,E,P),this._length=0)}},{key:"index",value:function(E,P){return E===this.textNode?0:o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"index",this).call(this,E,P)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var E=this.textNode,P=this.selection.getNativeRange(),R=void 0,k=void 0,N=void 0;if(P!=null&&P.start.node===E&&P.end.node===E){var M=[E,P.start.offset,P.end.offset];R=M[0],k=M[1],N=M[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==m.CONTENTS){var T=this.textNode.data.split(m.CONTENTS).join("");this.next instanceof v.default?(R=this.next.domNode,this.next.insertAt(0,T),this.textNode.data=m.CONTENTS):(this.textNode.data=T,this.parent.insertBefore(d.default.create(this.textNode),this),this.textNode=document.createTextNode(m.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),k!=null){var C=[k,N].map(function(H){return Math.max(0,Math.min(R.data.length,H-1))}),L=a(C,2);return k=L[0],N=L[1],{startNode:R,startOffset:k,endNode:R,endOffset:N}}}}},{key:"update",value:function(E,P){var R=this;if(E.some(function(N){return N.type==="characterData"&&N.target===R.textNode})){var k=this.restore();k&&(P.range=k)}}},{key:"value",value:function(){return""}}]),m}(d.default.Embed);S.blotName="cursor",S.className="ql-cursor",S.tagName="span",S.CONTENTS="\uFEFF",n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=d(a),l=i(4),u=d(l);function d(b){return b&&b.__esModule?b:{default:b}}function h(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function v(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function p(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var f=function(b){p(_,b);function _(){return h(this,_),v(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return _}(o.default.Container);f.allowedChildren=[u.default,l.BlockEmbed,f],n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=function(){function S(x,m){for(var w=0;w<m.length;w++){var E=m[w];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,m,w){return m&&S(x.prototype,m),w&&S(x,w),x}}(),o=function S(x,m,w){x===null&&(x=Function.prototype);var E=Object.getOwnPropertyDescriptor(x,m);if(E===void 0){var P=Object.getPrototypeOf(x);return P===null?void 0:S(P,m,w)}else{if("value"in E)return E.value;var R=E.get;return R===void 0?void 0:R.call(w)}},l=i(0),u=d(l);function d(S){return S&&S.__esModule?S:{default:S}}function h(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function v(S,x){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:S}function p(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(S,x):S.__proto__=x)}var f=function(S){p(x,S);function x(){return h(this,x),v(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"value",value:function(w){var E=o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"value",this).call(this,w);return E.startsWith("rgb(")?(E=E.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+E.split(",").map(function(P){return("00"+parseInt(P).toString(16)).slice(-2)}).join("")):E}}]),x}(u.default.Attributor.Style),b=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),_=new f("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=f,n.ColorClass=b,n.ColorStyle=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=function(){function _(S,x){for(var m=0;m<x.length;m++){var w=x[m];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(S,w.key,w)}}return function(S,x,m){return x&&_(S.prototype,x),m&&_(S,m),S}}(),o=function _(S,x,m){S===null&&(S=Function.prototype);var w=Object.getOwnPropertyDescriptor(S,x);if(w===void 0){var E=Object.getPrototypeOf(S);return E===null?void 0:_(E,x,m)}else{if("value"in w)return w.value;var P=w.get;return P===void 0?void 0:P.call(m)}},l=i(6),u=d(l);function d(_){return _&&_.__esModule?_:{default:_}}function h(_,S){if(!(_ instanceof S))throw new TypeError("Cannot call a class as a function")}function v(_,S){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:_}function p(_,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);_.prototype=Object.create(S&&S.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(_,S):_.__proto__=S)}var f=function(_){p(S,_);function S(){return h(this,S),v(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,[{key:"format",value:function(m,w){if(m!==this.statics.blotName||!w)return o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"format",this).call(this,m,w);w=this.constructor.sanitize(w),this.domNode.setAttribute("href",w)}}],[{key:"create",value:function(m){var w=o(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,m);return m=this.sanitize(m),w.setAttribute("href",m),w.setAttribute("rel","noopener noreferrer"),w.setAttribute("target","_blank"),w}},{key:"formats",value:function(m){return m.getAttribute("href")}},{key:"sanitize",value:function(m){return b(m,this.PROTOCOL_WHITELIST)?m:this.SANITIZED_URL}}]),S}(u.default);f.blotName="link",f.tagName="A",f.SANITIZED_URL="about:blank",f.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function b(_,S){var x=document.createElement("a");x.href=_;var m=x.href.slice(0,x.href.indexOf(":"));return S.indexOf(m)>-1}n.default=f,n.sanitize=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S},o=function(){function S(x,m){for(var w=0;w<m.length;w++){var E=m[w];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,m,w){return m&&S(x.prototype,m),w&&S(x,w),x}}(),l=i(23),u=v(l),d=i(107),h=v(d);function v(S){return S&&S.__esModule?S:{default:S}}function p(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}var f=0;function b(S,x){S.setAttribute(x,S.getAttribute(x)!=="true")}var _=function(){function S(x){var m=this;p(this,S),this.select=x,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){m.togglePicker()}),this.label.addEventListener("keydown",function(w){switch(w.keyCode){case u.default.keys.ENTER:m.togglePicker();break;case u.default.keys.ESCAPE:m.escape(),w.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(S,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),b(this.label,"aria-expanded"),b(this.options,"aria-hidden")}},{key:"buildItem",value:function(m){var w=this,E=document.createElement("span");return E.tabIndex="0",E.setAttribute("role","button"),E.classList.add("ql-picker-item"),m.hasAttribute("value")&&E.setAttribute("data-value",m.getAttribute("value")),m.textContent&&E.setAttribute("data-label",m.textContent),E.addEventListener("click",function(){w.selectItem(E,!0)}),E.addEventListener("keydown",function(P){switch(P.keyCode){case u.default.keys.ENTER:w.selectItem(E,!0),P.preventDefault();break;case u.default.keys.ESCAPE:w.escape(),P.preventDefault();break}}),E}},{key:"buildLabel",value:function(){var m=document.createElement("span");return m.classList.add("ql-picker-label"),m.innerHTML=h.default,m.tabIndex="0",m.setAttribute("role","button"),m.setAttribute("aria-expanded","false"),this.container.appendChild(m),m}},{key:"buildOptions",value:function(){var m=this,w=document.createElement("span");w.classList.add("ql-picker-options"),w.setAttribute("aria-hidden","true"),w.tabIndex="-1",w.id="ql-picker-options-"+f,f+=1,this.label.setAttribute("aria-controls",w.id),this.options=w,[].slice.call(this.select.options).forEach(function(E){var P=m.buildItem(E);w.appendChild(P),E.selected===!0&&m.selectItem(P)}),this.container.appendChild(w)}},{key:"buildPicker",value:function(){var m=this;[].slice.call(this.select.attributes).forEach(function(w){m.container.setAttribute(w.name,w.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var m=this;this.close(),setTimeout(function(){return m.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(m){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,E=this.container.querySelector(".ql-selected");if(m!==E&&(E?.classList.remove("ql-selected"),m!=null&&(m.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(m.parentNode.children,m),m.hasAttribute("data-value")?this.label.setAttribute("data-value",m.getAttribute("data-value")):this.label.removeAttribute("data-value"),m.hasAttribute("data-label")?this.label.setAttribute("data-label",m.getAttribute("data-label")):this.label.removeAttribute("data-label"),w))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":a(Event))==="object"){var P=document.createEvent("Event");P.initEvent("change",!0,!0),this.select.dispatchEvent(P)}this.close()}}},{key:"update",value:function(){var m=void 0;if(this.select.selectedIndex>-1){var w=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];m=this.select.options[this.select.selectedIndex],this.selectItem(w)}else this.selectItem(null);var E=m!=null&&m!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",E)}}]),S}();n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=J(a),l=i(5),u=J(l),d=i(4),h=J(d),v=i(16),p=J(v),f=i(25),b=J(f),_=i(24),S=J(_),x=i(35),m=J(x),w=i(6),E=J(w),P=i(22),R=J(P),k=i(7),N=J(k),M=i(55),T=J(M),C=i(42),L=J(C),H=i(23),G=J(H);function J(se){return se&&se.__esModule?se:{default:se}}u.default.register({"blots/block":h.default,"blots/block/embed":d.BlockEmbed,"blots/break":p.default,"blots/container":b.default,"blots/cursor":S.default,"blots/embed":m.default,"blots/inline":E.default,"blots/scroll":R.default,"blots/text":N.default,"modules/clipboard":T.default,"modules/history":L.default,"modules/keyboard":G.default}),o.default.register(h.default,p.default,S.default,E.default,R.default,N.default),n.default=u.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function l(u){this.domNode=u,this.domNode[a.DATA_KEY]={blot:this}}return Object.defineProperty(l.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),l.create=function(u){if(this.tagName==null)throw new a.ParchmentError("Blot definition missing tagName");var d;return Array.isArray(this.tagName)?(typeof u=="string"&&(u=u.toUpperCase(),parseInt(u).toString()===u&&(u=parseInt(u))),typeof u=="number"?d=document.createElement(this.tagName[u-1]):this.tagName.indexOf(u)>-1?d=document.createElement(u):d=document.createElement(this.tagName[0])):d=document.createElement(this.tagName),this.className&&d.classList.add(this.className),d},l.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},l.prototype.clone=function(){var u=this.domNode.cloneNode(!1);return a.create(u)},l.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[a.DATA_KEY]},l.prototype.deleteAt=function(u,d){var h=this.isolate(u,d);h.remove()},l.prototype.formatAt=function(u,d,h,v){var p=this.isolate(u,d);if(a.query(h,a.Scope.BLOT)!=null&&v)p.wrap(h,v);else if(a.query(h,a.Scope.ATTRIBUTE)!=null){var f=a.create(this.statics.scope);p.wrap(f),f.format(h,v)}},l.prototype.insertAt=function(u,d,h){var v=h==null?a.create("text",d):a.create(d,h),p=this.split(u);this.parent.insertBefore(v,p)},l.prototype.insertInto=function(u,d){d===void 0&&(d=null),this.parent!=null&&this.parent.children.remove(this);var h=null;u.children.insertBefore(this,d),d!=null&&(h=d.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=h)&&u.domNode.insertBefore(this.domNode,h),this.parent=u,this.attach()},l.prototype.isolate=function(u,d){var h=this.split(u);return h.split(d),h},l.prototype.length=function(){return 1},l.prototype.offset=function(u){return u===void 0&&(u=this.parent),this.parent==null||this==u?0:this.parent.children.offset(this)+this.parent.offset(u)},l.prototype.optimize=function(u){this.domNode[a.DATA_KEY]!=null&&delete this.domNode[a.DATA_KEY].mutations},l.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},l.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},l.prototype.replaceWith=function(u,d){var h=typeof u=="string"?a.create(u,d):u;return h.replace(this),h},l.prototype.split=function(u,d){return u===0?this:this.next},l.prototype.update=function(u,d){},l.prototype.wrap=function(u,d){var h=typeof u=="string"?a.create(u,d):u;return this.parent!=null&&this.parent.insertBefore(h,this.next),h.appendChild(this),h},l.blotName="abstract",l}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(12),o=i(32),l=i(33),u=i(1),d=function(){function h(v){this.attributes={},this.domNode=v,this.build()}return h.prototype.attribute=function(v,p){p?v.add(this.domNode,p)&&(v.value(this.domNode)!=null?this.attributes[v.attrName]=v:delete this.attributes[v.attrName]):(v.remove(this.domNode),delete this.attributes[v.attrName])},h.prototype.build=function(){var v=this;this.attributes={};var p=a.default.keys(this.domNode),f=o.default.keys(this.domNode),b=l.default.keys(this.domNode);p.concat(f).concat(b).forEach(function(_){var S=u.query(_,u.Scope.ATTRIBUTE);S instanceof a.default&&(v.attributes[S.attrName]=S)})},h.prototype.copy=function(v){var p=this;Object.keys(this.attributes).forEach(function(f){var b=p.attributes[f].value(p.domNode);v.format(f,b)})},h.prototype.move=function(v){var p=this;this.copy(v),Object.keys(this.attributes).forEach(function(f){p.attributes[f].remove(p.domNode)}),this.attributes={}},h.prototype.values=function(){var v=this;return Object.keys(this.attributes).reduce(function(p,f){return p[f]=v.attributes[f].value(v.domNode),p},{})},h}();n.default=d},function(r,n,i){var a=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var p in v)v.hasOwnProperty(p)&&(h[p]=v[p])};return function(h,v){d(h,v);function p(){this.constructor=h}h.prototype=v===null?Object.create(v):(p.prototype=v.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(d,h){var v=d.getAttribute("class")||"";return v.split(/\s+/).filter(function(p){return p.indexOf(h+"-")===0})}var u=function(d){a(h,d);function h(){return d!==null&&d.apply(this,arguments)||this}return h.keys=function(v){return(v.getAttribute("class")||"").split(/\s+/).map(function(p){return p.split("-").slice(0,-1).join("-")})},h.prototype.add=function(v,p){return this.canAdd(v,p)?(this.remove(v),v.classList.add(this.keyName+"-"+p),!0):!1},h.prototype.remove=function(v){var p=l(v,this.keyName);p.forEach(function(f){v.classList.remove(f)}),v.classList.length===0&&v.removeAttribute("class")},h.prototype.value=function(v){var p=l(v,this.keyName)[0]||"",f=p.slice(this.keyName.length+1);return this.canAdd(v,f)?f:""},h}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var p in v)v.hasOwnProperty(p)&&(h[p]=v[p])};return function(h,v){d(h,v);function p(){this.constructor=h}h.prototype=v===null?Object.create(v):(p.prototype=v.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function l(d){var h=d.split("-"),v=h.slice(1).map(function(p){return p[0].toUpperCase()+p.slice(1)}).join("");return h[0]+v}var u=function(d){a(h,d);function h(){return d!==null&&d.apply(this,arguments)||this}return h.keys=function(v){return(v.getAttribute("style")||"").split(";").map(function(p){var f=p.split(":");return f[0].trim()})},h.prototype.add=function(v,p){return this.canAdd(v,p)?(v.style[l(this.keyName)]=p,!0):!1},h.prototype.remove=function(v){v.style[l(this.keyName)]="",v.getAttribute("style")||v.removeAttribute("style")},h.prototype.value=function(v){var p=v.style[l(this.keyName)];return this.canAdd(v,p)?p:""},h}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(d,h){for(var v=0;v<h.length;v++){var p=h[v];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(d,p.key,p)}}return function(d,h,v){return h&&u(d.prototype,h),v&&u(d,v),d}}();function o(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(d,h){o(this,u),this.quill=d,this.options=h,this.modules={}}return a(u,[{key:"init",value:function(){var h=this;Object.keys(this.options.modules).forEach(function(v){h.modules[v]==null&&h.addModule(v)})}},{key:"addModule",value:function(h){var v=this.quill.constructor.import("modules/"+h);return this.modules[h]=new v(this.quill,this.options.modules[h]||{}),this.modules[h]}}]),u}();l.DEFAULTS={modules:{}},l.themes={default:l},n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(m,w){for(var E=0;E<w.length;E++){var P=w[E];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(m,P.key,P)}}return function(m,w,E){return w&&x(m.prototype,w),E&&x(m,E),m}}(),o=function x(m,w,E){m===null&&(m=Function.prototype);var P=Object.getOwnPropertyDescriptor(m,w);if(P===void 0){var R=Object.getPrototypeOf(m);return R===null?void 0:x(R,w,E)}else{if("value"in P)return P.value;var k=P.get;return k===void 0?void 0:k.call(E)}},l=i(0),u=v(l),d=i(7),h=v(d);function v(x){return x&&x.__esModule?x:{default:x}}function p(x,m){if(!(x instanceof m))throw new TypeError("Cannot call a class as a function")}function f(x,m){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:x}function b(x,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);x.prototype=Object.create(m&&m.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(x,m):x.__proto__=m)}var _="\uFEFF",S=function(x){b(m,x);function m(w){p(this,m);var E=f(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,w));return E.contentNode=document.createElement("span"),E.contentNode.setAttribute("contenteditable",!1),[].slice.call(E.domNode.childNodes).forEach(function(P){E.contentNode.appendChild(P)}),E.leftGuard=document.createTextNode(_),E.rightGuard=document.createTextNode(_),E.domNode.appendChild(E.leftGuard),E.domNode.appendChild(E.contentNode),E.domNode.appendChild(E.rightGuard),E}return a(m,[{key:"index",value:function(E,P){return E===this.leftGuard?0:E===this.rightGuard?1:o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"index",this).call(this,E,P)}},{key:"restore",value:function(E){var P=void 0,R=void 0,k=E.data.split(_).join("");if(E===this.leftGuard)if(this.prev instanceof h.default){var N=this.prev.length();this.prev.insertAt(N,k),P={startNode:this.prev.domNode,startOffset:N+k.length}}else R=document.createTextNode(k),this.parent.insertBefore(u.default.create(R),this),P={startNode:R,startOffset:k.length};else E===this.rightGuard&&(this.next instanceof h.default?(this.next.insertAt(0,k),P={startNode:this.next.domNode,startOffset:k.length}):(R=document.createTextNode(k),this.parent.insertBefore(u.default.create(R),this.next),P={startNode:R,startOffset:k.length}));return E.data=_,P}},{key:"update",value:function(E,P){var R=this;E.forEach(function(k){if(k.type==="characterData"&&(k.target===R.leftGuard||k.target===R.rightGuard)){var N=R.restore(k.target);N&&(P.range=N)}})}}]),m}(u.default.Embed);n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var a=i(0),o=l(a);function l(p){return p&&p.__esModule?p:{default:p}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},d=new o.default.Attributor.Attribute("align","align",u),h=new o.default.Attributor.Class("align","ql-align",u),v=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=d,n.AlignClass=h,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),l=i(26);function u(v){return v&&v.__esModule?v:{default:v}}var d=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),h=new l.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=d,n.BackgroundStyle=h},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var a=i(0),o=l(a);function l(p){return p&&p.__esModule?p:{default:p}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},d=new o.default.Attributor.Attribute("direction","dir",u),h=new o.default.Attributor.Class("direction","ql-direction",u),v=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=d,n.DirectionClass=h,n.DirectionStyle=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function x(m,w){for(var E=0;E<w.length;E++){var P=w[E];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(m,P.key,P)}}return function(m,w,E){return w&&x(m.prototype,w),E&&x(m,E),m}}(),o=function x(m,w,E){m===null&&(m=Function.prototype);var P=Object.getOwnPropertyDescriptor(m,w);if(P===void 0){var R=Object.getPrototypeOf(m);return R===null?void 0:x(R,w,E)}else{if("value"in P)return P.value;var k=P.get;return k===void 0?void 0:k.call(E)}},l=i(0),u=d(l);function d(x){return x&&x.__esModule?x:{default:x}}function h(x,m){if(!(x instanceof m))throw new TypeError("Cannot call a class as a function")}function v(x,m){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:x}function p(x,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);x.prototype=Object.create(m&&m.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(x,m):x.__proto__=m)}var f={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},b=new u.default.Attributor.Class("font","ql-font",f),_=function(x){p(m,x);function m(){return h(this,m),v(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"value",value:function(E){return o(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"value",this).call(this,E).replace(/["']/g,"")}}]),m}(u.default.Attributor.Style),S=new _("font","font-family",f);n.FontStyle=S,n.FontClass=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var a=i(0),o=l(a);function l(h){return h&&h.__esModule?h:{default:h}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),d=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=u,n.SizeStyle=d},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 w(E,P){for(var R=0;R<P.length;R++){var k=P[R];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(E,k.key,k)}}return function(E,P,R){return P&&w(E.prototype,P),R&&w(E,R),E}}(),o=i(0),l=p(o),u=i(5),d=p(u),h=i(9),v=p(h);function p(w){return w&&w.__esModule?w:{default:w}}function f(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function b(w,E){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:w}function _(w,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);w.prototype=Object.create(E&&E.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(w,E):w.__proto__=E)}var S=function(w){_(E,w);function E(P,R){f(this,E);var k=b(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,P,R));return k.lastRecorded=0,k.ignoreChange=!1,k.clear(),k.quill.on(d.default.events.EDITOR_CHANGE,function(N,M,T,C){N!==d.default.events.TEXT_CHANGE||k.ignoreChange||(!k.options.userOnly||C===d.default.sources.USER?k.record(M,T):k.transform(M))}),k.quill.keyboard.addBinding({key:"Z",shortKey:!0},k.undo.bind(k)),k.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},k.redo.bind(k)),/Win/i.test(navigator.platform)&&k.quill.keyboard.addBinding({key:"Y",shortKey:!0},k.redo.bind(k)),k}return a(E,[{key:"change",value:function(R,k){if(this.stack[R].length!==0){var N=this.stack[R].pop();this.stack[k].push(N),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(N[R],d.default.sources.USER),this.ignoreChange=!1;var M=m(N[R]);this.quill.setSelection(M)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(R,k){if(R.ops.length!==0){this.stack.redo=[];var N=this.quill.getContents().diff(k),M=Date.now();if(this.lastRecorded+this.options.delay>M&&this.stack.undo.length>0){var T=this.stack.undo.pop();N=N.compose(T.undo),R=T.redo.compose(R)}else this.lastRecorded=M;this.stack.undo.push({redo:R,undo:N}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(R){this.stack.undo.forEach(function(k){k.undo=R.transform(k.undo,!0),k.redo=R.transform(k.redo,!0)}),this.stack.redo.forEach(function(k){k.undo=R.transform(k.undo,!0),k.redo=R.transform(k.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),E}(v.default);S.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function x(w){var E=w.ops[w.ops.length-1];return E==null?!1:E.insert!=null?typeof E.insert=="string"&&E.insert.endsWith(`
131
- `):E.attributes!=null?Object.keys(E.attributes).some(function(P){return l.default.query(P,l.default.Scope.BLOCK)!=null}):!1}function m(w){var E=w.reduce(function(R,k){return R+=k.delete||0,R},0),P=w.length()-E;return x(w)&&(P-=1),P}n.default=S,n.getLastChangeIndex=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function F(q,Q){for(var re=0;re<Q.length;re++){var Y=Q[re];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(q,Y.key,Y)}}return function(q,Q,re){return Q&&F(q.prototype,Q),re&&F(q,re),q}}(),o=function F(q,Q,re){q===null&&(q=Function.prototype);var Y=Object.getOwnPropertyDescriptor(q,Q);if(Y===void 0){var ee=Object.getPrototypeOf(q);return ee===null?void 0:F(ee,Q,re)}else{if("value"in Y)return Y.value;var ae=Y.get;return ae===void 0?void 0:ae.call(re)}},l=i(3),u=M(l),d=i(2),h=M(d),v=i(8),p=M(v),f=i(23),b=M(f),_=i(34),S=M(_),x=i(59),m=M(x),w=i(60),E=M(w),P=i(28),R=M(P),k=i(61),N=M(k);function M(F){return F&&F.__esModule?F:{default:F}}function T(F,q){if(!(F instanceof q))throw new TypeError("Cannot call a class as a function")}function C(F,q){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return q&&(typeof q=="object"||typeof q=="function")?q:F}function L(F,q){if(typeof q!="function"&&q!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof q);F.prototype=Object.create(q&&q.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),q&&(Object.setPrototypeOf?Object.setPrototypeOf(F,q):F.__proto__=q)}var H=[!1,"center","right","justify"],G=["#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"],se=["1","2","3",!1],U=["small",!1,"large","huge"],V=function(F){L(q,F);function q(Q,re){T(this,q);var Y=C(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,Q,re)),ee=function ae(ue){if(!document.body.contains(Q.root))return document.body.removeEventListener("click",ae);Y.tooltip!=null&&!Y.tooltip.root.contains(ue.target)&&document.activeElement!==Y.tooltip.textbox&&!Y.quill.hasFocus()&&Y.tooltip.hide(),Y.pickers!=null&&Y.pickers.forEach(function(ce){ce.container.contains(ue.target)||ce.close()})};return Q.emitter.listenDOM("click",document.body,ee),Y}return a(q,[{key:"addModule",value:function(re){var Y=o(q.prototype.__proto__||Object.getPrototypeOf(q.prototype),"addModule",this).call(this,re);return re==="toolbar"&&this.extendToolbar(Y),Y}},{key:"buildButtons",value:function(re,Y){re.forEach(function(ee){var ae=ee.getAttribute("class")||"";ae.split(/\s+/).forEach(function(ue){if(ue.startsWith("ql-")&&(ue=ue.slice(3),Y[ue]!=null))if(ue==="direction")ee.innerHTML=Y[ue][""]+Y[ue].rtl;else if(typeof Y[ue]=="string")ee.innerHTML=Y[ue];else{var ce=ee.value||"";ce!=null&&Y[ue][ce]&&(ee.innerHTML=Y[ue][ce])}})})}},{key:"buildPickers",value:function(re,Y){var ee=this;this.pickers=re.map(function(ue){if(ue.classList.contains("ql-align"))return ue.querySelector("option")==null&&D(ue,H),new E.default(ue,Y.align);if(ue.classList.contains("ql-background")||ue.classList.contains("ql-color")){var ce=ue.classList.contains("ql-background")?"background":"color";return ue.querySelector("option")==null&&D(ue,G,ce==="background"?"#ffffff":"#000000"),new m.default(ue,Y[ce])}else return ue.querySelector("option")==null&&(ue.classList.contains("ql-font")?D(ue,J):ue.classList.contains("ql-header")?D(ue,se):ue.classList.contains("ql-size")&&D(ue,U)),new R.default(ue)});var ae=function(){ee.pickers.forEach(function(ce){ce.update()})};this.quill.on(p.default.events.EDITOR_CHANGE,ae)}}]),q}(S.default);V.DEFAULTS=(0,u.default)(!0,{},S.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var q=this,Q=this.container.querySelector("input.ql-image[type=file]");Q==null&&(Q=document.createElement("input"),Q.setAttribute("type","file"),Q.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),Q.classList.add("ql-image"),Q.addEventListener("change",function(){if(Q.files!=null&&Q.files[0]!=null){var re=new FileReader;re.onload=function(Y){var ee=q.quill.getSelection(!0);q.quill.updateContents(new h.default().retain(ee.index).delete(ee.length).insert({image:Y.target.result}),p.default.sources.USER),q.quill.setSelection(ee.index+1,p.default.sources.SILENT),Q.value=""},re.readAsDataURL(Q.files[0])}}),this.container.appendChild(Q)),Q.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var X=function(F){L(q,F);function q(Q,re){T(this,q);var Y=C(this,(q.__proto__||Object.getPrototypeOf(q)).call(this,Q,re));return Y.textbox=Y.root.querySelector('input[type="text"]'),Y.listen(),Y}return a(q,[{key:"listen",value:function(){var re=this;this.textbox.addEventListener("keydown",function(Y){b.default.match(Y,"enter")?(re.save(),Y.preventDefault()):b.default.match(Y,"escape")&&(re.cancel(),Y.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),Y!=null?this.textbox.value=Y:re!==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-"+re)||""),this.root.setAttribute("data-mode",re)}},{key:"restoreFocus",value:function(){var re=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=re}},{key:"save",value:function(){var re=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var Y=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",re,p.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",re,p.default.sources.USER)),this.quill.root.scrollTop=Y;break}case"video":re=z(re);case"formula":{if(!re)break;var ee=this.quill.getSelection(!0);if(ee!=null){var ae=ee.index+ee.length;this.quill.insertEmbed(ae,this.root.getAttribute("data-mode"),re,p.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(ae+1," ",p.default.sources.USER),this.quill.setSelection(ae+2,p.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),q}(N.default);function z(F){var q=F.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||F.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return q?(q[1]||"https")+"://www.youtube.com/embed/"+q[2]+"?showinfo=0":(q=F.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(q[1]||"https")+"://player.vimeo.com/video/"+q[2]+"/":F}function D(F,q){var Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;q.forEach(function(re){var Y=document.createElement("option");re===Q?Y.setAttribute("selected","selected"):Y.setAttribute("value",re),F.appendChild(Y)})}n.BaseTooltip=X,n.default=V},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];this.insertBefore(l[0],null),l.length>1&&this.append.apply(this,l.slice(1))},o.prototype.contains=function(l){for(var u,d=this.iterator();u=d();)if(u===l)return!0;return!1},o.prototype.insertBefore=function(l,u){l&&(l.next=u,u!=null?(l.prev=u.prev,u.prev!=null&&(u.prev.next=l),u.prev=l,u===this.head&&(this.head=l)):this.tail!=null?(this.tail.next=l,l.prev=this.tail,this.tail=l):(l.prev=null,this.head=this.tail=l),this.length+=1)},o.prototype.offset=function(l){for(var u=0,d=this.head;d!=null;){if(d===l)return u;u+=d.length(),d=d.next}return-1},o.prototype.remove=function(l){this.contains(l)&&(l.prev!=null&&(l.prev.next=l.next),l.next!=null&&(l.next.prev=l.prev),l===this.head&&(this.head=l.next),l===this.tail&&(this.tail=l.prev),this.length-=1)},o.prototype.iterator=function(l){return l===void 0&&(l=this.head),function(){var u=l;return l!=null&&(l=l.next),u}},o.prototype.find=function(l,u){u===void 0&&(u=!1);for(var d,h=this.iterator();d=h();){var v=d.length();if(l<v||u&&l===v&&(d.next==null||d.next.length()!==0))return[d,l];l-=v}return[null,0]},o.prototype.forEach=function(l){for(var u,d=this.iterator();u=d();)l(u)},o.prototype.forEachAt=function(l,u,d){if(!(u<=0))for(var h=this.find(l),v=h[0],p=h[1],f,b=l-p,_=this.iterator(v);(f=_())&&b<l+u;){var S=f.length();l>b?d(f,l-b,Math.min(u,b+S-l)):d(f,0,Math.min(S,l+u-b)),b+=S}},o.prototype.map=function(l){return this.reduce(function(u,d){return u.push(l(d)),u},[])},o.prototype.reduce=function(l,u){for(var d,h=this.iterator();d=h();)u=l(u,d);return u},o}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,f){p.__proto__=f}||function(p,f){for(var b in f)f.hasOwnProperty(b)&&(p[b]=f[b])};return function(p,f){v(p,f);function b(){this.constructor=p}p.prototype=f===null?Object.create(f):(b.prototype=f.prototype,new b)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(17),l=i(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},d=100,h=function(v){a(p,v);function p(f){var b=v.call(this,f)||this;return b.scroll=b,b.observer=new MutationObserver(function(_){b.update(_)}),b.observer.observe(b.domNode,u),b.attach(),b}return p.prototype.detach=function(){v.prototype.detach.call(this),this.observer.disconnect()},p.prototype.deleteAt=function(f,b){this.update(),f===0&&b===this.length()?this.children.forEach(function(_){_.remove()}):v.prototype.deleteAt.call(this,f,b)},p.prototype.formatAt=function(f,b,_,S){this.update(),v.prototype.formatAt.call(this,f,b,_,S)},p.prototype.insertAt=function(f,b,_){this.update(),v.prototype.insertAt.call(this,f,b,_)},p.prototype.optimize=function(f,b){var _=this;f===void 0&&(f=[]),b===void 0&&(b={}),v.prototype.optimize.call(this,b);for(var S=[].slice.call(this.observer.takeRecords());S.length>0;)f.push(S.pop());for(var x=function(P,R){R===void 0&&(R=!0),!(P==null||P===_)&&P.domNode.parentNode!=null&&(P.domNode[l.DATA_KEY].mutations==null&&(P.domNode[l.DATA_KEY].mutations=[]),R&&x(P.parent))},m=function(P){P.domNode[l.DATA_KEY]==null||P.domNode[l.DATA_KEY].mutations==null||(P instanceof o.default&&P.children.forEach(m),P.optimize(b))},w=f,E=0;w.length>0;E+=1){if(E>=d)throw new Error("[Parchment] Maximum optimize iterations reached");for(w.forEach(function(P){var R=l.find(P.target,!0);R!=null&&(R.domNode===P.target&&(P.type==="childList"?(x(l.find(P.previousSibling,!1)),[].forEach.call(P.addedNodes,function(k){var N=l.find(k,!1);x(N,!1),N instanceof o.default&&N.children.forEach(function(M){x(M,!1)})})):P.type==="attributes"&&x(R.prev)),x(R))}),this.children.forEach(m),w=[].slice.call(this.observer.takeRecords()),S=w.slice();S.length>0;)f.push(S.pop())}},p.prototype.update=function(f,b){var _=this;b===void 0&&(b={}),f=f||this.observer.takeRecords(),f.map(function(S){var x=l.find(S.target,!0);return x==null?null:x.domNode[l.DATA_KEY].mutations==null?(x.domNode[l.DATA_KEY].mutations=[S],x):(x.domNode[l.DATA_KEY].mutations.push(S),null)}).forEach(function(S){S==null||S===_||S.domNode[l.DATA_KEY]==null||S.update(S.domNode[l.DATA_KEY].mutations||[],b)}),this.domNode[l.DATA_KEY].mutations!=null&&v.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,b),this.optimize(f,b)},p.blotName="scroll",p.defaultChild="block",p.scope=l.Scope.BLOCK_BLOT,p.tagName="DIV",p}(o.default);n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,p){v.__proto__=p}||function(v,p){for(var f in p)p.hasOwnProperty(f)&&(v[f]=p[f])};return function(v,p){h(v,p);function f(){this.constructor=v}v.prototype=p===null?Object.create(p):(f.prototype=p.prototype,new f)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1);function u(h,v){if(Object.keys(h).length!==Object.keys(v).length)return!1;for(var p in h)if(h[p]!==v[p])return!1;return!0}var d=function(h){a(v,h);function v(){return h!==null&&h.apply(this,arguments)||this}return v.formats=function(p){if(p.tagName!==v.tagName)return h.formats.call(this,p)},v.prototype.format=function(p,f){var b=this;p===this.statics.blotName&&!f?(this.children.forEach(function(_){_ instanceof o.default||(_=_.wrap(v.blotName,!0)),b.attributes.copy(_)}),this.unwrap()):h.prototype.format.call(this,p,f)},v.prototype.formatAt=function(p,f,b,_){if(this.formats()[b]!=null||l.query(b,l.Scope.ATTRIBUTE)){var S=this.isolate(p,f);S.format(b,_)}else h.prototype.formatAt.call(this,p,f,b,_)},v.prototype.optimize=function(p){h.prototype.optimize.call(this,p);var f=this.formats();if(Object.keys(f).length===0)return this.unwrap();var b=this.next;b instanceof v&&b.prev===this&&u(f,b.formats())&&(b.moveChildren(this),b.remove())},v.blotName="inline",v.scope=l.Scope.INLINE_BLOT,v.tagName="SPAN",v}(o.default);n.default=d},function(r,n,i){var a=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var p in v)v.hasOwnProperty(p)&&(h[p]=v[p])};return function(h,v){d(h,v);function p(){this.constructor=h}h.prototype=v===null?Object.create(v):(p.prototype=v.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),l=i(1),u=function(d){a(h,d);function h(){return d!==null&&d.apply(this,arguments)||this}return h.formats=function(v){var p=l.query(h.blotName).tagName;if(v.tagName!==p)return d.formats.call(this,v)},h.prototype.format=function(v,p){l.query(v,l.Scope.BLOCK)!=null&&(v===this.statics.blotName&&!p?this.replaceWith(h.blotName):d.prototype.format.call(this,v,p))},h.prototype.formatAt=function(v,p,f,b){l.query(f,l.Scope.BLOCK)!=null?this.format(f,b):d.prototype.formatAt.call(this,v,p,f,b)},h.prototype.insertAt=function(v,p,f){if(f==null||l.query(p,l.Scope.INLINE)!=null)d.prototype.insertAt.call(this,v,p,f);else{var b=this.split(v),_=l.create(p,f);b.parent.insertBefore(_,b)}},h.prototype.update=function(v,p){navigator.userAgent.match(/Trident/)?this.build():d.prototype.update.call(this,v,p)},h.blotName="block",h.scope=l.Scope.BLOCK_BLOT,h.tagName="P",h}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,h){d.__proto__=h}||function(d,h){for(var v in h)h.hasOwnProperty(v)&&(d[v]=h[v])};return function(d,h){u(d,h);function v(){this.constructor=d}d.prototype=h===null?Object.create(h):(v.prototype=h.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=function(u){a(d,u);function d(){return u!==null&&u.apply(this,arguments)||this}return d.formats=function(h){},d.prototype.format=function(h,v){u.prototype.formatAt.call(this,0,this.length(),h,v)},d.prototype.formatAt=function(h,v,p,f){h===0&&v===this.length()?this.format(p,f):u.prototype.formatAt.call(this,h,v,p,f)},d.prototype.formats=function(){return this.statics.formats(this.domNode)},d}(o.default);n.default=l},function(r,n,i){var a=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,v){h.__proto__=v}||function(h,v){for(var p in v)v.hasOwnProperty(p)&&(h[p]=v[p])};return function(h,v){d(h,v);function p(){this.constructor=h}h.prototype=v===null?Object.create(v):(p.prototype=v.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),l=i(1),u=function(d){a(h,d);function h(v){var p=d.call(this,v)||this;return p.text=p.statics.value(p.domNode),p}return h.create=function(v){return document.createTextNode(v)},h.value=function(v){var p=v.data;return p.normalize&&(p=p.normalize()),p},h.prototype.deleteAt=function(v,p){this.domNode.data=this.text=this.text.slice(0,v)+this.text.slice(v+p)},h.prototype.index=function(v,p){return this.domNode===v?p:-1},h.prototype.insertAt=function(v,p,f){f==null?(this.text=this.text.slice(0,v)+p+this.text.slice(v),this.domNode.data=this.text):d.prototype.insertAt.call(this,v,p,f)},h.prototype.length=function(){return this.text.length},h.prototype.optimize=function(v){d.prototype.optimize.call(this,v),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof h&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},h.prototype.position=function(v,p){return[this.domNode,v]},h.prototype.split=function(v,p){if(p===void 0&&(p=!1),!p){if(v===0)return this;if(v===this.length())return this.next}var f=l.create(this.domNode.splitText(v));return this.parent.insertBefore(f,this.next),this.text=this.statics.value(this.domNode),f},h.prototype.update=function(v,p){var f=this;v.some(function(b){return b.type==="characterData"&&b.target===f.domNode})&&(this.text=this.statics.value(this.domNode))},h.prototype.value=function(){return this.text},h.blotName="text",h.scope=l.Scope.INLINE_BLOT,h}(o.default);n.default=u},function(r,n,i){var a=document.createElement("div");if(a.classList.toggle("test-class",!1),a.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(l,u){return arguments.length>1&&!this.contains(l)==!u?u:o.call(this,l)}}String.prototype.startsWith||(String.prototype.startsWith=function(l,u){return u=u||0,this.substr(u,l.length)===l}),String.prototype.endsWith||(String.prototype.endsWith=function(l,u){var d=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>d.length)&&(u=d.length),u-=l.length;var h=d.indexOf(l,u);return h!==-1&&h===u}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(u){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof u!="function")throw new TypeError("predicate must be a function");for(var d=Object(this),h=d.length>>>0,v=arguments[1],p,f=0;f<h;f++)if(p=d[f],u.call(v,p,f,d))return p}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var i=-1,a=1,o=0;function l(E,P,R){if(E==P)return E?[[o,E]]:[];(R<0||E.length<R)&&(R=null);var k=v(E,P),N=E.substring(0,k);E=E.substring(k),P=P.substring(k),k=p(E,P);var M=E.substring(E.length-k);E=E.substring(0,E.length-k),P=P.substring(0,P.length-k);var T=u(E,P);return N&&T.unshift([o,N]),M&&T.push([o,M]),b(T),R!=null&&(T=x(T,R)),T=m(T),T}function u(E,P){var R;if(!E)return[[a,P]];if(!P)return[[i,E]];var k=E.length>P.length?E:P,N=E.length>P.length?P:E,M=k.indexOf(N);if(M!=-1)return R=[[a,k.substring(0,M)],[o,N],[a,k.substring(M+N.length)]],E.length>P.length&&(R[0][0]=R[2][0]=i),R;if(N.length==1)return[[i,E],[a,P]];var T=f(E,P);if(T){var C=T[0],L=T[1],H=T[2],G=T[3],J=T[4],se=l(C,H),U=l(L,G);return se.concat([[o,J]],U)}return d(E,P)}function d(E,P){for(var R=E.length,k=P.length,N=Math.ceil((R+k)/2),M=N,T=2*N,C=new Array(T),L=new Array(T),H=0;H<T;H++)C[H]=-1,L[H]=-1;C[M+1]=0,L[M+1]=0;for(var G=R-k,J=G%2!=0,se=0,U=0,V=0,X=0,z=0;z<N;z++){for(var D=-z+se;D<=z-U;D+=2){var F=M+D,q;D==-z||D!=z&&C[F-1]<C[F+1]?q=C[F+1]:q=C[F-1]+1;for(var Q=q-D;q<R&&Q<k&&E.charAt(q)==P.charAt(Q);)q++,Q++;if(C[F]=q,q>R)U+=2;else if(Q>k)se+=2;else if(J){var re=M+G-D;if(re>=0&&re<T&&L[re]!=-1){var Y=R-L[re];if(q>=Y)return h(E,P,q,Q)}}}for(var ee=-z+V;ee<=z-X;ee+=2){var re=M+ee,Y;ee==-z||ee!=z&&L[re-1]<L[re+1]?Y=L[re+1]:Y=L[re-1]+1;for(var ae=Y-ee;Y<R&&ae<k&&E.charAt(R-Y-1)==P.charAt(k-ae-1);)Y++,ae++;if(L[re]=Y,Y>R)X+=2;else if(ae>k)V+=2;else if(!J){var F=M+G-ee;if(F>=0&&F<T&&C[F]!=-1){var q=C[F],Q=M+q-F;if(Y=R-Y,q>=Y)return h(E,P,q,Q)}}}}return[[i,E],[a,P]]}function h(E,P,R,k){var N=E.substring(0,R),M=P.substring(0,k),T=E.substring(R),C=P.substring(k),L=l(N,M),H=l(T,C);return L.concat(H)}function v(E,P){if(!E||!P||E.charAt(0)!=P.charAt(0))return 0;for(var R=0,k=Math.min(E.length,P.length),N=k,M=0;R<N;)E.substring(M,N)==P.substring(M,N)?(R=N,M=R):k=N,N=Math.floor((k-R)/2+R);return N}function p(E,P){if(!E||!P||E.charAt(E.length-1)!=P.charAt(P.length-1))return 0;for(var R=0,k=Math.min(E.length,P.length),N=k,M=0;R<N;)E.substring(E.length-N,E.length-M)==P.substring(P.length-N,P.length-M)?(R=N,M=R):k=N,N=Math.floor((k-R)/2+R);return N}function f(E,P){var R=E.length>P.length?E:P,k=E.length>P.length?P:E;if(R.length<4||k.length*2<R.length)return null;function N(U,V,X){for(var z=U.substring(X,X+Math.floor(U.length/4)),D=-1,F="",q,Q,re,Y;(D=V.indexOf(z,D+1))!=-1;){var ee=v(U.substring(X),V.substring(D)),ae=p(U.substring(0,X),V.substring(0,D));F.length<ae+ee&&(F=V.substring(D-ae,D)+V.substring(D,D+ee),q=U.substring(0,X-ae),Q=U.substring(X+ee),re=V.substring(0,D-ae),Y=V.substring(D+ee))}return F.length*2>=U.length?[q,Q,re,Y,F]:null}var M=N(R,k,Math.ceil(R.length/4)),T=N(R,k,Math.ceil(R.length/2)),C;if(!M&&!T)return null;T?M?C=M[4].length>T[4].length?M:T:C=T:C=M;var L,H,G,J;E.length>P.length?(L=C[0],H=C[1],G=C[2],J=C[3]):(G=C[0],J=C[1],L=C[2],H=C[3]);var se=C[4];return[L,H,G,J,se]}function b(E){E.push([o,""]);for(var P=0,R=0,k=0,N="",M="",T;P<E.length;)switch(E[P][0]){case a:k++,M+=E[P][1],P++;break;case i:R++,N+=E[P][1],P++;break;case o:R+k>1?(R!==0&&k!==0&&(T=v(M,N),T!==0&&(P-R-k>0&&E[P-R-k-1][0]==o?E[P-R-k-1][1]+=M.substring(0,T):(E.splice(0,0,[o,M.substring(0,T)]),P++),M=M.substring(T),N=N.substring(T)),T=p(M,N),T!==0&&(E[P][1]=M.substring(M.length-T)+E[P][1],M=M.substring(0,M.length-T),N=N.substring(0,N.length-T))),R===0?E.splice(P-k,R+k,[a,M]):k===0?E.splice(P-R,R+k,[i,N]):E.splice(P-R-k,R+k,[i,N],[a,M]),P=P-R-k+(R?1:0)+(k?1:0)+1):P!==0&&E[P-1][0]==o?(E[P-1][1]+=E[P][1],E.splice(P,1)):P++,k=0,R=0,N="",M="";break}E[E.length-1][1]===""&&E.pop();var C=!1;for(P=1;P<E.length-1;)E[P-1][0]==o&&E[P+1][0]==o&&(E[P][1].substring(E[P][1].length-E[P-1][1].length)==E[P-1][1]?(E[P][1]=E[P-1][1]+E[P][1].substring(0,E[P][1].length-E[P-1][1].length),E[P+1][1]=E[P-1][1]+E[P+1][1],E.splice(P-1,1),C=!0):E[P][1].substring(0,E[P+1][1].length)==E[P+1][1]&&(E[P-1][1]+=E[P+1][1],E[P][1]=E[P][1].substring(E[P+1][1].length)+E[P+1][1],E.splice(P+1,1),C=!0)),P++;C&&b(E)}var _=l;_.INSERT=a,_.DELETE=i,_.EQUAL=o,r.exports=_;function S(E,P){if(P===0)return[o,E];for(var R=0,k=0;k<E.length;k++){var N=E[k];if(N[0]===i||N[0]===o){var M=R+N[1].length;if(P===M)return[k+1,E];if(P<M){E=E.slice();var T=P-R,C=[N[0],N[1].slice(0,T)],L=[N[0],N[1].slice(T)];return E.splice(k,1,C,L),[k+1,E]}else R=M}}throw new Error("cursor_pos is out of bounds!")}function x(E,P){var R=S(E,P),k=R[1],N=R[0],M=k[N],T=k[N+1];if(M==null)return E;if(M[0]!==o)return E;if(T!=null&&M[1]+T[1]===T[1]+M[1])return k.splice(N,2,T,M),w(k,N,2);if(T!=null&&T[1].indexOf(M[1])===0){k.splice(N,2,[T[0],M[1]],[0,M[1]]);var C=T[1].slice(M[1].length);return C.length>0&&k.splice(N+2,0,[T[0],C]),w(k,N,3)}else return E}function m(E){for(var P=!1,R=function(T){return T.charCodeAt(0)>=56320&&T.charCodeAt(0)<=57343},k=function(T){return T.charCodeAt(T.length-1)>=55296&&T.charCodeAt(T.length-1)<=56319},N=2;N<E.length;N+=1)E[N-2][0]===o&&k(E[N-2][1])&&E[N-1][0]===i&&R(E[N-1][1])&&E[N][0]===a&&R(E[N][1])&&(P=!0,E[N-1][1]=E[N-2][1].slice(-1)+E[N-1][1],E[N][1]=E[N-2][1].slice(-1)+E[N][1],E[N-2][1]=E[N-2][1].slice(0,-1));if(!P)return E;for(var M=[],N=0;N<E.length;N+=1)E[N][1].length>0&&M.push(E[N]);return M}function w(E,P,R){for(var k=P+R-1;k>=0&&k>=P-1;k--)if(k+1<E.length){var N=E[k],M=E[k+1];N[0]===M[1]&&E.splice(k,2,[N[0],N[1]+M[1]])}return E}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(a){var o=[];for(var l in a)o.push(l);return o}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?a:o,n.supported=a;function a(l){return Object.prototype.toString.call(l)=="[object Arguments]"}n.unsupported=o;function o(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,a="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(a=!1));function l(d,h,v){this.fn=d,this.context=h,this.once=v||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var h=[],v,p;if(this._eventsCount===0)return h;for(p in v=this._events)i.call(v,p)&&h.push(a?p.slice(1):p);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(v)):h},u.prototype.listeners=function(h,v){var p=a?a+h:h,f=this._events[p];if(v)return!!f;if(!f)return[];if(f.fn)return[f.fn];for(var b=0,_=f.length,S=new Array(_);b<_;b++)S[b]=f[b].fn;return S},u.prototype.emit=function(h,v,p,f,b,_){var S=a?a+h:h;if(!this._events[S])return!1;var x=this._events[S],m=arguments.length,w,E;if(x.fn){switch(x.once&&this.removeListener(h,x.fn,void 0,!0),m){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,v),!0;case 3:return x.fn.call(x.context,v,p),!0;case 4:return x.fn.call(x.context,v,p,f),!0;case 5:return x.fn.call(x.context,v,p,f,b),!0;case 6:return x.fn.call(x.context,v,p,f,b,_),!0}for(E=1,w=new Array(m-1);E<m;E++)w[E-1]=arguments[E];x.fn.apply(x.context,w)}else{var P=x.length,R;for(E=0;E<P;E++)switch(x[E].once&&this.removeListener(h,x[E].fn,void 0,!0),m){case 1:x[E].fn.call(x[E].context);break;case 2:x[E].fn.call(x[E].context,v);break;case 3:x[E].fn.call(x[E].context,v,p);break;case 4:x[E].fn.call(x[E].context,v,p,f);break;default:if(!w)for(R=1,w=new Array(m-1);R<m;R++)w[R-1]=arguments[R];x[E].fn.apply(x[E].context,w)}}return!0},u.prototype.on=function(h,v,p){var f=new l(v,p||this),b=a?a+h:h;return this._events[b]?this._events[b].fn?this._events[b]=[this._events[b],f]:this._events[b].push(f):(this._events[b]=f,this._eventsCount++),this},u.prototype.once=function(h,v,p){var f=new l(v,p||this,!0),b=a?a+h:h;return this._events[b]?this._events[b].fn?this._events[b]=[this._events[b],f]:this._events[b].push(f):(this._events[b]=f,this._eventsCount++),this},u.prototype.removeListener=function(h,v,p,f){var b=a?a+h:h;if(!this._events[b])return this;if(!v)return--this._eventsCount===0?this._events=new o:delete this._events[b],this;var _=this._events[b];if(_.fn)_.fn===v&&(!f||_.once)&&(!p||_.context===p)&&(--this._eventsCount===0?this._events=new o:delete this._events[b]);else{for(var S=0,x=[],m=_.length;S<m;S++)(_[S].fn!==v||f&&!_[S].once||p&&_[S].context!==p)&&x.push(_[S]);x.length?this._events[b]=x.length===1?x[0]:x:--this._eventsCount===0?this._events=new o:delete this._events[b]}return this},u.prototype.removeAllListeners=function(h){var v;return h?(v=a?a+h:h,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(xe){return typeof xe}:function(xe){return xe&&typeof Symbol=="function"&&xe.constructor===Symbol&&xe!==Symbol.prototype?"symbol":typeof xe},o=function(){function xe(ye,Ne){var Te=[],ge=!0,Re=!1,Be=void 0;try{for(var Qe=ye[Symbol.iterator](),ct;!(ge=(ct=Qe.next()).done)&&(Te.push(ct.value),!(Ne&&Te.length===Ne));ge=!0);}catch(mt){Re=!0,Be=mt}finally{try{!ge&&Qe.return&&Qe.return()}finally{if(Re)throw Be}}return Te}return function(ye,Ne){if(Array.isArray(ye))return ye;if(Symbol.iterator in Object(ye))return xe(ye,Ne);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function xe(ye,Ne){for(var Te=0;Te<Ne.length;Te++){var ge=Ne[Te];ge.enumerable=ge.enumerable||!1,ge.configurable=!0,"value"in ge&&(ge.writable=!0),Object.defineProperty(ye,ge.key,ge)}}return function(ye,Ne,Te){return Ne&&xe(ye.prototype,Ne),Te&&xe(ye,Te),ye}}(),u=i(3),d=L(u),h=i(2),v=L(h),p=i(0),f=L(p),b=i(5),_=L(b),S=i(10),x=L(S),m=i(9),w=L(m),E=i(36),P=i(37),R=i(13),k=L(R),N=i(26),M=i(38),T=i(39),C=i(40);function L(xe){return xe&&xe.__esModule?xe:{default:xe}}function H(xe,ye,Ne){return ye in xe?Object.defineProperty(xe,ye,{value:Ne,enumerable:!0,configurable:!0,writable:!0}):xe[ye]=Ne,xe}function G(xe,ye){if(!(xe instanceof ye))throw new TypeError("Cannot call a class as a function")}function J(xe,ye){if(!xe)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return ye&&(typeof ye=="object"||typeof ye=="function")?ye:xe}function se(xe,ye){if(typeof ye!="function"&&ye!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof ye);xe.prototype=Object.create(ye&&ye.prototype,{constructor:{value:xe,enumerable:!1,writable:!0,configurable:!0}}),ye&&(Object.setPrototypeOf?Object.setPrototypeOf(xe,ye):xe.__proto__=ye)}var U=(0,x.default)("quill:clipboard"),V="__ql-matcher",X=[[Node.TEXT_NODE,Ee],[Node.TEXT_NODE,ke],["br",pe],[Node.ELEMENT_NODE,ke],[Node.ELEMENT_NODE,ce],[Node.ELEMENT_NODE,Se],[Node.ELEMENT_NODE,ue],[Node.ELEMENT_NODE,le],["li",Ce],["b",ae.bind(ae,"bold")],["i",ae.bind(ae,"italic")],["style",Ae]],z=[E.AlignAttribute,M.DirectionAttribute].reduce(function(xe,ye){return xe[ye.keyName]=ye,xe},{}),D=[E.AlignStyle,P.BackgroundStyle,N.ColorStyle,M.DirectionStyle,T.FontStyle,C.SizeStyle].reduce(function(xe,ye){return xe[ye.keyName]=ye,xe},{}),F=function(xe){se(ye,xe);function ye(Ne,Te){G(this,ye);var ge=J(this,(ye.__proto__||Object.getPrototypeOf(ye)).call(this,Ne,Te));return ge.quill.root.addEventListener("paste",ge.onPaste.bind(ge)),ge.container=ge.quill.addContainer("ql-clipboard"),ge.container.setAttribute("contenteditable",!0),ge.container.setAttribute("tabindex",-1),ge.matchers=[],X.concat(ge.options.matchers).forEach(function(Re){var Be=o(Re,2),Qe=Be[0],ct=Be[1];!Te.matchVisual&&ct===Se||ge.addMatcher(Qe,ct)}),ge}return l(ye,[{key:"addMatcher",value:function(Te,ge){this.matchers.push([Te,ge])}},{key:"convert",value:function(Te){if(typeof Te=="string")return this.container.innerHTML=Te.replace(/\>\r?\n +\</g,"><"),this.convert();var ge=this.quill.getFormat(this.quill.selection.savedRange.index);if(ge[k.default.blotName]){var Re=this.container.innerText;return this.container.innerHTML="",new v.default().insert(Re,H({},k.default.blotName,ge[k.default.blotName]))}var Be=this.prepareMatching(),Qe=o(Be,2),ct=Qe[0],mt=Qe[1],gt=ee(this.container,ct,mt);return re(gt,`
132
- `)&&gt.ops[gt.ops.length-1].attributes==null&&(gt=gt.compose(new v.default().retain(gt.length()-1).delete(1))),U.log("convert",this.container.innerHTML,gt),this.container.innerHTML="",gt}},{key:"dangerouslyPasteHTML",value:function(Te,ge){var Re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_.default.sources.API;if(typeof Te=="string")this.quill.setContents(this.convert(Te),ge),this.quill.setSelection(0,_.default.sources.SILENT);else{var Be=this.convert(ge);this.quill.updateContents(new v.default().retain(Te).concat(Be),Re),this.quill.setSelection(Te+Be.length(),_.default.sources.SILENT)}}},{key:"onPaste",value:function(Te){var ge=this;if(!(Te.defaultPrevented||!this.quill.isEnabled())){var Re=this.quill.getSelection(),Be=new v.default().retain(Re.index),Qe=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(_.default.sources.SILENT),setTimeout(function(){Be=Be.concat(ge.convert()).delete(Re.length),ge.quill.updateContents(Be,_.default.sources.USER),ge.quill.setSelection(Be.length()-Re.length,_.default.sources.SILENT),ge.quill.scrollingContainer.scrollTop=Qe,ge.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Te=this,ge=[],Re=[];return this.matchers.forEach(function(Be){var Qe=o(Be,2),ct=Qe[0],mt=Qe[1];switch(ct){case Node.TEXT_NODE:Re.push(mt);break;case Node.ELEMENT_NODE:ge.push(mt);break;default:[].forEach.call(Te.container.querySelectorAll(ct),function(gt){gt[V]=gt[V]||[],gt[V].push(mt)});break}}),[ge,Re]}}]),ye}(w.default);F.DEFAULTS={matchers:[],matchVisual:!0};function q(xe,ye,Ne){return(typeof ye>"u"?"undefined":a(ye))==="object"?Object.keys(ye).reduce(function(Te,ge){return q(Te,ge,ye[ge])},xe):xe.reduce(function(Te,ge){return ge.attributes&&ge.attributes[ye]?Te.push(ge):Te.insert(ge.insert,(0,d.default)({},H({},ye,Ne),ge.attributes))},new v.default)}function Q(xe){if(xe.nodeType!==Node.ELEMENT_NODE)return{};var ye="__ql-computed-style";return xe[ye]||(xe[ye]=window.getComputedStyle(xe))}function re(xe,ye){for(var Ne="",Te=xe.ops.length-1;Te>=0&&Ne.length<ye.length;--Te){var ge=xe.ops[Te];if(typeof ge.insert!="string")break;Ne=ge.insert+Ne}return Ne.slice(-1*ye.length)===ye}function Y(xe){if(xe.childNodes.length===0)return!1;var ye=Q(xe);return["block","list-item"].indexOf(ye.display)>-1}function ee(xe,ye,Ne){return xe.nodeType===xe.TEXT_NODE?Ne.reduce(function(Te,ge){return ge(xe,Te)},new v.default):xe.nodeType===xe.ELEMENT_NODE?[].reduce.call(xe.childNodes||[],function(Te,ge){var Re=ee(ge,ye,Ne);return ge.nodeType===xe.ELEMENT_NODE&&(Re=ye.reduce(function(Be,Qe){return Qe(ge,Be)},Re),Re=(ge[V]||[]).reduce(function(Be,Qe){return Qe(ge,Be)},Re)),Te.concat(Re)},new v.default):new v.default}function ae(xe,ye,Ne){return q(Ne,xe,!0)}function ue(xe,ye){var Ne=f.default.Attributor.Attribute.keys(xe),Te=f.default.Attributor.Class.keys(xe),ge=f.default.Attributor.Style.keys(xe),Re={};return Ne.concat(Te).concat(ge).forEach(function(Be){var Qe=f.default.query(Be,f.default.Scope.ATTRIBUTE);Qe!=null&&(Re[Qe.attrName]=Qe.value(xe),Re[Qe.attrName])||(Qe=z[Be],Qe!=null&&(Qe.attrName===Be||Qe.keyName===Be)&&(Re[Qe.attrName]=Qe.value(xe)||void 0),Qe=D[Be],Qe!=null&&(Qe.attrName===Be||Qe.keyName===Be)&&(Qe=D[Be],Re[Qe.attrName]=Qe.value(xe)||void 0))}),Object.keys(Re).length>0&&(ye=q(ye,Re)),ye}function ce(xe,ye){var Ne=f.default.query(xe);if(Ne==null)return ye;if(Ne.prototype instanceof f.default.Embed){var Te={},ge=Ne.value(xe);ge!=null&&(Te[Ne.blotName]=ge,ye=new v.default().insert(Te,Ne.formats(xe)))}else typeof Ne.formats=="function"&&(ye=q(ye,Ne.blotName,Ne.formats(xe)));return ye}function pe(xe,ye){return re(ye,`
133
- `)||ye.insert(`
134
- `),ye}function Ae(){return new v.default}function Ce(xe,ye){var Ne=f.default.query(xe);if(Ne==null||Ne.blotName!=="list-item"||!re(ye,`
135
- `))return ye;for(var Te=-1,ge=xe.parentNode;!ge.classList.contains("ql-clipboard");)(f.default.query(ge)||{}).blotName==="list"&&(Te+=1),ge=ge.parentNode;return Te<=0?ye:ye.compose(new v.default().retain(ye.length()-1).retain(1,{indent:Te}))}function ke(xe,ye){return re(ye,`
136
- `)||(Y(xe)||ye.length()>0&&xe.nextSibling&&Y(xe.nextSibling))&&ye.insert(`
137
- `),ye}function Se(xe,ye){if(Y(xe)&&xe.nextElementSibling!=null&&!re(ye,`
138
-
139
- `)){var Ne=xe.offsetHeight+parseFloat(Q(xe).marginTop)+parseFloat(Q(xe).marginBottom);xe.nextElementSibling.offsetTop>xe.offsetTop+Ne*1.5&&ye.insert(`
140
- `)}return ye}function le(xe,ye){var Ne={},Te=xe.style||{};return Te.fontStyle&&Q(xe).fontStyle==="italic"&&(Ne.italic=!0),Te.fontWeight&&(Q(xe).fontWeight.startsWith("bold")||parseInt(Q(xe).fontWeight)>=700)&&(Ne.bold=!0),Object.keys(Ne).length>0&&(ye=q(ye,Ne)),parseFloat(Te.textIndent||0)>0&&(ye=new v.default().insert(" ").concat(ye)),ye}function Ee(xe,ye){var Ne=xe.data;if(xe.parentNode.tagName==="O:P")return ye.insert(Ne.trim());if(Ne.trim().length===0&&xe.parentNode.classList.contains("ql-clipboard"))return ye;if(!Q(xe.parentNode).whiteSpace.startsWith("pre")){var Te=function(Re,Be){return Be=Be.replace(/[^\u00a0]/g,""),Be.length<1&&Re?" ":Be};Ne=Ne.replace(/\r\n/g," ").replace(/\n/g," "),Ne=Ne.replace(/\s\s+/g,Te.bind(Te,!0)),(xe.previousSibling==null&&Y(xe.parentNode)||xe.previousSibling!=null&&Y(xe.previousSibling))&&(Ne=Ne.replace(/^\s+/,Te.bind(Te,!1))),(xe.nextSibling==null&&Y(xe.parentNode)||xe.nextSibling!=null&&Y(xe.nextSibling))&&(Ne=Ne.replace(/\s+$/,Te.bind(Te,!1)))}return ye.insert(Ne)}n.default=F,n.matchAttributor=ue,n.matchBlot=ce,n.matchNewline=ke,n.matchSpacing=Se,n.matchText=Ee},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function b(_,S){for(var x=0;x<S.length;x++){var m=S[x];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(_,m.key,m)}}return function(_,S,x){return S&&b(_.prototype,S),x&&b(_,x),_}}(),o=function b(_,S,x){_===null&&(_=Function.prototype);var m=Object.getOwnPropertyDescriptor(_,S);if(m===void 0){var w=Object.getPrototypeOf(_);return w===null?void 0:b(w,S,x)}else{if("value"in m)return m.value;var E=m.get;return E===void 0?void 0:E.call(x)}},l=i(6),u=d(l);function d(b){return b&&b.__esModule?b:{default:b}}function h(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function v(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function p(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var f=function(b){p(_,b);function _(){return h(this,_),v(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"optimize",value:function(x){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,x),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);f.blotName="bold",f.tagName=["STRONG","B"],n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var a=function(){function C(L,H){var G=[],J=!0,se=!1,U=void 0;try{for(var V=L[Symbol.iterator](),X;!(J=(X=V.next()).done)&&(G.push(X.value),!(H&&G.length===H));J=!0);}catch(z){se=!0,U=z}finally{try{!J&&V.return&&V.return()}finally{if(se)throw U}}return G}return function(L,H){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return C(L,H);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function C(L,H){for(var G=0;G<H.length;G++){var J=H[G];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(L,J.key,J)}}return function(L,H,G){return H&&C(L.prototype,H),G&&C(L,G),L}}(),l=i(2),u=x(l),d=i(0),h=x(d),v=i(5),p=x(v),f=i(10),b=x(f),_=i(9),S=x(_);function x(C){return C&&C.__esModule?C:{default:C}}function m(C,L,H){return L in C?Object.defineProperty(C,L,{value:H,enumerable:!0,configurable:!0,writable:!0}):C[L]=H,C}function w(C,L){if(!(C instanceof L))throw new TypeError("Cannot call a class as a function")}function E(C,L){if(!C)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:C}function P(C,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);C.prototype=Object.create(L&&L.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(C,L):C.__proto__=L)}var R=(0,b.default)("quill:toolbar"),k=function(C){P(L,C);function L(H,G){w(this,L);var J=E(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,H,G));if(Array.isArray(J.options.container)){var se=document.createElement("div");M(se,J.options.container),H.container.parentNode.insertBefore(se,H.container),J.container=se}else typeof J.options.container=="string"?J.container=document.querySelector(J.options.container):J.container=J.options.container;if(!(J.container instanceof HTMLElement)){var U;return U=R.error("Container required for toolbar",J.options),E(J,U)}return J.container.classList.add("ql-toolbar"),J.controls=[],J.handlers={},Object.keys(J.options.handlers).forEach(function(V){J.addHandler(V,J.options.handlers[V])}),[].forEach.call(J.container.querySelectorAll("button, select"),function(V){J.attach(V)}),J.quill.on(p.default.events.EDITOR_CHANGE,function(V,X){V===p.default.events.SELECTION_CHANGE&&J.update(X)}),J.quill.on(p.default.events.SCROLL_OPTIMIZE,function(){var V=J.quill.selection.getRange(),X=a(V,1),z=X[0];J.update(z)}),J}return o(L,[{key:"addHandler",value:function(G,J){this.handlers[G]=J}},{key:"attach",value:function(G){var J=this,se=[].find.call(G.classList,function(V){return V.indexOf("ql-")===0});if(se){if(se=se.slice(3),G.tagName==="BUTTON"&&G.setAttribute("type","button"),this.handlers[se]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[se]==null){R.warn("ignoring attaching to disabled format",se,G);return}if(h.default.query(se)==null){R.warn("ignoring attaching to nonexistent format",se,G);return}}var U=G.tagName==="SELECT"?"change":"click";G.addEventListener(U,function(V){var X=void 0;if(G.tagName==="SELECT"){if(G.selectedIndex<0)return;var z=G.options[G.selectedIndex];z.hasAttribute("selected")?X=!1:X=z.value||!1}else G.classList.contains("ql-active")?X=!1:X=G.value||!G.hasAttribute("value"),V.preventDefault();J.quill.focus();var D=J.quill.selection.getRange(),F=a(D,1),q=F[0];if(J.handlers[se]!=null)J.handlers[se].call(J,X);else if(h.default.query(se).prototype instanceof h.default.Embed){if(X=prompt("Enter "+se),!X)return;J.quill.updateContents(new u.default().retain(q.index).delete(q.length).insert(m({},se,X)),p.default.sources.USER)}else J.quill.format(se,X,p.default.sources.USER);J.update(q)}),this.controls.push([se,G])}}},{key:"update",value:function(G){var J=G==null?{}:this.quill.getFormat(G);this.controls.forEach(function(se){var U=a(se,2),V=U[0],X=U[1];if(X.tagName==="SELECT"){var z=void 0;if(G==null)z=null;else if(J[V]==null)z=X.querySelector("option[selected]");else if(!Array.isArray(J[V])){var D=J[V];typeof D=="string"&&(D=D.replace(/\"/g,'\\"')),z=X.querySelector('option[value="'+D+'"]')}z==null?(X.value="",X.selectedIndex=-1):z.selected=!0}else if(G==null)X.classList.remove("ql-active");else if(X.hasAttribute("value")){var F=J[V]===X.getAttribute("value")||J[V]!=null&&J[V].toString()===X.getAttribute("value")||J[V]==null&&!X.getAttribute("value");X.classList.toggle("ql-active",F)}else X.classList.toggle("ql-active",J[V]!=null)})}}]),L}(S.default);k.DEFAULTS={};function N(C,L,H){var G=document.createElement("button");G.setAttribute("type","button"),G.classList.add("ql-"+L),H!=null&&(G.value=H),C.appendChild(G)}function M(C,L){Array.isArray(L[0])||(L=[L]),L.forEach(function(H){var G=document.createElement("span");G.classList.add("ql-formats"),H.forEach(function(J){if(typeof J=="string")N(G,J);else{var se=Object.keys(J)[0],U=J[se];Array.isArray(U)?T(G,se,U):N(G,se,U)}}),C.appendChild(G)})}function T(C,L,H){var G=document.createElement("select");G.classList.add("ql-"+L),H.forEach(function(J){var se=document.createElement("option");J!==!1?se.setAttribute("value",J):se.setAttribute("selected","selected"),G.appendChild(se)}),C.appendChild(G)}k.DEFAULTS={container:null,handlers:{clean:function(){var L=this,H=this.quill.getSelection();if(H!=null)if(H.length==0){var G=this.quill.getFormat();Object.keys(G).forEach(function(J){h.default.query(J,h.default.Scope.INLINE)!=null&&L.quill.format(J,!1)})}else this.quill.removeFormat(H,p.default.sources.USER)},direction:function(L){var H=this.quill.getFormat().align;L==="rtl"&&H==null?this.quill.format("align","right",p.default.sources.USER):!L&&H==="right"&&this.quill.format("align",!1,p.default.sources.USER),this.quill.format("direction",L,p.default.sources.USER)},indent:function(L){var H=this.quill.getSelection(),G=this.quill.getFormat(H),J=parseInt(G.indent||0);if(L==="+1"||L==="-1"){var se=L==="+1"?1:-1;G.direction==="rtl"&&(se*=-1),this.quill.format("indent",J+se,p.default.sources.USER)}},link:function(L){L===!0&&(L=prompt("Enter link URL:")),this.quill.format("link",L,p.default.sources.USER)},list:function(L){var H=this.quill.getSelection(),G=this.quill.getFormat(H);L==="check"?G.list==="checked"||G.list==="unchecked"?this.quill.format("list",!1,p.default.sources.USER):this.quill.format("list","unchecked",p.default.sources.USER):this.quill.format("list",L,p.default.sources.USER)}}},n.default=k,n.addControls=M},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 b(_,S){for(var x=0;x<S.length;x++){var m=S[x];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(_,m.key,m)}}return function(_,S,x){return S&&b(_.prototype,S),x&&b(_,x),_}}(),o=function b(_,S,x){_===null&&(_=Function.prototype);var m=Object.getOwnPropertyDescriptor(_,S);if(m===void 0){var w=Object.getPrototypeOf(_);return w===null?void 0:b(w,S,x)}else{if("value"in m)return m.value;var E=m.get;return E===void 0?void 0:E.call(x)}},l=i(28),u=d(l);function d(b){return b&&b.__esModule?b:{default:b}}function h(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function v(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function p(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var f=function(b){p(_,b);function _(S,x){h(this,_);var m=v(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,S));return m.label.innerHTML=x,m.container.classList.add("ql-color-picker"),[].slice.call(m.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(w){w.classList.add("ql-primary")}),m}return a(_,[{key:"buildItem",value:function(x){var m=o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"buildItem",this).call(this,x);return m.style.backgroundColor=x.getAttribute("value")||"",m}},{key:"selectItem",value:function(x,m){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"selectItem",this).call(this,x,m);var w=this.label.querySelector(".ql-color-label"),E=x&&x.getAttribute("data-value")||"";w&&(w.tagName==="line"?w.style.stroke=E:w.style.fill=E)}}]),_}(u.default);n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function b(_,S){for(var x=0;x<S.length;x++){var m=S[x];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(_,m.key,m)}}return function(_,S,x){return S&&b(_.prototype,S),x&&b(_,x),_}}(),o=function b(_,S,x){_===null&&(_=Function.prototype);var m=Object.getOwnPropertyDescriptor(_,S);if(m===void 0){var w=Object.getPrototypeOf(_);return w===null?void 0:b(w,S,x)}else{if("value"in m)return m.value;var E=m.get;return E===void 0?void 0:E.call(x)}},l=i(28),u=d(l);function d(b){return b&&b.__esModule?b:{default:b}}function h(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function v(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function p(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var f=function(b){p(_,b);function _(S,x){h(this,_);var m=v(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,S));return m.container.classList.add("ql-icon-picker"),[].forEach.call(m.container.querySelectorAll(".ql-picker-item"),function(w){w.innerHTML=x[w.getAttribute("data-value")||""]}),m.defaultItem=m.container.querySelector(".ql-selected"),m.selectItem(m.defaultItem),m}return a(_,[{key:"selectItem",value:function(x,m){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"selectItem",this).call(this,x,m),x=x||this.defaultItem,this.label.innerHTML=x.innerHTML}}]),_}(u.default);n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(d,h){for(var v=0;v<h.length;v++){var p=h[v];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(d,p.key,p)}}return function(d,h,v){return h&&u(d.prototype,h),v&&u(d,v),d}}();function o(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")}var l=function(){function u(d,h){var v=this;o(this,u),this.quill=d,this.boundsContainer=h||document.body,this.root=d.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(h){var v=h.left+h.width/2-this.root.offsetWidth/2,p=h.bottom+this.quill.root.scrollTop;this.root.style.left=v+"px",this.root.style.top=p+"px",this.root.classList.remove("ql-flip");var f=this.boundsContainer.getBoundingClientRect(),b=this.root.getBoundingClientRect(),_=0;if(b.right>f.right&&(_=f.right-b.right,this.root.style.left=v+_+"px"),b.left<f.left&&(_=f.left-b.left,this.root.style.left=v+_+"px"),b.bottom>f.bottom){var S=b.bottom-b.top,x=h.bottom-h.top+S;this.root.style.top=p-x+"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=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function T(C,L){var H=[],G=!0,J=!1,se=void 0;try{for(var U=C[Symbol.iterator](),V;!(G=(V=U.next()).done)&&(H.push(V.value),!(L&&H.length===L));G=!0);}catch(X){J=!0,se=X}finally{try{!G&&U.return&&U.return()}finally{if(J)throw se}}return H}return function(C,L){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return T(C,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function T(C,L,H){C===null&&(C=Function.prototype);var G=Object.getOwnPropertyDescriptor(C,L);if(G===void 0){var J=Object.getPrototypeOf(C);return J===null?void 0:T(J,L,H)}else{if("value"in G)return G.value;var se=G.get;return se===void 0?void 0:se.call(H)}},l=function(){function T(C,L){for(var H=0;H<L.length;H++){var G=L[H];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(C,G.key,G)}}return function(C,L,H){return L&&T(C.prototype,L),H&&T(C,H),C}}(),u=i(3),d=w(u),h=i(8),v=w(h),p=i(43),f=w(p),b=i(27),_=w(b),S=i(15),x=i(41),m=w(x);function w(T){return T&&T.__esModule?T:{default:T}}function E(T,C){if(!(T instanceof C))throw new TypeError("Cannot call a class as a function")}function P(T,C){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:T}function R(T,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);T.prototype=Object.create(C&&C.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(T,C):T.__proto__=C)}var k=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],N=function(T){R(C,T);function C(L,H){E(this,C),H.modules.toolbar!=null&&H.modules.toolbar.container==null&&(H.modules.toolbar.container=k);var G=P(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,L,H));return G.quill.container.classList.add("ql-snow"),G}return l(C,[{key:"extendToolbar",value:function(H){H.container.classList.add("ql-snow"),this.buildButtons([].slice.call(H.container.querySelectorAll("button")),m.default),this.buildPickers([].slice.call(H.container.querySelectorAll("select")),m.default),this.tooltip=new M(this.quill,this.options.bounds),H.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(G,J){H.handlers.link.call(H,!J.format.link)})}}]),C}(f.default);N.DEFAULTS=(0,d.default)(!0,{},f.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(C){if(C){var L=this.quill.getSelection();if(L==null||L.length==0)return;var H=this.quill.getText(L);/^\S+@\S+\.\S+$/.test(H)&&H.indexOf("mailto:")!==0&&(H="mailto:"+H);var G=this.quill.theme.tooltip;G.edit("link",H)}else this.quill.format("link",!1)}}}}});var M=function(T){R(C,T);function C(L,H){E(this,C);var G=P(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,L,H));return G.preview=G.root.querySelector("a.ql-preview"),G}return l(C,[{key:"listen",value:function(){var H=this;o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(G){H.root.classList.contains("ql-editing")?H.save():H.edit("link",H.preview.textContent),G.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(G){if(H.linkRange!=null){var J=H.linkRange;H.restoreFocus(),H.quill.formatText(J,"link",!1,v.default.sources.USER),delete H.linkRange}G.preventDefault(),H.hide()}),this.quill.on(v.default.events.SELECTION_CHANGE,function(G,J,se){if(G!=null){if(G.length===0&&se===v.default.sources.USER){var U=H.quill.scroll.descendant(_.default,G.index),V=a(U,2),X=V[0],z=V[1];if(X!=null){H.linkRange=new S.Range(G.index-z,X.length());var D=_.default.formats(X.domNode);H.preview.textContent=D,H.preview.setAttribute("href",D),H.show(),H.position(H.quill.getBounds(H.linkRange));return}}else delete H.linkRange;H.hide()}})}},{key:"show",value:function(){o(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),C}(p.BaseTooltip);M.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=N},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(29),o=ge(a),l=i(36),u=i(38),d=i(64),h=i(65),v=ge(h),p=i(66),f=ge(p),b=i(67),_=ge(b),S=i(37),x=i(26),m=i(39),w=i(40),E=i(56),P=ge(E),R=i(68),k=ge(R),N=i(27),M=ge(N),T=i(69),C=ge(T),L=i(70),H=ge(L),G=i(71),J=ge(G),se=i(72),U=ge(se),V=i(73),X=ge(V),z=i(13),D=ge(z),F=i(74),q=ge(F),Q=i(75),re=ge(Q),Y=i(57),ee=ge(Y),ae=i(41),ue=ge(ae),ce=i(28),pe=ge(ce),Ae=i(59),Ce=ge(Ae),ke=i(60),Se=ge(ke),le=i(61),Ee=ge(le),xe=i(108),ye=ge(xe),Ne=i(62),Te=ge(Ne);function ge(Re){return Re&&Re.__esModule?Re:{default:Re}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":S.BackgroundClass,"attributors/class/color":x.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":m.FontClass,"attributors/class/size":w.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":S.BackgroundStyle,"attributors/style/color":x.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":m.FontStyle,"attributors/style/size":w.SizeStyle},!0),o.default.register({"formats/align":l.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":d.IndentClass,"formats/background":S.BackgroundStyle,"formats/color":x.ColorStyle,"formats/font":m.FontClass,"formats/size":w.SizeClass,"formats/blockquote":v.default,"formats/code-block":D.default,"formats/header":f.default,"formats/list":_.default,"formats/bold":P.default,"formats/code":z.Code,"formats/italic":k.default,"formats/link":M.default,"formats/script":C.default,"formats/strike":H.default,"formats/underline":J.default,"formats/image":U.default,"formats/video":X.default,"formats/list/item":b.ListItem,"modules/formula":q.default,"modules/syntax":re.default,"modules/toolbar":ee.default,"themes/bubble":ye.default,"themes/snow":Te.default,"ui/icons":ue.default,"ui/picker":pe.default,"ui/icon-picker":Se.default,"ui/color-picker":Ce.default,"ui/tooltip":Ee.default},!0),n.default=o.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var a=function(){function _(S,x){for(var m=0;m<x.length;m++){var w=x[m];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(S,w.key,w)}}return function(S,x,m){return x&&_(S.prototype,x),m&&_(S,m),S}}(),o=function _(S,x,m){S===null&&(S=Function.prototype);var w=Object.getOwnPropertyDescriptor(S,x);if(w===void 0){var E=Object.getPrototypeOf(S);return E===null?void 0:_(E,x,m)}else{if("value"in w)return w.value;var P=w.get;return P===void 0?void 0:P.call(m)}},l=i(0),u=d(l);function d(_){return _&&_.__esModule?_:{default:_}}function h(_,S){if(!(_ instanceof S))throw new TypeError("Cannot call a class as a function")}function v(_,S){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:_}function p(_,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);_.prototype=Object.create(S&&S.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(_,S):_.__proto__=S)}var f=function(_){p(S,_);function S(){return h(this,S),v(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,[{key:"add",value:function(m,w){if(w==="+1"||w==="-1"){var E=this.value(m)||0;w=w==="+1"?E+1:E-1}return w===0?(this.remove(m),!0):o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"add",this).call(this,m,w)}},{key:"canAdd",value:function(m,w){return o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"canAdd",this).call(this,m,w)||o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"canAdd",this).call(this,m,parseInt(w))}},{key:"value",value:function(m){return parseInt(o(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"value",this).call(this,m))||void 0}}]),S}(u.default.Attributor.Class),b=new f("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(4),o=l(a);function l(p){return p&&p.__esModule?p:{default:p}}function u(p,f){if(!(p instanceof f))throw new TypeError("Cannot call a class as a function")}function d(p,f){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:p}function h(p,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);p.prototype=Object.create(f&&f.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(p,f):p.__proto__=f)}var v=function(p){h(f,p);function f(){return u(this,f),d(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(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 f(b,_){for(var S=0;S<_.length;S++){var x=_[S];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(b,x.key,x)}}return function(b,_,S){return _&&f(b.prototype,_),S&&f(b,S),b}}(),o=i(4),l=u(o);function u(f){return f&&f.__esModule?f:{default:f}}function d(f,b){if(!(f instanceof b))throw new TypeError("Cannot call a class as a function")}function h(f,b){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:f}function v(f,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);f.prototype=Object.create(b&&b.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(f,b):f.__proto__=b)}var p=function(f){v(b,f);function b(){return d(this,b),h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,null,[{key:"formats",value:function(S){return this.tagName.indexOf(S.tagName)+1}}]),b}(l.default);p.blotName="header",p.tagName=["H1","H2","H3","H4","H5","H6"],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function E(P,R){for(var k=0;k<R.length;k++){var N=R[k];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(P,N.key,N)}}return function(P,R,k){return R&&E(P.prototype,R),k&&E(P,k),P}}(),o=function E(P,R,k){P===null&&(P=Function.prototype);var N=Object.getOwnPropertyDescriptor(P,R);if(N===void 0){var M=Object.getPrototypeOf(P);return M===null?void 0:E(M,R,k)}else{if("value"in N)return N.value;var T=N.get;return T===void 0?void 0:T.call(k)}},l=i(0),u=f(l),d=i(4),h=f(d),v=i(25),p=f(v);function f(E){return E&&E.__esModule?E:{default:E}}function b(E,P,R){return P in E?Object.defineProperty(E,P,{value:R,enumerable:!0,configurable:!0,writable:!0}):E[P]=R,E}function _(E,P){if(!(E instanceof P))throw new TypeError("Cannot call a class as a function")}function S(E,P){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:E}function x(E,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);E.prototype=Object.create(P&&P.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(E,P):E.__proto__=P)}var m=function(E){x(P,E);function P(){return _(this,P),S(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}return a(P,[{key:"format",value:function(k,N){k===w.blotName&&!N?this.replaceWith(u.default.create(this.statics.scope)):o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"format",this).call(this,k,N)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(k,N){return this.parent.isolate(this.offset(this.parent),this.length()),k===this.parent.statics.blotName?(this.parent.replaceWith(k,N),this):(this.parent.unwrap(),o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replaceWith",this).call(this,k,N))}}],[{key:"formats",value:function(k){return k.tagName===this.tagName?void 0:o(P.__proto__||Object.getPrototypeOf(P),"formats",this).call(this,k)}}]),P}(h.default);m.blotName="list-item",m.tagName="LI";var w=function(E){x(P,E),a(P,null,[{key:"create",value:function(k){var N=k==="ordered"?"OL":"UL",M=o(P.__proto__||Object.getPrototypeOf(P),"create",this).call(this,N);return(k==="checked"||k==="unchecked")&&M.setAttribute("data-checked",k==="checked"),M}},{key:"formats",value:function(k){if(k.tagName==="OL")return"ordered";if(k.tagName==="UL")return k.hasAttribute("data-checked")?k.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function P(R){_(this,P);var k=S(this,(P.__proto__||Object.getPrototypeOf(P)).call(this,R)),N=function(T){if(T.target.parentNode===R){var C=k.statics.formats(R),L=u.default.find(T.target);C==="checked"?L.format("list","unchecked"):C==="unchecked"&&L.format("list","checked")}};return R.addEventListener("touchstart",N),R.addEventListener("mousedown",N),k}return a(P,[{key:"format",value:function(k,N){this.children.length>0&&this.children.tail.format(k,N)}},{key:"formats",value:function(){return b({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(k,N){if(k instanceof m)o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"insertBefore",this).call(this,k,N);else{var M=N==null?this.length():N.offset(this),T=this.split(M);T.parent.insertBefore(k,T)}}},{key:"optimize",value:function(k){o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"optimize",this).call(this,k);var N=this.next;N!=null&&N.prev===this&&N.statics.blotName===this.statics.blotName&&N.domNode.tagName===this.domNode.tagName&&N.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(N.moveChildren(this),N.remove())}},{key:"replace",value:function(k){if(k.statics.blotName!==this.statics.blotName){var N=u.default.create(this.statics.defaultChild);k.moveChildren(N),this.appendChild(N)}o(P.prototype.__proto__||Object.getPrototypeOf(P.prototype),"replace",this).call(this,k)}}]),P}(p.default);w.blotName="list",w.scope=u.default.Scope.BLOCK_BLOT,w.tagName=["OL","UL"],w.defaultChild="list-item",w.allowedChildren=[m],n.ListItem=m,n.default=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(56),o=l(a);function l(p){return p&&p.__esModule?p:{default:p}}function u(p,f){if(!(p instanceof f))throw new TypeError("Cannot call a class as a function")}function d(p,f){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:p}function h(p,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);p.prototype=Object.create(f&&f.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(p,f):p.__proto__=f)}var v=function(p){h(f,p);function f(){return u(this,f),d(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(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 b(_,S){for(var x=0;x<S.length;x++){var m=S[x];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(_,m.key,m)}}return function(_,S,x){return S&&b(_.prototype,S),x&&b(_,x),_}}(),o=function b(_,S,x){_===null&&(_=Function.prototype);var m=Object.getOwnPropertyDescriptor(_,S);if(m===void 0){var w=Object.getPrototypeOf(_);return w===null?void 0:b(w,S,x)}else{if("value"in m)return m.value;var E=m.get;return E===void 0?void 0:E.call(x)}},l=i(6),u=d(l);function d(b){return b&&b.__esModule?b:{default:b}}function h(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}function v(b,_){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:b}function p(b,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);b.prototype=Object.create(_&&_.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(b,_):b.__proto__=_)}var f=function(b){p(_,b);function _(){return h(this,_),v(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,null,[{key:"create",value:function(x){return x==="super"?document.createElement("sup"):x==="sub"?document.createElement("sub"):o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,x)}},{key:"formats",value:function(x){if(x.tagName==="SUB")return"sub";if(x.tagName==="SUP")return"super"}}]),_}(u.default);f.blotName="script",f.tagName=["SUB","SUP"],n.default=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=l(a);function l(p){return p&&p.__esModule?p:{default:p}}function u(p,f){if(!(p instanceof f))throw new TypeError("Cannot call a class as a function")}function d(p,f){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:p}function h(p,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);p.prototype=Object.create(f&&f.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(p,f):p.__proto__=f)}var v=function(p){h(f,p);function f(){return u(this,f),d(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(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=l(a);function l(p){return p&&p.__esModule?p:{default:p}}function u(p,f){if(!(p instanceof f))throw new TypeError("Cannot call a class as a function")}function d(p,f){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:p}function h(p,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);p.prototype=Object.create(f&&f.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(p,f):p.__proto__=f)}var v=function(p){h(f,p);function f(){return u(this,f),d(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(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 S(x,m){for(var w=0;w<m.length;w++){var E=m[w];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,m,w){return m&&S(x.prototype,m),w&&S(x,w),x}}(),o=function S(x,m,w){x===null&&(x=Function.prototype);var E=Object.getOwnPropertyDescriptor(x,m);if(E===void 0){var P=Object.getPrototypeOf(x);return P===null?void 0:S(P,m,w)}else{if("value"in E)return E.value;var R=E.get;return R===void 0?void 0:R.call(w)}},l=i(0),u=h(l),d=i(27);function h(S){return S&&S.__esModule?S:{default:S}}function v(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function p(S,x){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:S}function f(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(S,x):S.__proto__=x)}var b=["alt","height","width"],_=function(S){f(x,S);function x(){return v(this,x),p(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"format",value:function(w,E){b.indexOf(w)>-1?E?this.domNode.setAttribute(w,E):this.domNode.removeAttribute(w):o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,w,E)}}],[{key:"create",value:function(w){var E=o(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,w);return typeof w=="string"&&E.setAttribute("src",this.sanitize(w)),E}},{key:"formats",value:function(w){return b.reduce(function(E,P){return w.hasAttribute(P)&&(E[P]=w.getAttribute(P)),E},{})}},{key:"match",value:function(w){return/\.(jpe?g|gif|png)$/.test(w)||/^data:image\/.+;base64/.test(w)}},{key:"sanitize",value:function(w){return(0,d.sanitize)(w,["http","https","data"])?w:"//:0"}},{key:"value",value:function(w){return w.getAttribute("src")}}]),x}(u.default.Embed);_.blotName="image",_.tagName="IMG",n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(x,m){for(var w=0;w<m.length;w++){var E=m[w];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(x,E.key,E)}}return function(x,m,w){return m&&S(x.prototype,m),w&&S(x,w),x}}(),o=function S(x,m,w){x===null&&(x=Function.prototype);var E=Object.getOwnPropertyDescriptor(x,m);if(E===void 0){var P=Object.getPrototypeOf(x);return P===null?void 0:S(P,m,w)}else{if("value"in E)return E.value;var R=E.get;return R===void 0?void 0:R.call(w)}},l=i(4),u=i(27),d=h(u);function h(S){return S&&S.__esModule?S:{default:S}}function v(S,x){if(!(S instanceof x))throw new TypeError("Cannot call a class as a function")}function p(S,x){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:S}function f(S,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);S.prototype=Object.create(x&&x.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(S,x):S.__proto__=x)}var b=["height","width"],_=function(S){f(x,S);function x(){return v(this,x),p(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"format",value:function(w,E){b.indexOf(w)>-1?E?this.domNode.setAttribute(w,E):this.domNode.removeAttribute(w):o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,w,E)}}],[{key:"create",value:function(w){var E=o(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,w);return E.setAttribute("frameborder","0"),E.setAttribute("allowfullscreen",!0),E.setAttribute("src",this.sanitize(w)),E}},{key:"formats",value:function(w){return b.reduce(function(E,P){return w.hasAttribute(P)&&(E[P]=w.getAttribute(P)),E},{})}},{key:"sanitize",value:function(w){return d.default.sanitize(w)}},{key:"value",value:function(w){return w.getAttribute("src")}}]),x}(l.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 w(E,P){for(var R=0;R<P.length;R++){var k=P[R];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(E,k.key,k)}}return function(E,P,R){return P&&w(E.prototype,P),R&&w(E,R),E}}(),o=function w(E,P,R){E===null&&(E=Function.prototype);var k=Object.getOwnPropertyDescriptor(E,P);if(k===void 0){var N=Object.getPrototypeOf(E);return N===null?void 0:w(N,P,R)}else{if("value"in k)return k.value;var M=k.get;return M===void 0?void 0:M.call(R)}},l=i(35),u=f(l),d=i(5),h=f(d),v=i(9),p=f(v);function f(w){return w&&w.__esModule?w:{default:w}}function b(w,E){if(!(w instanceof E))throw new TypeError("Cannot call a class as a function")}function _(w,E){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:w}function S(w,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);w.prototype=Object.create(E&&E.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(w,E):w.__proto__=E)}var x=function(w){S(E,w);function E(){return b(this,E),_(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,null,[{key:"create",value:function(R){var k=o(E.__proto__||Object.getPrototypeOf(E),"create",this).call(this,R);return typeof R=="string"&&(window.katex.render(R,k,{throwOnError:!1,errorColor:"#f00"}),k.setAttribute("data-value",R)),k}},{key:"value",value:function(R){return R.getAttribute("data-value")}}]),E}(u.default);x.blotName="formula",x.className="ql-formula",x.tagName="SPAN";var m=function(w){S(E,w),a(E,null,[{key:"register",value:function(){h.default.register(x,!0)}}]);function E(){b(this,E);var P=_(this,(E.__proto__||Object.getPrototypeOf(E)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return P}return E}(p.default);n.FormulaBlot=x,n.default=m},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function R(k,N){for(var M=0;M<N.length;M++){var T=N[M];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(k,T.key,T)}}return function(k,N,M){return N&&R(k.prototype,N),M&&R(k,M),k}}(),o=function R(k,N,M){k===null&&(k=Function.prototype);var T=Object.getOwnPropertyDescriptor(k,N);if(T===void 0){var C=Object.getPrototypeOf(k);return C===null?void 0:R(C,N,M)}else{if("value"in T)return T.value;var L=T.get;return L===void 0?void 0:L.call(M)}},l=i(0),u=_(l),d=i(5),h=_(d),v=i(9),p=_(v),f=i(13),b=_(f);function _(R){return R&&R.__esModule?R:{default:R}}function S(R,k){if(!(R instanceof k))throw new TypeError("Cannot call a class as a function")}function x(R,k){if(!R)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:R}function m(R,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);R.prototype=Object.create(k&&k.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(R,k):R.__proto__=k)}var w=function(R){m(k,R);function k(){return S(this,k),x(this,(k.__proto__||Object.getPrototypeOf(k)).apply(this,arguments))}return a(k,[{key:"replaceWith",value:function(M){this.domNode.textContent=this.domNode.textContent,this.attach(),o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"replaceWith",this).call(this,M)}},{key:"highlight",value:function(M){var T=this.domNode.textContent;this.cachedText!==T&&((T.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=M(T),this.domNode.normalize(),this.attach()),this.cachedText=T)}}]),k}(b.default);w.className="ql-syntax";var E=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),P=function(R){m(k,R),a(k,null,[{key:"register",value:function(){h.default.register(E,!0),h.default.register(w,!0)}}]);function k(N,M){S(this,k);var T=x(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,N,M));if(typeof T.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var C=null;return T.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(C),C=setTimeout(function(){T.highlight(),C=null},T.options.interval)}),T.highlight(),T}return a(k,[{key:"highlight",value:function(){var M=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var T=this.quill.getSelection();this.quill.scroll.descendants(w).forEach(function(C){C.highlight(M.options.highlight)}),this.quill.update(h.default.sources.SILENT),T!=null&&this.quill.setSelection(T,h.default.sources.SILENT)}}}]),k}(p.default);P.DEFAULTS={highlight:function(){return window.hljs==null?null:function(R){var k=window.hljs.highlightAuto(R);return k.value}}(),interval:1e3},n.CodeBlock=w,n.CodeToken=E,n.default=P},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 k(N,M,T){N===null&&(N=Function.prototype);var C=Object.getOwnPropertyDescriptor(N,M);if(C===void 0){var L=Object.getPrototypeOf(N);return L===null?void 0:k(L,M,T)}else{if("value"in C)return C.value;var H=C.get;return H===void 0?void 0:H.call(T)}},o=function(){function k(N,M){for(var T=0;T<M.length;T++){var C=M[T];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(N,C.key,C)}}return function(N,M,T){return M&&k(N.prototype,M),T&&k(N,T),N}}(),l=i(3),u=S(l),d=i(8),h=S(d),v=i(43),p=S(v),f=i(15),b=i(41),_=S(b);function S(k){return k&&k.__esModule?k:{default:k}}function x(k,N){if(!(k instanceof N))throw new TypeError("Cannot call a class as a function")}function m(k,N){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return N&&(typeof N=="object"||typeof N=="function")?N:k}function w(k,N){if(typeof N!="function"&&N!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof N);k.prototype=Object.create(N&&N.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),N&&(Object.setPrototypeOf?Object.setPrototypeOf(k,N):k.__proto__=N)}var E=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],P=function(k){w(N,k);function N(M,T){x(this,N),T.modules.toolbar!=null&&T.modules.toolbar.container==null&&(T.modules.toolbar.container=E);var C=m(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,M,T));return C.quill.container.classList.add("ql-bubble"),C}return o(N,[{key:"extendToolbar",value:function(T){this.tooltip=new R(this.quill,this.options.bounds),this.tooltip.root.appendChild(T.container),this.buildButtons([].slice.call(T.container.querySelectorAll("button")),_.default),this.buildPickers([].slice.call(T.container.querySelectorAll("select")),_.default)}}]),N}(p.default);P.DEFAULTS=(0,u.default)(!0,{},p.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(N){N?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var R=function(k){w(N,k);function N(M,T){x(this,N);var C=m(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,M,T));return C.quill.on(h.default.events.EDITOR_CHANGE,function(L,H,G,J){if(L===h.default.events.SELECTION_CHANGE)if(H!=null&&H.length>0&&J===h.default.sources.USER){C.show(),C.root.style.left="0px",C.root.style.width="",C.root.style.width=C.root.offsetWidth+"px";var se=C.quill.getLines(H.index,H.length);if(se.length===1)C.position(C.quill.getBounds(H));else{var U=se[se.length-1],V=C.quill.getIndex(U),X=Math.min(U.length()-1,H.index+H.length-V),z=C.quill.getBounds(new f.Range(V,X));C.position(z)}}else document.activeElement!==C.textbox&&C.quill.hasFocus()&&C.hide()}),C}return o(N,[{key:"listen",value:function(){var T=this;a(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){T.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!T.root.classList.contains("ql-hidden")){var C=T.quill.getSelection();C!=null&&T.position(T.quill.getBounds(C))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(T){var C=a(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"position",this).call(this,T),L=this.root.querySelector(".ql-tooltip-arrow");if(L.style.marginLeft="",C===0)return C;L.style.marginLeft=-1*C-L.offsetWidth/2+"px"}}]),N}(v.BaseTooltip);R.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=R,n.default=P},function(r,n,i){r.exports=i(63)}]).default})}(u1)),u1.exports}var eA=JP();const b6=dc(eA);var c1={exports:{}},Sf={},Bd={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var tA=Bd.exports,s3;function rA(){return s3||(s3=1,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof xh=="object"&&xh;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,l=2147483647,u=36,d=1,h=26,v=38,p=700,f=72,b=128,_="-",S=/^xn--/,x=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=u-d,P=Math.floor,R=String.fromCharCode,k;function N(z){throw new RangeError(w[z])}function M(z,D){for(var F=z.length,q=[];F--;)q[F]=D(z[F]);return q}function T(z,D){var F=z.split("@"),q="";F.length>1&&(q=F[0]+"@",z=F[1]),z=z.replace(m,".");var Q=z.split("."),re=M(Q,D).join(".");return q+re}function C(z){for(var D=[],F=0,q=z.length,Q,re;F<q;)Q=z.charCodeAt(F++),Q>=55296&&Q<=56319&&F<q?(re=z.charCodeAt(F++),(re&64512)==56320?D.push(((Q&1023)<<10)+(re&1023)+65536):(D.push(Q),F--)):D.push(Q);return D}function L(z){return M(z,function(D){var F="";return D>65535&&(D-=65536,F+=R(D>>>10&1023|55296),D=56320|D&1023),F+=R(D),F}).join("")}function H(z){return z-48<10?z-22:z-65<26?z-65:z-97<26?z-97:u}function G(z,D){return z+22+75*(z<26)-((D!=0)<<5)}function J(z,D,F){var q=0;for(z=F?P(z/p):z>>1,z+=P(z/D);z>E*h>>1;q+=u)z=P(z/E);return P(q+(E+1)*z/(z+v))}function se(z){var D=[],F=z.length,q,Q=0,re=b,Y=f,ee,ae,ue,ce,pe,Ae,Ce,ke,Se;for(ee=z.lastIndexOf(_),ee<0&&(ee=0),ae=0;ae<ee;++ae)z.charCodeAt(ae)>=128&&N("not-basic"),D.push(z.charCodeAt(ae));for(ue=ee>0?ee+1:0;ue<F;){for(ce=Q,pe=1,Ae=u;ue>=F&&N("invalid-input"),Ce=H(z.charCodeAt(ue++)),(Ce>=u||Ce>P((l-Q)/pe))&&N("overflow"),Q+=Ce*pe,ke=Ae<=Y?d:Ae>=Y+h?h:Ae-Y,!(Ce<ke);Ae+=u)Se=u-ke,pe>P(l/Se)&&N("overflow"),pe*=Se;q=D.length+1,Y=J(Q-ce,q,ce==0),P(Q/q)>l-re&&N("overflow"),re+=P(Q/q),Q%=q,D.splice(Q++,0,re)}return L(D)}function U(z){var D,F,q,Q,re,Y,ee,ae,ue,ce,pe,Ae=[],Ce,ke,Se,le;for(z=C(z),Ce=z.length,D=b,F=0,re=f,Y=0;Y<Ce;++Y)pe=z[Y],pe<128&&Ae.push(R(pe));for(q=Q=Ae.length,Q&&Ae.push(_);q<Ce;){for(ee=l,Y=0;Y<Ce;++Y)pe=z[Y],pe>=D&&pe<ee&&(ee=pe);for(ke=q+1,ee-D>P((l-F)/ke)&&N("overflow"),F+=(ee-D)*ke,D=ee,Y=0;Y<Ce;++Y)if(pe=z[Y],pe<D&&++F>l&&N("overflow"),pe==D){for(ae=F,ue=u;ce=ue<=re?d:ue>=re+h?h:ue-re,!(ae<ce);ue+=u)le=ae-ce,Se=u-ce,Ae.push(R(G(ce+le%Se,0))),ae=P(le/Se);Ae.push(R(G(ae,0))),re=J(F,ke,q==Q),F=0,++q}++F,++D}return Ae.join("")}function V(z){return T(z,function(D){return S.test(D)?se(D.slice(4).toLowerCase()):D})}function X(z){return T(z,function(D){return x.test(D)?"xn--"+U(D):D})}if(o={version:"1.4.1",ucs2:{decode:C,encode:L},decode:se,encode:U,toASCII:X,toUnicode:V},n&&i)if(e.exports==n)i.exports=o;else for(k in o)o.hasOwnProperty(k)&&(n[k]=o[k]);else r.punycode=o})(tA)}(Bd,Bd.exports)),Bd.exports}var wg,l3;function Rh(){return l3||(l3=1,wg=TypeError),wg}const nA={},iA=Object.freeze(Object.defineProperty({__proto__:null,default:nA},Symbol.toStringTag,{value:"Module"})),aA=J8(iA);var _g,u3;function t0(){if(u3)return _g;u3=1;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,n=e&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&a&&typeof a.get=="function"?a.get:null,l=i&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,d=u?WeakMap.prototype.has:null,h=typeof WeakSet=="function"&&WeakSet.prototype,v=h?WeakSet.prototype.has:null,p=typeof WeakRef=="function"&&WeakRef.prototype,f=p?WeakRef.prototype.deref:null,b=Boolean.prototype.valueOf,_=Object.prototype.toString,S=Function.prototype.toString,x=String.prototype.match,m=String.prototype.slice,w=String.prototype.replace,E=String.prototype.toUpperCase,P=String.prototype.toLowerCase,R=RegExp.prototype.test,k=Array.prototype.concat,N=Array.prototype.join,M=Array.prototype.slice,T=Math.floor,C=typeof BigInt=="function"?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,G=typeof Symbol=="function"&&typeof Symbol.iterator=="object",J=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===G||!0)?Symbol.toStringTag:null,se=Object.prototype.propertyIsEnumerable,U=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Ge){return Ge.__proto__}:null);function V(Ge,Ze){if(Ge===1/0||Ge===-1/0||Ge!==Ge||Ge&&Ge>-1e3&&Ge<1e3||R.call(/e/,Ze))return Ze;var Lt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Ge=="number"){var gr=Ge<0?-T(-Ge):T(Ge);if(gr!==Ge){var Wt=String(gr),Ut=m.call(Ze,Wt.length+1);return w.call(Wt,Lt,"$&_")+"."+w.call(w.call(Ut,/([0-9]{3})/g,"$&_"),/_$/,"")}}return w.call(Ze,Lt,"$&_")}var X=aA,z=X.custom,D=ke(z)?z:null,F={__proto__:null,double:'"',single:"'"},q={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};_g=function Ge(Ze,Lt,gr,Wt){var Ut=Lt||{};if(Ee(Ut,"quoteStyle")&&!Ee(F,Ut.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ee(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 kn=Ee(Ut,"customInspect")?Ut.customInspect:!0;if(typeof kn!="boolean"&&kn!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ee(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(Ee(Ut,"numericSeparator")&&typeof Ut.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Rr=Ut.numericSeparator;if(typeof Ze>"u")return"undefined";if(Ze===null)return"null";if(typeof Ze=="boolean")return Ze?"true":"false";if(typeof Ze=="string")return mt(Ze,Ut);if(typeof Ze=="number"){if(Ze===0)return 1/0/Ze>0?"0":"-0";var It=String(Ze);return Rr?V(Ze,It):It}if(typeof Ze=="bigint"){var lr=String(Ze)+"n";return Rr?V(Ze,lr):lr}var so=typeof Ut.depth>"u"?5:Ut.depth;if(typeof gr>"u"&&(gr=0),gr>=so&&so>0&&typeof Ze=="object")return ee(Ze)?"[Array]":"[Object]";var on=rr(Ut,gr);if(typeof Wt>"u")Wt=[];else if(Ne(Wt,Ze)>=0)return"[Circular]";function pn(da,uo,As){if(uo&&(Wt=M.call(Wt),Wt.push(uo)),As){var Ko={depth:Ut.depth};return Ee(Ut,"quoteStyle")&&(Ko.quoteStyle=Ut.quoteStyle),Ge(da,Ko,gr+1,Wt)}return Ge(da,Ut,gr+1,Wt)}if(typeof Ze=="function"&&!ue(Ze)){var ca=ye(Ze),qt=ur(Ze,pn);return"[Function"+(ca?": "+ca:" (anonymous)")+"]"+(qt.length>0?" { "+N.call(qt,", ")+" }":"")}if(ke(Ze)){var Ji=G?w.call(String(Ze),/^(Symbol\(.*\))_[^)]*$/,"$1"):H.call(Ze);return typeof Ze=="object"&&!G?St(Ji):Ji}if(ct(Ze)){for(var Jn="<"+P.call(String(Ze.nodeName)),ci=Ze.attributes||[],zr=0;zr<ci.length;zr++)Jn+=" "+ci[zr].name+"="+Q(re(ci[zr].value),"double",Ut);return Jn+=">",Ze.childNodes&&Ze.childNodes.length&&(Jn+="..."),Jn+="</"+P.call(String(Ze.nodeName))+">",Jn}if(ee(Ze)){if(Ze.length===0)return"[]";var sn=ur(Ze,pn);return on&&!Br(sn)?"["+Nr(sn,on)+"]":"[ "+N.call(sn,", ")+" ]"}if(ce(Ze)){var ei=ur(Ze,pn);return!("cause"in Error.prototype)&&"cause"in Ze&&!se.call(Ze,"cause")?"{ ["+String(Ze)+"] "+N.call(k.call("[cause]: "+pn(Ze.cause),ei),", ")+" }":ei.length===0?"["+String(Ze)+"]":"{ ["+String(Ze)+"] "+N.call(ei,", ")+" }"}if(typeof Ze=="object"&&kn){if(D&&typeof Ze[D]=="function"&&X)return X(Ze,{depth:so-gr});if(kn!=="symbol"&&typeof Ze.inspect=="function")return Ze.inspect()}if(Te(Ze)){var xa=[];return n&&n.call(Ze,function(da,uo){xa.push(pn(uo,Ze,!0)+" => "+pn(da,Ze))}),ut("Map",r.call(Ze),xa,on)}if(Be(Ze)){var lo=[];return l&&l.call(Ze,function(da){lo.push(pn(da,Ze))}),ut("Set",o.call(Ze),lo,on)}if(ge(Ze))return pt("WeakMap");if(Qe(Ze))return pt("WeakSet");if(Re(Ze))return pt("WeakRef");if(Ae(Ze))return St(pn(Number(Ze)));if(Se(Ze))return St(pn(C.call(Ze)));if(Ce(Ze))return St(b.call(Ze));if(pe(Ze))return St(pn(String(Ze)));if(typeof window<"u"&&Ze===window)return"{ [object Window] }";if(typeof globalThis<"u"&&Ze===globalThis||typeof xh<"u"&&Ze===xh)return"{ [object globalThis] }";if(!ae(Ze)&&!ue(Ze)){var fa=ur(Ze,pn),Sa=U?U(Ze)===Object.prototype:Ze instanceof Object||Ze.constructor===Object,Yn=Ze instanceof Object?"":"null prototype",Ea=!Sa&&J&&Object(Ze)===Ze&&J in Ze?m.call(xe(Ze),8,-1):Yn?"Object":"",ha=Sa||typeof Ze.constructor!="function"?"":Ze.constructor.name?Ze.constructor.name+" ":"",Pa=ha+(Ea||Yn?"["+N.call(k.call([],Ea||[],Yn||[]),": ")+"] ":"");return fa.length===0?Pa+"{}":on?Pa+"{"+Nr(fa,on)+"}":Pa+"{ "+N.call(fa,", ")+" }"}return String(Ze)};function Q(Ge,Ze,Lt){var gr=Lt.quoteStyle||Ze,Wt=F[gr];return Wt+Ge+Wt}function re(Ge){return w.call(String(Ge),/"/g,"&quot;")}function Y(Ge){return!J||!(typeof Ge=="object"&&(J in Ge||typeof Ge[J]<"u"))}function ee(Ge){return xe(Ge)==="[object Array]"&&Y(Ge)}function ae(Ge){return xe(Ge)==="[object Date]"&&Y(Ge)}function ue(Ge){return xe(Ge)==="[object RegExp]"&&Y(Ge)}function ce(Ge){return xe(Ge)==="[object Error]"&&Y(Ge)}function pe(Ge){return xe(Ge)==="[object String]"&&Y(Ge)}function Ae(Ge){return xe(Ge)==="[object Number]"&&Y(Ge)}function Ce(Ge){return xe(Ge)==="[object Boolean]"&&Y(Ge)}function ke(Ge){if(G)return Ge&&typeof Ge=="object"&&Ge instanceof Symbol;if(typeof Ge=="symbol")return!0;if(!Ge||typeof Ge!="object"||!H)return!1;try{return H.call(Ge),!0}catch{}return!1}function Se(Ge){if(!Ge||typeof Ge!="object"||!C)return!1;try{return C.call(Ge),!0}catch{}return!1}var le=Object.prototype.hasOwnProperty||function(Ge){return Ge in this};function Ee(Ge,Ze){return le.call(Ge,Ze)}function xe(Ge){return _.call(Ge)}function ye(Ge){if(Ge.name)return Ge.name;var Ze=x.call(S.call(Ge),/^function\s*([\w$]+)/);return Ze?Ze[1]:null}function Ne(Ge,Ze){if(Ge.indexOf)return Ge.indexOf(Ze);for(var Lt=0,gr=Ge.length;Lt<gr;Lt++)if(Ge[Lt]===Ze)return Lt;return-1}function Te(Ge){if(!r||!Ge||typeof Ge!="object")return!1;try{r.call(Ge);try{o.call(Ge)}catch{return!0}return Ge instanceof Map}catch{}return!1}function ge(Ge){if(!d||!Ge||typeof Ge!="object")return!1;try{d.call(Ge,d);try{v.call(Ge,v)}catch{return!0}return Ge instanceof WeakMap}catch{}return!1}function Re(Ge){if(!f||!Ge||typeof Ge!="object")return!1;try{return f.call(Ge),!0}catch{}return!1}function Be(Ge){if(!o||!Ge||typeof Ge!="object")return!1;try{o.call(Ge);try{r.call(Ge)}catch{return!0}return Ge instanceof Set}catch{}return!1}function Qe(Ge){if(!v||!Ge||typeof Ge!="object")return!1;try{v.call(Ge,v);try{d.call(Ge,d)}catch{return!0}return Ge instanceof WeakSet}catch{}return!1}function ct(Ge){return!Ge||typeof Ge!="object"?!1:typeof HTMLElement<"u"&&Ge instanceof HTMLElement?!0:typeof Ge.nodeName=="string"&&typeof Ge.getAttribute=="function"}function mt(Ge,Ze){if(Ge.length>Ze.maxStringLength){var Lt=Ge.length-Ze.maxStringLength,gr="... "+Lt+" more character"+(Lt>1?"s":"");return mt(m.call(Ge,0,Ze.maxStringLength),Ze)+gr}var Wt=q[Ze.quoteStyle||"single"];Wt.lastIndex=0;var Ut=w.call(w.call(Ge,Wt,"\\$1"),/[\x00-\x1f]/g,gt);return Q(Ut,"single",Ze)}function gt(Ge){var Ze=Ge.charCodeAt(0),Lt={8:"b",9:"t",10:"n",12:"f",13:"r"}[Ze];return Lt?"\\"+Lt:"\\x"+(Ze<16?"0":"")+E.call(Ze.toString(16))}function St(Ge){return"Object("+Ge+")"}function pt(Ge){return Ge+" { ? }"}function ut(Ge,Ze,Lt,gr){var Wt=gr?Nr(Lt,gr):N.call(Lt,", ");return Ge+" ("+Ze+") {"+Wt+"}"}function Br(Ge){for(var Ze=0;Ze<Ge.length;Ze++)if(Ne(Ge[Ze],`
141
- `)>=0)return!1;return!0}function rr(Ge,Ze){var Lt;if(Ge.indent===" ")Lt=" ";else if(typeof Ge.indent=="number"&&Ge.indent>0)Lt=N.call(Array(Ge.indent+1)," ");else return null;return{base:Lt,prev:N.call(Array(Ze+1),Lt)}}function Nr(Ge,Ze){if(Ge.length===0)return"";var Lt=`
142
- `+Ze.prev+Ze.base;return Lt+N.call(Ge,","+Lt)+`
143
- `+Ze.prev}function ur(Ge,Ze){var Lt=ee(Ge),gr=[];if(Lt){gr.length=Ge.length;for(var Wt=0;Wt<Ge.length;Wt++)gr[Wt]=Ee(Ge,Wt)?Ze(Ge[Wt],Ge):""}var Ut=typeof L=="function"?L(Ge):[],kn;if(G){kn={};for(var Rr=0;Rr<Ut.length;Rr++)kn["$"+Ut[Rr]]=Ut[Rr]}for(var It in Ge)Ee(Ge,It)&&(Lt&&String(Number(It))===It&&It<Ge.length||G&&kn["$"+It]instanceof Symbol||(R.call(/[^\w$]/,It)?gr.push(Ze(It,Ge)+": "+Ze(Ge[It],Ge)):gr.push(It+": "+Ze(Ge[It],Ge))));if(typeof L=="function")for(var lr=0;lr<Ut.length;lr++)se.call(Ge,Ut[lr])&&gr.push("["+Ze(Ut[lr])+"]: "+Ze(Ge[Ut[lr]],Ge));return gr}return _g}var xg,c3;function oA(){if(c3)return xg;c3=1;var e=t0(),t=Rh(),r=function(l,u,d){for(var h=l,v;(v=h.next)!=null;h=v)if(v.key===u)return h.next=v.next,d||(v.next=l.next,l.next=v),v},n=function(l,u){if(l){var d=r(l,u);return d&&d.value}},i=function(l,u,d){var h=r(l,u);h?h.value=d:l.next={key:u,next:l.next,value:d}},a=function(l,u){return l?!!r(l,u):!1},o=function(l,u){if(l)return r(l,u,!0)};return xg=function(){var u,d={assert:function(h){if(!d.has(h))throw new t("Side channel does not contain "+e(h))},delete:function(h){var v=u&&u.next,p=o(u,h);return p&&v&&v===p&&(u=void 0),!!p},get:function(h){return n(u,h)},has:function(h){return a(u,h)},set:function(h,v){u||(u={next:void 0}),i(u,h,v)}};return d},xg}var Sg,f3;function w6(){return f3||(f3=1,Sg=Object),Sg}var Eg,h3;function sA(){return h3||(h3=1,Eg=Error),Eg}var Pg,d3;function lA(){return d3||(d3=1,Pg=EvalError),Pg}var Ag,p3;function uA(){return p3||(p3=1,Ag=RangeError),Ag}var Og,g3;function cA(){return g3||(g3=1,Og=ReferenceError),Og}var Cg,v3;function fA(){return v3||(v3=1,Cg=SyntaxError),Cg}var kg,m3;function hA(){return m3||(m3=1,kg=URIError),kg}var Ng,y3;function dA(){return y3||(y3=1,Ng=Math.abs),Ng}var Lg,b3;function pA(){return b3||(b3=1,Lg=Math.floor),Lg}var Tg,w3;function gA(){return w3||(w3=1,Tg=Math.max),Tg}var Rg,_3;function vA(){return _3||(_3=1,Rg=Math.min),Rg}var Mg,x3;function mA(){return x3||(x3=1,Mg=Math.pow),Mg}var Ig,S3;function yA(){return S3||(S3=1,Ig=Math.round),Ig}var jg,E3;function bA(){return E3||(E3=1,jg=Number.isNaN||function(t){return t!==t}),jg}var Fg,P3;function wA(){if(P3)return Fg;P3=1;var e=bA();return Fg=function(r){return e(r)||r===0?r:r<0?-1:1},Fg}var Dg,A3;function _A(){return A3||(A3=1,Dg=Object.getOwnPropertyDescriptor),Dg}var Bg,O3;function _6(){if(O3)return Bg;O3=1;var e=_A();if(e)try{e([],"length")}catch{e=null}return Bg=e,Bg}var zg,C3;function xA(){if(C3)return zg;C3=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return zg=e,zg}var qg,k3;function SA(){return k3||(k3=1,qg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var a in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0}),qg}var Ug,N3;function EA(){if(N3)return Ug;N3=1;var e=typeof Symbol<"u"&&Symbol,t=SA();return Ug=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Ug}var Hg,L3;function x6(){return L3||(L3=1,Hg=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Hg}var Vg,T3;function S6(){if(T3)return Vg;T3=1;var e=w6();return Vg=e.getPrototypeOf||null,Vg}var Gg,R3;function PA(){if(R3)return Gg;R3=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(u,d){for(var h=[],v=0;v<u.length;v+=1)h[v]=u[v];for(var p=0;p<d.length;p+=1)h[p+u.length]=d[p];return h},a=function(u,d){for(var h=[],v=d,p=0;v<u.length;v+=1,p+=1)h[p]=u[v];return h},o=function(l,u){for(var d="",h=0;h<l.length;h+=1)d+=l[h],h+1<l.length&&(d+=u);return d};return Gg=function(u){var d=this;if(typeof d!="function"||t.apply(d)!==n)throw new TypeError(e+d);for(var h=a(arguments,1),v,p=function(){if(this instanceof v){var x=d.apply(this,i(h,arguments));return Object(x)===x?x:this}return d.apply(u,i(h,arguments))},f=r(0,d.length-h.length),b=[],_=0;_<f;_++)b[_]="$"+_;if(v=Function("binder","return function ("+o(b,",")+"){ return binder.apply(this,arguments); }")(p),d.prototype){var S=function(){};S.prototype=d.prototype,v.prototype=new S,S.prototype=null}return v},Gg}var $g,M3;function r0(){if(M3)return $g;M3=1;var e=PA();return $g=Function.prototype.bind||e,$g}var Wg,I3;function Kv(){return I3||(I3=1,Wg=Function.prototype.call),Wg}var Yg,j3;function E6(){return j3||(j3=1,Yg=Function.prototype.apply),Yg}var Xg,F3;function AA(){return F3||(F3=1,Xg=typeof Reflect<"u"&&Reflect&&Reflect.apply),Xg}var Kg,D3;function OA(){if(D3)return Kg;D3=1;var e=r0(),t=E6(),r=Kv(),n=AA();return Kg=n||e.call(r,t),Kg}var Zg,B3;function P6(){if(B3)return Zg;B3=1;var e=r0(),t=Rh(),r=Kv(),n=OA();return Zg=function(a){if(a.length<1||typeof a[0]!="function")throw new t("a function is required");return n(e,r,a)},Zg}var Qg,z3;function CA(){if(z3)return Qg;z3=1;var e=P6(),t=_6(),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&&t&&t(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return Qg=n&&typeof n.get=="function"?e([n.get]):typeof a=="function"?function(l){return a(l==null?l:i(l))}:!1,Qg}var Jg,q3;function kA(){if(q3)return Jg;q3=1;var e=x6(),t=S6(),r=CA();return Jg=e?function(i){return e(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:r?function(i){return r(i)}:null,Jg}var e2,U3;function NA(){if(U3)return e2;U3=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=r0();return e2=r.call(e,t),e2}var t2,H3;function Zv(){if(H3)return t2;H3=1;var e,t=w6(),r=sA(),n=lA(),i=uA(),a=cA(),o=fA(),l=Rh(),u=hA(),d=dA(),h=pA(),v=gA(),p=vA(),f=mA(),b=yA(),_=wA(),S=Function,x=function(ue){try{return S('"use strict"; return ('+ue+").constructor;")()}catch{}},m=_6(),w=xA(),E=function(){throw new l},P=m?function(){try{return arguments.callee,E}catch{try{return m(arguments,"callee").get}catch{return E}}}():E,R=EA()(),k=kA(),N=S6(),M=x6(),T=E6(),C=Kv(),L={},H=typeof Uint8Array>"u"||!k?e:k(Uint8Array),G={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":R&&k?k([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":L,"%AsyncGenerator%":L,"%AsyncGeneratorFunction%":L,"%AsyncIteratorPrototype%":L,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":S,"%GeneratorFunction%":L,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":R&&k?k(k([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!R||!k?e:k(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":m,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!R||!k?e:k(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":R&&k?k(""[Symbol.iterator]()):e,"%Symbol%":R?Symbol:e,"%SyntaxError%":o,"%ThrowTypeError%":P,"%TypedArray%":H,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":C,"%Function.prototype.apply%":T,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":N,"%Math.abs%":d,"%Math.floor%":h,"%Math.max%":v,"%Math.min%":p,"%Math.pow%":f,"%Math.round%":b,"%Math.sign%":_,"%Reflect.getPrototypeOf%":M};if(k)try{null.error}catch(ue){var J=k(k(ue));G["%Error.prototype%"]=J}var se=function ue(ce){var pe;if(ce==="%AsyncFunction%")pe=x("async function () {}");else if(ce==="%GeneratorFunction%")pe=x("function* () {}");else if(ce==="%AsyncGeneratorFunction%")pe=x("async function* () {}");else if(ce==="%AsyncGenerator%"){var Ae=ue("%AsyncGeneratorFunction%");Ae&&(pe=Ae.prototype)}else if(ce==="%AsyncIteratorPrototype%"){var Ce=ue("%AsyncGenerator%");Ce&&k&&(pe=k(Ce.prototype))}return G[ce]=pe,pe},U={__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"]},V=r0(),X=NA(),z=V.call(C,Array.prototype.concat),D=V.call(T,Array.prototype.splice),F=V.call(C,String.prototype.replace),q=V.call(C,String.prototype.slice),Q=V.call(C,RegExp.prototype.exec),re=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Y=/\\(\\)?/g,ee=function(ce){var pe=q(ce,0,1),Ae=q(ce,-1);if(pe==="%"&&Ae!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(Ae==="%"&&pe!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var Ce=[];return F(ce,re,function(ke,Se,le,Ee){Ce[Ce.length]=le?F(Ee,Y,"$1"):Se||ke}),Ce},ae=function(ce,pe){var Ae=ce,Ce;if(X(U,Ae)&&(Ce=U[Ae],Ae="%"+Ce[0]+"%"),X(G,Ae)){var ke=G[Ae];if(ke===L&&(ke=se(Ae)),typeof ke>"u"&&!pe)throw new l("intrinsic "+ce+" exists, but is not available. Please file an issue!");return{alias:Ce,name:Ae,value:ke}}throw new o("intrinsic "+ce+" does not exist!")};return t2=function(ce,pe){if(typeof ce!="string"||ce.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof pe!="boolean")throw new l('"allowMissing" argument must be a boolean');if(Q(/^%?[^%]*%?$/,ce)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Ae=ee(ce),Ce=Ae.length>0?Ae[0]:"",ke=ae("%"+Ce+"%",pe),Se=ke.name,le=ke.value,Ee=!1,xe=ke.alias;xe&&(Ce=xe[0],D(Ae,z([0,1],xe)));for(var ye=1,Ne=!0;ye<Ae.length;ye+=1){var Te=Ae[ye],ge=q(Te,0,1),Re=q(Te,-1);if((ge==='"'||ge==="'"||ge==="`"||Re==='"'||Re==="'"||Re==="`")&&ge!==Re)throw new o("property names with quotes must have matching quotes");if((Te==="constructor"||!Ne)&&(Ee=!0),Ce+="."+Te,Se="%"+Ce+"%",X(G,Se))le=G[Se];else if(le!=null){if(!(Te in le)){if(!pe)throw new l("base intrinsic for "+ce+" exists, but the property is not available.");return}if(m&&ye+1>=Ae.length){var Be=m(le,Te);Ne=!!Be,Ne&&"get"in Be&&!("originalValue"in Be.get)?le=Be.get:le=le[Te]}else Ne=X(le,Te),le=le[Te];Ne&&!Ee&&(G[Se]=le)}}return le},t2}var r2,V3;function A6(){if(V3)return r2;V3=1;var e=Zv(),t=P6(),r=t([e("%String.prototype.indexOf%")]);return r2=function(i,a){var o=e(i,!!a);return typeof o=="function"&&r(i,".prototype.")>-1?t([o]):o},r2}var n2,G3;function O6(){if(G3)return n2;G3=1;var e=Zv(),t=A6(),r=t0(),n=Rh(),i=e("%Map%",!0),a=t("Map.prototype.get",!0),o=t("Map.prototype.set",!0),l=t("Map.prototype.has",!0),u=t("Map.prototype.delete",!0),d=t("Map.prototype.size",!0);return n2=!!i&&function(){var v,p={assert:function(f){if(!p.has(f))throw new n("Side channel does not contain "+r(f))},delete:function(f){if(v){var b=u(v,f);return d(v)===0&&(v=void 0),b}return!1},get:function(f){if(v)return a(v,f)},has:function(f){return v?l(v,f):!1},set:function(f,b){v||(v=new i),o(v,f,b)}};return p},n2}var i2,$3;function LA(){if($3)return i2;$3=1;var e=Zv(),t=A6(),r=t0(),n=O6(),i=Rh(),a=e("%WeakMap%",!0),o=t("WeakMap.prototype.get",!0),l=t("WeakMap.prototype.set",!0),u=t("WeakMap.prototype.has",!0),d=t("WeakMap.prototype.delete",!0);return i2=a?function(){var v,p,f={assert:function(b){if(!f.has(b))throw new i("Side channel does not contain "+r(b))},delete:function(b){if(a&&b&&(typeof b=="object"||typeof b=="function")){if(v)return d(v,b)}else if(n&&p)return p.delete(b);return!1},get:function(b){return a&&b&&(typeof b=="object"||typeof b=="function")&&v?o(v,b):p&&p.get(b)},has:function(b){return a&&b&&(typeof b=="object"||typeof b=="function")&&v?u(v,b):!!p&&p.has(b)},set:function(b,_){a&&b&&(typeof b=="object"||typeof b=="function")?(v||(v=new a),l(v,b,_)):n&&(p||(p=n()),p.set(b,_))}};return f}:n,i2}var a2,W3;function TA(){if(W3)return a2;W3=1;var e=Rh(),t=t0(),r=oA(),n=O6(),i=LA(),a=i||n||r;return a2=function(){var l,u={assert:function(d){if(!u.has(d))throw new e("Side channel does not contain "+t(d))},delete:function(d){return!!l&&l.delete(d)},get:function(d){return l&&l.get(d)},has:function(d){return!!l&&l.has(d)},set:function(d,h){l||(l=a()),l.set(d,h)}};return u},a2}var o2,Y3;function Qv(){if(Y3)return o2;Y3=1;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return o2={default:r.RFC3986,formatters:{RFC1738:function(n){return e.call(n,t,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},o2}var s2,X3;function C6(){if(X3)return s2;X3=1;var e=Qv(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var S=[],x=0;x<256;++x)S.push("%"+((x<16?"0":"")+x.toString(16)).toUpperCase());return S}(),i=function(x){for(;x.length>1;){var m=x.pop(),w=m.obj[m.prop];if(r(w)){for(var E=[],P=0;P<w.length;++P)typeof w[P]<"u"&&E.push(w[P]);m.obj[m.prop]=E}}},a=function(x,m){for(var w=m&&m.plainObjects?{__proto__:null}:{},E=0;E<x.length;++E)typeof x[E]<"u"&&(w[E]=x[E]);return w},o=function S(x,m,w){if(!m)return x;if(typeof m!="object"&&typeof m!="function"){if(r(x))x.push(m);else if(x&&typeof x=="object")(w&&(w.plainObjects||w.allowPrototypes)||!t.call(Object.prototype,m))&&(x[m]=!0);else return[x,m];return x}if(!x||typeof x!="object")return[x].concat(m);var E=x;return r(x)&&!r(m)&&(E=a(x,w)),r(x)&&r(m)?(m.forEach(function(P,R){if(t.call(x,R)){var k=x[R];k&&typeof k=="object"&&P&&typeof P=="object"?x[R]=S(k,P,w):x.push(P)}else x[R]=P}),x):Object.keys(m).reduce(function(P,R){var k=m[R];return t.call(P,R)?P[R]=S(P[R],k,w):P[R]=k,P},E)},l=function(x,m){return Object.keys(m).reduce(function(w,E){return w[E]=m[E],w},x)},u=function(S,x,m){var w=S.replace(/\+/g," ");if(m==="iso-8859-1")return w.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(w)}catch{return w}},d=1024,h=function(x,m,w,E,P){if(x.length===0)return x;var R=x;if(typeof x=="symbol"?R=Symbol.prototype.toString.call(x):typeof x!="string"&&(R=String(x)),w==="iso-8859-1")return escape(R).replace(/%u[0-9a-f]{4}/gi,function(H){return"%26%23"+parseInt(H.slice(2),16)+"%3B"});for(var k="",N=0;N<R.length;N+=d){for(var M=R.length>=d?R.slice(N,N+d):R,T=[],C=0;C<M.length;++C){var L=M.charCodeAt(C);if(L===45||L===46||L===95||L===126||L>=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||P===e.RFC1738&&(L===40||L===41)){T[T.length]=M.charAt(C);continue}if(L<128){T[T.length]=n[L];continue}if(L<2048){T[T.length]=n[192|L>>6]+n[128|L&63];continue}if(L<55296||L>=57344){T[T.length]=n[224|L>>12]+n[128|L>>6&63]+n[128|L&63];continue}C+=1,L=65536+((L&1023)<<10|M.charCodeAt(C)&1023),T[T.length]=n[240|L>>18]+n[128|L>>12&63]+n[128|L>>6&63]+n[128|L&63]}k+=T.join("")}return k},v=function(x){for(var m=[{obj:{o:x},prop:"o"}],w=[],E=0;E<m.length;++E)for(var P=m[E],R=P.obj[P.prop],k=Object.keys(R),N=0;N<k.length;++N){var M=k[N],T=R[M];typeof T=="object"&&T!==null&&w.indexOf(T)===-1&&(m.push({obj:R,prop:M}),w.push(T))}return i(m),x},p=function(x){return Object.prototype.toString.call(x)==="[object RegExp]"},f=function(x){return!x||typeof x!="object"?!1:!!(x.constructor&&x.constructor.isBuffer&&x.constructor.isBuffer(x))},b=function(x,m){return[].concat(x,m)},_=function(x,m){if(r(x)){for(var w=[],E=0;E<x.length;E+=1)w.push(m(x[E]));return w}return m(x)};return s2={arrayToObject:a,assign:l,combine:b,compact:v,decode:u,encode:h,isBuffer:f,isRegExp:p,maybeMap:_,merge:o},s2}var l2,K3;function RA(){if(K3)return l2;K3=1;var e=TA(),t=C6(),r=Qv(),n=Object.prototype.hasOwnProperty,i={brackets:function(S){return S+"[]"},comma:"comma",indices:function(S,x){return S+"["+x+"]"},repeat:function(S){return S}},a=Array.isArray,o=Array.prototype.push,l=function(_,S){o.apply(_,a(S)?S:[S])},u=Date.prototype.toISOString,d=r.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:r.formatters[d],indices:!1,serializeDate:function(S){return u.call(S)},skipNulls:!1,strictNullHandling:!1},v=function(S){return typeof S=="string"||typeof S=="number"||typeof S=="boolean"||typeof S=="symbol"||typeof S=="bigint"},p={},f=function _(S,x,m,w,E,P,R,k,N,M,T,C,L,H,G,J,se,U){for(var V=S,X=U,z=0,D=!1;(X=X.get(p))!==void 0&&!D;){var F=X.get(S);if(z+=1,typeof F<"u"){if(F===z)throw new RangeError("Cyclic object value");D=!0}typeof X.get(p)>"u"&&(z=0)}if(typeof M=="function"?V=M(x,V):V instanceof Date?V=L(V):m==="comma"&&a(V)&&(V=t.maybeMap(V,function(Se){return Se instanceof Date?L(Se):Se})),V===null){if(P)return N&&!J?N(x,h.encoder,se,"key",H):x;V=""}if(v(V)||t.isBuffer(V)){if(N){var q=J?x:N(x,h.encoder,se,"key",H);return[G(q)+"="+G(N(V,h.encoder,se,"value",H))]}return[G(x)+"="+G(String(V))]}var Q=[];if(typeof V>"u")return Q;var re;if(m==="comma"&&a(V))J&&N&&(V=t.maybeMap(V,N)),re=[{value:V.length>0?V.join(",")||null:void 0}];else if(a(M))re=M;else{var Y=Object.keys(V);re=T?Y.sort(T):Y}var ee=k?String(x).replace(/\./g,"%2E"):String(x),ae=w&&a(V)&&V.length===1?ee+"[]":ee;if(E&&a(V)&&V.length===0)return ae+"[]";for(var ue=0;ue<re.length;++ue){var ce=re[ue],pe=typeof ce=="object"&&ce&&typeof ce.value<"u"?ce.value:V[ce];if(!(R&&pe===null)){var Ae=C&&k?String(ce).replace(/\./g,"%2E"):String(ce),Ce=a(V)?typeof m=="function"?m(ae,Ae):ae:ae+(C?"."+Ae:"["+Ae+"]");U.set(S,z);var ke=e();ke.set(p,U),l(Q,_(pe,Ce,m,w,E,P,R,k,m==="comma"&&J&&a(V)?null:N,M,T,C,L,H,G,J,se,ke))}}return Q},b=function(S){if(!S)return h;if(typeof S.allowEmptyArrays<"u"&&typeof S.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof S.encodeDotInKeys<"u"&&typeof S.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(S.encoder!==null&&typeof S.encoder<"u"&&typeof S.encoder!="function")throw new TypeError("Encoder has to be a function.");var x=S.charset||h.charset;if(typeof S.charset<"u"&&S.charset!=="utf-8"&&S.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var m=r.default;if(typeof S.format<"u"){if(!n.call(r.formatters,S.format))throw new TypeError("Unknown format option provided.");m=S.format}var w=r.formatters[m],E=h.filter;(typeof S.filter=="function"||a(S.filter))&&(E=S.filter);var P;if(S.arrayFormat in i?P=S.arrayFormat:"indices"in S?P=S.indices?"indices":"repeat":P=h.arrayFormat,"commaRoundTrip"in S&&typeof S.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var R=typeof S.allowDots>"u"?S.encodeDotInKeys===!0?!0:h.allowDots:!!S.allowDots;return{addQueryPrefix:typeof S.addQueryPrefix=="boolean"?S.addQueryPrefix:h.addQueryPrefix,allowDots:R,allowEmptyArrays:typeof S.allowEmptyArrays=="boolean"?!!S.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:P,charset:x,charsetSentinel:typeof S.charsetSentinel=="boolean"?S.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!S.commaRoundTrip,delimiter:typeof S.delimiter>"u"?h.delimiter:S.delimiter,encode:typeof S.encode=="boolean"?S.encode:h.encode,encodeDotInKeys:typeof S.encodeDotInKeys=="boolean"?S.encodeDotInKeys:h.encodeDotInKeys,encoder:typeof S.encoder=="function"?S.encoder:h.encoder,encodeValuesOnly:typeof S.encodeValuesOnly=="boolean"?S.encodeValuesOnly:h.encodeValuesOnly,filter:E,format:m,formatter:w,serializeDate:typeof S.serializeDate=="function"?S.serializeDate:h.serializeDate,skipNulls:typeof S.skipNulls=="boolean"?S.skipNulls:h.skipNulls,sort:typeof S.sort=="function"?S.sort:null,strictNullHandling:typeof S.strictNullHandling=="boolean"?S.strictNullHandling:h.strictNullHandling}};return l2=function(_,S){var x=_,m=b(S),w,E;typeof m.filter=="function"?(E=m.filter,x=E("",x)):a(m.filter)&&(E=m.filter,w=E);var P=[];if(typeof x!="object"||x===null)return"";var R=i[m.arrayFormat],k=R==="comma"&&m.commaRoundTrip;w||(w=Object.keys(x)),m.sort&&w.sort(m.sort);for(var N=e(),M=0;M<w.length;++M){var T=w[M],C=x[T];m.skipNulls&&C===null||l(P,f(C,T,R,k,m.allowEmptyArrays,m.strictNullHandling,m.skipNulls,m.encodeDotInKeys,m.encode?m.encoder:null,m.filter,m.sort,m.allowDots,m.serializeDate,m.format,m.formatter,m.encodeValuesOnly,m.charset,N))}var L=P.join(m.delimiter),H=m.addQueryPrefix===!0?"?":"";return m.charsetSentinel&&(m.charset==="iso-8859-1"?H+="utf8=%26%2310003%3B&":H+="utf8=%E2%9C%93&"),L.length>0?H+L:""},l2}var u2,Z3;function MA(){if(Z3)return u2;Z3=1;var e=C6(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},i=function(p){return p.replace(/&#(\d+);/g,function(f,b){return String.fromCharCode(parseInt(b,10))})},a=function(p,f,b){if(p&&typeof p=="string"&&f.comma&&p.indexOf(",")>-1)return p.split(",");if(f.throwOnLimitExceeded&&b>=f.arrayLimit)throw new RangeError("Array limit exceeded. Only "+f.arrayLimit+" element"+(f.arrayLimit===1?"":"s")+" allowed in an array.");return p},o="utf8=%26%2310003%3B",l="utf8=%E2%9C%93",u=function(f,b){var _={__proto__:null},S=b.ignoreQueryPrefix?f.replace(/^\?/,""):f;S=S.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var x=b.parameterLimit===1/0?void 0:b.parameterLimit,m=S.split(b.delimiter,b.throwOnLimitExceeded?x+1:x);if(b.throwOnLimitExceeded&&m.length>x)throw new RangeError("Parameter limit exceeded. Only "+x+" parameter"+(x===1?"":"s")+" allowed.");var w=-1,E,P=b.charset;if(b.charsetSentinel)for(E=0;E<m.length;++E)m[E].indexOf("utf8=")===0&&(m[E]===l?P="utf-8":m[E]===o&&(P="iso-8859-1"),w=E,E=m.length);for(E=0;E<m.length;++E)if(E!==w){var R=m[E],k=R.indexOf("]="),N=k===-1?R.indexOf("="):k+1,M,T;N===-1?(M=b.decoder(R,n.decoder,P,"key"),T=b.strictNullHandling?null:""):(M=b.decoder(R.slice(0,N),n.decoder,P,"key"),T=e.maybeMap(a(R.slice(N+1),b,r(_[M])?_[M].length:0),function(L){return b.decoder(L,n.decoder,P,"value")})),T&&b.interpretNumericEntities&&P==="iso-8859-1"&&(T=i(String(T))),R.indexOf("[]=")>-1&&(T=r(T)?[T]:T);var C=t.call(_,M);C&&b.duplicates==="combine"?_[M]=e.combine(_[M],T):(!C||b.duplicates==="last")&&(_[M]=T)}return _},d=function(p,f,b,_){var S=0;if(p.length>0&&p[p.length-1]==="[]"){var x=p.slice(0,-1).join("");S=Array.isArray(f)&&f[x]?f[x].length:0}for(var m=_?f:a(f,b,S),w=p.length-1;w>=0;--w){var E,P=p[w];if(P==="[]"&&b.parseArrays)E=b.allowEmptyArrays&&(m===""||b.strictNullHandling&&m===null)?[]:e.combine([],m);else{E=b.plainObjects?{__proto__:null}:{};var R=P.charAt(0)==="["&&P.charAt(P.length-1)==="]"?P.slice(1,-1):P,k=b.decodeDotInKeys?R.replace(/%2E/g,"."):R,N=parseInt(k,10);!b.parseArrays&&k===""?E={0:m}:!isNaN(N)&&P!==k&&String(N)===k&&N>=0&&b.parseArrays&&N<=b.arrayLimit?(E=[],E[N]=m):k!=="__proto__"&&(E[k]=m)}m=E}return m},h=function(f,b,_,S){if(f){var x=_.allowDots?f.replace(/\.([^.[]+)/g,"[$1]"):f,m=/(\[[^[\]]*])/,w=/(\[[^[\]]*])/g,E=_.depth>0&&m.exec(x),P=E?x.slice(0,E.index):x,R=[];if(P){if(!_.plainObjects&&t.call(Object.prototype,P)&&!_.allowPrototypes)return;R.push(P)}for(var k=0;_.depth>0&&(E=w.exec(x))!==null&&k<_.depth;){if(k+=1,!_.plainObjects&&t.call(Object.prototype,E[1].slice(1,-1))&&!_.allowPrototypes)return;R.push(E[1])}if(E){if(_.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+_.depth+" and strictDepth is true");R.push("["+x.slice(E.index)+"]")}return d(R,b,_,S)}},v=function(f){if(!f)return n;if(typeof f.allowEmptyArrays<"u"&&typeof f.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof f.decodeDotInKeys<"u"&&typeof f.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(f.decoder!==null&&typeof f.decoder<"u"&&typeof f.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof f.charset<"u"&&f.charset!=="utf-8"&&f.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof f.throwOnLimitExceeded<"u"&&typeof f.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var b=typeof f.charset>"u"?n.charset:f.charset,_=typeof f.duplicates>"u"?n.duplicates:f.duplicates;if(_!=="combine"&&_!=="first"&&_!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var S=typeof f.allowDots>"u"?f.decodeDotInKeys===!0?!0:n.allowDots:!!f.allowDots;return{allowDots:S,allowEmptyArrays:typeof f.allowEmptyArrays=="boolean"?!!f.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof f.allowPrototypes=="boolean"?f.allowPrototypes:n.allowPrototypes,allowSparse:typeof f.allowSparse=="boolean"?f.allowSparse:n.allowSparse,arrayLimit:typeof f.arrayLimit=="number"?f.arrayLimit:n.arrayLimit,charset:b,charsetSentinel:typeof f.charsetSentinel=="boolean"?f.charsetSentinel:n.charsetSentinel,comma:typeof f.comma=="boolean"?f.comma:n.comma,decodeDotInKeys:typeof f.decodeDotInKeys=="boolean"?f.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof f.decoder=="function"?f.decoder:n.decoder,delimiter:typeof f.delimiter=="string"||e.isRegExp(f.delimiter)?f.delimiter:n.delimiter,depth:typeof f.depth=="number"||f.depth===!1?+f.depth:n.depth,duplicates:_,ignoreQueryPrefix:f.ignoreQueryPrefix===!0,interpretNumericEntities:typeof f.interpretNumericEntities=="boolean"?f.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof f.parameterLimit=="number"?f.parameterLimit:n.parameterLimit,parseArrays:f.parseArrays!==!1,plainObjects:typeof f.plainObjects=="boolean"?f.plainObjects:n.plainObjects,strictDepth:typeof f.strictDepth=="boolean"?!!f.strictDepth:n.strictDepth,strictNullHandling:typeof f.strictNullHandling=="boolean"?f.strictNullHandling:n.strictNullHandling,throwOnLimitExceeded:typeof f.throwOnLimitExceeded=="boolean"?f.throwOnLimitExceeded:!1}};return u2=function(p,f){var b=v(f);if(p===""||p===null||typeof p>"u")return b.plainObjects?{__proto__:null}:{};for(var _=typeof p=="string"?u(p,b):p,S=b.plainObjects?{__proto__:null}:{},x=Object.keys(_),m=0;m<x.length;++m){var w=x[m],E=h(w,_[w],b,typeof p=="string");S=e.merge(S,E,b)}return b.allowSparse===!0?S:e.compact(S)},u2}var c2,Q3;function IA(){if(Q3)return c2;Q3=1;var e=RA(),t=MA(),r=Qv();return c2={formats:r,parse:t,stringify:e},c2}var J3;function k6(){if(J3)return Sf;J3=1;var e=rA();function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r",`
144
- `," "],o=["{","}","|","\\","^","`"].concat(a),l=["'"].concat(o),u=["%","/","?",";","#"].concat(l),d=["/","?","#"],h=255,v=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},S=IA();function x(P,R,k){if(P&&typeof P=="object"&&P instanceof t)return P;var N=new t;return N.parse(P,R,k),N}t.prototype.parse=function(P,R,k){if(typeof P!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof P);var N=P.indexOf("?"),M=N!==-1&&N<P.indexOf("#")?"?":"#",T=P.split(M),C=/\\/g;T[0]=T[0].replace(C,"/"),P=T.join(M);var L=P;if(L=L.trim(),!k&&P.split("#").length===1){var H=i.exec(L);if(H)return this.path=L,this.href=L,this.pathname=H[1],H[2]?(this.search=H[2],R?this.query=S.parse(this.search.substr(1)):this.query=this.search.substr(1)):R&&(this.search="",this.query={}),this}var G=r.exec(L);if(G){G=G[0];var J=G.toLowerCase();this.protocol=J,L=L.substr(G.length)}if(k||G||L.match(/^\/\/[^@/]+@[^@/]+/)){var se=L.substr(0,2)==="//";se&&!(G&&b[G])&&(L=L.substr(2),this.slashes=!0)}if(!b[G]&&(se||G&&!_[G])){for(var U=-1,V=0;V<d.length;V++){var X=L.indexOf(d[V]);X!==-1&&(U===-1||X<U)&&(U=X)}var z,D;U===-1?D=L.lastIndexOf("@"):D=L.lastIndexOf("@",U),D!==-1&&(z=L.slice(0,D),L=L.slice(D+1),this.auth=decodeURIComponent(z)),U=-1;for(var V=0;V<u.length;V++){var X=L.indexOf(u[V]);X!==-1&&(U===-1||X<U)&&(U=X)}U===-1&&(U=L.length),this.host=L.slice(0,U),L=L.slice(U),this.parseHost(),this.hostname=this.hostname||"";var F=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!F)for(var q=this.hostname.split(/\./),V=0,Q=q.length;V<Q;V++){var re=q[V];if(re&&!re.match(v)){for(var Y="",ee=0,ae=re.length;ee<ae;ee++)re.charCodeAt(ee)>127?Y+="x":Y+=re[ee];if(!Y.match(v)){var ue=q.slice(0,V),ce=q.slice(V+1),pe=re.match(p);pe&&(ue.push(pe[1]),ce.unshift(pe[2])),ce.length&&(L="/"+ce.join(".")+L),this.hostname=ue.join(".");break}}}this.hostname.length>h?this.hostname="":this.hostname=this.hostname.toLowerCase(),F||(this.hostname=e.toASCII(this.hostname));var Ae=this.port?":"+this.port:"",Ce=this.hostname||"";this.host=Ce+Ae,this.href+=this.host,F&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),L[0]!=="/"&&(L="/"+L))}if(!f[J])for(var V=0,Q=l.length;V<Q;V++){var ke=l[V];if(L.indexOf(ke)!==-1){var Se=encodeURIComponent(ke);Se===ke&&(Se=escape(ke)),L=L.split(ke).join(Se)}}var le=L.indexOf("#");le!==-1&&(this.hash=L.substr(le),L=L.slice(0,le));var Ee=L.indexOf("?");if(Ee!==-1?(this.search=L.substr(Ee),this.query=L.substr(Ee+1),R&&(this.query=S.parse(this.query)),L=L.slice(0,Ee)):R&&(this.search="",this.query={}),L&&(this.pathname=L),_[J]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var Ae=this.pathname||"",xe=this.search||"";this.path=Ae+xe}return this.href=this.format(),this};function m(P){return typeof P=="string"&&(P=x(P)),P instanceof t?P.format():t.prototype.format.call(P)}t.prototype.format=function(){var P=this.auth||"";P&&(P=encodeURIComponent(P),P=P.replace(/%3A/i,":"),P+="@");var R=this.protocol||"",k=this.pathname||"",N=this.hash||"",M=!1,T="";this.host?M=P+this.host:this.hostname&&(M=P+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(M+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(T=S.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var C=this.search||T&&"?"+T||"";return R&&R.substr(-1)!==":"&&(R+=":"),this.slashes||(!R||_[R])&&M!==!1?(M="//"+(M||""),k&&k.charAt(0)!=="/"&&(k="/"+k)):M||(M=""),N&&N.charAt(0)!=="#"&&(N="#"+N),C&&C.charAt(0)!=="?"&&(C="?"+C),k=k.replace(/[?#]/g,function(L){return encodeURIComponent(L)}),C=C.replace("#","%23"),R+M+k+C+N};function w(P,R){return x(P,!1,!0).resolve(R)}t.prototype.resolve=function(P){return this.resolveObject(x(P,!1,!0)).format()};function E(P,R){return P?x(P,!1,!0).resolveObject(R):R}return t.prototype.resolveObject=function(P){if(typeof P=="string"){var R=new t;R.parse(P,!1,!0),P=R}for(var k=new t,N=Object.keys(this),M=0;M<N.length;M++){var T=N[M];k[T]=this[T]}if(k.hash=P.hash,P.href==="")return k.href=k.format(),k;if(P.slashes&&!P.protocol){for(var C=Object.keys(P),L=0;L<C.length;L++){var H=C[L];H!=="protocol"&&(k[H]=P[H])}return _[k.protocol]&&k.hostname&&!k.pathname&&(k.pathname="/",k.path=k.pathname),k.href=k.format(),k}if(P.protocol&&P.protocol!==k.protocol){if(!_[P.protocol]){for(var G=Object.keys(P),J=0;J<G.length;J++){var se=G[J];k[se]=P[se]}return k.href=k.format(),k}if(k.protocol=P.protocol,!P.host&&!b[P.protocol]){for(var Q=(P.pathname||"").split("/");Q.length&&!(P.host=Q.shift()););P.host||(P.host=""),P.hostname||(P.hostname=""),Q[0]!==""&&Q.unshift(""),Q.length<2&&Q.unshift(""),k.pathname=Q.join("/")}else k.pathname=P.pathname;if(k.search=P.search,k.query=P.query,k.host=P.host||"",k.auth=P.auth,k.hostname=P.hostname||P.host,k.port=P.port,k.pathname||k.search){var U=k.pathname||"",V=k.search||"";k.path=U+V}return k.slashes=k.slashes||P.slashes,k.href=k.format(),k}var X=k.pathname&&k.pathname.charAt(0)==="/",z=P.host||P.pathname&&P.pathname.charAt(0)==="/",D=z||X||k.host&&P.pathname,F=D,q=k.pathname&&k.pathname.split("/")||[],Q=P.pathname&&P.pathname.split("/")||[],re=k.protocol&&!_[k.protocol];if(re&&(k.hostname="",k.port=null,k.host&&(q[0]===""?q[0]=k.host:q.unshift(k.host)),k.host="",P.protocol&&(P.hostname=null,P.port=null,P.host&&(Q[0]===""?Q[0]=P.host:Q.unshift(P.host)),P.host=null),D=D&&(Q[0]===""||q[0]==="")),z)k.host=P.host||P.host===""?P.host:k.host,k.hostname=P.hostname||P.hostname===""?P.hostname:k.hostname,k.search=P.search,k.query=P.query,q=Q;else if(Q.length)q||(q=[]),q.pop(),q=q.concat(Q),k.search=P.search,k.query=P.query;else if(P.search!=null){if(re){k.host=q.shift(),k.hostname=k.host;var Y=k.host&&k.host.indexOf("@")>0?k.host.split("@"):!1;Y&&(k.auth=Y.shift(),k.hostname=Y.shift(),k.host=k.hostname)}return k.search=P.search,k.query=P.query,(k.pathname!==null||k.search!==null)&&(k.path=(k.pathname?k.pathname:"")+(k.search?k.search:"")),k.href=k.format(),k}if(!q.length)return k.pathname=null,k.search?k.path="/"+k.search:k.path=null,k.href=k.format(),k;for(var ee=q.slice(-1)[0],ae=(k.host||P.host||q.length>1)&&(ee==="."||ee==="..")||ee==="",ue=0,ce=q.length;ce>=0;ce--)ee=q[ce],ee==="."?q.splice(ce,1):ee===".."?(q.splice(ce,1),ue++):ue&&(q.splice(ce,1),ue--);if(!D&&!F)for(;ue--;ue)q.unshift("..");D&&q[0]!==""&&(!q[0]||q[0].charAt(0)!=="/")&&q.unshift(""),ae&&q.join("/").substr(-1)!=="/"&&q.push("");var pe=q[0]===""||q[0]&&q[0].charAt(0)==="/";if(re){k.hostname=pe?"":q.length?q.shift():"",k.host=k.hostname;var Y=k.host&&k.host.indexOf("@")>0?k.host.split("@"):!1;Y&&(k.auth=Y.shift(),k.hostname=Y.shift(),k.host=k.hostname)}return D=D||k.host&&q.length,D&&!pe&&q.unshift(""),q.length>0?k.pathname=q.join("/"):(k.pathname=null,k.path=null),(k.pathname!==null||k.search!==null)&&(k.path=(k.pathname?k.pathname:"")+(k.search?k.search:"")),k.auth=P.auth||k.auth,k.slashes=k.slashes||P.slashes,k.href=k.format(),k},t.prototype.parseHost=function(){var P=this.host,R=n.exec(P);R&&(R=R[0],R!==":"&&(this.port=R.substr(1)),P=P.substr(0,P.length-R.length)),P&&(this.hostname=P)},Sf.parse=x,Sf.resolve=w,Sf.resolveObject=E,Sf.format=m,Sf.Url=t,Sf}var f1={exports:{}},jA=f1.exports,eb;function FA(){return eb||(eb=1,function(e){(function(t,r){e.exports?e.exports=r():t.xmlserializer=r()})(jA,function(){var t=function(f){return f.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(f){return f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},n=function(f){return f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},i=function(f){var b=f.value;return" "+f.name+'="'+r(b)+'"'},a=function(f){var b=f.tagName;return f.namespaceURI==="http://www.w3.org/1999/xhtml"&&(b=b.toLowerCase()),b},o=function(f,b){var _=Array.prototype.map.call(f.attributes||f.attrs,function(S){return S.name}).indexOf("xmlns")>=0;return!_&&(b||f.namespaceURI!==f.parentNode.namespaceURI)?' xmlns="'+f.namespaceURI+'"':""},l=function(f){return Array.prototype.map.call(f.childNodes,function(b){return p(b)}).join("")},u=function(f,b){var _="<"+a(f);return _+=o(f,b),Array.prototype.forEach.call(f.attributes||f.attrs,function(S){_+=i(S)}),f.childNodes.length>0?(_+=">",_+=l(f),_+="</"+a(f)+">"):_+="/>",_},d=function(f){var b=f.nodeValue||f.value||"";return n(b)},h=function(f){return"<!--"+f.data.replace(/-/g,"&#45;")+"-->"},v=function(f){return"<![CDATA["+f.nodeValue+"]]>"},p=function(f,b){var _=b&&b.rootNode;if(f.nodeName==="#document"||f.nodeName==="#document-fragment")return l(f);if(f.tagName)return u(f,_);if(f.nodeName==="#text")return d(f);if(f.nodeName==="#comment")return h(f);if(f.nodeName==="#cdata-section")return v(f)};return{serializeToString:function(f){return t(p(f,{rootNode:!0}))}}})}(f1)),f1.exports}var f2={},tb;function DA(){if(tb)return f2;tb=1;var e=function(a){var o=new XMLSerializer;return Array.prototype.map.call(a.childNodes,function(l){return o.serializeToString(l)}).join("")},t=function(a){if(a.documentElement.tagName==="parsererror"&&a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return a.documentElement;if((a.documentElement.tagName==="xml"||a.documentElement.tagName==="html")&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0];if(a.documentElement.tagName==="html"&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="body"&&a.documentElement.childNodes[0].childNodes&&a.documentElement.childNodes[0].childNodes.length&&a.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0].childNodes[0]},r=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
145
- ?</div>`),new RegExp(`^(.+)
146
- `)],n=function(a){var o=e(a),l,u;for(l=0;l<r.length;l++)if(u=r[l].exec(o),u)return u[1]},i=function(a){var o;if(a===null)throw new Error("Parse error");var l=t(a);if(l!==void 0)throw o=n(l)||"Parse error",new Error(o)};return f2.failOnParseError=function(a){return i(a),a},f2}var h2={},d2={},rb;function n0(){return rb||(rb=1,function(e){var t=k6();e.getDocumentBaseUrl=function(l){return l.baseURI!=="about:blank"?l.baseURI:null},e.clone=function(l){var u={},d;for(d in l)l.hasOwnProperty(d)&&(u[d]=l[d]);return u},e.cloneArray=function(l){return Array.prototype.slice.apply(l,[0])},e.joinUrl=function(l,u){return l?t.resolve(l,u):u},e.isDataUri=function(l){return/^data:/.test(l)},e.collectAndReportErrors=function(l){var u=[];return Promise.all(l.map(function(d){return d.catch(function(h){u.push(h)})})).then(function(){return u})};var r=null,n=function(l,u){return u===!1||u==="none"||u==="repeated"?((r===null||u!=="repeated")&&(r=Date.now()),l+"?_="+r):l};e.ajax=function(l,u){return new Promise(function(d,h){var v=new window.XMLHttpRequest,p=e.joinUrl(u.baseUrl,l),f,b=function(){h({msg:"Unable to load url",url:p})};f=n(p,u.cache),v.addEventListener("load",function(){v.status===200||v.status===0?d(v.response):b()},!1),v.addEventListener("error",b,!1);try{v.open("GET",f,!0),v.overrideMimeType(u.mimeType),v.send(null)}catch{b()}})},e.binaryAjax=function(l,u){var d=e.clone(u);return d.mimeType="text/plain; charset=x-user-defined",e.ajax(l,d).then(function(h){for(var v="",p=0;p<h.length;p++)v+=String.fromCharCode(h.charCodeAt(p)&255);return v})};var i=function(l){var u=function(d,h){return d.substring(0,h.length)===h};return u(l,"<?xml")||u(l,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(l,u){return e.binaryAjax(l,u).then(function(d){var h=btoa(d),v=i(d);return"data:"+v+";base64,"+h})};var a=[],o=function(l){return a.indexOf(l)<0&&a.push(l),a.indexOf(l)};e.memoize=function(l,u,d){if(typeof d!="object")throw new Error("cacheBucket is not an object");return function(){var h=Array.prototype.slice.call(arguments),v=u(h),p=o(l),f;return d[p]&&d[p][v]?d[p][v]:(f=l.apply(null,h),d[p]=d[p]||{},d[p][v]=f,f)}}}(d2)),d2}var p2={},nb;function BA(){if(nb)return p2;nb=1;var e=n0(),t=function(a,o){var l=null;a.hasAttribute("src")?l=a.getAttribute("src"):a.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=a.getAttributeNS("http://www.w3.org/1999/xlink","href"):a.hasAttribute("href")&&(l=a.getAttribute("href"));var u=e.getDocumentBaseUrl(a.ownerDocument),d=e.clone(o);return!d.baseUrl&&u&&(d.baseUrl=u),e.getDataURIForImageURL(l,d).then(function(h){return h},function(h){throw{resourceType:"image",url:h.url,msg:"Unable to load image "+h.url}})},r=function(a){return a.filter(function(o){var l=null;return o.hasAttribute("src")?l=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?l=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(l=o.getAttribute("href")),l!==null&&!e.isDataUri(l)})},n=function(a){return Array.prototype.filter.call(a,function(o){return o.type==="image"})},i=function(a){return Array.prototype.slice.call(a)};return p2.inline=function(a,o){var l=i(a.getElementsByTagName("img")),u=i(a.getElementsByTagName("image")),d=n(a.getElementsByTagName("input"));l=l.concat(u),l=l.concat(d);var h=r(l);return e.collectAndReportErrors(h.map(function(v){return t(v,o).then(function(p){v.attributes.src?v.attributes.src.value=p:v.attributes["xlink:href"]?v.attributes["xlink:href"].value=p:v.attributes.href&&(v.attributes.href.value=p)})}))},p2}var g2={},ib;function zA(){if(ib)return g2;ib=1;var e=n0(),t=function(a,o){var l=a.attributes.src.value,u=e.getDocumentBaseUrl(a.ownerDocument),d=e.clone(o);return!d.baseUrl&&u&&(d.baseUrl=u),e.ajax(l,d).catch(function(h){throw{resourceType:"script",url:h.url,msg:"Unable to load script "+h.url}})},r=function(a){return a.replace(/<\//g,"<\\/")},n=function(a,o){a.attributes.removeNamedItem("src"),a.textContent=r(o)},i=function(a){var o=a.getElementsByTagName("script");return Array.prototype.filter.call(o,function(l){return!!l.attributes.src})};return g2.inline=function(a,o){var l=i(a);return e.collectAndReportErrors(l.map(function(u){return t(u,o).then(function(d){n(u,d)})}))},g2}var v2={},m2={},ab;function Jv(){return ab||(ab=1,function(e){e.unquoteString=function(t){var r=/^"(.*)"$/,n=/^'(.*)'$/;return r.test(t)?t.replace(r,"$1"):n.test(t)?t.replace(n,"$1"):t},e.rulesForCssText=function(t){var r=document.implementation.createHTMLDocument(""),n=document.createElement("style"),i;return n.textContent=t,r.body.appendChild(n),i=n.sheet.cssRules,Array.prototype.slice.call(i)},e.cssRulesToText=function(t){return t.reduce(function(r,n){return r+n.cssText},"")},e.exchangeRule=function(t,r,n){var i=t.indexOf(r);t[i]=e.rulesForCssText(n)[0]},e.changeFontFaceRuleSrc=function(t,r,n){var i="@font-face { font-family: "+r.style.getPropertyValue("font-family")+"; ";r.style.getPropertyValue("font-style")&&(i+="font-style: "+r.style.getPropertyValue("font-style")+"; "),r.style.getPropertyValue("font-weight")&&(i+="font-weight: "+r.style.getPropertyValue("font-weight")+"; "),r.style.getPropertyValue("unicode-range")&&(i+="unicode-range: "+r.style.getPropertyValue("unicode-range")+"; "),i+="src: "+n+"}",e.exchangeRule(t,r,i)}}(m2)),m2}var y2={},ob;function qA(){return ob||(ob=1,function(e){var t=Jv(),r=function(a){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return a.replace(o,"$1")};e.extractCssUrl=function(a){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,l;if(!o.test(a))throw new Error("Invalid url");return l=o.exec(a)[1],t.unquoteString(r(l))};var n=function(a){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,l="(url\\("+o+"\\)|[^,\\s]+)",u="(?:\\s*"+l+")+",d="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",h=new RegExp(u,"g"),v,p=[],f=function(b){var _=new RegExp(l,"g"),S=[],x;for(x=_.exec(b);x;)S.push(x[1]),x=_.exec(b);return S};if(a.match(new RegExp(d))){for(v=h.exec(a);v;)p.push(f(v[0])),v=h.exec(a);return p}return[]},i=function(a){var o,l;for(o=0;o<a.length;o++)try{return l=e.extractCssUrl(a[o]),{url:l,idx:o}}catch{}};e.parse=function(a){var o=n(a);return o.map(function(l){var u=i(l);return u?{preUrl:l.slice(0,u.idx),url:u.url,postUrl:l.slice(u.idx+1)}:{preUrl:l}})},e.serialize=function(a){var o=a.map(function(l){var u=[].concat(l.preUrl);return l.url&&u.push('url("'+l.url+'")'),l.postUrl&&(u=u.concat(l.postUrl)),u.join(" ")});return o.join(", ")}}(y2)),y2}function Zp(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var b2={exports:{}},sb;function UA(){return sb||(sb=1,function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,a){function o(d,h){if(!i[d]){if(!n[d]){var v=typeof Zp=="function"&&Zp;if(!h&&v)return v(d,!0);if(l)return l(d,!0);var p=new Error("Cannot find module '"+d+"'");throw p.code="MODULE_NOT_FOUND",p}var f=i[d]={exports:{}};n[d][0].call(f.exports,function(b){var _=n[d][1][b];return o(_||b)},f,f.exports,r,n,i,a)}return i[d].exports}for(var l=typeof Zp=="function"&&Zp,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,d){function h(){this.constructor=u}h.prototype=d.prototype,u.prototype=new h}function o(u,d,h,v){this.message=u,this.expected=d,this.found=h,this.location=v,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,d){var h={literal:function(x){return'"'+p(x.text)+'"'},class:function(x){var m="",w;for(w=0;w<x.parts.length;w++)m+=x.parts[w]instanceof Array?f(x.parts[w][0])+"-"+f(x.parts[w][1]):f(x.parts[w]);return"["+(x.inverted?"^":"")+m+"]"},any:function(x){return"any character"},end:function(x){return"end of input"},other:function(x){return x.description}};function v(x){return x.charCodeAt(0).toString(16).toUpperCase()}function p(x){return x.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(m){return"\\x0"+v(m)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(m){return"\\x"+v(m)})}function f(x){return x.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(m){return"\\x0"+v(m)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(m){return"\\x"+v(m)})}function b(x){return h[x.type](x)}function _(x){var m=new Array(x.length),w,E;for(w=0;w<x.length;w++)m[w]=b(x[w]);if(m.sort(),m.length>0){for(w=1,E=1;w<m.length;w++)m[w-1]!==m[w]&&(m[E]=m[w],E++);m.length=E}switch(m.length){case 1:return m[0];case 2:return m[0]+" or "+m[1];default:return m.slice(0,-1).join(", ")+", or "+m[m.length-1]}}function S(x){return x?'"'+p(x)+'"':"end of input"}return"Expected "+_(u)+" but "+S(d)+" found."};function l(u,d){d=d!==void 0?d:{};var h={},v={start:Ae},p=Ae,f="",b=function(){return[]},_=",",S=re(",",!1),x=function(ge,Re){return[ge].concat(Re)},m=function(ge){return[ge]},w=function(ge,Re){return{url:ge,format:Re}},E=function(ge){return{url:ge}},P="url(",R=re("url(",!1),k=")",N=re(")",!1),M=function(ge){return ge},T="format(",C=re("format(",!1),L="local(",H=re("local(",!1),G=function(ge){return{local:ge}},J=/^[^)]/,se=Y([")"],!0,!1),U=function(ge){return Te.extractValue(ge.join(""))},V=/^[ \t\r\n\f]/,X=Y([" "," ","\r",`
147
- `,"\f"],!1,!1),z=0,D=[{line:1,column:1}],F=0,q=[],Q;if("startRule"in d){if(!(d.startRule in v))throw new Error(`Can't start parsing from rule "`+d.startRule+'".');p=v[d.startRule]}function re(ge,Re){return{type:"literal",text:ge,ignoreCase:Re}}function Y(ge,Re,Be){return{type:"class",parts:ge,inverted:Re,ignoreCase:Be}}function ee(){return{type:"end"}}function ae(ge){var Re=D[ge],Be;if(Re)return Re;for(Be=ge-1;!D[Be];)Be--;for(Re=D[Be],Re={line:Re.line,column:Re.column};Be<ge;)u.charCodeAt(Be)===10?(Re.line++,Re.column=1):Re.column++,Be++;return D[ge]=Re,Re}function ue(ge,Re){var Be=ae(ge),Qe=ae(Re);return{start:{offset:ge,line:Be.line,column:Be.column},end:{offset:Re,line:Qe.line,column:Qe.column}}}function ce(ge){z<F||(z>F&&(F=z,q=[]),q.push(ge))}function pe(ge,Re,Be){return new o(o.buildMessage(ge,Re),ge,Re,Be)}function Ae(){var ge,Re;return ge=Ce(),ge===h&&(ge=z,Re=f,Re!==h&&(Re=b()),ge=Re),ge}function Ce(){var ge,Re,Be,Qe,ct,mt;if(ge=z,Re=ke(),Re!==h){for(Be=[],Qe=Ne();Qe!==h;)Be.push(Qe),Qe=Ne();if(Be!==h)if(u.charCodeAt(z)===44?(Qe=_,z++):(Qe=h,ce(S)),Qe!==h){for(ct=[],mt=Ne();mt!==h;)ct.push(mt),mt=Ne();ct!==h?(mt=Ce(),mt!==h?(Re=x(Re,mt),ge=Re):(z=ge,ge=h)):(z=ge,ge=h)}else z=ge,ge=h;else z=ge,ge=h}else z=ge,ge=h;return ge===h&&(ge=z,Re=ke(),Re!==h&&(Re=m(Re)),ge=Re),ge}function ke(){var ge;return ge=Se(),ge===h&&(ge=xe()),ge}function Se(){var ge,Re,Be,Qe;if(ge=z,Re=le(),Re!==h){if(Be=[],Qe=Ne(),Qe!==h)for(;Qe!==h;)Be.push(Qe),Qe=Ne();else Be=h;Be!==h?(Qe=Ee(),Qe!==h?(Re=w(Re,Qe),ge=Re):(z=ge,ge=h)):(z=ge,ge=h)}else z=ge,ge=h;return ge===h&&(ge=z,Re=le(),Re!==h&&(Re=E(Re)),ge=Re),ge}function le(){var ge,Re,Be,Qe;return ge=z,u.substr(z,4)===P?(Re=P,z+=4):(Re=h,ce(R)),Re!==h?(Be=ye(),Be!==h?(u.charCodeAt(z)===41?(Qe=k,z++):(Qe=h,ce(N)),Qe!==h?(Re=M(Be),ge=Re):(z=ge,ge=h)):(z=ge,ge=h)):(z=ge,ge=h),ge}function Ee(){var ge,Re,Be,Qe;return ge=z,u.substr(z,7)===T?(Re=T,z+=7):(Re=h,ce(C)),Re!==h?(Be=ye(),Be!==h?(u.charCodeAt(z)===41?(Qe=k,z++):(Qe=h,ce(N)),Qe!==h?(Re=M(Be),ge=Re):(z=ge,ge=h)):(z=ge,ge=h)):(z=ge,ge=h),ge}function xe(){var ge,Re,Be,Qe;return ge=z,u.substr(z,6)===L?(Re=L,z+=6):(Re=h,ce(H)),Re!==h?(Be=ye(),Be!==h?(u.charCodeAt(z)===41?(Qe=k,z++):(Qe=h,ce(N)),Qe!==h?(Re=G(Be),ge=Re):(z=ge,ge=h)):(z=ge,ge=h)):(z=ge,ge=h),ge}function ye(){var ge,Re,Be;if(ge=z,Re=[],J.test(u.charAt(z))?(Be=u.charAt(z),z++):(Be=h,ce(se)),Be!==h)for(;Be!==h;)Re.push(Be),J.test(u.charAt(z))?(Be=u.charAt(z),z++):(Be=h,ce(se));else Re=h;return Re!==h&&(Re=U(Re)),ge=Re,ge}function Ne(){var ge;return V.test(u.charAt(z))?(ge=u.charAt(z),z++):(ge=h,ce(X)),ge}var Te=r("../util");if(Q=p(),Q!==h&&z===u.length)return Q;throw Q!==h&&z<u.length&&ce(ee()),pe(q,F<u.length?u.charAt(F):null,F<u.length?ue(F,F+1):ue(F,F))}n.exports={SyntaxError:o,parse:l}},{"../util":3}],2:[function(r,n,i){var a=r("./grammar");i.SyntaxError=function(o,l){this.message=o,this.offset=l},i.parse=function(o){try{return a.parse(o)}catch(l){throw new i.SyntaxError(l.message,l.offset)}},i.serialize=function(o){return o.map(function(l){var u;return l.url?(u='url("'+l.url+'")',l.format&&(u+=' format("'+l.format+'")')):u='local("'+l.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(r,n,i){var a=function(l){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return l.replace(u,"$1")},o=function(l){var u=/^"(.*)"$/,d=/^'(.*)'$/;return u.test(l)?l.replace(u,"$1"):d.test(l)?l.replace(d,"$1"):l};i.extractValue=function(l){return o(a(l))}},{}]},{},[2])(2)})}(b2)),b2.exports}var lb;function HA(){return lb||(lb=1,function(e){var t=n0(),r=Jv(),n=qA(),i=UA(),a=function(m,w,E){m.style.setProperty(w,E,m.style.getPropertyPriority(w))},o=function(m){return m.filter(function(w){return w.type===window.CSSRule.STYLE_RULE&&(w.style.getPropertyValue("background-image")||w.style.getPropertyValue("background"))})},l=function(m){var w=[];return m.forEach(function(E){E.style.getPropertyValue("background-image")?w.push({property:"background-image",value:E.style.getPropertyValue("background-image"),rule:E}):E.style.getPropertyValue("background")&&w.push({property:"background",value:E.style.getPropertyValue("background"),rule:E})}),w},u=function(m){return m.filter(function(w){return w.type===window.CSSRule.FONT_FACE_RULE&&w.style.getPropertyValue("src")})},d=function(m){return m.filter(function(w){return w.type===window.CSSRule.IMPORT_RULE&&w.href})},h=function(m){var w=[];return m.forEach(function(E,P){E.url&&!t.isDataUri(E.url)&&w.push(P)}),w},v=function(m){var w=[];return m.forEach(function(E,P){E.url&&!t.isDataUri(E.url)&&w.push(P)}),w};e.adjustPathsOfCssResources=function(m,w){var E=o(w),P=l(E),R=!1;return P.forEach(function(k){var N=n.parse(k.value),M=h(N),T;M.length>0&&(M.forEach(function(C){var L=N[C].url,H=t.joinUrl(m,L);N[C].url=H}),T=n.serialize(N),a(k.rule,k.property,T),R=!0)}),u(w).forEach(function(k){var N=k.style.getPropertyValue("src"),M,T;try{M=i.parse(N)}catch{return}T=v(M),T.length>0&&(T.forEach(function(C){var L=M[C].url,H=t.joinUrl(m,L);M[C].url=H}),r.changeFontFaceRuleSrc(w,k,i.serialize(M)),R=!0)}),d(w).forEach(function(k){var N=k.href,M=t.joinUrl(m,N);r.exchangeRule(w,k,"@import url("+M+");"),R=!0}),R};var p=function(m,w,E){var P=m.indexOf(w);m.splice(P,1),E.forEach(function(R,k){m.splice(P+k,0,R)})},f=function(m,w,E,P){var R=w.href,k;return R=r.unquoteString(R),k=t.joinUrl(P.baseUrl,R),E.indexOf(k)>=0?(p(m,w,[]),Promise.resolve([])):(E.push(k),t.ajax(R,P).then(function(N){var M=r.rulesForCssText(N);return e.loadCSSImportsForRules(M,E,P).then(function(T){return e.adjustPathsOfCssResources(R,M),p(m,w,M),T.errors})},function(N){throw{resourceType:"stylesheet",url:N.url,msg:"Unable to load stylesheet "+N.url}}))};e.loadCSSImportsForRules=function(m,w,E){var P=d(m),R=[],k=!1;return Promise.all(P.map(function(N){return f(m,N,w,E).then(function(M){R=R.concat(M),k=!0},function(M){R.push(M)})})).then(function(){return{hasChanges:k,errors:R}})};var b=function(m,w){var E=n.parse(m),P=h(E),R=!1;return t.collectAndReportErrors(P.map(function(k){var N=E[k].url;return t.getDataURIForImageURL(N,w).then(function(M){E[k].url=M,R=!0},function(M){throw{resourceType:"backgroundImage",url:M.url,msg:"Unable to load background-image "+M.url}})})).then(function(k){return{backgroundValue:n.serialize(E),hasChanges:R,errors:k}})},_=function(m,w){var E=o(m),P=l(E),R=[],k=!1;return Promise.all(P.map(function(N){return b(N.value,w).then(function(M){M.hasChanges&&(a(N.rule,N.property,M.backgroundValue),k=!0),R=R.concat(M.errors)})})).then(function(){return{hasChanges:k,errors:R}})},S=function(m,w){var E=!1,P,R;try{P=i.parse(m)}catch{P=[]}return R=v(P),t.collectAndReportErrors(R.map(function(k){var N=P[k],M=N.format||"woff";return t.binaryAjax(N.url,w).then(function(T){var C=btoa(T);N.url="data:font/"+M+";base64,"+C,E=!0},function(T){throw{resourceType:"fontFace",url:T.url,msg:"Unable to load font-face "+T.url}})})).then(function(k){return{srcDeclarationValue:i.serialize(P),hasChanges:E,errors:k}})},x=function(m,w){var E=u(m),P=[],R=!1;return Promise.all(E.map(function(k){var N=k.style.getPropertyValue("src");return S(N,w).then(function(M){M.hasChanges&&(r.changeFontFaceRuleSrc(m,k,M.srcDeclarationValue),R=!0),P=P.concat(M.errors)})})).then(function(){return{hasChanges:R,errors:P}})};e.loadAndInlineCSSResourcesForRules=function(m,w){var E=!1,P=[];return Promise.all([_,x].map(function(R){return R(m,w).then(function(k){E=E||k.hasChanges,P=P.concat(k.errors)})})).then(function(){return{hasChanges:E,errors:P}})}}(v2)),v2}var ub;function VA(){return ub||(ub=1,function(e){var t=n0(),r=BA(),n=zA(),i=HA(),a=Jv(),o=function(S){return t.joinUrl(S,".")},l=function(S){var x=S.map(function(m,w){return w===S.length-1&&(m={baseUrl:o(m.baseUrl)}),JSON.stringify(m)});return x},u=function(S,x){return x.cache!==!1&&x.cache!=="none"&&x.cacheBucket?t.memoize(S,l,x.cacheBucket):S},d=function(S,x,m){var w=a.rulesForCssText(S);return i.loadCSSImportsForRules(w,x,m).then(function(E){return i.loadAndInlineCSSResourcesForRules(w,m).then(function(P){var R=E.errors.concat(P.errors),k=E.hasChanges||P.hasChanges;return k&&(S=a.cssRulesToText(w)),{hasChanges:k,content:S,errors:R}})})},h=function(S,x,m){var w=S.textContent,E=u(d,x);return E(w,m,x).then(function(P){return P.hasChanges&&(S.childNodes[0].nodeValue=P.content),t.cloneArray(P.errors)})},v=function(S){var x=S.getElementsByTagName("style");return Array.prototype.filter.call(x,function(m){return!m.attributes.type||m.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(S,x){var m=v(S),w=[],E=[],P;return P=t.clone(x),P.baseUrl=P.baseUrl||t.getDocumentBaseUrl(S),Promise.all(m.map(function(R){return h(R,P,E).then(function(k){w=w.concat(k)})})).then(function(){return w})};var p=function(S,x){var m=S.parentNode,w;x=x.trim(),x&&(w=S.ownerDocument.createElement("style"),w.type="text/css",w.appendChild(S.ownerDocument.createTextNode(x)),m.insertBefore(w,S)),m.removeChild(S)},f=function(S,x){return t.ajax(S,x).then(function(m){var w=a.rulesForCssText(m);return{content:m,cssRules:w}}).then(function(m){var w=i.adjustPathsOfCssResources(S,m.cssRules);return{content:m.content,cssRules:m.cssRules,hasChanges:w}}).then(function(m){return i.loadCSSImportsForRules(m.cssRules,[],x).then(function(w){return{content:m.content,cssRules:m.cssRules,hasChanges:m.hasChanges||w.hasChanges,errors:w.errors}})}).then(function(m){return i.loadAndInlineCSSResourcesForRules(m.cssRules,x).then(function(w){return{content:m.content,cssRules:m.cssRules,hasChanges:m.hasChanges||w.hasChanges,errors:m.errors.concat(w.errors)}})}).then(function(m){var w=m.content;return m.hasChanges&&(w=a.cssRulesToText(m.cssRules)),{content:w,errors:m.errors}})},b=function(S,x){var m=S.attributes.href.value,w=t.getDocumentBaseUrl(S.ownerDocument),E=t.clone(x);!E.baseUrl&&w&&(E.baseUrl=w);var P=u(f,x);return P(m,E).then(function(R){return{content:R.content,errors:t.cloneArray(R.errors)}})},_=function(S){var x=S.getElementsByTagName("link");return Array.prototype.filter.call(x,function(m){return m.attributes.rel&&m.attributes.rel.value==="stylesheet"&&(!m.attributes.type||m.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(S,x){var m=_(S),w=[];return Promise.all(m.map(function(E){return b(E,x).then(function(P){p(E,P.content+`
148
- `),w=w.concat(P.errors)},function(P){w.push({resourceType:"stylesheet",url:P.url,msg:"Unable to load stylesheet "+P.url})})})).then(function(){return w})},e.loadAndInlineImages=r.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(S,x){var m=[],w=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return x.inlineScripts!==!1&&w.push(e.loadAndInlineScript),Promise.all(w.map(function(E){return E(S,x).then(function(P){m=m.concat(P)})})).then(function(){return m})}}(h2)),h2}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
149
- * http://www.github.com/cburgmer/rasterizeHTML.js
150
- * Copyright (c) 2022 Christoph Burgmer; Licensed MIT */var GA=c1.exports,cb;function $A(){return cb||(cb=1,function(e){(function(t,r){t===void 0&&window!==void 0&&(t=window),e.exports?e.exports=r(k6(),FA(),DA(),VA()):t.rasterizeHTML=r(t.url,t.xmlserializer,t.sanedomparsererror,t.inlineresources)})(GA,function(t,r,n,i){var a=function(b){var _={},S=[];_.joinUrl=function(w,E){return w?b.resolve(w,E):E},_.getConstantUniqueIdFor=function(w){return S.indexOf(w)<0&&S.push(w),S.indexOf(w)},_.clone=function(w){var E={},P;for(P in w)w.hasOwnProperty(P)&&(E[P]=w[P]);return E};var x=function(w){return typeof w=="object"&&w!==null},m=function(w){return x(w)&&Object.prototype.toString.apply(w).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return _.parseOptionalParameters=function(w){var E={canvas:null,options:{}};return w[0]==null||m(w[0])?(E.canvas=w[0]||null,E.options=_.clone(w[1])):E.options=_.clone(w[0]),E},_}(t),o=function(b){var _={},S=function(x,m,w){var E=x[m];return x[m]=function(){var P=Array.prototype.slice.call(arguments);return w.apply(this,[P,E])},E};return _.baseUrlRespectingXhr=function(x,m){var w=function(){var E=new x;return S(E,"open",function(P,R){var k=P.shift(),N=P.shift(),M=b.joinUrl(m,N);return R.apply(this,[k,M].concat(P))}),E};return w},_.finishNotifyingXhr=function(x){var m=0,w=0,E=!1,P,R=new Promise(function(N){P=function(){var M=m-w;M<=0&&E&&N({totalCount:m})}}),k=function(){var N=new x;return S(N,"send",function(M,T){return m+=1,T.apply(this,arguments)}),N.addEventListener("load",function(){w+=1,P()}),N};return k.waitForRequestsToFinish=function(){return E=!0,P(),R},k},_}(a),l=function(){var b={},_=function(k){return Array.prototype.slice.call(k)};b.addClassName=function(k,N){k.className+=" "+N},b.addClassNameRecursively=function(k,N){b.addClassName(k,N),k.parentNode!==k.ownerDocument&&b.addClassNameRecursively(k.parentNode,N)};var S=function(k,N){var M=k.parentStyleSheet,T=_(M.cssRules).indexOf(k);M.insertRule(N,T+1),M.deleteRule(T)},x=function(k,N){var M=k.cssText.replace(/^[^\{]+/,""),T=N+" "+M;S(k,T)},m=function(k){return _(k).reduce(function(N,M){return N+M.cssText},"")},w=function(k){k.textContent=m(k.sheet.cssRules)},E=function(k){var N=document.implementation.createHTMLDocument(""),M=document.createElement("style");M.textContent=k.textContent,N.body.appendChild(M),k.sheet=M.sheet},P=function(k){return"((?:^|[^.#:\\w])|(?=\\W))("+k.join("|")+")(?=\\W|$)"},R=function(k,N,M){var T=P(N);_(k.querySelectorAll("style")).forEach(function(C){typeof C.sheet>"u"&&E(C);var L=_(C.sheet.cssRules).filter(function(H){return H.selectorText&&new RegExp(T,"i").test(H.selectorText)});L.length&&(L.forEach(function(H){var G=H.selectorText.replace(new RegExp(T,"gi"),function(J,se,U){return se+M(U)});G!==H.selectorText&&x(H,G)}),w(C))})};return b.rewriteCssSelectorWith=function(k,N,M){R(k,[N],function(){return M})},b.lowercaseCssTypeSelectors=function(k,N){R(k,N,function(M){return M.toLowerCase()})},b.findHtmlOnlyNodeNames=function(k){var N=k.ownerDocument.createTreeWalker(k,NodeFilter.SHOW_ELEMENT),M={},T={},C;do C=N.currentNode.tagName.toLowerCase(),N.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?M[C]=!0:T[C]=!0;while(N.nextNode());return Object.keys(M).filter(function(L){return!T[L]})},b}(),u=function(b){var _={},S=function(m){return Array.prototype.slice.call(m)},x={active:!0,hover:!0,focus:!1,target:!1};return _.fakeUserAction=function(m,w,E){var P=m.querySelector(w),R=":"+E,k="rasterizehtml"+E;P&&(x[E]?b.addClassNameRecursively(P,k):b.addClassName(P,k),b.rewriteCssSelectorWith(m,R,"."+k))},_.persistInputValues=function(m){var w=m.querySelectorAll("input"),E=m.querySelectorAll("textarea"),P=function(R){return R.type==="checkbox"||R.type==="radio"};S(w).filter(P).forEach(function(R){R.checked?R.setAttribute("checked",""):R.removeAttribute("checked")}),S(w).filter(function(R){return!P(R)}).forEach(function(R){R.setAttribute("value",R.value)}),S(E).forEach(function(R){R.textContent=R.value})},_.rewriteTagNameSelectorsToLowerCase=function(m){b.lowercaseCssTypeSelectors(m,b.findHtmlOnlyNodeNames(m))},_}(l),d=function(b,_,S,x){var m={},w=function(U,V,X,z){var D=U.createElement(V);return D.style.visibility="hidden",D.style.width=X+"px",D.style.height=z+"px",D.style.position="absolute",D.style.top=-1e4-z+"px",D.style.left=-1e4-X+"px",U.getElementsByTagName("body")[0].appendChild(D),D},E=function(U){return U>0?new Promise(function(V){setTimeout(V,U)}):Promise.resolve()};m.executeJavascript=function(U,V){return new Promise(function(X){var z=w(x.document,"iframe",V.width,V.height),D=U.outerHTML,F=[],q=V.executeJsTimeout||0,Q=function(){x.document.getElementsByTagName("body")[0].removeChild(z)},re=function(){var ue=z.contentDocument;X({document:ue,errors:F,cleanUp:Q})},Y=z.contentWindow.XMLHttpRequest,ee=_.finishNotifyingXhr(Y),ae=_.baseUrlRespectingXhr(ee,V.baseUrl);z.onload=function(){E(q).then(ee.waitForRequestsToFinish).then(re)},z.contentDocument.open(),z.contentWindow.XMLHttpRequest=ae,z.contentWindow.onerror=function(ue){F.push({resourceType:"scriptExecution",msg:ue})},z.contentDocument.write("<!DOCTYPE html>"),z.contentDocument.write(D),z.contentDocument.close()})};var P=function(U,V,X){var z=U.createElement("iframe");return z.style.width=V+"px",z.style.height=X+"px",z.style.visibility="hidden",z.style.position="absolute",z.style.top=-1e4-X+"px",z.style.left=-1e4-V+"px",z.style.borderWidth=0,z.sandbox="allow-same-origin",z.scrolling="no",z},R=function(U,V,X){var z=Math.floor(U/X),D=Math.floor(V/X);return P(x.document,z,D)},k=function(U,V,X,z){return{width:Math.max(U.width*z,V),height:Math.max(U.height*z,X)}},N=function(U,V){var X=U.querySelector(V);if(X)return X;if(U.ownerDocument.querySelector(V)===U)return U;throw{message:"Clipping selector not found"}},M=function(U,V,X,z,D){var F=Math.max(U.scrollWidth,U.clientWidth),q=Math.max(U.scrollHeight,U.clientHeight),Q,re,Y,ee,ae,ue,ce,pe;return V?(ue=N(U,V),ce=ue.getBoundingClientRect(),Q=ce.top,re=ce.left,Y=ce.width,ee=ce.height):(Q=0,re=0,Y=F,ee=q),pe=k({width:Y,height:ee},X,z,D),ae=x.getComputedStyle(U.ownerDocument.documentElement).fontSize,{left:re,top:Q,width:pe.width,height:pe.height,viewportWidth:F,viewportHeight:q,rootFontSize:ae}},T=function(U,V){var X=U.tagName;return V.querySelector(X)},C=function(U){var V=U.tagName.toLowerCase();return V==="html"||V==="body"?U.outerHTML:'<body style="margin: 0;">'+U.outerHTML+"</body>"};m.calculateDocumentContentSize=function(U,V){return new Promise(function(X,z){var D=V.zoom||1,F;F=R(V.width,V.height,D),x.document.getElementsByTagName("body")[0].appendChild(F),F.onload=function(){var q=F.contentDocument,Q;try{Q=M(T(U,q),V.clip,V.width,V.height,D),X(Q)}catch(re){z(re)}finally{x.document.getElementsByTagName("body")[0].removeChild(F)}},F.contentDocument.open(),F.contentDocument.write("<!DOCTYPE html>"),F.contentDocument.write(C(U)),F.contentDocument.close()})},m.parseHtmlFragment=function(U){var V=x.document.implementation.createHTMLDocument("");V.documentElement.innerHTML=U;var X=V.querySelector("body").firstChild;if(!X)throw"Invalid source";return X};var L=function(U,V){var X=/<html((?:\s+[^>]*)?)>/im.exec(V),z=x.document.implementation.createHTMLDocument(""),D,F,q,Q;if(X)for(D="<div"+X[1]+"></div>",z.documentElement.innerHTML=D,q=z.querySelector("div"),F=0;F<q.attributes.length;F++)Q=q.attributes[F],U.documentElement.setAttribute(Q.name,Q.value)};m.parseHTML=function(U){var V=x.document.implementation.createHTMLDocument("");return V.documentElement.innerHTML=U,L(V,U),V};var H=function(U){try{return S.failOnParseError(U)}catch(V){throw{message:"Invalid source",originalError:V}}};m.validateXHTML=function(U){var V=new DOMParser,X=V.parseFromString(U,"application/xml");H(X)};var G=null,J=function(U,V){return V==="none"||V==="repeated"?((G===null||V!=="repeated")&&(G=Date.now()),U+"?_="+G):U},se=function(U,V){return new Promise(function(X,z){var D=new window.XMLHttpRequest,F=b.joinUrl(V.baseUrl,U),q=J(F,V.cache),Q=function(re){z({message:"Unable to load page",originalError:re})};D.addEventListener("load",function(){D.status===200||D.status===0?X(D.responseXML):Q(D.statusText)},!1),D.addEventListener("error",function(re){Q(re)},!1);try{D.open("GET",q,!0),D.responseType="document",D.send(null)}catch(re){Q(re)}})};return m.loadDocument=function(U,V){return se(U,V).then(function(X){return H(X)})},m}(a,o,n,window),h=function(b){var _={},S=function(T,C){return C?URL.createObjectURL(new Blob([T],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(T)},x=function(T){T instanceof Blob&&URL.revokeObjectURL(T)},m='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',w=function(T){return new Promise(function(C,L){var H=document.createElement("canvas"),G=new Image;G.onload=function(){var J=H.getContext("2d");try{J.drawImage(G,0,0),H.toDataURL("image/png"),C(!0)}catch{C(!1)}},G.onerror=L,G.src=T})},E=function(){var T=S(m,!0);return w(T).then(function(C){return x(T),C?!1:w(S(m,!1)).then(function(L){return L})},function(){return!1})},P=function(){if(b.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},R=function(){return new Promise(function(T,C){P()&&b.URL?E().then(function(L){T(!L)},function(){C()}):T(!1)})},k,N=function(){return k===void 0&&(k=R()),k},M=function(T){return N().then(function(C){return S(T,C)})};return _.renderSvg=function(T){return new Promise(function(C,L){var H,G,J=function(){G.onload=null,G.onerror=null},se=function(){H&&x(H)};G=new Image,G.onload=function(){J(),se(),C(G)},G.onerror=function(){se(),L()},M(T).then(function(U){H=U,G.src=H},L)})},_}(window),v=function(b,_,S,x){var m={},w=function(T,C){var L=C||1,H={width:T.width,height:T.height,"font-size":T.rootFontSize};return L!==1&&(H.style="transform:scale("+L+"); transform-origin: 0 0;"),H},E=function(T){var C,L,H,G;C=Math.round(T.viewportWidth),L=Math.round(T.viewportHeight),H=-T.left,G=-T.top;var J={x:H,y:G,width:C,height:L};return J},P=function(T){var C=T.style||"";T.style=C+"float: left;"},R=function(T){T.externalResourcesRequired=!0},k=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},N=function(T){var C=Object.keys(T);return C.length?" "+C.map(function(L){return L+'="'+T[L]+'"'}).join(" "):""},M=function(T,C,L){var H=x.serializeToString(T);_.validateXHTML(H);var G=E(C);return P(G),R(G),'<svg xmlns="http://www.w3.org/2000/svg"'+N(w(C,L))+">"+k()+"<foreignObject"+N(G)+">"+H+"</foreignObject></svg>"};return m.getSvgForDocument=function(T,C,L){return S.rewriteTagNameSelectorsToLowerCase(T),M(T,C,L)},m.drawDocumentAsSvg=function(T,C){return["hover","active","focus","target"].forEach(function(L){C[L]&&S.fakeUserAction(T,C[L],L)}),_.calculateDocumentContentSize(T,C).then(function(L){return m.getSvgForDocument(T,L,C.zoom)})},m}(a,d,u,r),p=function(b,_,S,x,m,w){var E={},P=function(T){return{message:"Error rendering page",originalError:T}},R=function(T){return m.renderSvg(T).then(function(C){return{image:C,svg:T}},function(C){throw P(C)})},k=function(T,C){try{C.getContext("2d").drawImage(T,0,0)}catch(L){throw P(L)}},N=function(T,C,L){return x.drawDocumentAsSvg(T,L).then(R).then(function(H){return C&&k(H.image,C),H})},M=function(T,C){return _.executeJavascript(T,C).then(function(L){var H=L.document;return S.persistInputValues(H),{document:H,errors:L.errors,cleanUp:L.cleanUp}})};return E.rasterize=function(T,C,L){var H;return H=b.clone(L),H.inlineScripts=L.executeJs===!0,w.inlineReferences(T,H).then(function(G){return L.executeJs?M(T,L).then(function(J){return{element:J.document.documentElement,errors:G.concat(J.errors),cleanUp:J.cleanUp}}):{element:T,errors:G,cleanUp:function(){}}}).then(function(G){return N(G.element,C,L).then(function(J){return G.cleanUp(),{image:J.image,svg:J.svg,errors:G.errors}})})},E}(a,d,u,v,h,i),f=function(b,_,S){var x={},m=function(k,N){var M=300,T=200,C=k?k.width:M,L=k?k.height:T,H=N.width!==void 0?N.width:C,G=N.height!==void 0?N.height:L;return{width:H,height:G}},w=function(k){var N=m(k.canvas,k.options),M;return M=b.clone(k.options),M.width=N.width,M.height=N.height,M};x.drawDocument=function(){var k=arguments[0],N=Array.prototype.slice.call(arguments,1),M=b.parseOptionalParameters(N),T=k.documentElement?k.documentElement:k;return S.rasterize(T,M.canvas,w(M))};var E=function(k,N,M){var T=_.parseHTML(k);return x.drawDocument(T,N,M)};x.drawHTML=function(){var k=arguments[0],N=Array.prototype.slice.call(arguments,1),M=b.parseOptionalParameters(N);return E(k,M.canvas,M.options)};var P=function(k,N,M){var T=document.implementation.createHTMLDocument("");T.replaceChild(k.documentElement,T.documentElement);var C=M?b.clone(M):{};return M.baseUrl||(C.baseUrl=N),{document:T,options:C}},R=function(k,N,M){return _.loadDocument(k,M).then(function(T){var C=P(T,k,M);return x.drawDocument(C.document,N,C.options)})};return x.drawURL=function(){var k=arguments[0],N=Array.prototype.slice.call(arguments,1),M=b.parseOptionalParameters(N);return R(k,M.canvas,M.options)},x}(a,d,p);return f})}(c1)),c1.exports}var WA=$A();function YA(e,t){if(!e.includes("@font-face"))return"";const r=new Set,n=new Set;t&&((t.match(/font-weight:\s*(\d+|bold|normal)/gi)||[]).forEach(d=>{const h=d.split(":")[1].trim();h==="bold"?r.add("700"):h==="normal"?r.add("400"):/^\d+$/.test(h)&&r.add(h)}),(t.match(/font-style:\s*(italic|normal)/gi)||[]).forEach(d=>{d.split(":")[1].trim().toLowerCase()==="italic"&&n.add("italic")}),/<(b|strong)\b/i.test(t)&&r.add("700"),/<(i|em)\b/i.test(t)&&n.add("italic"));const i=Lu(t);i&&i.trim()&&r.add("400"),r.size===0&&r.add("400");const a=r,o=n.has("italic"),l=Array.from(new Set(i)).map(d=>d.codePointAt(0)).filter(d=>d!==void 0),u=e.split(/}\s*/).map(d=>d&&d+"}").filter(d=>/@font-face/.test(d)&&(h=>{const v=(h.match(/font-weight:\s*(\d+)/)||[])[1];if(v&&!a.has(v)||/font-style:\s*italic/.test(h)&&!o)return!1;const p=h.match(/unicode-range:\s*([^;]+);/);if(!p)return!0;const f=p[1].split(",").map(b=>{const[_,S=_]=b.replace("U+","").split("-").map(x=>parseInt(x,16));return[_,S]});return l.some(b=>f.some(([_,S])=>b>=_&&b<=S))})(d)).join(`
151
- `);return u?`<style>${u}</style>`:""}const i0=`
152
- p {
153
- margin: 0;
154
- padding: 0;
155
- word-wrap: break-word; /* Required for Firefox */
156
- /* a text may have several spaces, we need to preserve them */
157
- white-space: pre-wrap;
158
- }
159
-
160
- /* Reset default list styles and setup counters */
161
- ul, ol {
162
- list-style: none; /* Remove default markers */
163
- padding-inline-start: 0; /* Reset padding */
164
- margin: 0;
165
- display: block; /* Use block instead of inline-block for better text wrapping */
166
- width: 100%;
167
- text-decoration: inherit;
168
- counter-reset: ol-counter; /* Initialize counter for ol */
169
- }
170
-
171
- li {
172
- position: relative; /* Needed for absolute positioning of ::before */
173
- padding-inline-start: 2.1em; /* Space for the marker (start side) */
174
- margin: 0; /* Reset default li margins */
175
- word-wrap: break-word; /* Required for Firefox text wrapping */
176
- white-space: pre-wrap; /* Preserve spaces and allow wrapping */
177
- }
178
-
179
- li::before {
180
- content: ''; /* Base content */
181
- position: absolute;
182
- /* Use logical properties for positioning */
183
- inset-inline-start: 0; /* Position marker at the start edge (left in LTR, right in RTL) */
184
- top: 0; /* Adjust vertical alignment */
185
- /* Prevent letter-spacing from affecting the marker */
186
- letter-spacing: normal;
187
- /* Define width to ensure consistent spacing and alignment */
188
- display: inline-block;
189
- width: 2em; /* Width for the marker container */
190
- /* Align multi-digit numbers to the end (right in LTR, left in RTL) */
191
- text-align: end;
192
- /* Space between marker and text (using logical property) */
193
- margin-inline-end: 0.8em; /* Pushes text away from marker (2.5em total = 1.7em width + 0.8em margin)*/
194
- /* Prevent marker style from inheriting list item styles */
195
- font-weight: normal;
196
- font-style: normal;
197
- }
198
-
199
- /* Style for bullet points */
200
- ul > li::before {
201
- content: '•'; /* Literal bullet character */
202
- /* Center the bullet within its allocated width */
203
- text-align: center; /* Override text-align: end for bullets */
204
- font-size: 1.2em;
205
- top: 0em; /* Re-adjust vertical alignment for bullet */
206
- /* Bullets don't need number alignment, width can be tighter */
207
- width: 2em;
208
- /* Adjust margin to maintain overall padding */
209
- margin-inline-end: 1.5em; /* 2.5em total padding = 1em width + 1.5em margin */
210
- }
211
-
212
- /* Style for numbers using counter */
213
- ol > li {
214
- counter-increment: ol-counter; /* Increment counter for each li in ol */
215
- }
216
-
217
- ol > li::before {
218
- content: counter(ol-counter) "."; /* Display counter value + dot */
219
- }
220
-
221
- .ql-indent-1 {
222
- margin-inline-start: 0.5em;
223
- }
224
- .ql-indent-2 {
225
- margin-inline-start: 1em;
226
- }
227
- .ql-indent-3 {
228
- margin-inline-start: 1.5em;
229
- }
230
- `,XA=`
231
- <style>
232
- html, body {
233
- padding: 0;
234
- margin: 0;
235
- }
236
- ${i0}
237
- </style>
238
- `;let Dc;const N6=()=>(Dc||(Dc=document.createElement("div"),Dc.id="polotno-hidden-do-not-touch",Dc.style.overflow="hidden",Dc.style.position="relative",document.body.appendChild(Dc),Dc.innerHTML=`<style>#polotno-hidden-do-not-touch {${i0}}</style>`),Dc);navigator.userAgent.includes("Firefox");function KA({html:e}){const t=document.createElement("div");t.innerHTML=e,t.style.display="inline-block",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.zIndex="1000",t.style.whiteSpace="nowrap",t.style.visibility="hidden";const r=N6();r.appendChild(t);const n=t.textContent,i=t.childNodes[0],a=n?.split(/\s+/)||[];let o=!1;for(let l=0;l<a.length;l++){const u=a[l];if(i&&(i.textContent=u,o=i.scrollWidth>t.clientWidth,o))break}return r.removeChild(t),o}function fb(e){const t=document.createElement("div");t.innerHTML=e,t.style.display="inline-block",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.zIndex="1000";const r=N6();r.appendChild(t);const n=t.getBoundingClientRect();return r.removeChild(t),{width:n.width,height:n.height}}const ZA={},w2={},_2=new Map;async function hb({html:e,width:t,height:r,fontFamily:n,padding:i,font:a,pixelRatio:o}){let l="";if(n!=="Arial"&&!a){const b=zS();l=await async function(_,S){const x=`${_}|${S}`;if(_2.has(x))return _2.get(x);const m=`https://fonts.googleapis.com/css?family=${_}:${S}&display=swap`,w=await(await fetch(m)).text();return _2.set(x,w),w}(n,b)}if(a){const b=a.styles||(a.url?[{src:`url("${a.url}")`}]:(_=>{if(w2[_])return w2[_];const S=function(m){const w=[];for(let E=0;E<document.styleSheets.length;E++){const P=document.styleSheets[E];try{const R=P.cssRules;if(R)for(let k=0;k<R.length;k++){const N=R[k];N instanceof CSSFontFaceRule&&N.style.fontFamily.replace(/['"]/g,"")===m&&w.push(N)}}catch(R){console.warn(`Could not access stylesheet: ${P.href}`,R)}}return w}(_),x=S.filter(m=>m.style.fontFamily.replace(/['"]/g,"")===_).map(m=>({src:m.style.getPropertyValue("src"),fontStyle:m.style.getPropertyValue("font-style")||"normal",fontWeight:m.style.getPropertyValue("font-weight")||"normal"}));return w2[_]=x,x})(n));l="",b.forEach(_=>{l+=`
239
- @font-face {
240
- font-family: '${n}';
241
- src: ${_.src};
242
- font-style: ${_.fontStyle||"normal"};
243
- font-weight: ${_.fontWeight||"normal"};
244
- }
245
- `})}let u="";l&&(u=YA(l,e)),e+=u+XA;const d=t+2*i,h=r+2*i,v=document.createElement("canvas"),p=await WA.drawHTML(`<div style="padding: ${i}px;" dir="auto">${e}</div>`,v,{width:d,height:h,cacheBucket:ZA});Xv(v,d*o,h*o);const f=v.getContext("2d");return f?.drawImage(p.image,0,0,d,h,0,0,v.width,v.height),v}let QA={data:""},JA=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||QA,eO=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,tO=/\/\*[^]*?\*\/|\s\s+|\n/g,Uc=(e,t)=>{let r="",n="",i="";for(let a in e){let o=e[a];a[0]=="@"?a[1]=="i"?r=a+" "+o+";":n+=a[1]=="f"?Uc(o,a):a+"{"+Uc(o,a[1]=="k"?"":t)+"}":typeof o=="object"?n+=Uc(o,t?t.replace(/([^,])+/g,l=>a.replace(/(^:.*)|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,l):l?l+" "+u:u)):a):o!=null&&(a=a.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=Uc.p?Uc.p(a,o):a+":"+o+";")}return r+(t&&i?t+"{"+i+"}":i)+n},Td={},L6=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+L6(e[r]);return t}return e},rO=(e,t,r,n,i)=>{let a=L6(e),o=Td[a]||(Td[a]=(l=>{let u=0,d=11;for(;u<l.length;)d=101*d+l.charCodeAt(u++)>>>0;return"go"+d})(a));if(!Td[o]){let l=a!==e?e:(u=>{let d,h=[{}];for(;d=eO.exec(u.replace(tO,""));)d[4]?h.shift():d[3]?h.unshift(h[0][d[3]]=h[0][d[3]]||{}):h[0][d[1]]=d[2];return h[0]})(e);Td[o]=Uc(i?{["@keyframes "+o]:l}:l,r?"":"."+o)}return((l,u,d)=>{u.data.indexOf(l)==-1&&(u.data=d?l+u.data:u.data+l)})(Td[o],t,n),o};function em(e){let t=this||{},r=e.call?e(t.p):e;return rO(r.unshift?r.raw?((n,i,a)=>n.reduce((o,l,u)=>{let d=i[u];if(d&&d.call){let h=d(a),v=h&&h.props&&h.props.className||/^go/.test(h)&&h;d=v?"."+v:h&&typeof h=="object"?h.props?"":Uc(h,""):h===!1?"":h}return o+l+(d??"")},""))(r,[].slice.call(arguments,1),t.p):r.reduce((n,i)=>Object.assign(n,i&&i.call?i(t.p):i),{}):r,JA(t.target),t.g,t.o,t.k)}let T6,av,ov;em.bind({g:1});em.bind({k:1});function nO(e,t,r,n){Uc.p=t,T6=e,av=r,ov=n}function Mh(e,t){let r=this||{};return function(){let n=arguments;function i(a,o){let l=Object.assign({},a),u=l.className||i.className;r.p=Object.assign({theme:av&&av()},l),r.o=/ *go\d+/.test(u),l.className=em.apply(r,n)+(u?" "+u:""),t&&(l.ref=o);let d=e;return e[0]&&(d=l.as||e,delete l.as),ov&&d[0]&&ov(l),T6(d,l)}return t?t(i):i}}nO(fe.createElement);const Ef=Fr({enabled:!1,currentFormat:{},editor:Fr.object({instance:null},{},{deep:!1})}),R6=Mh("div",fe.forwardRef)`
246
- .ql-editor {
247
- outline: none;
248
- }
249
- .ql-clipboard {
250
- pointer-events: none;
251
- }
252
- ${i0}
253
- strong {
254
- font-weight: 700;
255
- }
256
- .ql-direction-rtl {
257
- direction: rtl;
258
- }
259
- `;let iO=["bold","color","font","italic","size","strike","underline","indent","list","direction"];const db=(e,t)=>{var r=e.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+t+"<p><br></p></div>");e.setContents(r),e.history.clear()},aO=({html:e,onBlur:t,onChange:r,element:n,clickCoords:i})=>{const a=fe.useRef(null);fe.useEffect(()=>{if(!a.current)return;const l=(u=a.current,new b6(u,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:iO}));var u;return oc(()=>{Ef.editor.instance=l}),window.__polotnoQuill=l,l.on("text-change",()=>{l.getSelection()&&oc(()=>{Ef.currentFormat=l.getFormat()}),setTimeout(()=>{var d;const h=(d=a.current)===null||d===void 0?void 0:d.childNodes[0];r(h.innerHTML)},10)}),db(l,e),i?lO(l,i):l.setSelection(0,0,"api"),l.on("selection-change",(d,h,v)=>{d&&oc(()=>{Ef.currentFormat=l.getFormat()})}),a.current.childNodes[0].addEventListener("blur",d=>{var h;if(!((h=d.relatedTarget)===null||h===void 0)&&h.classList.contains("ql-clipboard"))return;(function(p){return!!p&&!!p.closest(".sketch-picker")})(d.relatedTarget)||t()}),()=>{oc(()=>{Ef.editor.instance=null,Ef.currentFormat={}}),delete window.__polotnoQuill}},[]),fe.useEffect(()=>G4(()=>n.text,()=>{var l;const u=Ef.editor.instance;if(!u)return;const d=u.getSelection();((l=a.current)===null||l===void 0?void 0:l.childNodes[0].innerHTML)===n.text||(db(u,e),d&&(u.setSelection(d.index,d.length),oc(()=>{Ef.currentFormat=u.getFormat()})))},{fireImmediately:!0}),[]),fe.useEffect(()=>{window.addEventListener("blur",t);const l=u=>{var d;!((d=a.current)===null||d===void 0)&&d.contains(u.target)||t()};return window.addEventListener("touchstart",l),()=>{window.removeEventListener("blur",t),window.removeEventListener("touchstart",l)}},[]);const o={color:n.fill};return 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"),fe.createElement(R6,{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)}),dir:e0(Lu(n.text))})};function oO(e){return!function(t){const r=t.getContext("2d").getImageData(0,0,t.width,t.height).data;for(let n=0;n<r.length;n+=4)if(r[n+3]!==0)return!0;return!1}(e)}function pb(e,{fontFamily:t="",color:r="black"}={}){let n=`color: ${r||e.fill}`;return e.fill.indexOf("gradient")>=0&&(n=`
260
- background-color: ${r};
261
- background-image: ${e.fill};
262
- background-size: 100% 100%;
263
- background-repeat: repeat;
264
- -webkit-background-clip: text;
265
- -moz-background-clip: text;
266
- -webkit-text-fill-color: transparent;
267
- -moz-text-fill-color: transparent;
268
- `),`<div style="${["white-space: pre-wrap",`width: ${Math.round(e.width||100)}px`,n,`font-size: ${e.fontSize}px`,`font-family: '${t}'`,`text-align: ${e.align}`,`text-transform: ${e.textTransform}`,e.textDecoration?`text-decoration: ${e.textDecoration}; text-decoration-color: ${r||e.fill}; text-decoration-layer: over`:"",e.lineHeight?`line-height: ${e.lineHeight}`:"",e.letterSpacing?`letter-spacing: ${e.letterSpacing*e.fontSize}px`:"",e.fontStyle?`font-style: ${e.fontStyle}`:"",e.fontWeight?`font-weight: ${e.fontWeight}`:"",e.strokeWidth?`-webkit-text-stroke: ${e.strokeWidth}px ${e.stroke}`:"",e.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${e0(Lu(e.text))}">${YS(e.text).replace(/\n/g,"</br>")}</div>`}const gb=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),sO=Gn(({element:e,store:t})=>{const r=fe.useRef(null),[n,i]=fe.useState(),[a,o]=fe.useState(!1),[l,u]=fe.useState(!1),d=fe.useRef(e.height),h=t.selectedShapes.indexOf(e)>=0&&e.selectable,v=e.fontSize/3,{textVerticalResizeEnabled:p}=bi,f=p6(e.fontFamily),[b]=h6(t,e.fontFamily),_=e._editModeEnabled;hp(r);const S=b?e.fontFamily:f!==e.fontFamily?f:"Arial",x=Zc(e).fill,m=pb(e,{fontFamily:S,color:x}),{width:w,height:E}=function(V,X,z){return fe.useMemo(()=>fb(V),[V,X.width,z])}(m,e,b);fe.useEffect(()=>{if(!b)return;if(!e.height)return void e.set({height:E});const{textOverflow:V}=bi;if(V!=="change-font-size"||a)V==="resize"&&(p&&e.height<E&&t.history.ignore(()=>{e.set({height:E})}),p||e.height===E||t.history.ignore(()=>{e.set({height:E})}));else{const X=(z=>{let D=z.fontSize;for(let F=1;F<50;F++){const q=pb(Object.assign(Object.assign({},z.toJSON()),{fontSize:D}),{fontFamily:z.fontFamily}),{height:Q}=fb(q),re=z.height&&Q>z.height,Y=KA({html:q});if(!re&&!Y)break;D-=.5}return D})(e);X!==e.fontSize?t.history.ignore(()=>{e.set({fontSize:X})}):e.height!==E&&(p&&e.height<E?t.history.ignore(()=>{e.set({height:E})}):p||t.history.ignore(()=>{e.set({height:E})}))}});const P=fe.useMemo(()=>{const V={lastArgs:null,lastResult:null};return async function(X){return V.lastArgs&&V.lastResult&&(z=V.lastArgs,D=X,JSON.stringify(z)===JSON.stringify(D))||(V.lastResult=await hb(X),V.lastArgs=Object.assign({},X)),V.lastResult;var z,D}},[]),R=fe.useRef(0),k=fe.useRef(null);fe.useEffect(()=>{a||_||(async()=>{R.current++;const V=R.current;let X=Ah(`text ${e.id} ${V}`);k.current&&k.current(),k.current=X,u(!0);let z=null;const D=gb?5:1;for(let F=0;F<D;F++){const q=F>0?P:hb;try{if(z=await q({skipCache:F>0,html:m,width:e.width||1,height:e.height||E||1,fontFamily:S,padding:v,pixelRatio:t._elementsPixelRatio,font:t.fonts.find(Q=>Q.fontFamily===S)||Uv.find(Q=>Q.fontFamily===S)}),V!==R.current)return;if(gb&&oO(z)){await new Promise(Q=>setTimeout(Q,50*(F+1)));continue}break}catch(Q){console.error(Q),dp(`Error rendering rich text with id ${e.id}`);break}}z?i(z):X?(X(),X=null):console.error("Finish function is called twice!"),u(!1)})()},[m,a,E,_,S,e.height,t._elementsPixelRatio,b]);const[N,M]=iv(l,300),[T]=iv(a,300,!0),C=T||N;fe.useEffect(()=>{if(!C)return Mu(()=>{const V=r.current;_s(V,e)})},[n,C,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]),fe.useEffect(()=>{n&&!l&&k.current&&(k.current(),k.current=null)},[n,l]),fe.useEffect(()=>()=>{k.current&&k.current()},[]);let L=0;e.verticalAlign==="middle"&&(L=(e.height-E)/2),e.verticalAlign==="bottom"&&(L=e.height-E);const H=d6({fontLoaded:b,fontFamily:e.fontFamily,fontSize:e.fontSize,lineHeight:e.lineHeight}),G=af(),J=fe.useRef(null),se=fe.useRef(null),U=_&&e.strokeWidth>0;return fe.createElement(fe.Fragment,null,fe.createElement(xn,{x:e.a.x,y:e.a.y,offsetX:e.backgroundPadding*(e.fontSize*H*.5),offsetY:e.backgroundPadding*(e.fontSize*H*.5),rotation:e.a.rotation,hideInExport:!e.showInExport,listening:!1,visible:e.backgroundEnabled,opacity:e.backgroundOpacity*e.a.opacity,fill:e.backgroundColor,width:e.a.width+e.backgroundPadding*(e.fontSize*H),height:e.a.height+e.backgroundPadding*(e.fontSize*H),cornerRadius:e.backgroundCornerRadius*(e.fontSize*H*.5)}),fe.createElement(xn,{ref:r,name:"element",x:e.a.x,y:e.a.y,listening:e.selectable,rotation:e.a.rotation,width:e.a.width,height:e.a.height,visible:!C,draggable:G?e.draggable&&h:e.draggable,preventDefault:!G||h,opacity:_?0:e.a.opacity,hideInExport:!e.showInExport,onDragMove:V=>{e.set({x:V.target.x(),y:V.target.y()})},onDragEnd:V=>{e.set({x:V.target.x(),y:V.target.y()})},id:e.id,onDblClick:V=>{e.contentEditable&&(se.current={x:V.evt.clientX,y:V.evt.clientY},e.toggleEditMode(!0))},onDblTap:V=>{var X;if(e.contentEditable){const z=(X=V.evt.changedTouches)===null||X===void 0?void 0:X[0];se.current=z?{x:z.clientX,y:z.clientY}:null,e.toggleEditMode(!0)}},onTransformStart:V=>{o(!0),d.current=e.height},onTransform:V=>{var X;const z=V.target,D=((X=z.getStage())===null||X===void 0?void 0:X.findOne("Transformer")).getActiveAnchor(),F=D==="middle-left"||D==="middle-right",q=D==="top-center"||D==="bottom-center",Q=z.scaleX();if(F){const re=z.scaleX(),Y=z.width()*re,ee=e.fontSize;let ae=Y;if(Y<ee&&(ae=ee,J.current&&z.position(J.current)),z.width(ae),z.scaleX(1),bi.textVerticalResizeEnabled){const ue=Math.max(E,d.current);e.set({height:ue})}e.set({width:z.width(),x:z.x(),y:z.y()})}else if(q){let re=bi.textOverflow==="resize"?E:e.lineHeight*e.fontSize;const Y=Math.max(re,V.target.height()*V.target.scaleY());z.scaleY(1),e.set({x:z.x(),y:z.y(),height:Y,rotation:z.rotation()})}else z.scaleX(1),z.scaleY(1),e.set({fontSize:e.fontSize*Q,letterSpacing:e.letterSpacing,width:z.width()*Q,x:z.x(),y:z.y(),rotation:z.rotation(),height:z.height()*Q});J.current=V.target.position()},onTransformEnd:V=>{o(!1),u(!0);const X=V.target.scaleX();V.target.scaleX(1),V.target.scaleY(1),e.set({fontSize:e.fontSize*X,width:V.target.width()*X,x:V.target.x(),y:V.target.y(),rotation:V.target.rotation(),shadowBlur:e.shadowBlur*X,shadowOffsetX:e.shadowOffsetX*X,shadowOffsetY:e.shadowOffsetY*X,strokeWidth:e.strokeWidth*X})}}),fe.createElement(Eu,{ref:r,image:n,x:e.a.x,y:e.a.y,offsetX:v,offsetY:v-L,listening:!1,rotation:e.a.rotation,width:e.a.width+2*v,height:(e.a.width+2*v)*(n?.height/n?.width||1),visible:!C&&!_,opacity:e.a.opacity,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,hideInExport:!e.showInExport,editModeEnabled:e._editModeEnabled||a}),(C||U)&&fe.createElement(dn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,offsetY:-L},fe.createElement(C1,{divProps:{style:{pointerEvents:"none"}}},fe.createElement(R6,{dangerouslySetInnerHTML:{__html:m},style:{pointerEvents:"none",opacity:e.a.opacity}}))),_&&fe.createElement(dn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,offsetY:-L},fe.createElement(C1,null,fe.createElement(aO,{html:m,element:e,onChange:V=>{const X=f6({oldText:Lu(e.text),newText:Lu(V),element:e});e.set({text:V,fontSize:X})},onBlur:V=>{e.toggleEditMode(!1),M(!0),Lu(e.text)===""&&e.removable&&!e.placeholder&&t.deleteElements([e.id])},clickCoords:se.current}))))});function lO(e,t){if(!e||!t)return;const{x:r,y:n}=t;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=b6.find(i.startContainer,!0);if(a){const o=a.offset(e.scroll)+i.startOffset;return void e.setSelection(o,0,"api")}}}catch{}e.setSelection(0,0,"api")}function tm(e){return e/180*Math.PI}function Qp(e,t,r,n,i){const a=Math.sqrt(r*r+n*n);return i+=Math.atan2(n,r),{x:e+a*Math.cos(i),y:t+a*Math.sin(i)}}function a0(e){const{x:t,y:r,width:n,height:i}=e,a=tm(e.rotation),o=Qp(t,r,0,0,a),l=Qp(t,r,n,0,a),u=Qp(t,r,n,i,a),d=Qp(t,r,0,i,a),h=Math.min(o.x,l.x,u.x,d.x),v=Math.min(o.y,l.y,u.y,d.y),p=Math.max(o.x,l.x,u.x,d.x),f=Math.max(o.y,l.y,u.y,d.y);return{x:h,y:v,width:p-h,height:f-v,minX:h,minY:v,maxX:p,maxY:f}}function o0(e){const t=e.map(o=>a0(o)),r=Math.min(...t.map(o=>o.minX)),n=Math.min(...t.map(o=>o.minY)),i=Math.max(...t.map(o=>o.maxX)),a=Math.max(...t.map(o=>o.maxY));return{x:r,y:n,width:i-r,height:a-n,minX:r,minY:n,maxX:i,maxY:a}}function uO(e){const t=tm(e.rotation||0);return{x:e.x+e.width/2*Math.cos(t)+e.height/2*Math.sin(-t),y:e.y+e.height/2*Math.cos(t)+e.width/2*Math.sin(t)}}function cO(e,t,r){const n=tm(t),i=r.x+(e.x-r.x)*Math.cos(n)-(e.y-r.y)*Math.sin(n),a=r.y+(e.x-r.x)*Math.sin(n)+(e.y-r.y)*Math.cos(n);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:i,y:a})}function fO(e,t){return cO(e,t,uO(e))}const Yo={stroke:"rgb(0, 161, 255)",strokeWidth:1,dash:[4,6]},hO=({stroke:e,strokeWidth:t,dash:r})=>{e!==void 0&&(Yo.stroke=e),t!==void 0&&(Yo.strokeWidth=t),r!==void 0&&(Yo.dash=r)};let vb=({targetKonvaNodes:e,guideKonvaNode:t,distance:r,snapDirection:n})=>r<5;function sv(e,t){var r=[],n=[];e.vertical.forEach(d=>{t.vertical.forEach(h=>{var v=Math.abs(d.offset-h.guide);vb({targetKonvaNodes:h.nodes,guideKonvaNode:d.node,distance:v,snapDirection:d.snap})&&r.push({lineGuide:d.offset,diff:v,snap:h.snap,offset:h.offset})})}),e.horizontal.forEach(d=>{t.horizontal.forEach(h=>{var v=Math.abs(d.offset-h.guide);vb({targetKonvaNodes:h.nodes,guideKonvaNode:d.node,distance:v,snapDirection:d.snap})&&n.push({lineGuide:d.offset,diff:v,snap:h.snap,offset:h.offset})})});var i=[];const a=r.sort((d,h)=>d.diff-h.diff),o=n.sort((d,h)=>d.diff-h.diff);var l=a[0],u=o[0];return l&&a.filter(d=>Math.abs(d.diff-l.diff)<.1).forEach(d=>{i.push(Object.assign({orientation:"V"},d))}),u&&o.filter(d=>Math.abs(d.diff-u.diff)<.1).forEach(d=>{i.push(Object.assign({orientation:"H"},d))}),i}function dO(e,t,r){const n=fe.useRef(null);hO(r);const i=h=>h.hasName("element")||h.hasName("page-background")||!n.current&&h.hasName("elements-area");function a(h){var v;const p=(v=e.current)===null||v===void 0?void 0:v.getStage(),f=[],b=[];return p.find(i).forEach(_=>{if(!(h.indexOf(_)>=0)){var S=_.getClientRect({skipShadow:!0,skipStroke:!0});f.push({offset:S.x,node:_,snap:"start"},{offset:S.x+S.width,node:_,snap:"end"},{offset:S.x+S.width/2,node:_,snap:"center"}),b.push({offset:S.y,node:_,snap:"start"},{offset:S.y+S.height,node:_,snap:"end"},{offset:S.y+S.height/2,node:_,snap:"center"})}}),{vertical:f,horizontal:b}}function o(h){var v;const p=(v=e.current)===null||v===void 0?void 0:v.getLayer(),f=p?.children.find(b=>b.name()==="line-guides");h.forEach(b=>{if(b.orientation==="H"){var _=new Kt.Line({x:-p.getStage().x(),y:-p.getStage().y(),points:[-6e3,b.lineGuide,6e3,b.lineGuide],stroke:Yo.stroke,strokeWidth:Yo.strokeWidth,name:"guid-line",dash:Yo.dash});f?.add(_),p.batchDraw()}else b.orientation==="V"&&(_=new Kt.Line({x:-p.getStage().x(),y:-p.getStage().y(),points:[b.lineGuide,-6e3,b.lineGuide,6e3],stroke:Yo.stroke,strokeWidth:Yo.strokeWidth,name:"guid-line",dash:Yo.dash}),f?.add(_))})}const l=h=>{const v=h.target.getLayer().children.find(w=>w.name()==="line-guides");v?.destroyChildren();var p=a(h.target.nodes()),f=function(w){const E=w.__getNodeRect(),P=a0(Object.assign(Object.assign({},E),{rotation:Kt.Util.radToDeg(E.rotation)})),R=w.getAbsolutePosition();return{vertical:[{guide:P.x,offset:R.x-P.x,snap:"start",nodes:w.nodes()},{guide:P.x+P.width/2,offset:R.x-P.x-P.width/2,snap:"center",nodes:w.nodes()},{guide:P.x+P.width,offset:R.x-P.x-P.width,snap:"end",nodes:w.nodes()}],horizontal:[{guide:P.y,offset:R.y-P.y,snap:"start",nodes:w.nodes()},{guide:P.y+P.height/2,offset:R.y-P.y-P.height/2,snap:"center",nodes:w.nodes()},{guide:P.y+P.height,offset:R.y-P.y-P.height,snap:"end",nodes:w.nodes()}]}}(h.target),b=sv(p,f);if(!b.length)return;o(b);const _=h.target.getAbsolutePosition(),S=(h.target.nodes().map(w=>w.getAbsolutePosition()),Object.assign({},_));b.forEach(w=>{switch(w.snap){case"start":case"center":case"end":switch(w.orientation){case"V":S.x=w.lineGuide+w.offset;break;case"H":S.y=w.lineGuide+w.offset}}});const x=S.x-_.x,m=S.y-_.y;h.evt.ctrlKey||h.evt.metaKey||h.target.nodes().forEach(w=>{const E=w.getAbsolutePosition();w.setAbsolutePosition({x:E.x+x,y:E.y+m})})},u=(h,v,p)=>{var f;const b=e.current,_=b.getLayer().children.find(N=>N.name()==="line-guides");if(_?.destroyChildren(),b.getActiveAnchor()==="rotater")return v;const S=b.getActiveAnchor(),x=pO[S],m=(f=b.findOne(`.${x}`))===null||f===void 0?void 0:f.getAbsolutePosition();if(!m)return v;const w={x:h.x-m.x,y:h.y-m.y},E=function(N,M){const T=yb(N,M)/yb(M,M);return{x:T*M.x,y:T*M.y}}({x:v.x-h.x,y:v.y-h.y},w),P={x:h.x+E.x,y:h.y+E.y};var R=sv(a(b.nodes()),{vertical:[{guide:P.x,offset:0,snap:"start",nodes:b.nodes()}],horizontal:[{guide:P.y,offset:0,snap:"start",nodes:b.nodes()}]});if(!R.length||(o(R),p.ctrlKey||p.metaKey))return v;const k=[];if(R.forEach(N=>{const M=function(T,C,L){if(L.orientation==="V"){const H=L.lineGuide;if(Math.abs(C.x-T.x)<1e-4)return null;const G=(C.y-T.y)/(C.x-T.x);return{x:H,y:G*H+(T.y-G*T.x)}}{const H=L.lineGuide;if(Math.abs(C.y-T.y)<1e-4)return null;const G=(C.y-T.y)/(C.x-T.x);return{x:(H-T.y)/G+T.x,y:H}}}(P,m,{orientation:N.orientation,lineGuide:N.lineGuide});M&&k.push(M)}),k.length>0){let N=k[0],M=Math.sqrt(Math.pow(P.x-N.x,2)+Math.pow(P.y-N.y,2));if(k.forEach(T=>{const C=Math.sqrt(Math.pow(P.x-T.x,2)+Math.pow(P.y-T.y,2));C<M&&(M=C,N=T)}),M<10)return N}return P},d=h=>{if(!h.target)return;const v=h.target.getLayer(),p=v.children.find(f=>f.name()==="line-guides");p?.destroyChildren(),v.batchDraw()};fe.useEffect(()=>{e.current&&(e.current.anchorDragBoundFunc(u),e.current.on("dragstart",h=>{setTimeout(()=>{if(Kt.DD._dragElements.size===0)return;const v=[...Kt.DD._dragElements.entries()],p=v.find(([f,b])=>b.node instanceof Kt.Transformer);p&&(v.splice(v.indexOf(p),1),v.unshift(p),Kt.DD._dragElements.clear(),v.forEach(([f,b])=>{Kt.DD._dragElements.set(f,b)}))})}),e.current.on("dragmove",l),e.current.on("dragend",d),e.current.on("transformend",d),e.current.on("transform",h=>{var v,p;h.evt.ctrlKey||h.evt.metaKey?(v=e.current)===null||v===void 0||v.rotationSnapTolerance(0):(p=e.current)===null||p===void 0||p.rotationSnapTolerance(5)}))},[])}function mb(e,t,r){const n=o=>o.hasName("element")||o.hasName("line-anchor")||o.hasName("page-background")||o.hasName("elements-area"),i=o=>{const l=o.target.getLayer().children.find(b=>b.name()==="line-guides");l?.destroyChildren();var u,d=sv(function(b){var _;const S=(_=e.current)===null||_===void 0?void 0:_.getStage();var x=[],m=[];return S.find(n).forEach(w=>{if(!(b.indexOf(w)>=0)){var E=w.getClientRect({skipShadow:!0,skipStroke:!0});w.hasName("line-anchor")&&(E={x:w.absolutePosition().x,y:w.absolutePosition().y,width:0,height:0}),x.push({offset:E.x,node:w,snap:"start"},{offset:E.x+E.width,node:w,snap:"end"},{offset:E.x+E.width/2,node:w,snap:"center"}),m.push({offset:E.y,node:w,snap:"start"},{offset:E.y+E.height,node:w,snap:"end"},{offset:E.y+E.height/2,node:w,snap:"center"})}}),{vertical:x,horizontal:m}}([o.target,...t.map(b=>b.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(!d.length)return;(function(b){var _;const S=(_=e.current)===null||_===void 0?void 0:_.getLayer(),x=S?.children.find(m=>m.name()==="line-guides");b.forEach(m=>{if(m.orientation==="H"){var w=new Kt.Line({points:[-6e3,m.lineGuide,6e3,m.lineGuide],stroke:Yo.stroke,strokeWidth:Yo.strokeWidth,name:"guid-line",dash:Yo.dash});x?.add(w),S.batchDraw()}else m.orientation==="V"&&(w=new Kt.Line({points:[m.lineGuide,-6e3,m.lineGuide,6e3],stroke:Yo.stroke,strokeWidth:Yo.strokeWidth,name:"guid-line",dash:Yo.dash}),x?.add(w))})})(d);const h=o.target.getAbsolutePosition(),v=Object.assign({},h);d.forEach(b=>{switch(b.snap){case"start":case"center":case"end":switch(b.orientation){case"V":v.x=b.lineGuide+b.offset;break;case"H":v.y=b.lineGuide+b.offset}}});const p=v.x-h.x,f=v.y-h.y;if(!o.evt.ctrlKey&&!o.evt.metaKey){const b=o.target.getAbsolutePosition();o.target.absolutePosition({x:b.x+p,y:b.y+f})}},a=o=>{if(!o.target)return;const l=o.target.getLayer(),u=l.children.find(d=>d.name()==="line-guides");u?.destroyChildren(),l.batchDraw()};fe.useEffect(()=>{e.current&&(e.current.on("dragmove",i),e.current.on("dragend",a))},r)}function yb(e,t){return e.x*t.x+e.y*t.y}const pO={"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 gO(e){const{x:t,y:r,width:n,height:i,rotation:a}=e.a,o=a*Math.PI/180,l={x:t+i/2*Math.cos(o+Math.PI/2),y:r+i/2*Math.sin(o+Math.PI/2)};return{middleLeft:l,middleRight:{x:l.x+n*Math.cos(o),y:l.y+n*Math.sin(o)}}}function bb(e,t,r){const n=Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),i=Math.atan2(t.y-e.y,t.x-e.x),a=180*i/Math.PI;return{x:e.x+Math.cos(i-Math.PI/2)*r/2,y:e.y+Math.sin(i-Math.PI/2)*r/2,width:n,height:r,rotation:a}}const wb=(e,t)=>({offsetX:5/e,offsetY:5/e,width:10/e,height:10/e,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:r=>{r.target.getStage().container().style.cursor="crosshair"},onMouseLeave:r=>{r.target.getStage().container().style.cursor=""},onDragStart:r=>{t.history.startTransaction()},onDragEnd:r=>{t.history.endTransaction()}}),_b=Gn(({element:e,type:t})=>{const r=Zc(e,e.a.color,"fill"),n=Zc(e,e.a.color,"stroke"),i=Object.assign(Object.assign(Object.assign({strokeWidth:e.height,lineCap:"round",lineJoin:"round"},n),r),{opacity:e.a.opacity,hideInExport:!e.showInExport});return fe.createElement(fe.Fragment,null,t==="arrow"&&fe.createElement(Vc,Object.assign({points:[3*e.height,2*-e.height,0,0,3*e.height,2*e.height]},i)),t==="triangle"&&fe.createElement(Vc,Object.assign({points:[3*e.height,2*-e.height,0,0,3*e.height,2*e.height],closed:!0},i)),t==="bar"&&fe.createElement(Vc,Object.assign({points:[0,2*-e.height,0,2*e.height],closed:!0},i)),t==="square"&&fe.createElement(Vc,Object.assign({points:[0,2*-e.height,4*e.height,2*-e.height,4*e.height,2*e.height,0,2*e.height],closed:!0},i)),t==="circle"&&fe.createElement(cS,Object.assign({x:2*e.height,y:0,radius:2*e.height},i)))}),vO=Gn(({element:e,store:t})=>{const r=fe.useRef(null),n=fe.useRef(null),i=fe.useRef(null),a=e.selectable||t.role==="admin",o=af(),l=t.selectedElements.indexOf(e)>=0&&t.selectedElements.length===1,u=t.selectedShapes.indexOf(e)>=0&&e.selectable,{middleLeft:d,middleRight:h}=gO(e);mb(n,[r],[l]),mb(i,[r],[l]);const v=Zc(e,e.a.color,"stroke");return fe.createElement(fe.Fragment,null,fe.createElement(Vc,Object.assign({ref:r,name:"element",id:e.id,x:e.a.x,y:e.a.y,points:[0,0,e.a.width,0],offsetY:-e.a.height/2,strokeWidth:e.a.height,hitStrokeWidth:Math.max(e.a.height,20),dash:e.dash.map(p=>p*e.a.height)},v,{rotation:e.a.rotation,opacity:e.animated("opacity"),shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,listening:a,draggable:o?e.draggable&&u:e.draggable,preventDefault:!o||u,hideInExport:!e.showInExport,onDragMove:p=>{e.set({x:p.target.x(),y:p.target.y()})},onDragEnd:p=>{e.set({x:p.target.x(),y:p.target.y()})},onTransform:p=>{const f=p.target.scaleX();p.target.scaleX(1),p.target.scaleY(1),e.set({height:e.height*f,width:e.width*f,x:p.target.x(),y:p.target.y(),rotation:p.target.rotation()})}})),fe.createElement(dn,{x:d.x,y:d.y,rotation:e.rotation,hideInExport:!e.showInExport},fe.createElement(_b,{element:e,type:e.startHead})),fe.createElement(dn,{x:h.x,y:h.y,rotation:e.rotation+180},fe.createElement(_b,{element:e,type:e.endHead})),l&&e.resizable&&fe.createElement(qv,{selector:".page-abs-container",enabled:!0},fe.createElement(dn,{visible:l},fe.createElement(xn,Object.assign({x:d.x,y:d.y,ref:n,name:"line-anchor"},wb(t.scale,t),{onDragMove:p=>{const f=bb(p.target.position(),h,e.height);e.set({x:f.x,y:f.y,width:f.width,rotation:f.rotation})}})),fe.createElement(xn,Object.assign({x:h.x,y:h.y,ref:i,name:"line-anchor"},wb(t.scale,t),{onDragMove:p=>{const f=bb(d,p.target.position(),e.height);e.set({x:f.x,y:f.y,width:f.width,rotation:f.rotation})}})))))});function ip(){return document.createElement("canvas")}const M6=new window.Image;M6.src=Uf(`
269
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
270
- <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"/>
271
- <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"/>
272
- </svg>
273
- `);const I6=new window.Image;I6.src=Uf(`
274
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
275
- <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"/>
276
- <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"/>
277
- <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"/>
278
- <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"/>
279
- </svg>
280
- `);const j6=(e,t,r,n,i=0,a=!1)=>{const o=Math.floor(Math.max(e.width*n,1)),l=Math.floor(Math.max(e.height*n,1)),u=Math.min(i*n,o/2,l/2),d=Math.max(e.width/r.width,e.height/r.height)*n,h=e.page._exportingOrRendering&&bi.imageDownScalingEnabled&&d<1&&!a,v=r.x===0&&r.y===0&&r.width===t?.width&&r.height===t?.height,p=fe.useMemo(()=>{if(t&&t.width&&t.height)return v&&u===0&&!h?void 0:ip()},[t,u,h,v]),f=()=>{if(!p||!t)return;p.width=o,p.height=l;const b=p.getContext("2d");if(!b)return;u&&(b.beginPath(),b.moveTo(u,0),b.lineTo(o-u,0),b.arc(o-u,u,u,3*Math.PI/2,0,!1),b.lineTo(o,l-u),b.arc(o-u,l-u,u,0,Math.PI/2,!1),b.lineTo(u,l),b.arc(u,l-u,u,Math.PI/2,Math.PI,!1),b.lineTo(0,u),b.arc(u,u,u,Math.PI,3*Math.PI/2,!1),b.clip());const _=h?function(x,m){var w,E;const P=ip();P.width=x.width,P.height=x.height,(w=P.getContext("2d"))===null||w===void 0||w.drawImage(x,0,0,P.width,P.height);const R=function(k,N,M,T,C,L,H){for(var G=new ImageData(N,M),J=new Int32Array(k.data.buffer),se=k.width,U=new Int32Array(G.data.buffer),V=G.width,X=N/L,z=M/H,D=Math.round(1/X),F=Math.round(1/z),q=D*F,Q=0;Q<G.height;Q++)for(var re=0;re<V;re++){for(var Y=0+Math.round(re/X)+(0+Math.round(Q/z))*se,ee=0,ae=0,ue=0,ce=0,pe=0;pe<F;pe++)for(var Ae=0;Ae<D;Ae++){var Ce=J[Y+Ae+pe*se];ee+=Ce<<24>>>24,ae+=Ce<<16>>>24,ue+=Ce<<8>>>24,ce+=Ce>>>24}ee=Math.round(ee/q),ae=Math.round(ae/q),ue=Math.round(ue/q),ce=Math.round(ce/q),U[re+Q*V]=ce<<24|ue<<16|ae<<8|ee}return G}(P.getContext("2d").getImageData(0,0,P.width,P.height),Math.floor(P.width*m),Math.floor(P.height*m),0,0,P.width,P.height);return P.width=Math.floor(P.width*m),P.height=Math.floor(P.height*m),(E=P.getContext("2d"))===null||E===void 0||E.putImageData(R,0,0),P}(t,d):t,S=h?{x:Math.floor(r.x*d),y:Math.floor(r.y*d),width:Math.floor(r.width*d),height:Math.floor(r.height*d)}:r;b.drawImage(_,S.x,S.y,S.width,S.height,0,0,p.width,p.height)};return fe.useLayoutEffect(()=>{f()},[p,e.width,e.height,r.x,r.y,r.width,r.height,i,n,a,e.page._exportingOrRendering,h]),fe.useEffect(()=>()=>{p&&p.nodeName==="CANVAS"&&Kt.Util.releaseCanvas(p)},[p]),[p||t,f]},mO=ip(),yO=Gn(({element:e})=>{const t=Math.min(30,e.width/4,e.height/4),r=fe.useRef(null);return fe.useEffect(()=>{const n=r.current;if(!n)return;const i=new Kt.Animation(a=>{n.rotate((a?.timeDiff||0)/2)},n.getLayer());return i.start(),()=>{i.stop()}}),fe.createElement(dn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},fe.createElement(xn,{width:e.width,height:e.height,fill:"rgba(124, 173, 212, 0.8)"}),fe.createElement(Bv,{ref:r,x:e.width/2,y:e.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),bO=Gn(({element:e})=>{const t=Math.max(10,Math.min(30,e.width/25));return fe.createElement(dn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},fe.createElement(xn,{width:e.width,height:e.height,fill:"rgba(223, 102, 102, 0.8)"}),fe.createElement(Nu,{text:"Can not load the video...",fontSize:t,width:e.width,height:e.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let wO=function(e,t,r){const n=fe.useRef("loading"),i=fe.useRef(null),[a,o]=fe.useState(0),l=fe.useRef(),u=fe.useRef(),d=fe.useRef();return l.current===e&&u.current===t&&d.current===r||(n.current="loading",i.current=void 0,l.current=e,u.current=t,d.current=r),fe.useLayoutEffect(function(){if(e){var h=document.createElement("video");return h.addEventListener("canplay",v),h.addEventListener("error",p),h.crossOrigin=t,h.src=e,h.load(),function(){h.removeEventListener("canplay",v),h.removeEventListener("error",p)}}function v(){n.current="loaded",i.current=h,i.current.currentTime=0,o(Math.random()),i.current.removeEventListener("canplay",v)}function p(f){var b;const _=h.readyState===4,S=h.buffered&&h.buffered.length>0&&h.buffered.end(h.buffered.length-1)/h.duration*100>=100;if(_&&S)return;const x=f.message||((b=h.error)===null||b===void 0?void 0:b.message)||"Unknown error",m=new Error("Video failed to load: "+x);console.error(m),n.current="failed",i.current=void 0,o(Math.random())}},[e,t,r]),[i.current,n.current]};function xb(e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA}const Sb=(e,t,r)=>{const n=fe.useRef(),i=()=>{var a;(a=n.current)===null||a===void 0||a.call(n),n.current=void 0};fe.useEffect(()=>i,[]),fe.useLayoutEffect(()=>{const a=t.slice(0,200),o=`video with id ${r} url: ${a}`;e!=="loading"||n.current||(n.current=Ah(o)),e!=="loading"&&i(),e==="failed"&&dp(o)},[e])},_O=Gn(({element:e,store:t})=>{var r;const[n,i]=fe.useState(!1),a=fe.useRef(null),o=fe.useRef(null),l=t.selectedShapes.indexOf(e)>=0&&e.selectable,[u,d]=fe.useState(!1),[h,v]=wO(e.src,"anonymous"),p=t.activePage===e.page;Sb(v,e.src,e.id),h&&(h.width=h.videoWidth,h.height=h.videoHeight,h.playsInline=!0);const f=h||mO;fe.useEffect(()=>{h&&t.history.ignore(()=>{e.set({duration:1e3*h.duration})})},[h]),fe.useEffect(()=>{var ce;if(!h)return;const pe=t.animatedElementsIds,Ae=(!pe.length||pe.includes(e.id))&&t.isPlaying,Ce=p&&(Ae||u);if(!Ce)return void h.pause();Ce&&(h.currentTime=e.startTime*h.duration,h.play());const ke=new Kt.Animation(()=>{se()},(ce=a.current)===null||ce===void 0?void 0:ce.getLayer());ke.start();const Se=()=>{d(!1),h.currentTime=e.startTime*h.duration},le=()=>{h.currentTime>=e.endTime*h.duration&&(h.pause(),h.currentTime=e.startTime*h.duration,d(!1))};return h.addEventListener("ended",Se),h.addEventListener("timeupdate",le),()=>{h.pause(),ke.stop(),h.removeEventListener("ended",Se),h.removeEventListener("timeupdate",le)}},[h,u,t.isPlaying,p]),fe.useEffect(()=>{h&&(h.volume=e.volume)},[h,e.volume]);const b=fe.useRef();fe.useEffect(()=>{const ce=Mu(()=>{var pe,Ae;if(h){const Ce=t.animatedElementsIds;if(Ce.length&&!Ce.includes(e.id))return;const ke=e.startTime*h.duration*1e3,Se=h.duration*(e.endTime-e.startTime)*1e3,le=((t.currentTime||e.page.startTime)-e.page.startTime)%Se+ke;if(Math.abs(1e3*h.currentTime-le)>500||!t.isPlaying){const Ee=le/1e3;Ee!==h.currentTime&&(h.currentTime=Ee),!xb(h)&&!t.isPlaying&&!b.current&&(b.current=Ah(`video ${e.id}`))}se(),(Ae=(pe=a.current)===null||pe===void 0?void 0:pe.getLayer())===null||Ae===void 0||Ae.batchDraw()}});return()=>{ce(),b.current&&(b.current(),b.current=null)}},[t,h]),fe.useEffect(()=>{if(!h)return;const ce=()=>{var Ae,Ce;!xb(h)&&e.page._exportingOrRendering||b.current&&(se(),(Ce=(Ae=a.current)===null||Ae===void 0?void 0:Ae.getLayer())===null||Ce===void 0||Ce.batchDraw(),b.current(),b.current=null)};let pe;return e.page._exportingOrRendering&&(pe=setInterval(ce,50)),h.addEventListener("timeupdate",ce),h.addEventListener("canplay",ce),()=>{clearInterval(pe),h.removeEventListener("timeupdate",ce),h.removeEventListener("canplay",ce)}},[e.page._exportingOrRendering,h,e.id,Ah]);let{cropX:_,cropY:S,cropWidth:x,cropHeight:m}=e;v!=="loaded"&&(_=S=0,x=m=1);const w=f.width*x,E=f.height*m,P=e.width/e.height;let R,k;const N=w/E,M=e.type==="svg";M?(R=w,k=E):P>=N?(R=w,k=w/P):(R=E*P,k=E);const T={x:f.width*_,y:f.height*S,width:R,height:k},C=(r=e.cornerRadius)!==null&&r!==void 0?r:0,[L,H]=j6(e,f,T,t._elementsPixelRatio,C,n||e._cropModeEnabled||e.type==="svg");let[G,J]=((ce,pe,Ae,Ce)=>{const ke=(Ne=>{const[Te,ge]=fe.useState(Ne);return fe.useEffect(()=>{(async()=>{const Re=await async function(Be){if(!(Be.indexOf("data:image/svg+xml")>=0||Be.indexOf(".svg")>=0))return Be;const Qe=await gp(Be),ct=Wv(Qe);return Uf(ct)}(Ne);Re!==Te&&ge(Re)})()},[Ne]),Te})(ce.clipSrc||""),[Se,le]=zv(ke,"anonymous"),Ee=ce.clipSrc?le:"loaded";Sb(Ee,ce.clipSrc,ce.id);const xe=fe.useMemo(()=>{if(pe&&Se)return ip()},[pe,Se]);function ye(){var Ne;if(!Se||!pe||!pe.width||!pe.height||!Se||!Se.width||!Se.height||!xe)return;const Te=ip(),ge=Math.max(ce.width/Se.width*Ae,ce.height/Se.height*Ae);Te.width=Se.width*ge,Te.height=Se.height*ge,(Ne=Te.getContext("2d"))===null||Ne===void 0||Ne.drawImage(Se,0,0,Te.width,Te.height),xe.width=Math.max(pe.width,1),xe.height=Math.max(pe.height,1);const Re=xe.getContext("2d");Re&&(Re.save(),Re.drawImage(Te,0,0,pe.width,pe.height),Kt.Util.releaseCanvas(Te),Re.globalCompositeOperation="source-in",Re.drawImage(pe,0,0,xe.width,xe.height),Re.restore())}return fe.useLayoutEffect(()=>{ye()},[xe,pe,Se,ce.width,ce.height,Ae,...Ce]),[ce.clipSrc&&Se?xe:pe,ye]})(e,L,t._elementsPixelRatio,[T,C,t._elementsPixelRatio]);function se(){H(),J()}const U=Math.max(e.width/R,e.height/k);fe.useEffect(()=>{var ce;if(!e._cropModeEnabled)return;const pe=(ce=a.current)===null||ce===void 0?void 0:ce.getStage();function Ae(ke){e._cropModeEnabled&&ke.target!==o.current&&e.toggleCropMode(!1)}function Ce(ke){e._cropModeEnabled&&ke.target.parentNode!==pe.content&&e.toggleCropMode(!1)}return document.body.addEventListener("click",Ce),pe?.on("click",Ae),pe?.on("tap",Ae),()=>{document.body.removeEventListener("click",Ce),document.body.removeEventListener("touchstart",Ce),pe?.off("click",Ae),pe?.off("click",Ae)}},[e._cropModeEnabled]),fe.useLayoutEffect(()=>{if(!n&&!e._cropModeEnabled)return _s(a.current,e),Mu(()=>{_s(a.current,e)},{delay:100})},[f,n,x,m,e._cropModeEnabled]),fe.useLayoutEffect(()=>{var ce;n||e._cropModeEnabled?(ce=a.current)===null||ce===void 0||ce.clearCache():_s(a.current,e)},[n,e.width,e.height,e._cropModeEnabled]),fe.useEffect(()=>{_s(a.current,e)},[e.shadowEnabled,e.shadowBlur,e.cornerRadius,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]);const V=fe.useRef(null),X=fe.useRef(null),z=fe.useRef(null);fe.useLayoutEffect(()=>{e._cropModeEnabled&&(X.current.nodes([V.current]),z.current.nodes([o.current]))},[e._cropModeEnabled]);const D=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 pe=ce.target.width()*ce.target.scaleX(),Ae=ce.target.height()*ce.target.scaleY(),Ce=Math.min(1,R/pe),ke=Math.min(1,k/Ae),Se=1-Ce,le=Math.min(Se,Math.max(0,Math.round(-ce.target.x())/pe)),Ee=1-ke,xe=Math.min(Ee,Math.max(0,Math.round(-ce.target.y())/Ae));ce.target.setAttrs({x:-le*f.width,y:-xe*f.height,scaleX:1,scaleY:1}),e.set({cropX:le,cropY:xe,cropWidth:Ce,cropHeight:ke})},F=()=>{e.type!=="svg"&&e.contentEditable&&setTimeout(()=>{e.toggleCropMode(!0)})},q=v==="loading",Q=v==="failed",re=!q&&!Q,Y=fe.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),ee=re?e.a.opacity:0;hp(a,ee);const ae=e.selectable||t.role==="admin",ue=af();return fe.createElement(fe.Fragment,null,q&&fe.createElement(yO,{element:e}),Q&&fe.createElement(bO,{element:e}),fe.createElement(Eu,{ref:a,name:"element",id:e.id,image:G,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:ee,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:T,listening:ae,draggable:ue?e.draggable&&l:e.draggable,preventDefault:!ue||l,hideInExport:!e.showInExport,onDragMove:ce=>{e.set({x:ce.target.x(),y:ce.target.y()})},onDragEnd:ce=>{e.set({x:ce.target.x(),y:ce.target.y()})},onDblClick:F,onDblTap:F,onTransformStart:()=>{i(!0),Y.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:ce=>{var pe;const Ae=ce.currentTarget,Ce=Math.abs(Ae.scaleX()-1)<1e-7?1:Ae.scaleX(),ke=Math.abs(Ae.scaleY()-1)<1e-7?1:Ae.scaleY();Ae.scaleX(1),Ae.scaleY(1);const Se=(pe=ce.target.getStage())===null||pe===void 0?void 0:pe.findOne("Transformer"),le=1-R/f.width,Ee=Math.min(le,Math.max(0,e.cropX)),xe=1-k/f.height,ye=Math.min(xe,Math.max(0,e.cropY)),Ne=Se.getActiveAnchor(),Te=!(Ne.indexOf("middle")>=0||Ne.indexOf("center")>=0),ge=!Te&&Ce<1&&Y.current.cropHeight>k/f.height;let Re=Te?e.cropWidth:e.cropWidth*Ce;ge&&(Re=e.cropWidth);const Be=!Te&&ke<1&&Y.current.cropWidth>R/f.width;let Qe=Te?e.cropHeight:e.cropHeight*ke;Be&&(Qe=e.cropHeight),M&&(Re=e.cropWidth,Qe=e.cropHeight),e.set({cropX:Ee,cropY:ye,x:Ae.x(),y:Ae.y(),width:Ae.width()*Ce,height:Ae.height()*ke,rotation:ce.target.rotation(),cropWidth:Math.min(Re,1-Ee),cropHeight:Math.min(Qe,1-ye)})},onTransformEnd:ce=>{const pe=ce.currentTarget;e.set({width:pe.width(),height:pe.height(),x:pe.x(),y:pe.y(),rotation:ce.target.rotation(),cropWidth:R/f.width,cropHeight:k/f.height}),i(!1)}}),fe.createElement(xn,{x:e.a.x,y:e.a.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:ee,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,C-e.borderSize),hideInExport:!e.showInExport}),!t.isPlaying&&fe.createElement(Eu,{image:u?I6:M6,x:e.a.x,y:e.a.y,offsetX:-e.a.width/2+15/t.scale,offsetY:-e.a.height/2+15/t.scale,rotation:e.a.rotation,width:30/t.scale,height:30/t.scale,hideInExport:!0,onClick:()=>d(!u),onTap:()=>d(!u)}),e._cropModeEnabled&&fe.createElement(qv,{selector:".page-abs-container",enabled:!0},fe.createElement(xn,{x:-window.innerWidth/t.scale,y:-window.innerWidth/t.scale,width:window.innerWidth/t.scale*3,height:window.innerWidth/t.scale*3,fill:"rgba(0,0,0,0.3)"}),fe.createElement(Eu,{listening:!1,image:G,x:e.a.x,y:e.a.y,width:e.a.width,height:e.a.height,rotation:e.a.rotation,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur}),fe.createElement(dn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,scaleX:U,scaleY:U},fe.createElement(Eu,{image:f,ref:o,opacity:.4,draggable:!0,x:-e.cropX*f.width,y:-e.cropY*f.height,onDragMove:D,onTransform:D}),fe.createElement(Jd,{ref:z,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ce,pe)=>pe.width<5||pe.height<5?ce:pe,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),fe.createElement(xn,{width:R,height:k,ref:V,listening:!1,onTransform:ce=>{ce.target.x()<-e.cropX*f.width-1e-9&&(ce.target.x(-e.cropX*f.width),ce.target.scaleX(1)),ce.target.y()<-e.cropY*f.height-1e-9&&(ce.target.y(-e.cropY*f.height),ce.target.scaleY(1));const pe=Math.min(1,Math.max(0,e.cropX+ce.target.x()/f.width)),Ae=Math.min(1,Math.max(0,ce.target.y()/f.height+e.cropY)),Ce=ce.target.width()*ce.target.scaleX(),ke=ce.target.height()*ce.target.scaleY(),Se=Math.min(1-pe,Ce/f.width),le=Math.min(1-Ae,ke/f.height),Ee=ce.target.getAbsolutePosition(ce.target.getParent().getParent());ce.target.scale({x:1,y:1}),ce.target.position({x:0,y:0}),e.set({x:Ee.x,y:Ee.y,cropX:pe,cropY:Ae,cropWidth:Se,cropHeight:le,width:Math.min(Ce*U,f.width*(1-pe)*U),height:Math.min(ke*U,f.height*(1-Ae)*U)})}}),fe.createElement(Jd,{ref:X,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(ce,pe)=>pe.width<5||pe.height<5?ce:pe,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:e.resizable}))))}),rm=({width:e,height:t,cornerRadius:r})=>{if(r>0){const n=Math.min(r,e/2,t/2);return`M 0 ${n} A ${n} ${n} 0 0 1 ${n} 0 L ${e-n} 0 A ${n} ${n} 0 0 1 ${e} ${n} L ${e} ${t-n} A ${n} ${n} 0 0 1 ${e-n} ${t} L ${n} ${t} A ${n} ${n} 0 0 1 0 ${t-n} Z`}return`M 0 0 L ${e} 0 L ${e} ${t} L 0 ${t} Z`},xO=({width:e,height:t})=>`M ${e/2} 0 L ${e} ${t} L 0 ${t} Z`,SO=({width:e,height:t})=>`M 0 0 L ${e} 0 L 0 ${t} Z`,EO=({width:e,height:t})=>`M ${e/2} ${t/2} m -${e/2}, 0 a ${e/2},${t/2} 0 1,0 ${e},0 a ${e/2},${t/2} 0 1,0 -${e},0`;function PO({width:e,height:t}){const r=e/2,n=t/2,i=e/2,a=t/2,o=i/2,l=a/2;let u="",d=Math.PI/5;for(let h=0;h<10;h++){const v=h%2==0?a:l,p=r+(h%2==0?i:o)*Math.sin(h*d),f=n-v*Math.cos(h*d);h===0?u=`M ${p} ${f}`:u+=` L ${p} ${f}`}return u+" Z"}function AO({width:e,height:t}){const r=e/2,n=t/2;return`M ${r} 0 L ${e} ${n} L ${r} ${t} L 0 ${n} Z`}function OO({width:e,height:t}){const r=e/2,n=t/2,i=e/2,a=t/2;let o="",l=2*Math.PI/5;for(let u=0;u<5;u++){const d=a,h=r+i*Math.sin(u*l),v=n-d*Math.cos(u*l);u===0?o=`M ${h} ${v}`:o+=` L ${h} ${v}`}return o+" Z"}function CO({width:e,height:t}){const r=e/2,n=t/2,i=e/2,a=t/2;let o="",l=2*Math.PI/6;for(let u=0;u<6;u++){const d=a,h=r+i*Math.sin(u*l),v=n-d*Math.cos(u*l);u===0?o=`M ${h} ${v}`:o+=` L ${h} ${v}`}return o+" Z"}function kt({path:e,aspectRatio:t,width:r,height:n}){return{path:e,scaleX:r/t.width,scaleY:n/t.height}}function kO({width:e,height:t}){const r=.1*Math.min(e,t),n=.2*e,i=.2*t,a=.5*e;let o=`M ${r},0`;return o+=" H "+(e-r),o+=` A ${r},${r} 0 0 1 ${e},${r}`,o+=" V "+(t-r-i),o+=` A ${r},${r} 0 0 1 ${e-r},${t-i}`,o+=` H ${a+n/2}`,o+=` L ${a},${t}`,o+=` L ${a-n/2},${t-i}`,o+=` H ${r}`,o+=` A ${r},${r} 0 0 1 0,${t-r-i}`,o+=` V ${r}`,o+=` A ${r},${r} 0 0 1 ${r},0`,o+=" Z",o}function NO({width:e,height:t}){const r=.3*e,n=.3*t,i=e/2,a=t/2,o=i-r/2,l=i+r/2,u=a-n/2,d=a+n/2;let h=`M ${o},0 `;return h+=`H ${l} `,h+=`V ${u} `,h+=`H ${e} `,h+=`V ${d} `,h+=`H ${l} `,h+=`V ${t} `,h+=`H ${o} `,h+=`V ${d} `,h+="H 0 ",h+=`V ${u} `,h+=`H ${o} `,h+="V 0 ",h+="Z",h}const LO={rect:rm,circle:EO,star:PO,triangle:xO,rightTriangle:SO,diamond:AO,pentagon:OO,hexagon:CO,speechBubble:kO,cross:NO,arc:({width:e,height:t})=>kt({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:e,height:t}),cloud:({width:e,height:t})=>kt({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:e,height:t}),rightArrow:({width:e,height:t})=>{const r=.6*e;return`M 0 ${t/4} L ${r} ${t/4} L ${r} 0 L ${e} ${t/2} L ${r} ${t} L ${r} ${.75*t} L 0 ${.75*t} Z`},leftArrow:({width:e,height:t})=>{const r=.4*e;return`M ${e} ${t/4} L ${r} ${t/4} L ${r} 0 L 0 ${t/2} L ${r} ${t} L ${r} ${.75*t} L ${e} ${.75*t} Z`},downArrow:({width:e,height:t})=>{const r=.6*t;return`M ${e/4} 0 L ${e/4} ${r} L 0 ${r} L ${e/2} ${t} L ${e} ${r} L ${.75*e} ${r} L ${.75*e} 0 Z`},upArrow:({width:e,height:t})=>{const r=.4*t;return`M ${e/4} ${t} L ${e/4} ${r} L 0 ${r} L ${e/2} 0 L ${e} ${r} L ${.75*e} ${r} L ${.75*e} ${t} Z`},asterisk1:({width:e,height:t})=>kt({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:e,height:t}),asterisk2:({width:e,height:t})=>kt({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:e,height:t}),bookmark:({width:e,height:t})=>kt({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:e,height:t}),butterfly:({width:e,height:t})=>kt({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:e,height:t}),cylinder:({width:e,height:t})=>kt({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:e,height:t}),diamond2:({width:e,height:t})=>kt({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:e,height:t}),door:({width:e,height:t})=>kt({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:e,height:t}),drop1:({width:e,height:t})=>kt({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:e,height:t}),drop2:({width:e,height:t})=>kt({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:e,height:t}),explosion:({width:e,height:t})=>kt({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:e,height:t}),flag:({width:e,height:t})=>kt({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:e,height:t}),flower:({width:e,height:t})=>kt({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:e,height:t}),frame:({width:e,height:t})=>kt({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:e,height:t}),heart1:({width:e,height:t})=>kt({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:e,height:t}),home:({width:e,height:t})=>kt({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:e,height:t}),home2:({width:e,height:t})=>kt({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:e,height:t}),hourglass:({width:e,height:t})=>kt({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:e,height:t}),house:({width:e,height:t})=>kt({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:e,height:t}),keyhole:({width:e,height:t})=>kt({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:e,height:t}),kiss:({width:e,height:t})=>kt({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:e,height:t}),leaf:({width:e,height:t})=>kt({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:e,height:t}),lightning1:({width:e,height:t})=>kt({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:e,height:t}),lightning2:({width:e,height:t})=>kt({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:e,height:t}),magnet:({width:e,height:t})=>kt({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:e,height:t}),mithosis:({width:e,height:t})=>kt({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:e,height:t}),orangeRicky:({width:e,height:t})=>kt({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:e,height:t}),party:({width:e,height:t})=>kt({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:e,height:t}),pillow:({width:e,height:t})=>kt({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:e,height:t}),polygon:({width:e,height:t})=>kt({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:e,height:t}),rainbow:({width:e,height:t})=>kt({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:e,height:t}),rhodeIsland:({width:e,height:t})=>kt({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:e,height:t}),shell:({width:e,height:t})=>kt({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:e,height:t}),shield1:({width:e,height:t})=>kt({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:e,height:t}),shield2:({width:e,height:t})=>kt({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:e,height:t}),skewedRectangle:({width:e,height:t})=>kt({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:e,height:t}),softFlower:({width:e,height:t})=>kt({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:e,height:t}),softStar:({width:e,height:t})=>kt({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:e,height:t}),stairs1:({width:e,height:t})=>kt({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:e,height:t}),stairs2:({width:e,height:t})=>kt({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:e,height:t}),teewee:({width:e,height:t})=>kt({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:e,height:t}),blob1:({width:e,height:t})=>kt({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:e,height:t}),blob10:({width:e,height:t})=>kt({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:e,height:t}),blob11:({width:e,height:t})=>kt({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:e,height:t}),blob12:({width:e,height:t})=>kt({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:e,height:t}),blob13:({width:e,height:t})=>kt({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:e,height:t}),blob14:({width:e,height:t})=>kt({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:e,height:t}),blob15:({width:e,height:t})=>kt({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:e,height:t}),blob16:({width:e,height:t})=>kt({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:e,height:t}),blob17:({width:e,height:t})=>kt({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:e,height:t}),blob18:({width:e,height:t})=>kt({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:e,height:t}),blob19:({width:e,height:t})=>kt({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:e,height:t}),blob2:({width:e,height:t})=>kt({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:e,height:t}),blob20:({width:e,height:t})=>kt({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:e,height:t}),blob21:({width:e,height:t})=>kt({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:e,height:t}),blob22:({width:e,height:t})=>kt({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:e,height:t}),blob23:({width:e,height:t})=>kt({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:e,height:t}),blob24:({width:e,height:t})=>kt({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:e,height:t}),blob25:({width:e,height:t})=>kt({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:e,height:t}),blob26:({width:e,height:t})=>kt({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:e,height:t}),blob27:({width:e,height:t})=>kt({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:e,height:t}),blob28:({width:e,height:t})=>kt({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:e,height:t}),blob29:({width:e,height:t})=>kt({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:e,height:t}),blob3:({width:e,height:t})=>kt({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:e,height:t}),blob30:({width:e,height:t})=>kt({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:e,height:t}),blob31:({width:e,height:t})=>kt({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:e,height:t}),blob32:({width:e,height:t})=>kt({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:e,height:t}),blob4:({width:e,height:t})=>kt({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:e,height:t}),blob5:({width:e,height:t})=>kt({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:e,height:t}),blob6:({width:e,height:t})=>kt({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:e,height:t}),blob7:({width:e,height:t})=>kt({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:e,height:t}),blob8:({width:e,height:t})=>kt({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:e,height:t}),blob9:({width:e,height:t})=>kt({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:e,height:t})};function F6(e){return LO[e]||rm}function D6(e){const{subType:t}=e,r=F6(t);return r?function(n,i){const{width:a,height:o,fill:l,stroke:u,strokeWidth:d,dash:h}=n,v=(h||[]).map(S=>S*d);let p=i(n),f=1,b=1;typeof p!="string"&&(f=p.scaleX,b=p.scaleY,p=p.path);const _=`clip-${n.id||Math.random()}`;return`
281
- <svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${o}">
282
- <defs>
283
- <clipPath id="${_}">
284
- <path d="${p}" />
285
- </clipPath>
286
- </defs>
287
-
288
- <!-- Path for the fill -->
289
- <path d="${p}" fill="${l}" transform="scale(${f}, ${b})"/>
290
-
291
- <!-- Path for the stroke, clipped by the star path -->
292
- <path d="${p}" fill="none" stroke="${u}" stroke-width="${2*d}" clip-path="url(#${_})" transform="scale(${f}, ${b})" stroke-dasharray="${v.join(" ")}"/>
293
- </svg>
294
- `}(e,r):(console.error(`Polotno error: Can not convert ${e.subType} figure to svg.`),rm(e))}const x2={},TO=Gn(({element:e,store:t})=>{const r=e.selectable||t.role==="admin",n=af(),i=t.selectedShapes.indexOf(e)>=0&&e.selectable,a=Math.min(e.strokeWidth,e.width/2,e.height/2),o=Math.max(0,Math.min(e.width/2,e.height/2,e.cornerRadius)),l=Zc(e,e.a.fill,"fill"),u=Object.assign(Object.assign({width:e.a.width,height:e.a.height},l),{cornerRadius:o,opacity:e.animated("opacity"),shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,preventDefault:!n||i,hideInExport:!e.showInExport}),d=Zc(e,e.stroke,"stroke"),h=Object.assign(Object.assign({visible:a>0,x:a/2,y:a/2,width:e.a.width-a,height:e.a.height-a},d),{strokeWidth:a,cornerRadius:Math.max(0,o-a),dash:e.dash.map(b=>b*a),opacity:e.animated("opacity"),hideInExport:!e.showInExport,listening:!1}),v=(p=e.subType,x2[p]||(x2[p]=(f=F6(p),Gn(({element:b,fillProps:_,strokeProps:S})=>{let x=f({width:b.a.width,height:b.a.height,cornerRadius:b.cornerRadius}),m=1,w=1;typeof x!="string"&&(m=x.scaleX,w=x.scaleY,x=x.path);const E=fe.useRef(null);return fe.createElement(fe.Fragment,null,fe.createElement(xn,{width:b.width,height:b.height,fill:"transparent"}),fe.createElement(J2,Object.assign({},_,{ref:E,data:x,scaleX:m,scaleY:w})),fe.createElement(dn,{clipFunc:P=>{const R=E.current;if(R){var k=R.dataArray;P.beginPath();for(var N=0;N<k.length;N++){var M=k[N].command,T=k[N].points;switch(M){case"L":P.lineTo(T[0],T[1]);break;case"M":P.moveTo(T[0],T[1]);break;case"C":P.bezierCurveTo(T[0],T[1],T[2],T[3],T[4],T[5]);break;case"Q":P.quadraticCurveTo(T[0],T[1],T[2],T[3]);break;case"A":var C=T[0],L=T[1],H=T[2],G=T[3],J=T[4],se=T[5],U=T[6],V=T[7],X=H>G?H:G,z=H>G?1:H/G,D=H>G?G/H:1;P.translate(C,L),P.rotate(U),P.scale(z,D),P.arc(0,0,X,J,J+se,1-V),P.scale(1/z,1/D),P.rotate(-U),P.translate(-C,-L);break;case"z":P.closePath()}}}},scaleX:m,scaleY:w},fe.createElement(J2,Object.assign({},S,{x:0,y:0,data:x,strokeWidth:2*S.strokeWidth,dash:S.dash.map(P=>P)}))))}))),x2[p]||dn);var p,f;return fe.createElement(fe.Fragment,null,fe.createElement(dn,{id:e.id,x:e.a.x,y:e.a.y,rotation:e.a.rotation,opacity:e.a.opacity,listening:r,draggable:n?e.draggable&&i:e.draggable,name:"element",onDragMove:b=>{e.set({x:b.target.x(),y:b.target.y()})},onDragEnd:b=>{e.set({x:b.target.x(),y:b.target.y()})},onTransform:b=>{const _=b.target.scale();b.target.scaleX(1),b.target.scaleY(1),e.set({width:e.width*_.x,height:e.height*_.y,x:b.target.x(),y:b.target.y(),rotation:b.target.rotation()})}},fe.createElement(v,{element:e,fillProps:u,strokeProps:h})))});var rc={},S2={},nc={},Eb;function B6(){if(Eb)return nc;Eb=1,Object.defineProperty(nc,"__esModule",{value:!0}),nc.loop=nc.conditional=nc.parse=void 0;var e=function n(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o;if(Array.isArray(a))a.forEach(function(d){return n(i,d,o,l)});else if(typeof a=="function")a(i,o,l,n);else{var u=Object.keys(a)[0];Array.isArray(a[u])?(l[u]={},n(i,a[u],o,l[u])):l[u]=a[u](i,o,l,n)}return o};nc.parse=e;var t=function(i,a){return function(o,l,u,d){a(o,l,u)&&d(o,i,l,u)}};nc.conditional=t;var r=function(i,a){return function(o,l,u,d){for(var h=[],v=o.pos;a(o,l,u);){var p={};if(d(o,i,l,p),o.pos===v)break;v=o.pos,h.push(p)}return h}};return nc.loop=r,nc}var Yi={},Pb;function z6(){if(Pb)return Yi;Pb=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.readBits=Yi.readArray=Yi.readUnsigned=Yi.readString=Yi.peekBytes=Yi.readBytes=Yi.peekByte=Yi.readByte=Yi.buildStream=void 0;var e=function(v){return{data:v,pos:0}};Yi.buildStream=e;var t=function(){return function(v){return v.data[v.pos++]}};Yi.readByte=t;var r=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(p){return p.data[p.pos+v]}};Yi.peekByte=r;var n=function(v){return function(p){return p.data.subarray(p.pos,p.pos+=v)}};Yi.readBytes=n;var i=function(v){return function(p){return p.data.subarray(p.pos,p.pos+v)}};Yi.peekBytes=i;var a=function(v){return function(p){return Array.from(n(v)(p)).map(function(f){return String.fromCharCode(f)}).join("")}};Yi.readString=a;var o=function(v){return function(p){var f=n(2)(p);return v?(f[1]<<8)+f[0]:(f[0]<<8)+f[1]}};Yi.readUnsigned=o;var l=function(v,p){return function(f,b,_){for(var S=typeof p=="function"?p(f,b,_):p,x=n(v),m=new Array(S),w=0;w<S;w++)m[w]=x(f);return m}};Yi.readArray=l;var u=function(v,p,f){for(var b=0,_=0;_<f;_++)b+=v[p+_]&&Math.pow(2,f-_-1);return b},d=function(v){return function(p){for(var f=t()(p),b=new Array(8),_=0;_<8;_++)b[7-_]=!!(f&1<<_);return Object.keys(v).reduce(function(S,x){var m=v[x];return m.length?S[x]=u(b,m.index,m.length):S[x]=b[m.index],S},{})}};return Yi.readBits=d,Yi}var Ab;function RO(){return Ab||(Ab=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=B6(),r=z6(),n={blocks:function(p){for(var f=0,b=[],_=p.data.length,S=0,x=(0,r.readByte)()(p);x!==f&&x;x=(0,r.readByte)()(p)){if(p.pos+x>=_){var m=_-p.pos;b.push((0,r.readBytes)(m)(p)),S+=m;break}b.push((0,r.readBytes)(x)(p)),S+=x}for(var w=new Uint8Array(S),E=0,P=0;P<b.length;P++)w.set(b[P],E),E+=b[P].length;return w}},i=(0,t.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 p=(0,r.peekBytes)(2)(v);return p[0]===33&&p[1]===249}),a=(0,t.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,t.conditional)({lct:(0,r.readArray)(3,function(v,p,f){return Math.pow(2,f.descriptor.lct.size+1)})},function(v,p,f){return f.descriptor.lct.exists}),{data:[{minCodeSize:(0,r.readByte)()},n]}]},function(v){return(0,r.peekByte)()(v)===44}),o=(0,t.conditional)({text:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{preData:function(p,f,b){return(0,r.readBytes)(b.text.blockSize)(p)}},n]},function(v){var p=(0,r.peekBytes)(2)(v);return p[0]===33&&p[1]===1}),l=(0,t.conditional)({application:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{id:function(p,f,b){return(0,r.readString)(b.blockSize)(p)}},n]},function(v){var p=(0,r.peekBytes)(2)(v);return p[0]===33&&p[1]===255}),u=(0,t.conditional)({comment:[{codes:(0,r.readBytes)(2)},n]},function(v){var p=(0,r.peekBytes)(2)(v);return p[0]===33&&p[1]===254}),d=[{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,t.conditional)({gct:(0,r.readArray)(3,function(v,p){return Math.pow(2,p.lsd.gct.size+1)})},function(v,p){return p.lsd.gct.exists}),{frames:(0,t.loop)([i,l,u,a,o],function(v){var p=(0,r.peekByte)()(v);return p===33||p===44})}],h=d;e.default=h}(S2)),S2}var Rd={},Ob;function MO(){if(Ob)return Rd;Ob=1,Object.defineProperty(Rd,"__esModule",{value:!0}),Rd.deinterlace=void 0;var e=function(r,n){for(var i=new Array(r.length),a=r.length/n,o=function(f,b){var _=r.slice(b*n,(b+1)*n);i.splice.apply(i,[f*n,n].concat(_))},l=[0,4,2,1],u=[8,8,4,2],d=0,h=0;h<4;h++)for(var v=l[h];v<a;v+=u[h])o(v,d),d++;return i};return Rd.deinterlace=e,Rd}var Md={},Cb;function IO(){if(Cb)return Md;Cb=1,Object.defineProperty(Md,"__esModule",{value:!0}),Md.lzw=void 0;var e=function(r,n,i){var a=4096,o=-1,l=i,u,d,h,v,p,f,b,k,_,S,R,x,N,M,C,T,m=new Array(i),w=new Array(a),E=new Array(a),P=new Array(a+1);for(x=r,d=1<<x,p=d+1,u=d+2,b=o,v=x+1,h=(1<<v)-1,_=0;_<d;_++)w[_]=0,E[_]=_;var R,k,N,M,T,C;for(R=k=N=M=T=C=0,S=0;S<l;){if(M===0){if(k<v){R+=n[C]<<k,k+=8,C++;continue}if(_=R&h,R>>=v,k-=v,_>u||_==p)break;if(_==d){v=x+1,h=(1<<v)-1,u=d+2,b=o;continue}if(b==o){P[M++]=E[_],b=_,N=_;continue}for(f=_,_==u&&(P[M++]=N,_=b);_>d;)P[M++]=E[_],_=w[_];N=E[_]&255,P[M++]=N,u<a&&(w[u]=b,E[u]=N,u++,(u&h)===0&&u<a&&(v++,h+=u)),b=f}M--,m[T++]=P[M],S++}for(S=T;S<l;S++)m[S]=0;return m};return Md.lzw=e,Md}var kb;function jO(){if(kb)return rc;kb=1,Object.defineProperty(rc,"__esModule",{value:!0}),rc.decompressFrames=rc.decompressFrame=rc.parseGIF=void 0;var e=a(RO()),t=B6(),r=z6(),n=MO(),i=IO();function a(h){return h&&h.__esModule?h:{default:h}}var o=function(v){var p=new Uint8Array(v);return(0,t.parse)((0,r.buildStream)(p),e.default)};rc.parseGIF=o;var l=function(v){for(var p=v.pixels.length,f=new Uint8ClampedArray(p*4),b=0;b<p;b++){var _=b*4,S=v.pixels[b],x=v.colorTable[S]||[0,0,0];f[_]=x[0],f[_+1]=x[1],f[_+2]=x[2],f[_+3]=S!==v.transparentIndex?255:0}return f},u=function(v,p,f){if(!v.image){console.warn("gif frame does not have associated image.");return}var b=v.image,_=b.descriptor.width*b.descriptor.height,S=(0,i.lzw)(b.data.minCodeSize,b.data.blocks,_);b.descriptor.lct.interlaced&&(S=(0,n.deinterlace)(S,b.descriptor.width));var x={pixels:S,dims:{top:v.image.descriptor.top,left:v.image.descriptor.left,width:v.image.descriptor.width,height:v.image.descriptor.height}};return b.descriptor.lct&&b.descriptor.lct.exists?x.colorTable=b.lct:x.colorTable=p,v.gce&&(x.delay=(v.gce.delay||10)*10,x.disposalType=v.gce.extras.disposal,v.gce.extras.transparentColorGiven&&(x.transparentIndex=v.gce.transparentColorIndex)),f&&(x.patch=l(x)),x};rc.decompressFrame=u;var d=function(v,p){return v.frames.filter(function(f){return f.image}).map(function(f){return u(f,v.gct,p)})};return rc.decompressFrames=d,rc}var Nb=jO();function E2(e,t,r){const n=t.getContext("2d"),i=r.getContext("2d");if(!n||!i)return;e.disposalType===2&&n.clearRect(0,0,t.width,t.height),r.width=e.width,r.height=e.height;const a=i.createImageData(e.width,e.height);a.data.set(e.patch),i.putImageData(a,0,0),n.drawImage(r,e.left,e.top)}const FO=Gn(({element:e})=>{const t=Math.min(30,e.width/4,e.height/4),r=fe.useRef(null);return fe.useEffect(()=>{const n=r.current;if(!n)return;const i=new Kt.Animation(a=>{n.rotate((a?.timeDiff||0)/2)},n.getLayer());return i.start(),()=>{i.stop()}},[]),fe.createElement(dn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},fe.createElement(xn,{width:e.width,height:e.height,fill:"rgba(124, 173, 212, 0.8)"}),fe.createElement(Bv,{ref:r,x:e.width/2,y:e.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),DO=Gn(({element:e})=>{const t=Math.max(10,Math.min(30,e.width/22));return fe.createElement(dn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},fe.createElement(xn,{width:e.width,height:e.height,fill:"rgba(223, 102, 102, 0.8)"}),fe.createElement(Nu,{text:"Cannot load the GIF...",fontSize:t,width:e.width,height:e.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))}),BO=Gn(({element:e,store:t})=>{var r;const[n,i]=fe.useState(!1),a=t.selectedShapes.indexOf(e)>=0&&e.selectable,o=fe.useRef(null),l=fe.useRef(),[u,d,h,v]=function(M){const[T,C]=fe.useState([]),[L,H]=fe.useState(0),[G,J]=fe.useState("loading"),[se,U]=fe.useState({width:0,height:0});return fe.useEffect(()=>{(async()=>{try{const V=await fetch(M),X=await V.arrayBuffer(),z=Nb.parseGIF(X),D=Nb.decompressFrames(z,!0),F=z.lsd.width,q=z.lsd.height;U({width:F,height:q});const Q=D.map(Y=>({patch:new Uint8ClampedArray(Y.patch),delay:Y.delay,width:Y.dims.width,height:Y.dims.height,left:Y.dims.left,top:Y.dims.top,disposalType:Y.disposalType})),re=Q.reduce((Y,ee)=>Y+ee.delay,0);C(Q),H(re),J("loaded")}catch(V){console.error("Failed to load GIF:",V),J("failed")}})()},[M]),[T,L,se,G]}(e.src);Gd(v,e.src,e.id),fe.useEffect(()=>(l.current=document.createElement("canvas"),()=>{l.current&&Kt.Util.releaseCanvas(l.current)}),[]),fe.useEffect(()=>{if(v==="loaded"&&l.current&&(l.current.width=h.width,l.current.height=h.height,u.length>0)){const M=l.current.getContext("2d");if(M){M.clearRect(0,0,h.width,h.height);const T=document.createElement("canvas");E2(u[0],l.current,T)}}},[h,v,u]),fe.useEffect(()=>{if(!u.length||!l.current)return;const M=l.current;M.width=h.width,M.height=h.height;const T=document.createElement("canvas"),C=M.getContext("2d");C&&C.clearRect(0,0,M.width,M.height);let L=-1;E2(u[0],M,T),w(),L=0;const H=G=>{const J=(se=>{const U=se%d;let V=0;for(let X=0;X<u.length;X++)if(V+=u[X].delay,V>U)return X;return 0})(G);J!==L&&(E2(u[J],M,T),w(),o.current.getLayer().draw(),L=J)};if(t.isPlaying||e.page._exportingOrRendering)return Mu(()=>{H(t.currentTime-e.page.startTime)});{const G=window.setInterval(()=>{H(t.currentTime||performance.now())},16);return()=>{clearInterval(G)}}},[t.isPlaying,u,d,e.page._exportingOrRendering]),fe.useEffect(()=>{d&&t.history.ignore(()=>{e.set({duration:d})})},[d]);let{cropX:p,cropY:f,cropWidth:b,cropHeight:_}=e;v!=="loaded"&&(p=f=0,b=_=1);const S={x:h.width*p,y:h.height*f,width:h.width*b,height:h.height*_},x=(r=e.cornerRadius)!==null&&r!==void 0?r:0,[m,w]=j6(e,l.current,S,t._elementsPixelRatio,x,n||e._cropModeEnabled);fe.useLayoutEffect(()=>{if(!n&&!e._cropModeEnabled&&o.current)return _s(o.current,e),Mu(()=>{_s(o.current,e)},{delay:100})},[l.current,n,b,_,e._cropModeEnabled,h.width,h.height]);const E=v==="loading",P=v==="failed",R=E||P?0:e.a.opacity;hp(o,R);const k=e.selectable||t.role==="admin",N=af();return fe.createElement(fe.Fragment,null,E&&fe.createElement(FO,{element:e}),P&&fe.createElement(DO,{element:e}),fe.createElement(Eu,{ref:o,name:"element",id:e.id,image:m,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:R,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:S,listening:k,draggable:N?e.draggable&&a:e.draggable,preventDefault:!N||a,hideInExport:!e.showInExport,onDragMove:M=>{e.set({x:M.target.x(),y:M.target.y()})},onDragEnd:M=>{e.set({x:M.target.x(),y:M.target.y()})},onTransformStart:()=>i(!0),onTransform:M=>{const T=M.currentTarget,C=Math.abs(T.scaleX()-1)<1e-7?1:T.scaleX(),L=Math.abs(T.scaleY()-1)<1e-7?1:T.scaleY();T.scaleX(1),T.scaleY(1),e.set({x:T.x(),y:T.y(),width:T.width()*C,height:T.height()*L,rotation:T.rotation()})},onTransformEnd:()=>i(!1)}),fe.createElement(xn,{x:e.a.x,y:e.a.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:R,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,x-e.borderSize),hideInExport:!e.showInExport}))}),zO={stroke:"rgb(0, 161, 255)",strokeWidth:2},qO=Gn(({element:e})=>fe.createElement(xn,Object.assign({name:"highlighter",x:e.a.x,y:e.a.y,rotation:e.a.rotation,width:e.a.width,height:e.a.height,listening:!1,strokeScaleEnabled:!1},zO)));let gl=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");const $d=function(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!=Object.keys(t).length)return!1;for(var r in e)if(!t.hasOwnProperty(r)||!$d(e[r],t[r]))return!1;return!0}return!1};Object.assign($t);const UO=$t.model("UndoManager",{history:$t.array($t.frozen()),undoIdx:-1,targetPath:""}).views(e=>({get canUndo(){return e.undoIdx>0},get canRedo(){return e.undoIdx<e.history.length-1}})).actions(e=>{let t,r,n=!1,i=null,a=0,o=0;const l=()=>o>0;function u(){const h=Pu(t);return{pages:h.pages,width:h.width,height:h.height,custom:h.custom,audios:h.audios}}function d(h){const v=t.pages.map(_=>_.id),p=h.pages.map(_=>_.id),f=!$d(v,p),b=!$d(t.custom,h.custom);f?nv(t.pages,h.pages):t.pages.forEach((_,S)=>{nv(_,h.pages[S])}),b&&t.set({custom:h.custom}),t.setSize(h.width,h.height)}return{startTransaction(){o++},endTransaction(h){o--,h||this.requestAddState(u())},async ignore(h,v=!1,p=!1){p&&await new Promise(x=>setTimeout(x,10)),a&&e.addUndoState();let f=l();e.startTransaction();let b=o;try{await h()}catch(x){setTimeout(()=>{throw x})}const _=b!==o,S=!_;e.endTransaction(S),v||f||e.replaceState(),_||(clearTimeout(a),a=0)},async transaction(h){await e.ignore(h,!0),this.addUndoState()},requestAddState(h){i=h,a||l()||(n?n=!1:a=setTimeout(()=>{a=0,clearTimeout(a),l()||this.addUndoState()},100))},addUndoState(){if(n)return void(n=!1);const h=e.history[e.undoIdx];!$d(i,h)&&(clearTimeout(a),a=0,e.history.splice(e.undoIdx+1),e.history.push(i),e.undoIdx=e.history.length-1)},afterCreate(){if(t=tE(e,".."),!t)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");r=Fw(t,()=>{this.requestAddState(u())}),e.history.length===0&&this.requestAddState(u())},clear(){clearTimeout(a),a=0,e.history.splice(0,e.history.length),e.undoIdx=-1,e.addUndoState(u())},beforeDestroy(){r()},undo(){a&&this.addUndoState(),e.canUndo?(e.undoIdx--,n=!0,d(e.history[e.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){a&&this.addUndoState(),e.canRedo?(e.undoIdx++,n=!0,d(e.history[e.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){e.history[e.undoIdx]=u()}}});async function Jp(e,t){const r=await(await fetch(e)).blob(),n=document.createElement("a"),i=URL.createObjectURL(r);n.href=i,n.download=t,document.body.appendChild(n),n.click(),setTimeout(function(){document.body.removeChild(n),window.URL.revokeObjectURL(i)},0)}let P2=null;function HO(){var e;return!((e=window.jspdf)===null||e===void 0)&&e.jsPDF?Promise.resolve(window.jspdf.jsPDF):P2||(P2=new Promise(t=>{var r=document.createElement("script");r.onload=function(){t(window.jspdf.jsPDF)},r.src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/3.0.1/jspdf.umd.min.js",document.head.appendChild(r)}),P2)}function VO(){return window.GIF?Promise.resolve(window.GIF):new Promise(e=>{var t=document.createElement("script");t.onload=function(){e(window.GIF)},t.src="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js",document.head.appendChild(t)})}async function GO({width:e,height:t}){return new(await VO())({workers:4,width:e,height:t,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
295
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.pageSize;i++){rv+=ByteArray.charMap[this.pages[p][i]]}}return rv};ByteArray.prototype.writeByte=function(val){if(this.cursor>=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i<l;i++)this.writeByte(string.charCodeAt(i))};ByteArray.prototype.writeBytes=function(array,offset,length){for(var l=length||array.length,i=offset||0;i<l;i++)this.writeByte(array[i])};function GIFEncoder(width,height){this.width=~~width;this.height=~~height;this.transparent=null;this.transIndex=0;this.repeat=-1;this.delay=0;this.image=null;this.pixels=null;this.indexedPixels=null;this.colorDepth=null;this.colorTab=null;this.neuQuant=null;this.usedEntry=new Array;this.palSize=7;this.dispose=-1;this.firstFrame=true;this.sample=10;this.dither=false;this.globalPalette=false;this.out=new ByteArray}GIFEncoder.prototype.setDelay=function(milliseconds){this.delay=Math.round(milliseconds/10)};GIFEncoder.prototype.setFrameRate=function(fps){this.delay=Math.round(100/fps)};GIFEncoder.prototype.setDispose=function(disposalCode){if(disposalCode>=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j<nPix;j++){var index=this.findClosestRGB(this.pixels[k++]&255,this.pixels[k++]&255,this.pixels[k++]&255);this.usedEntry[index]=true;this.indexedPixels[j]=index}};GIFEncoder.prototype.ditherPixels=function(kernel,serpentine){var kernels={FalseFloydSteinberg:[[3/8,1,0],[3/8,0,1],[2/8,1,1]],FloydSteinberg:[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]],Stucki:[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]],Atkinson:[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]]};if(!kernel||!kernels[kernel]){throw"Unknown dithering kernel: "+kernel}var ds=kernels[kernel];var index=0,height=this.height,width=this.width,data=this.pixels;var direction=serpentine?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var y=0;y<height;y++){if(serpentine)direction=direction*-1;for(var x=direction==1?0:width-1,xend=direction==1?width:0;x!==xend;x+=direction){index=y*width+x;var idx=index*3;var r1=data[idx];var g1=data[idx+1];var b1=data[idx+2];idx=this.findClosestRGB(r1,g1,b1);this.usedEntry[idx]=true;this.indexedPixels[index]=idx;idx*=3;var r2=this.colorTab[idx];var g2=this.colorTab[idx+1];var b2=this.colorTab[idx+2];var er=r1-r2;var eg=g1-g2;var eb=b1-b2;for(var i=direction==1?0:ds.length-1,end=direction==1?ds.length:0;i!==end;i+=direction){var x1=ds[i][1];var y1=ds[i][2];if(x1+x>=0&&x1+x<width&&y1+y>=0&&y1+y<height){var d=ds[i][0];idx=index+x1+y1*width;idx*=3;data[idx]=Math.max(0,Math.min(255,data[idx]+er*d));data[idx+1]=Math.max(0,Math.min(255,data[idx+1]+eg*d));data[idx+2]=Math.max(0,Math.min(255,data[idx+2]+eb*d))}}}}};GIFEncoder.prototype.findClosest=function(c,used){return this.findClosestRGB((c&16711680)>>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i<len;index++){var dr=r-(this.colorTab[i++]&255);var dg=g-(this.colorTab[i++]&255);var db=b-(this.colorTab[i++]&255);var d=dr*dr+dg*dg+db*db;if((!used||this.usedEntry[index])&&d<dmin){dmin=d;minpos=index}}return minpos};GIFEncoder.prototype.getImagePixels=function(){var w=this.width;var h=this.height;this.pixels=new Uint8Array(w*h*3);var data=this.image;var srcPos=0;var count=0;for(var i=0;i<h;i++){for(var j=0;j<w;j++){this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];srcPos++}}};GIFEncoder.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33);this.out.writeByte(249);this.out.writeByte(4);var transp,disp;if(this.transparent===null){transp=0;disp=0}else{transp=1;disp=2}if(this.dispose>=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i<n;i++)this.out.writeByte(0)};GIFEncoder.prototype.writeShort=function(pValue){this.out.writeByte(pValue&255);this.out.writeByte(pValue>>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i<hsize;++i)htab[i]=-1}function compress(init_bits,outs){var fcode,c,i,ent,disp,hsize_reg,hshift;g_init_bits=init_bits;clear_flg=false;n_bits=g_init_bits;maxcode=MAXCODE(n_bits);ClearCode=1<<init_bits-1;EOFCode=ClearCode+1;free_ent=ClearCode+2;a_count=0;ent=nextPixel();hshift=0;for(fcode=HSIZE;fcode<65536;fcode*=2)++hshift;hshift=8-hshift;hsize_reg=HSIZE;cl_hash(hsize_reg);output(ClearCode,outs);outer_loop:while((c=nextPixel())!=EOF){fcode=(c<<BITS)+ent;i=c<<hshift^ent;if(htab[i]===fcode){ent=codetab[i];continue}else if(htab[i]>=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<<BITS){codetab[i]=free_ent++;htab[i]=fcode}else{cl_block(outs)}}output(ent,outs);output(EOFCode,outs)}function encode(outs){outs.writeByte(initCodeSize);remaining=width*height;curPixel=0;compress(initCodeSize+1,outs);outs.writeByte(0)}function flush_char(outs){if(a_count>0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<<n_bits)-1}function nextPixel(){if(remaining===0)return EOF;--remaining;var pix=pixels[curPixel++];return pix&255}function output(code,outs){cur_accum&=masks[cur_bits];if(cur_bits>0)cur_accum|=code<<cur_bits;else cur_accum=code;cur_bits+=n_bits;while(cur_bits>=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<<BITS;else maxcode=MAXCODE(n_bits)}}if(code==EOFCode){while(cur_bits>0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<<intbiasshift;var gammashift=10;var gamma=1<<gammashift;var betashift=10;var beta=intbias>>betashift;var betagamma=intbias<<gammashift-betashift;var initrad=netsize>>3;var radiusbiasshift=6;var radiusbias=1<<radiusbiasshift;var initradius=initrad*radiusbias;var radiusdec=30;var alphabiasshift=10;var initalpha=1<<alphabiasshift;var alphadec;var radbiasshift=8;var radbias=1<<radbiasshift;var alpharadbshift=alphabiasshift+radbiasshift;var alpharadbias=1<<alpharadbshift;var prime1=499;var prime2=491;var prime3=487;var prime4=503;var minpicturebytes=3*prime4;function NeuQuant(pixels,samplefac){var network;var netindex;var bias;var freq;var radpower;function init(){network=[];netindex=new Int32Array(256);bias=new Int32Array(netsize);freq=new Int32Array(netsize);radpower=new Int32Array(netsize>>3);var i,v;for(i=0;i<netsize;i++){v=(i<<netbiasshift+8)/netsize;network[i]=new Float64Array([v,v,v,0]);freq[i]=intbias/netsize;bias[i]=0}}function unbiasnet(){for(var i=0;i<netsize;i++){network[i][0]>>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(j<hi||k>lo){a=radpower[m++];if(j<hi){p=network[j++];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}if(k>lo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i<netsize;i++){n=network[i];dist=Math.abs(n[0]-b)+Math.abs(n[1]-g)+Math.abs(n[2]-r);if(dist<bestd){bestd=dist;bestpos=i}biasdist=dist-(bias[i]>>intbiasshift-netbiasshift);if(biasdist<bestbiasd){bestbiasd=biasdist;bestbiaspos=i}betafreq=freq[i]>>betashift;freq[i]-=betafreq;bias[i]+=betafreq<<gammashift}freq[bestpos]+=beta;bias[bestpos]-=betagamma;return bestbiaspos}function inxbuild(){var i,j,p,q,smallpos,smallval,previouscol=0,startpos=0;for(i=0;i<netsize;i++){p=network[i];smallpos=i;smallval=p[1];for(j=i+1;j<netsize;j++){q=network[j];if(q[1]<smallval){smallpos=j;smallval=q[1]}}q=network[smallpos];if(i!=smallpos){j=q[0];q[0]=p[0];p[0]=j;j=q[1];q[1]=p[1];p[1]=j;j=q[2];q[2]=p[2];p[2]=j;j=q[3];q[3]=p[3];p[3]=j}if(smallval!=previouscol){netindex[previouscol]=startpos+i>>1;for(j=previouscol+1;j<smallval;j++)netindex[j]=i;previouscol=smallval;startpos=i}}netindex[previouscol]=startpos+maxnetpos>>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i<netsize||j>=0){if(i<netsize){p=network[i];dist=p[1]-g;if(dist>=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}if(j>=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}}return best}function learn(){var i;var lengthcount=pixels.length;var alphadec=30+(samplefac-1)/3;var samplepixels=lengthcount/(3*samplefac);var delta=~~(samplepixels/ncycles);var alpha=initalpha;var radius=initradius;var rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i<rad;i++)radpower[i]=alpha*((rad*rad-i*i)*radbias/(rad*rad));var step;if(lengthcount<minpicturebytes){samplefac=1;step=3}else if(lengthcount%prime1!==0){step=3*prime1}else if(lengthcount%prime2!==0){step=3*prime2}else if(lengthcount%prime3!==0){step=3*prime3}else{step=3*prime4}var b,g,r,j;var pix=0;i=0;while(i<samplepixels){b=(pixels[pix]&255)<<netbiasshift;g=(pixels[pix+1]&255)<<netbiasshift;r=(pixels[pix+2]&255)<<netbiasshift;j=contest(b,g,r);altersingle(alpha,j,b,g,r);if(rad!==0)alterneigh(rad,j,b,g,r);pix+=step;if(pix>=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j<rad;j++)radpower[j]=alpha*((rad*rad-j*j)*radbias/(rad*rad))}}}function buildColormap(){init();learn();unbiasnet();inxbuild()}this.buildColormap=buildColormap;function getColormap(){var map=[];var index=[];for(var i=0;i<netsize;i++)index[network[i][3]]=i;var k=0;for(var l=0;l<netsize;l++){var j=index[l];map[k++]=network[j][0];map[k++]=network[j][1];map[k++]=network[j][2]}return map}this.getColormap=getColormap;this.lookupRGB=inxsearch}module.exports=NeuQuant},{}],4:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i<len;i++){page=ref[i];results.push(page.buffer)}return results}();return self.postMessage(frame,transfer)}else{return self.postMessage(frame)}};self.onmessage=function(event){return renderFrame(event.data)}},{"./GIFEncoder.js":1}]},{},[4]);
296
- `],{type:"application/javascript"}))})}const $O="https://api.polotno.com",WO=()=>$O+"/api",q6=Fr({value:!1}),U6=Fr({value:"v1"}),YO=()=>U6.value,XO=()=>q6.value,KO=Dr(()=>{q6.value=!0});let zd=typeof window<"u"?window.location.origin:"";const ZO=typeof navigator<"u"&&navigator.userAgent.indexOf("Headless")>-1,QO=typeof navigator<"u"&&navigator.userAgent.indexOf("Electron")>-1;zd==="file://"&&ZO&&(zd="headless"),zd==="file://"&&QO&&(zd="electron");const JO=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${zd}" here: https://polotno.com/cabinet`;let eC=fetch;async function tC(e){for(let t=0;t<5;t++)try{const r=await eC(WO()+"/validate-key",{method:"POST",body:JSON.stringify({key:e,site:location.host,skdVersion:"2.25.9"})});if(oc(()=>{U6.value=r.headers.get("x-api-version")}),!e)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(JO,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),VS(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 rC(e,t){await tC(e)&&!t||KO()}const s0=({px:e,unit:t="px",dpi:r})=>{switch(t){case"pt":default:return e;case"mm":return e/(r/25.4);case"cm":return e/(r/2.54);case"in":return e/r}},Lb=({px:e,precious:t=2,dpi:r=72,unit:n="px"})=>parseFloat(s0({px:e,dpi:r,unit:n}).toFixed(t)),Tb=({unitVal:e,dpi:t,unit:r})=>e/s0({px:1,unit:r,dpi:t}),nC=e=>{const t=parseFloat(s0(e).toFixed(1));switch(e.unit){case"pt":return`${Math.round(t)}pt`;case"mm":return`${t}mm`;case"cm":return`${t}cm`;case"in":return`${t}in`;default:return`${Math.round(t)}px`}};async function iC(e){for(let t=0;t<30;t++){const r=await e();if(r)return r;await new Promise(n=>setTimeout(n,50))}}function vp(e){return new Promise((t,r)=>{const n=document.createElement("img");n.onload=()=>{t(n)},n.onerror=i=>{r(i)},n.crossOrigin="anonymous",n.src=e})}async function aC(e,t){const r=await vp(e),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=t.width,i.height=t.height;const a=i.getContext("2d");let{cropX:o,cropY:l}=t;const u=n.width*t.cropWidth,d=n.height*t.cropHeight,h=t.width/t.height;let v,p;const f=u/d;return t.type==="svg"?(v=u,p=d):h>=f?(v=u,p=u/h):(v=d*h,p=d),a.drawImage(n,o*n.width,l*n.height,v,p,0,0,i.width,i.height),i.toDataURL("image/png")}function H6(e,t){const{width:r,height:n}=e,i=r/n;let a,o;i>=t.width/t.height?(a=t.width,o=t.width/i):(a=t.height*i,o=t.height);const l=(t.width-a)/2,u=(t.height-o)/2;return{cropX:l/t.width,cropY:u/t.height,cropWidth:a/t.width,cropHeight:o/t.height}}var qs;(function(e){e.sepia="sepia",e.grayscale="grayscale",e.natural="natural",e.warm="warm",e.cold="cold",e.temperature="temperature",e.contrast="contrast",e.shadows="shadows",e.white="white",e.black="black",e.vibrance="vibrance",e.saturation="saturation"})(qs||(qs={}));function V6(e,t){let r={filter:"",html:void 0};switch(e){case qs.warm:{const n=Math.max(0,Math.min(1,t??.5)),i=1+.3*n,a=1+.15*n,o=1;return r.filter="url(#warm-filter)",r.html=`
297
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
298
- <filter id="warm-filter" color-interpolation-filters="sRGB">
299
- <feColorMatrix type="matrix" values="
300
- ${i} 0 0 0 0
301
- 0 ${a} 0 0 0
302
- 0 0 ${o} 0 0
303
- 0 0 0 1 0" />
304
- </filter>
305
- </svg>`,r}case qs.cold:{const n=Math.max(0,Math.min(1,t??.5)),i=1-.15*n,a=1-.1*n,o=1+.15*n;return r.filter="url(#cold-filter)",r.html=`
306
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
307
- <filter id="cold-filter" color-interpolation-filters="sRGB">
308
- <feColorMatrix type="matrix" values="
309
- ${i} 0 0 0 0
310
- 0 ${a} 0 0 0
311
- 0 0 ${o} 0 0
312
- 0 0 0 1 0" />
313
- </filter>
314
- </svg>`,r}case"natural":{const n=Math.max(0,Math.min(1,t??.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,t??0)),i=1+.15*n,a=1,o=1-.15*n;return r.filter="url(#temperature-filter)",r.html=`
315
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
316
- <filter id="temperature-filter" color-interpolation-filters="sRGB">
317
- <feColorMatrix type="matrix" values="
318
- ${i} 0 0 0 0
319
- 0 ${a} 0 0 0
320
- 0 0 ${o} 0 0
321
- 0 0 0 1 0" />
322
- </filter>
323
- </svg>
324
- `,r}case qs.contrast:{const n=100*Math.max(-1,Math.min(1,t??0)),i=259*(n+255)/(255*(259-n)),a=.5*(1-i);return r.filter="url(#contrast-filter)",r.html=`
325
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
326
- <filter id="contrast-filter" color-interpolation-filters="sRGB">
327
- <feComponentTransfer>
328
- <feFuncR type="linear" slope="${i}" intercept="${a}" />
329
- <feFuncG type="linear" slope="${i}" intercept="${a}" />
330
- <feFuncB type="linear" slope="${i}" intercept="${a}" />
331
- </feComponentTransfer>
332
- </filter>
333
- </svg>
334
- `,r}case qs.shadows:{const n=Math.max(-1,Math.min(1,t??0)),i=Math.min(Math.max(1-.6*n,.4),2.5);return r.filter="url(#shadows-filter)",r.html=`
335
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
336
- <filter id="shadows-filter" color-interpolation-filters="sRGB">
337
- <feComponentTransfer>
338
- <feFuncR type="gamma" amplitude="1" exponent="${i}" offset="0" />
339
- <feFuncG type="gamma" amplitude="1" exponent="${i}" offset="0" />
340
- <feFuncB type="gamma" amplitude="1" exponent="${i}" offset="0" />
341
- </feComponentTransfer>
342
- </filter>
343
- </svg>
344
- `,r}case qs.white:case qs.black:return null;case qs.vibrance:{const n=Math.max(-1,Math.min(1,t??0)),i=.299,a=.587,o=.114;let l;l=n>=0?1+1.5*n:1+n;const u=1-l,d=u*i+l,h=u*a,v=u*o,p=u*i,f=u*a+l,b=u*o,_=u*i,S=u*a,x=u*o+l;return r.filter="url(#vibrance-filter)",r.html=`
345
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
346
- <filter id="vibrance-filter" color-interpolation-filters="sRGB">
347
- <feColorMatrix type="matrix" values="
348
- ${d} ${h} ${v} 0 0
349
- ${p} ${f} ${b} 0 0
350
- ${_} ${S} ${x} 0 0
351
- 0 0 0 1 0" />
352
- </filter>
353
- </svg>
354
- `,r}case qs.saturation:{const o=1+Math.max(-1,Math.min(1,t??0)),l=1-o,u=l*.2126+o,d=l*.7152,h=l*.0722,v=l*.2126,p=l*.7152+o,f=l*.0722,b=l*.2126,_=l*.7152,S=l*.0722+o;return r.filter="url(#saturation-filter)",r.html=`
355
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
356
- <filter id="saturation-filter" color-interpolation-filters="sRGB">
357
- <feColorMatrix type="matrix" values="
358
- ${u} ${d} ${h} 0 0
359
- ${v} ${p} ${f} 0 0
360
- ${b} ${_} ${S} 0 0
361
- 0 0 0 1 0" />
362
- </filter>
363
- </svg>
364
- `,r}default:return null}}async function oC(e){return new Promise((t,r)=>{const n=document.createElement("video");n.crossOrigin="anonymous",n.src=e,n.addEventListener("loadedmetadata",()=>{const{videoWidth:i,videoHeight:a}=n;t({width:i,height:a})}),n.addEventListener("error",i=>{const a=e.slice(0,100);r(new Error(`Failed to load video: ${a}`))})})}var sC=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};const ki=(e,t,...r)=>({type:e,props:t,children:r||[]}),h1=async({element:e,page:t,store:r})=>{let{src:n}=e;if(e.type==="svg"&&Object.keys(e.colorsReplace).length){const E=await gp(n);n=Yv(E,new Map(Object.entries(e.colorsReplace)))}let i="";e.flipX&&(i+="scaleX(-1)"),e.flipY&&(i+="scaleY(-1)"),i||(i="none");const a={};if(e.clipSrc){const E=await m6(e.clipSrc);a["clip-path"]=`url(${E})`}const o=await vp(n),l=o.width*e.cropWidth,u=o.height*e.cropHeight,d=e.width/e.height;let h,v;const p=l/u;e.type==="svg"?(h=l,v=u):d>=p?(h=l,v=l/d):(h=u*d,v=u);const f=h/o.width,b=v/o.height,_=h/v>e.width/e.height?e.height/v:e.width/h,S=h*_/f,x=v*_/b,m=e.cropX*_*o.width,w=e.cropY*_*o.height;return ki("div",{style:Object.assign(Object.assign({},a),{width:"100%",height:"100%",borderRadius:e.cornerRadius+"px",border:e.borderSize?`${e.borderSize}px solid ${e.borderColor}`:"none",backgroundRepeat:"no-repeat",backgroundImage:`url(${n})`,transform:i,backgroundSize:`${Math.round(S)}px ${Math.round(x)}px`,backgroundPositionX:-Math.round(m)+"px",backgroundPositionY:-Math.round(w)+"px"})})},Rb=({element:e,type:t})=>{const r={"stroke-width":e.height,stroke:e.color,"line-cap":"round","stroke-linejoin":"round",opacity:e.opacity};return t==="arrow"||t==="triangle"?ki("polyline",Object.assign({points:`${3*e.height},${2*-e.height} 0,0 ${3*e.height},${2*e.height}`},r)):t==="bar"?ki("polyline",Object.assign({points:`0,${2*-e.height} 0,${2*e.height}`},r)):t==="circle"?ki("circle",Object.assign({r:e.height},r)):t==="square"?ki("polyline",Object.assign({points:`${-e.height},${-e.height} ${-e.height},${e.height} ${e.height},${e.height} ${e.height},${-e.height}`},r)):null},lC={image:h1,svg:h1,text:async({element:e,page:t,store:r})=>{let n={top:0,left:0};e.fill.indexOf("gradient")>=0&&(n=Object.assign(Object.assign({},n),{backgroundColor:e.fill,backgroundImage:e.fill,backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}));const i=e.backgroundPadding*(e.fontSize*e.lineHeight),a=ki("div",{style:{position:"absolute",top:-i/2+"px",left:-i/2+"px",display:e.backgroundEnabled?"block":"none",width:e.width+i+"px",height:e.height+i+"px",backgroundColor:e.backgroundColor,borderRadius:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)+"px"}});e.verticalAlign==="middle"?(n.top="50%",n.transform="translateY(-50%)"):e.verticalAlign==="bottom"&&(n.bottom=0);const o=/<[a-z][\s\S]*>/i.test(e.text),l=Object.assign(Object.assign({},n),{position:"absolute",width:e.width+"px",color:e.fill,whiteSpace:"pre-wrap",fontSize:e.fontSize+"px",textAlign:e.align,fontFamily:e.fontFamily,textDecoration:e.textDecoration||"none",textTransform:e.textTransform||"none",lineHeight:e.lineHeight,letterSpacing:e.letterSpacing+"em",fontStyle:e.fontStyle,fontWeight:e.fontWeight,WebkitTextStroke:`${e.strokeWidth}px ${e.stroke}`,textStroke:`${e.strokeWidth}px ${e.stroke}`}),u="el-"+e.id,d=o?{id:u}:{},h=`<style>#${u} {${i0}}</style>`,v=ki("div",Object.assign(Object.assign({style:l},d),{innerHTML:o?`${h}${e.text}`:e.text.split(`
365
- `).join("<br />")}));return ki("div",{style:{position:"relative",width:"100%",height:"100%"}},a,v)},line:async({element:e,page:t,store:r})=>ki("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},ki("rect",{x:0,y:0,width:e.width,height:e.height,fill:e.color}),ki("g",{transform:`translate(0 ${e.height/2})`},Rb({element:e,type:e.startHead})),ki("g",{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},Rb({element:e,type:e.endHead}))),figure:async({element:e,page:t,store:r,elementHook:n})=>{const i=D6(e),a=ki("div",{innerHTML:i});return n&&n({dom:a,element:e})||a},group:async({element:e,page:t,store:r,elementHook:n})=>{const i=await Promise.all(e.children.map(o=>G6({element:o,page:t,store:r,elementHook:n}))),a=ki("div",{style:{transformOrigin:"top left",opacity:e.opacity}},...i);return n&&n({dom:a,element:e})||a},video:async({element:e,page:t,store:r,elementHook:n})=>{const{cropX:i,cropY:a,cropWidth:o,cropHeight:l}=e,u=await oC(e.src),d=u.width*o,h=u.height*l,v=e.width/e.height;let p,f;v>=d/h?(p=d,f=d/v):(p=h*v,f=h);const b=p/o,_=f/l,S=i*u.width,x=a*u.height,m=Math.max(e.width/u.width,e.height/u.height),w={position:"absolute",width:`${Math.round(b*m)}px`,height:`${Math.round(_*m)}px`,left:-Math.round(S*m)+"px",top:-Math.round(x*m)+"px",objectFit:"fill"},E=`video-${e.id}`,P=ki("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",borderRadius:e.cornerRadius+"px",border:e.borderSize?`${e.borderSize}px solid ${e.borderColor}`:"none"}},ki("video",{id:E,src:e.src,style:w,controls:!0,playsInline:!0,muted:!0,volume:e.volume}));return n&&n({dom:P,element:e})||P},gif:h1};async function G6({element:e,page:t,store:r,elementHook:n}){let i=await lC[e.type];if(i||(i=()=>ki("div",{}),console.error(`HTML export does not support ${e.type} type...`)),!e.visible)return null;const a=await i({element:e,page:t,store:r}),o=[],l=[];if(e.blurEnabled&&o.push(`blur(${e.blurRadius/2}px)`),e.brightnessEnabled&&o.push(`brightness(${100*e.brightness+100}%)`),e.sepiaEnabled&&o.push("sepia()"),e.grayscaleEnabled&&o.push("grayscale()"),e.filters)for(const[d,h]of Object.entries(e.filters)){const v=V6(qs[d],h.intensity);v&&(o.push(v.filter),v.html&&l.push(v.html))}e.shadowEnabled&&o.push(`drop-shadow(${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${e.shadowColor})`);const u=ki("div",{id:e.id,style:{position:"absolute",left:e.x+"px",top:e.y+"px",width:e.width+"px",height:e.height+"px",transform:`rotate(${e.rotation}deg)`,transformOrigin:"top left",opacity:e.opacity,display:e.visible&&e.showInExport?"block":"none",filter:o.join(" ")||"none"}},a,...l);return n&&n({dom:u,element:e})||u}async function uC({json:e,elementHook:t}){const r=await Promise.all(e.pages.map(a=>async function({page:o,store:l,elementHook:u}){const d=await Promise.all(o.children.map(f=>G6({element:f,page:o,store:l,elementHook:u}))),h=o.width==="auto"?l.width:o.width,v=o.height==="auto"?l.height:o.height;let p={};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:f,height:b}=await vp(o.background),_=await h1({element:Object.assign({x:0,y:0,width:f,height:b,src:o.background,cornerRadius:0},H6({width:f,height:b},{width:f,height:b})),page:o,store:l});d.unshift(_)}else p=Object.assign(Object.assign({},p),{backgroundColor:o.background});return ki("div",{className:"page",id:o.id,style:Object.assign(Object.assign({},p),{width:h+"px",height:v+"px",overflow:"hidden",position:"relative"})},...d)}({page:a,store:e,elementHook:t}))),n=[];e.pages.forEach(a=>{a.children.forEach(o=>{o.type==="text"&&n.indexOf(o.fontFamily)===-1&&n.push(o.fontFamily)})});const i=n.map(a=>e.fonts.find(o=>o.fontFamily===a)?ki("style",{},""):ki("link",{href:Rw(a),rel:"stylesheet"}));return ki("div",{className:"design"},...i,...r)}const $6=({dom:e})=>{if(typeof e=="string")return e;if(!e)return"";const t=e.props,{innerHTML:r}=t,n=sC(t,["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,l=>`-${l.toLowerCase()}`)}: ${n[a][o]}`).join("; ")}"`:((o,l)=>typeof l=="object"?`${o}="${Object.keys(l).map(u=>`${u.replace(/-([a-z])/g,d=>d[1].toUpperCase())}:${l[u]};`).join(" ")}"`:`${o}="${l}"`)(a,n[a])).join(" ");return`<${e.type} ${i}>${r||e.children.map(a=>$6({dom:a})).join("")}</${e.type}>`};async function cC({json:e,elementHook:t}){const r=await uC({json:e,elementHook:t});return $6({dom:r})}var fC=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};const W6=(e,t)=>{if(e.children)for(const r of e.children){if(t(r)===!0)break;W6(r,t)}},_n=(e,t,...r)=>({type:e,props:t,children:r||[]}),A2=async({element:e,page:t,store:r})=>{let{src:n}=e;if(e.type==="svg"){const P=await gp(n);n=Yv(P,new Map(Object.entries(e.colorsReplace)))}else n=await(async P=>{try{const R=await fetch(P);if(typeof Buffer<"u"){const k=await R.arrayBuffer(),N=Buffer.from(k).toString("base64");return`data:${R.headers.get("content-type")||"image/png"};base64,${N}`}{const k=await R.blob();return new Promise((N,M)=>{const T=new FileReader;T.onloadend=()=>N(T.result),T.onerror=M,T.readAsDataURL(k)})}}catch(R){return console.error("Error converting URL to data URL:",R),P}})(n);let i="";e.flipX&&(i+="scaleX(-1)"),e.flipY&&(i+="scaleY(-1)"),e.clipSrc&&await m6(e.clipSrc);const a=await vp(n),o=a.width*e.cropWidth,l=a.height*e.cropHeight,u=e.width/e.height;let d,h;const v=o/l;e.type==="svg"?(d=o,h=l):u>=v?(d=o,h=o/u):(d=l*u,h=l);const p=d/a.width,f=h/a.height,b=d/h>e.width/e.height?e.height/h:e.width/d,_=d*b/p,S=h*b/f,x=e.cropX*a.width*b,m=e.cropY*a.height*b,w=`clip-${e.id}`,E=n.replace(/&/g,"&amp;");return _n("g",{style:{transform:i}},_n("defs",{},_n("clipPath",{id:w},_n("rect",{x:0,y:0,width:e.width,height:e.height}))),_n("image",{href:E,x:-x,y:-m,width:_,height:S,preserveAspectRatio:"none","clip-path":`url(#${w})`}))},Mb=({element:e,type:t})=>{const r={"stroke-width":e.height,stroke:e.color,"line-cap":"round","stroke-linejoin":"round",opacity:e.opacity,fill:e.color};return t==="arrow"?_n("polyline",Object.assign({points:`${3*e.height},${2*-e.height} 0,0 ${3*e.height},${2*e.height}`},r)):t==="triangle"?_n("polygon",Object.assign({points:`${3*e.height},${2*-e.height} 0,0 ${3*e.height},${2*e.height}`},r)):t==="bar"?_n("polyline",Object.assign({points:`0,${2*-e.height} 0,${2*e.height}`},r)):t==="circle"?_n("circle",Object.assign({cx:2*e.height,cy:0,r:2*e.height},r)):t==="square"?_n("polygon",Object.assign({points:`0,${2*-e.height} ${4*e.height},${2*-e.height} ${4*e.height},${2*e.height} 0,${2*e.height}`},r)):null},hC={image:A2,svg:A2,text:async({element:e,page:t,store:r})=>{const n=(d,h,v,p,f)=>{const b=document.createElement("canvas").getContext("2d");return b.font=`${f} ${p} ${h}px ${v}`,b.measureText(d).width};let i=Lu(e.text);e.textTransform=="uppercase"&&(i=i.toUpperCase());const a=((d,h,v,p,f,b)=>{const _=[];return d.split(`
366
- `).forEach(S=>{const x=S.split(" ");let m="";for(let w=0;w<x.length;w++){const E=m+x[w]+" ";n(E,v,p,f,b)>h+.5&&w>0?(_.push(m.trim()),m=x[w]+" "):m=E}_.push(m.trim())}),_})(i,e.width,e.fontSize,e.fontFamily,e.fontWeight,e.fontStyle),o=e.fontSize*e.lineHeight,l=e.align==="center"?"middle":e.align==="right"?"end":"start",u=a.map((d,h)=>_n("tspan",{x:e.align==="center"?e.width/2:e.align==="right"?e.width:0,dy:h===0?0:o,innerHTML:d}));return _n("g",{},_n("text",{fill:e.fill,y:e.fontSize,"font-size":e.fontSize+"px","text-anchor":l,"font-family":e.fontFamily,"font-style":e.fontStyle,"font-weight":e.fontWeight,"text-decoration":e.textDecoration,"line-height":e.lineHeight,"letter-spacing":e.letterSpacing+"em","stroke-width":e.strokeWidth,stroke:e.stroke},...u))},line:async({element:e,page:t,store:r})=>_n("g",{opacity:e.opacity},_n("line",{x1:0,y1:e.height/2,x2:e.width,y2:e.height/2,stroke:e.color,"stroke-width":e.height,"stroke-dasharray":e.dash&&e.dash.length?e.dash.map(n=>n*e.height).join(" "):void 0}),_n("g",{transform:`translate(0 ${e.height/2})`},Mb({element:e,type:e.startHead})),_n("g",{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},Mb({element:e,type:e.endHead}))),figure:async({element:e,page:t,store:r,elementHook:n})=>{const i=function(o){let l=o.replace(/<svg[^>]*>/,"");return l=l.replace(/<\/svg>/,""),l}(D6(e)),a=_n("g",{innerHTML:i});return n&&n({dom:a,element:e})||a},group:async({element:e,page:t,store:r,elementHook:n})=>{const i=await Promise.all(e.children.map(o=>Y6({element:o,page:t,store:r,elementHook:n}))),a=_n("g",{opacity:e.opacity,style:{"transform-origin":"top left"}},...i);return n&&n({dom:a,element:e})||a},gif:A2};async function Y6({element:e,page:t,store:r,elementHook:n}){let i=await hC[e.type];i||(i=()=>_n("g",{}),console.error(`SVG export does not support ${e.type} type...`));const a=await i({element:e,page:t,store:r}),o=[],l=[];if(e.blurEnabled&&o.push(`blur(${e.blurRadius/2}px)`),e.brightnessEnabled&&o.push(`brightness(${100*e.brightness+100}%)`),e.sepiaEnabled&&o.push("sepia()"),e.grayscaleEnabled&&o.push("grayscale()"),e.shadowEnabled&&o.push(`drop-shadow(${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${e.shadowColor})`),e.filters)for(const[d,h]of Object.entries(e.filters)){const v=V6(qs[d],h.intensity);if(v&&(o.push(v.filter),v.html)){const p=v.html.replace(/<svg([^>]*)>/,"<g$1>").replace(/<\/svg>/,"</g>");l.push(p)}}const u=_n("g",{className:"element",id:e.id,transform:e.type!=="group"?`translate(${e.x}, ${e.y}) rotate(${e.rotation})`:void 0,display:e.visible?void 0:"none",style:{"transform-origin":"top left",filter:o.join(" ")}},a,...l);return n&&n({dom:u,element:e})||u}async function Ib(e){try{const t=await fetch(e),r=await t.blob();return new Promise((n,i)=>{const a=new FileReader;a.onloadend=()=>n(a.result),a.onerror=i,a.readAsDataURL(r)})}catch(t){return console.error("Error embedding font:",t),e}}async function dC({json:e,elementHook:t}){const r=await Promise.all(e.pages.map(a=>async function({page:o,store:l,elementHook:u}){const d=await Promise.all(o.children.map(p=>Y6({element:p,page:o,store:l,elementHook:u}))),h=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;let v;if(h){const p=await vp(o.background);v=await aC(o.background,Object.assign({width:l.width,height:l.height,x:0,y:0},H6({width:l.width,height:l.height},{width:p.width,height:p.height})))}return _n("g",{className:"page",style:{}},h?_n("image",{"xlink:href":v,x:0,y:0,width:l.width,height:l.height,preserveAspectRatio:"none"}):_n("rect",{x:0,y:0,width:l.width,height:l.height,fill:h?void 0:o.background}),...d)}({page:a,store:e,elementHook:t}))),n=[];W6({children:e.pages},a=>{a.type==="text"&&n.indexOf(a.fontFamily)===-1&&n.push(a.fontFamily)});const i=await async function(a,o){return await Promise.all(a.map(async l=>{var u,d;const h=o.find(v=>v.fontFamily===l);if(h){const v=await Ib(h.url);return _n("style",{},`@font-face { font-family: ${l}; src: url(${v}); }`)}{const v=`https://fonts.googleapis.com/css?family=${l}:bi,normal,i,b`;try{const p=await fetch(v),f=await p.text(),b=(d=(u=f.match(/url\((.*?)\)/g))===null||u===void 0?void 0:u.map(S=>S.replace(/url\((.*?)\)/,"$1")))===null||d===void 0?void 0:d.filter(S=>S.startsWith("https"));if(!b?.length)throw new Error("No font URLs found");const _=await Promise.all(b.map(async S=>{const x=await Ib(S),m=f.match(/font-style:\s*(.*?);/),w=f.match(/font-weight:\s*(.*?);/),E=m?m[1]:"normal",P=w?w[1]:"normal";return`@font-face {
367
- font-family: ${l};
368
- font-style: ${E};
369
- font-weight: ${P};
370
- src: url(${x});
371
- }`}));return _n("style",{},_.join(`
372
- `))}catch(p){return console.error("Error embedding Google Font:",p),_n("defs",{},_n("style",{type:"text/css",innerHTML:`@import url('${v}');`.replace(/&/g,"&amp;")}))}}}))}(n,e.fonts);return _n("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${e.width} ${e.height}`,width:e.width,height:e.height},...i,...r)}const X6=({dom:e,nestLevel:t=0})=>{if(typeof e=="string")return e;if(!e)return"";const r=e.props,{innerHTML:n}=r,i=fC(r,["innerHTML"]),a=" ".repeat(t);return`${a}<${e.type} ${Object.keys(i).map(o=>((l,u)=>typeof u=="object"?`${l}="${Object.keys(u).map(d=>`${d}:${u[d]};`).join(" ")}"`:u==null||u===""?"":`${l}="${u}"`)(o,i[o])).join(" ")}>${n||`
373
- `+e.children.map(o=>X6({dom:o,nestLevel:t+1})).join("")}${a}</${e.type}>
374
- `};async function pC({json:e,elementHook:t}){const r=await dC({json:e,elementHook:t});return X6({dom:r})}const Wd=$t.model("Page",{id:$t.identifier,children:$t.array($t.late(()=>n8)),width:$t.optional($t.union($t.number,$t.literal("auto")),"auto"),height:$t.optional($t.union($t.number,$t.literal("auto")),"auto"),background:"white",bleed:0,custom:$t.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(e=>{const t=Object.assign({},e),r={};for(var n in t)n[0]!=="_"&&(r[n]=e[n]);return r}).views(e=>({get store(){return Pf(e,Rf)}})).views(e=>({get startTime(){let t=0;for(const r of e.store.pages){if(r.id===e.id)return t;t+=r.duration}return t},get _exportingOrRendering(){return e._exporting||e._rendering}})).views(e=>({get computedWidth(){return e.width==="auto"?e.store.width:e.width},get computedHeight(){return e.height==="auto"?e.store.height:e.height}})).actions(e=>({toJSON:()=>JSON.parse(JSON.stringify(Pu(e))),_forEachElementUp(t,r){const n=t.map(i=>({id:i,index:e.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<e.children.length-1&&e.children[i+1],o=t.indexOf(a?.id)>=0;i===e.children.length-1||o||r(i)}},_forEachElementDown(t,r){const n=t.map(i=>({id:i,index:e.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&&e.children[i-1],o=t.indexOf(a?.id)>=0;i===0||o||r(i)}return!1}})).actions(e=>({clone(t={}){const r=e.toJSON();r.children.forEach(o=>{o.id=gl(10),yi(o,l=>{l.id=gl(10)})});const n=Object.assign(Object.assign(Object.assign({},r),{id:gl(10)}),t),i=e.store.addPage(n),a=e.store.pages.indexOf(e);return i.setZIndex(a+1),i.select(),i},setZIndex(t){e.store.setPageZIndex(e.id,t)},set(t){Object.assign(e,t)},select(){e.store.selectPage(e.id)},addElement(t,{skipSelect:r=!1}={}){const n=nm[t.type];if(!n)return void console.error("Can not find model with type "+t.type);"children"in t&&Array.isArray(t.children)&&yi(t,a=>{a.id=a.id||gl(10)});const i=n.create(Object.assign({id:gl(10)},t));return e.children.push(i),i.selectable&&!r&&e.store.selectElements([i.id]),i},canMoveElementsUp(t){let r=!1;return e._forEachElementUp(t,()=>{r=r||!0}),r},moveElementsUp(t){e._forEachElementUp(t,r=>{const n=e.children[r];kf(n),e.children.splice(r+1,0,n)})},canMoveElementsTop(t){return this.canMoveElementsUp(t)},moveElementsTop(t){const r=[],n=[];e.children.forEach(i=>{t.indexOf(i.id)>=0?r.push(i):n.push(i)}),e.children.replace(n.concat(r))},canMoveElementsDown(t){let r=!1;return e._forEachElementDown(t,()=>{r=r||!0}),r},moveElementsDown(t){e._forEachElementDown(t,r=>{const n=e.children[r];kf(n),e.children.splice(r-1,0,n)})},canMoveElementsBottom(t){return this.canMoveElementsDown(t)},moveElementsBottom(t){const r=[],n=[];e.children.forEach(i=>{t.indexOf(i.id)>=0?r.push(i):n.push(i)}),e.children.replace(r.concat(n))},setElementZIndex(t,r){const n=e.children.find(i=>i.id===t);n&&(kf(n),e.children.remove(n),e.children.splice(r,0,n))},setSize({width:t,height:r,useMagic:n,softChange:i}){if(n){const a=[],o=R=>R.type==="image"&&R.x<1&&R.y<1&&R.width>=e.computedWidth-2&&R.height>=e.computedHeight-2;yi(e,R=>{R.type!=="group"&&(o(R)||a.push(R))});const l=a.length?o0(a):{x:0,y:0,width:e.computedWidth,height:e.computedHeight},u=1/4,d=Math.max(0,Math.min(l.x,e.computedWidth-l.x-l.width)),h=e.computedWidth*u,v=Math.max(0,d-h),p=Math.max(0,Math.min(l.y,e.computedHeight-l.y-l.height)),f=e.computedHeight*u,b=Math.max(0,p-f),_=e.computedWidth-2*v,S=e.computedHeight-2*b,x=t/_,m=r/S,w=Math.min(x,m),E=(t-_*w)/2-v*w,P=(r-S*w)/2-b*w;yi(e,R=>{R.type!=="group"&&(o(R)?R.set({x:R.x*w,y:R.y*w,width:R.width*x,height:R.height*m,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(R.set({x:E+R.x*w,y:P+R.y*w,width:R.width*w,height:R.height*w}),R.type==="text"?R.set({fontSize:R.fontSize*w}):R.type==="figure"&&R.set({strokeWidth:R.strokeWidth*w})))})}i||(e.width=t),i||(e.height=r)}})).actions(e=>({moveElementUp(t){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),e.moveElementsUp([t])},moveElementDown(t){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),e.moveElementsDown([t])},moveElementTop(t){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),e.moveElementsTop([t])},moveElementBottom(t){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),e.moveElementsBottom([t])},play(){e.store.play({startTime:e.startTime,endTime:e.startTime+e.duration})}})),jb=$t.model("Audio",{id:$t.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(e=>({toJSON:()=>Object.assign({},Pu(e))})).actions(e=>({set(t){Object.assign(e,t)}}));var Id=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};KS("ignore");const gC=$t.model("Font",{fontFamily:$t.string,url:$t.optional($t.string,""),styles:$t.frozen()}).preProcessSnapshot(e=>Object.assign(Object.assign({},e),{fontFamily:e.fontFamily||e.name})),Rf=$t.model("Store",{role:"",pages:$t.array(Wd),fonts:$t.array(gC),audios:$t.array(jb),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:$t.frozen(),selectedElementsIds:$t.array($t.string),animatedElementsIds:$t.array($t.string),history:$t.optional(UO,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),_activePageId:"",_forceShowCredit:!1,_key:"",_validated:!1}).views(e=>{const t=Df(()=>{const r={};return yi({children:e.pages},n=>(r[n.id]=n,!1)),r},{keepAlive:!0});return{get _idsMap(){return t.get()}}}).views(e=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),e.bleedVisible},get selectedElements(){return e.selectedElementsIds.map(t=>{for(const r of e.pages)for(const n of r.children)if(n.id===t)return n}).filter(t=>!!t)},get children(){return e.pages},get selectedShapes(){const t=[];return yi({children:e.selectedElements},r=>{r.type!=="group"&&t.push(r)}),t},get activePage(){return e.pages.slice().find(t=>t.id===e._activePageId)||(e.pages.length?e.pages[0]:null)},get duration(){let t=0;return e.pages.forEach(r=>{t+=r.duration}),t},get _hasCroppedImages(){return e.find(t=>t.type==="image"&&t._cropModeEnabled)},find(t){let r;return yi({children:e.pages},n=>{if(!r&&t(n))return r=n,!0}),r},getElementById:t=>e._idsMap[t]})).actions(e=>{let t=0,r=null,n=!1;return{afterCreate(){e.history.canUndo},setCurrentTime(i){e.currentTime=i},_togglePlaying(i=!e.isPlaying){e.isPlaying=i},play({animatedElementsIds:i=[],startTime:a=0,currentTime:o=0,endTime:l=e.duration,repeat:u=!1}={}){o&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),a=o),e.animatedElementsIds=i,e.currentTime=a,e.isPlaying=!0,t=Date.now(),r=l,n=u,requestAnimationFrame(e.seek)},checkActivePage(){let i=0;for(const a of e.pages){if(e.currentTime>=a.startTime&&e.currentTime<a.startTime+a.duration){e.selectPage(a.id);break}i+=a.duration}},seek(){if(!e.isPlaying)return;const i=Date.now(),a=i-t;t=i,e.currentTime+=a,e.checkActivePage();const o=r||e.duration;e.isPlaying&&e.currentTime<o?requestAnimationFrame(e.seek):e.isPlaying&&n?(e.currentTime=0,requestAnimationFrame(e.seek)):e.stop()},stop(){e.isPlaying=!1,e.currentTime=0,e.animatedElementsIds=[],e.checkActivePage()}}}).actions(e=>({__(){e._validated||(rC(e._key,e._forceShowCredit),e._validated=!0)},set(t){Object.assign(e,t)},setUnit({unit:t,dpi:r}){e.unit=t||e.unit,e.dpi=r||e.dpi},setRole(t){e.role=t},addPage(t){const r=Wd.create(Object.assign({id:gl(10)},t));return e.pages.push(r),e._activePageId=r.id,r},selectPage(t){e._activePageId=t},selectElements(t){const r=t.map(n=>e.getElementById(n)).sort((n,i)=>n.page.children.indexOf(n)-n.page.children.indexOf(i)).filter(n=>!!n).map(n=>n.id);e.selectedElementsIds=r},toggleBleed(t){e.bleedVisible=t??!e.bleedVisible},toggleRulers(t){e.rulesVisible=t??!e.rulesVisible},openSidePanel(t){e.openedSidePanel!==t&&(e.previousOpenedSidePanel=e.openedSidePanel,e.openedSidePanel=t)},setScale(t){e.scale=t},_setScaleToFit(t){e.scaleToFit=t},setElementsPixelRatio(t){e._elementsPixelRatio=t},setSize(t,r,n){e.pages.forEach(i=>{i.setSize({width:t,height:r,useMagic:n,softChange:!0})}),e.width=t,e.height=r},setPageZIndex(t,r){const n=e.pages.find(i=>i.id===t);n&&(kf(n),e.pages.remove(n),e.pages.splice(r,0,n))},deletePages(t){const r=e.pages.indexOf(e.activePage);t.forEach(a=>{const o=e.pages.find(l=>l.id===a);cg(o)});const n=Math.min(e.pages.length-1,r),i=e.pages[n];i&&(e._activePageId=i.id),e.selectedElementsIds=e.selectedElementsIds.filter(a=>e.getElementById(a))},groupElements(t,r={}){const n=t.map(o=>e.getElementById(o)),i=n[0].page;if(n.forEach(o=>{o&&kf(o)}),!n.length)return;const a=Object.assign({id:gl(10),children:n,type:"group"},r);return i.children.push(a),e.selectedElementsIds=[a.id],i.children.find(o=>o.id===a.id)},ungroupElements(t){const r=t.map(i=>e.getElementById(i)),n=[];r.forEach(i=>{if(i&&i.type==="group"){const a=i.page,o=a.children.indexOf(i);i.children.forEach(l=>{n.push(l.id)}),i.children.forEach(l=>{kf(l),a.children.push(l)}),a.children.splice(o,1)}}),e.selectedElementsIds=n},deleteElements(t){const r=[];e.find(n=>(t.includes(n.id)&&r.push(n),!1)),r.forEach(n=>{cg(n)}),e.selectedElementsIds=e.selectedElementsIds.filter(n=>e.getElementById(n))},on(t,r){if(t==="change"){let n=e.toJSON();return Fw(e,i=>{const a=e.toJSON();!$d(n,a)&&(n=a,r(a))})}},async _toCanvas({pixelRatio:t,ignoreBackground:r,pageId:n,mimeType:i,includeBleed:a,_skipTimeout:o,quickMode:l=!1}={}){var u;const d=t||1;n=n||((u=e.pages[0])===null||u===void 0?void 0:u.id);const h=e.pages.find(C=>C.id===n);if(!h)throw new Error(`No page for export with id ${n}`);const v=e._elementsPixelRatio;d>e._elementsPixelRatio&&e.setElementsPixelRatio(d),l?h?.set({_forceMount:!0}):h?.set({_exporting:!0});const p=await iC(()=>Kt.stages.find(C=>C.getAttr("pageId")===n));if(!p)throw h?.set({_forceMount:!1,_exporting:!1}),e.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 e.waitLoading({_skipTimeout:o});const f=p.findOne(".page-container");if(!f)throw e.setElementsPixelRatio(v),h?.set({_forceMount:!1,_exporting:!1}),new Error("Export is failed. Canvas was unmounted.");const b=p.position();p.position({x:0,y:0}),p.find("Transformer").forEach(C=>{C.setAttr("oldVisible",C.visible()),C.visible(!1)}),f.find(".page-background").forEach(C=>C.shadowEnabled(!1)),f.find(".page-background").forEach(C=>C.strokeEnabled(!1)),f.find(".highlighter").forEach(C=>C.visible(!1));const _=f.findOne(".page-background-group"),S=_.clip();_.clip({x:null,y:null,width:null,height:null});const x=f.findOne(".elements-container"),m=x.clip();x.clip({x:null,y:null,width:null,height:null});const w=f.find(C=>C.getAttr("hideInExport"));w.forEach(C=>{C.setAttr("oldVisible",C.visible()),C.hide()});const E=f.find(C=>!C.visible()&&C.getAttr("editModeEnabled"));E.forEach(C=>{C.setAttr("oldVisible",C.visible()),C.show()}),r&&f.find(".page-background").forEach(C=>C.hide());const P=a?h.bleed:0;let R=P;!e.bleedVisible&&a||(e.bleedVisible||a?e.bleedVisible&&a?R=0:e.bleedVisible&&!a&&(R=-h.bleed):R=0);const k=document.createElement("canvas");k.width=Math.round((h.computedWidth+2*P)*d),k.height=Math.round((h.computedHeight+2*P)*d);const N=k.getContext("2d");i==="image/jpeg"&&(N.fillStyle="white",N.fillRect(0,0,k.width,k.height));const M=f.scale();f.scale({x:1,y:1});const T=f.toCanvas({x:f.x()-R,y:f.y()-R,width:h.computedWidth+2*P,height:h.computedHeight+2*P,pixelRatio:d});return f.scale(M),N.drawImage(T,0,0,k.width,k.height),Kt.Util.releaseCanvas(T),r&&f.find(".page-background").forEach(C=>C.show()),w.forEach(C=>{C.visible(C.getAttr("oldVisible"))}),E.forEach(C=>{C.visible(C.getAttr("oldVisible"))}),f.find(".page-background").forEach(C=>C.shadowEnabled(!0)),f.find(".page-background").forEach(C=>C.strokeEnabled(!0)),p.find("Transformer").forEach(C=>{C.visible(C.getAttr("oldVisible"))}),f.find(".highlighter").forEach(C=>C.visible(!0)),_.clip(S),x.clip(m),p.position(b),h?.set({_exporting:!1,_forceMount:!1}),await new Promise(C=>setTimeout(C)),e.setElementsPixelRatio(v),k},async toDataURL(t={}){var{mimeType:r,quality:n}=t,i=Id(t,["mimeType","quality"]);const a=await e._toCanvas(Object.assign({mimeType:r},i)),o=a.toDataURL(r,n);return Kt.Util.releaseCanvas(a),o},async toBlob(t={}){var{mimeType:r,quality:n}=t,i=Id(t,["mimeType","quality"]);const a=await e._toCanvas(Object.assign({mimeType:r},i)),o=await new Promise(l=>{a.toBlob(l,r,n)});return Kt.Util.releaseCanvas(a),o},async saveAsImage(t={}){var{fileName:r}=t,n=Id(t,["fileName"]);const i=n.mimeType||"image/png",a=i.split("/")[1];Jp(await e.toDataURL(n),r||"polotno."+a)},async _toPDF(t){const r=t.dpi||e.dpi,n=t.parallel||1,i=t.unit||(e.unit==="px"?"mm":e.unit),a=t.pixelRatio||1,o=t.pageIds||e.pages.map(w=>w.id),l=e.pages.filter(w=>o.includes(w.id)),u=await HO(),d=w=>s0({px:w,unit:i,dpi:r}),h=t.cropMarkSize||0,v=d(h),p=l[0]||{},f=t.includeBleed?p.bleed:0,b=d(p.computedWidth+2*f+2*v),_=d(p.computedHeight+2*f+2*v);var S=new u({unit:i,orientation:b>_?"landscape":"portrait",format:[b,_],compress:!0,putOnlyUsedFonts:!0});S.deletePage(1);const x=((w,E)=>{for(var P=[],R=0;R<w.length;R+=E)P.push(w.slice(R,R+E));return P})(l,n);let m=0;for(const w of x){const E=w.map(async P=>{const R=t.includeBleed?P.bleed:0,k=P.computedWidth+2*R+2*h,N=P.computedHeight+2*R+2*h,M=d(k),T=d(N);let C=0,L=a;for(;C<10;){C+=1,C===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const H=await e.toDataURL(Object.assign(Object.assign({},t),{pageId:P.id,pixelRatio:L}));if(H.length>20)return t.onProgress&&t.onProgress(++m/o.length*.9),{url:H,width:M,height:T,widthPx:k,heightPx:N};L*=.8}});(await Promise.all(E)).forEach(({url:P,width:R,height:k,widthPx:N,heightPx:M})=>{S.addPage([R,k],R>k?"landscape":"portrait");const T=S.getCurrentPageInfo();var C;switch(i){case"pt":C=1;break;case"mm":C=72/25.4;break;case"cm":C=72/2.54;break;case"in":C=72;break;case"px":C=.75;break;case"pc":case"em":C=12;break;case"ex":C=6;break;default:throw"Invalid unit: "+i}if(T.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:R*C,topRightY:k*C},T.pageContext.artBox={bottomLeftX:d(h+f)*C,bottomLeftY:d(h+f)*C,topRightX:d(N-h-f)*C,topRightY:d(M-h-f)*C},T.pageContext.bleedBox={bottomLeftX:d(h+f)*C,bottomLeftY:d(h+f)*C,topRightX:d(N-h-f)*C,topRightY:d(M-h-f)*C},v){S.setLineWidth(d(1));const L=v+d(f);S.line(L,0,L,v),S.line(0,L,v,L),S.line(R-L,0,R-L,v),S.line(R,L,R-v,L),S.line(0,k-L,v,k-L),S.line(L,k,L,k-v),S.line(R,k-L,R-v,k-L),S.line(R-L,k,R-L,k-v)}S.addImage(P,v,v,R-2*v,k-2*v,void 0,"FAST")})}return S},toPDFDataURL:async t=>(await e._toPDF(Object.assign({mimeType:"image/jpeg"},t))).output("datauristring"),async toGIFDataURL(t={}){const r=t.pixelRatio||1,n=await GO({width:e.width*r,height:e.height*r}),i=1e3/(t.fps||10),a=e.duration/i;for(let o=0;o<a-1;o++){const l=o*i||1;e.setCurrentTime(l);let u=0,d="";for(const v of e.pages)if(u+=v.duration,v.set({_rendering:u>l}),u>l){d=v.id;break}const h=await e._toCanvas({pixelRatio:r,pageId:d,_skipTimeout:!0});n.addFrame(h.getContext("2d"),{delay:i,copy:!0})}for(const o of e.pages)o.set({_rendering:!1});return e.stop(),n.render(),new Promise(o=>{n.on("finished",function(l){(function(u,d){var h=new FileReader;h.onload=function(v){d(v.target.result)},h.readAsDataURL(u)})(l,o)})})},async saveAsGIF(t={}){var{fileName:r}=t,n=Id(t,["fileName"]);const i=await e.toGIFDataURL(n);Jp(i,r||"polotno.gif")},async toHTML({elementHook:t}={elementHook:void 0}){const r=e.toJSON();return cC({json:r,elementHook:t})},async saveAsHTML({fileName:t}={}){const r=await e.toHTML(),n="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(r)));Jp(n,t||"polotno.html")},async toSVG({elementHook:t,pageId:r}={elementHook:void 0,pageId:void 0}){var n;const i=e.toJSON();r=r||((n=i.pages[0])===null||n===void 0?void 0:n.id);const a=i.pages.find(o=>o.id===r);return pC({json:Object.assign(Object.assign({},i),{pages:a?[a]:[]}),elementHook:t})},async saveAsSVG({fileName:t,elementHook:r,pageId:n}={}){const i=await e.toSVG({elementHook:r,pageId:n}),a="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(i)));Jp(a,t||"polotno.svg")},async saveAsPDF(t={}){var{fileName:r}=t,n=Id(t,["fileName"]);(await e._toPDF(Object.assign({mimeType:"image/jpeg"},n))).save(r||"polotno.pdf")},async waitLoading({_skipTimeout:t=!1}={}){t||await new Promise(r=>setTimeout(r,50)),await IS()},toJSON:()=>({width:e.width,height:e.height,fonts:Pu(e.fonts),pages:Pu(e.pages),audios:Pu(e.audios),unit:e.unit,dpi:e.dpi,custom:e.custom,schemaVersion:e.schemaVersion}),loadJSON(t,r=!1){var n;const i=JSON.parse(JSON.stringify(t)),a=i.schemaVersion||0;a<1&&bi.htmlRenderEnabled&&yi({children:i.pages},d=>{if(d.type==="text"){const v=d.letterSpacing*16;d.letterSpacing=v/d.fontSize}}),a<2&&yi({children:i.pages},d=>{d.filters&&Object.keys(d.filters).forEach(h=>{if(["warm","cold","natural"].includes(h))return;const v=d.filters[h];v&&typeof v.intensity=="number"&&(v.intensity=v.intensity/100)})}),delete i.schemaVersion;const o=e.pages.indexOf(e.activePage);let l=(n=i.pages[o]||i.pages[0])===null||n===void 0?void 0:n.id;i._activePageId=l;const u=Object.assign({},Pu(e));Object.assign(u,i),u.history=r?e.history.toJSON():{history:[],undoIdx:-1},nv(e,u)},clear({keepHistory:t=!1}={}){const r=e.pages.map(n=>n.id);e.deletePages(r),e.custom=null,t||e.history.clear()},addFont(t){e.removeFont(t.fontFamily),e.fonts.push(t),e.loadFont(t.fontFamily)},removeFont(t){e.fonts.filter(r=>r.fontFamily===t).forEach(r=>cg(r))},addAudio(t){const r=jb.create(Object.assign({id:gl(10)},t));e.audios.push(r)},removeAudio(t){const r=e.audios.find(n=>n.id===t);r&&e.audios.remove(r)},async loadFont(t){const r=e.fonts.find(i=>i.fontFamily===t)||Uv.find(i=>i.fontFamily===t);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"}))),US(r)):qS(t),Promise.all(n.map(i=>BS(t,i.fontStyle,i.fontWeight)))},validate:t=>Rf.validate(t,[{path:"",type:Rf}]).map(r=>({path:"store"+r.context.map(n=>n.path).join("."),message:r.message}))}));function vC({key:e,showCredit:t}={key:"",showCredit:!1}){return Rf.create({_forceShowCredit:t,_key:e})}const K6=$t.model("Node",{id:$t.identifier,type:"none",name:"",opacity:1,custom:$t.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(e=>{for(var t in e)e[t]===null&&(e[t]=void 0);return e}).postProcessSnapshot(e=>{const t=Object.assign({},e),r={};for(var n in t)n[0]!=="_"&&(r[n]=e[n]);return r}).views(e=>({get locked(){return!(e.draggable||e.contentEditable||e.styleEditable||e.resizable)},get page(){return Pf(e,Wd)},get store(){return Pf(e,Rf)},get top(){let t=e;for(;;){if(!Kp(t,vh))return t;t=Pf(t,vh)}},get parent(){return Kp(e,vh)?Pf(e,vh):Kp(e,Wd)?Pf(e,Wd):Kp(e,Rf)?Pf(e,Rf):null},get zIndex(){return e.parent.children.indexOf(e)}})).actions(e=>({toJSON:()=>Object.assign({},Pu(e))})).actions(e=>({clone(t={},{skipSelect:r=!1}={}){const n=JSON.parse(JSON.stringify(e.toJSON()));return t.id=t.id||gl(10),yi(n,i=>{i.id=gl(10)}),Object.assign(n,t),e.page.addElement(n,{skipSelect:r})},set(t){Object.assign(e,t)},moveUp(){e.page.moveElementsUp([e.id])},moveTop(){e.page.moveElementsTop([e.id])},moveDown(){e.page.moveElementsDown([e.id])},moveBottom(){e.page.moveElementsBottom([e.id])},setZIndex(t){e.parent.setElementZIndex(e.id,t)},beforeDestroy(){}})),Fb={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}}},Db={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}},mC={fade:({dTime:e,element:t,animation:r})=>{const n=e/r.duration;return r.type==="enter"?{opacity:n*t.opacity}:{opacity:(1-n)*t.opacity}},rotate:({dTime:e,element:t,animation:r})=>{const n=e/r.duration*360;return fO({x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.rotation},n)},blink:({dTime:e,element:t,animation:r})=>{const n=r.duration,i=e%n/(n/2),a=i<=1?i:2-i;return{opacity:t.opacity*a}},bounce:({dTime:e,element:t,animation:r})=>{var n;const i=r.duration,a=i/2,o=(n=r.data.strength)!==null&&n!==void 0?n:1,l={},u={x:t.x+t.width/3*o,y:t.y+t.height/3*o,width:t.width/3*o,height:t.height/3*o,fontSize:t.fontSize/3*o},d={x:t.x,y:t.y,width:t.width,height:t.height,fontSize:t.fontSize},h=e%i/a,v=h<=1?h:2-h;for(let p in u){const f=u[p],b=d[p]-f;l[p]=f+v*b}return l},move:({dTime:e,element:t,animation:r})=>{var n;const i=Fb[r.data.direction]||Fb.right,a=(n=r.data.strength)!==null&&n!==void 0?n:1,o={};for(var l in i.from){let u=i.from[l],d=i.to[l];r.type==="exit"&&(u=i.to[l],d=-i.from[l]),u*=a,d*=a;const h=t[l]+u,v=t[l]+d-h;o[l]=h+e/r.duration*v}return o},zoom:({dTime:e,element:t,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=t.rotation*Math.PI/180,l=Math.cos(o),u=Math.sin(o),d=t.width*(1-a),h=t.height*(1-a),v=(d*l-h*u)/2,p=(d*u+h*l)/2,f={x:t.x+v,y:t.y+p,width:t.width*a,height:t.height*a,fontSize:t.fontSize*a},b={x:t.x,y:t.y,width:t.width,height:t.height,fontSize:t.fontSize};for(var _ in f){let S=f[_],x=b[_];if(r.type==="exit"){const w=S;S=x,x=w}const m=x-S;i[_]=S+e/r.duration*m}return i},cameraZoom:({dTime:e,element:t,animation:r})=>{var n,i,a;const o={},l=r.data.direction||"right",u=Db[l]||Db.right,d=(n=r.data.movementStrength)!==null&&n!==void 0?n:.1,h=(i=r.data.shakeStrength)!==null&&i!==void 0?i:.015;a=r.data.zoomStrength;const v=e/r.duration,p=h*(1-v),f=Math.sin(12*v)*p*.7+Math.sin(8*v)*p*.3;r.type==="exit"&&Math.max(t.cropWidth||1,t.cropHeight||1),r.type;const b=1-Math.pow(1-v,2),_=t.cropX||0,S=t.cropY||0,x=t.cropWidth||1,m=t.cropHeight||1,w=x,E=m;let P,R,k=0,N=0;if(u.cropX){const M=u.cropX>0?1-(_+x):_;k=Math.min(M,Math.abs(d))*u.cropX}if(u.cropY){const M=u.cropY>0?1-(S+m):S;N=Math.min(M,Math.abs(d))*u.cropY}return r.type==="enter"?(P=u.cropX?_+k*(1-b):_,R=u.cropY?S+N*(1-b):S):(P=u.cropX?_+k*b:_,R=u.cropY?S+N*b:S),o.cropX=Math.max(0,Math.min(1-w,P+f*w)),o.cropY=Math.max(0,Math.min(1-E,R+f*E)),o.cropWidth=w,o.cropHeight=E,o}},O2=({element:e,dTime:t,animation:r})=>{const n=mC[r.name];return n?n({element:e,dTime:t,animation:r}):(console.error("Can not find animation type: "+r.name),{})},yC=$t.model("Animation",{delay:0,duration:500,enabled:!0,type:$t.enumeration("Type",["enter","exit","loop"]),name:"none",data:$t.frozen({})}),C2=(e,t)=>{const r={};for(const n in t)if(typeof e[n]=="number"&&typeof t[n]=="number"){const i=t[n]-e[n];i!==0&&(r[n]=i)}return r},bC=$t.model("ShapeFilter",{intensity:1}),Bb=["temperature","contrast","highlights","shadows","white","black","saturation","vibrance"],mp=K6.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:$t.array(yC),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:$t.map(bC),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(e=>{const t=Object.assign(Object.assign({},e),{x:e.x||0,y:e.y||0,filters:Array.isArray(e.filters)?{}:e.filters});return"width"in e&&(t.width=t.width||1),"height"in e&&(t.height=t.height||1),e.locked&&(t.draggable=!1,t.contentEditable=!1,t.styleEditable=!1,t.resizable=!1,t.removable=!1),t}).views(e=>{const t=Fr({x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation,opacity:e.opacity,color:e.color,fontSize:e.fontSize}),r=Dr(i=>{Object.assign(t,i)}),n=Dr(i=>{for(const a in i)typeof t[a]=="number"&&(t[a]=t[a]+i[a])});return{get a(){const{currentTime:i}=e.store;if(r({x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation,opacity:e.opacity,color:e.color,fontSize:e.fontSize,cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}),i===0)return t;const a=i-e.page.startTime;if(a>e.page.duration||a<0)return t;const o=e.store.animatedElementsIds;if(o.length&&!o.includes(e.id))return t;const l=e.animations.find(p=>p.type==="enter"),u=l?.enabled&&a<l.delay;u&&r({opacity:0});const d=l?.enabled&&a>=l.delay&&a<=l.delay+l.duration;if(d){const p=a-l.delay,f=O2({element:e,animation:l,dTime:p}),b=C2(e,f);n(b)}const h=e.animations.find(p=>p.type==="exit");if(!u&&!d&&h?.enabled&&a>=e.page.duration-h.duration-h.delay&&a<=e.page.duration-h.delay){const p=a-(e.page.duration-h.duration-h.delay),f=O2({element:e,animation:h,dTime:p}),b=C2(e,f);n(b)}h?.enabled&&a>=e.page.duration-h.delay&&r({opacity:0});const v=e.animations.find(p=>p.type==="loop");if(v?.enabled){const p=O2({element:e,animation:v,dTime:a}),f=C2(e,p);n(f)}return t},animated:i=>e.a[i]}}).actions(e=>({setAnimation(t,r){const n=e.animations.find(i=>i.type===t);n?Object.assign(n,r):e.animations.push(Object.assign({type:t},r))},setFilter(t,r){Bb.includes(t)||e.filters.forEach((n,i)=>{Bb.includes(i.toString())||e.filters.delete(i.toString())}),r==null?e.filters.delete(t):e.filters.set(t,{intensity:r})}})),Z6=mp.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:$t.optional($t.union($t.number,$t.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(e=>Object.assign({},e)).actions(e=>({toggleEditMode(t){e._editModeEnabled=t??!e._editModeEnabled,e._editModeEnabled?e.store.history.startTransaction():e.store.history.endTransaction()}})),l0=mp.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(e=>({toggleCropMode(t){e._cropModeEnabled=t??!e._cropModeEnabled,e._cropModeEnabled?e.store.history.startTransaction():e.store.history.endTransaction()},beforeDestroy(){e._cropModeEnabled&&e.store.history.endTransaction()}})),Q6=l0.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1}),J6=mp.named("Line").props({type:"line",width:400,height:10,color:"black",dash:$t.array($t.number),startHead:"",endHead:""}).actions(e=>({})),e8=mp.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:$t.map($t.string)}).preProcessSnapshot(e=>Object.assign(Object.assign({},e),{src:e.src||e.svgSource,colorsReplace:Array.isArray(e.colorsReplace)?{}:e.colorsReplace})).actions(e=>({replaceColor(t,r){e.colorsReplace.set(t,r)}})),t8=mp.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:$t.array($t.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0}),r8=l0.named("Gif").props({type:"gif",duration:0,keepRatio:!0});var wC=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};const yi=(e,t)=>{if(e.children)for(const r of e.children){if(t(r)===!0)break;yi(r,t)}},_C=[...new Array(20)].map((e,t)=>$t.late(()=>xC[t])),n8=$t.union({dispatcher:e=>{const t=nm[e.type];if(!t)throw new Error(`Unknown element type: "${e.type}"`);return t}},e8,Z6,l0,J6,Q6,t8,r8,$t.late(()=>vh),..._C),vh=K6.named("Group").props({type:"group",children:$t.array(n8)}).views(e=>({get draggable(){let t=!0;return yi(e,r=>{r.draggable||(t=!1)}),t},get resizable(){let t=!0;return yi(e,r=>{r.resizable||(t=!1)}),t},get contentEditable(){let t=!0;return yi(e,r=>{r.contentEditable||(t=!1)}),t},get styleEditable(){let t=!0;return yi(e,r=>{r.styleEditable||(t=!1)}),t},get locked(){let t=!0;return yi(e,r=>{r.locked||(t=!1)}),t}})).actions(e=>({set(t){var{draggable:r,contentEditable:n,styleEditable:i,resizable:a}=t,o=wC(t,["draggable","contentEditable","styleEditable","resizable"]);r!==void 0&&yi(e,l=>{l.set({draggable:r})}),n!==void 0&&yi(e,l=>{l.set({contentEditable:n})}),i!==void 0&&yi(e,l=>{l.set({styleEditable:i})}),a!==void 0&&yi(e,l=>{l.set({resizable:a})}),Object.assign(e,o)},addElement(t,{skipSelect:r=!1}={}){const n=nm[t.type];if(!n)return void console.error("Can not find model with type "+t.type);t.children&&t.children.forEach(a=>{a.id=a.id||gl(10)});const i=n.create(Object.assign({id:gl(10)},t));return e.children.push(i),i.selectable&&!r&&e.store.selectElements([i.id]),i},setElementZIndex(t,r){const n=e.children.find(i=>i.id===t);n&&(kf(n),e.children.remove(n),e.children.splice(r,0,n))}})),xC=[],nm={svg:e8,text:Z6,image:l0,group:vh,line:J6,video:Q6,figure:t8,gif:r8},SC={text:IP,image:a3,svg:a3,line:vO,video:_O,figure:TO,group:Gn(e=>{const{element:t,store:r}=e,{children:n}=t,i=t.selectable||r.role==="admin";return fe.createElement(dn,{opacity:t.opacity,listening:i,hideInExport:!t.showInExport},n.map(a=>fe.createElement(i8,Object.assign({},e,{key:a.id,store:r,element:a}))))}),gif:BO},EC=(e,t)=>{const r=[];yi(e,h=>{h.type!=="group"&&r.push(h.a)});const n=[];r.forEach(h=>{const v=[{x:0,y:0},{x:0+h.width,y:0},{x:0+h.width,y:0+h.height},{x:0,y:0+h.height}],p=new Kt.Transform;p.translate(h.x,h.y),p.rotate(Kt.Util.degToRad(h.rotation)),v.forEach(f=>{const b=p.point(f);n.push(b)})});const i=new Kt.Transform;i.rotate(-Kt.Util.degToRad(t));let a=1/0,o=1/0,l=-1/0,u=-1/0;n.forEach(h=>{const v=i.point(h);a=Math.min(a,v.x),o=Math.min(o,v.y),l=Math.max(l,v.x),u=Math.max(u,v.y)}),i.invert();const d=i.point({x:a,y:o});return{x:d.x,y:d.y,width:l-a,height:u-o,rotation:t}},i8=Gn(e=>{const{element:t,store:r}=e,[n,i]=fe.useState(!1),a=r.selectedElements.indexOf(t)>=0&&t.selectable,o=t.parent.type==="group",l=(h=>{const[v,p]=fe.useState(null);return fe.useEffect(()=>{const f=setTimeout(()=>{const b=h.page.id,_=Kt.stages.find(S=>S.getAttr("pageId")===b);_||console.error("No stage is found for element",h.id),p(_)});return()=>clearTimeout(f)},[h.id]),v})(t),u=l?.findOne("Transformer");fe.useEffect(()=>{if(l){const h=p=>{const f=p.target.findAncestor(".element",!0),b=r.getElementById(f?.id()),_=b?.top,S=_?.id;i(S===t.id)};l.on("mouseover",h);const v=()=>{i(!1)};return l.on("mouseleave",v),()=>{l.off("mouseover",h),l.off("mouseleave",v)}}},[l]);let d=SC[e.element.type];return e.element.type==="text"&&bi.htmlRenderEnabled&&(d=sO),e.element.visible?d?fe.createElement(fe.Fragment,null,fe.createElement(d,Object.assign({},e)),(n||a)&&!o&&fe.createElement(qO,{element:t.type==="group"?{a:EC(t,u?.rotation()||0)}:t})):(console.error("Can not find component for "+e.element.type),null):null});function PC(e,t,r="scale"){const n=t.width/t.height;let i,a;n>=e.width/e.height?(i=e.width,a=e.width/n):(i=e.height*n,a=e.height);let o=0,l=0;return r==="left-top"?(o=0,l=0):r==="left-middle"?(o=0,l=(e.height-a)/2):r==="left-bottom"?(o=0,l=e.height-a):r==="center-top"?(o=(e.width-i)/2,l=0):r==="center-middle"?(o=(e.width-i)/2,l=(e.height-a)/2):r==="center-bottom"?(o=(e.width-i)/2,l=e.height-a):r==="right-top"?(o=e.width-i,l=0):r==="right-middle"?(o=e.width-i,l=(e.height-a)/2):r==="right-bottom"?(o=e.width-i,l=e.height-a):r==="scale"?(o=0,l=0,i=e.width,a=e.height):console.error(new Error("Unknown clip position property - "+r)),{cropX:o,cropY:l,cropWidth:i,cropHeight:a}}var a8=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};const zb=Kt.DD._drag;window.removeEventListener("mousemove",zb),Kt.DD._drag=function(e){oc(()=>{zb.call(this,e)})},window.addEventListener("mousemove",Kt.DD._drag);const lv=new Kt.Group,Gc=20;lv.add(new Kt.Rect({width:Gc,height:Gc,fill:"white"})),lv.add(new Kt.Path({scaleX:Gc/24,scaleY:Gc/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 AC=lv.toCanvas({pixelRatio:2,width:Gc,height:Gc}),k2={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:e=>{e.hasName("rotater")&&e.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:AC,fillPatternScaleX:20/Gc/2,fillPatternScaleY:20/Gc/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},N2={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"]}},OC=e=>fe.createElement(xn,Object.assign({},e,{preventDefault:!1})),CC=e=>{var{url:t}=e,r=a8(e,["url"]);const[n,i]=zv(t,"anonymous"),a=n?PC(n,{width:r.width,height:r.height},"center-middle"):{};return Gd(i,t,"page background"),fe.createElement(Eu,Object.assign({image:n},r,a))},kC=e=>{const t=Zc({fill:e.fill,a:{width:e.width,height:e.height}});return fe.createElement(xn,Object.assign({},e,t))},NC=e=>{const{background:t,scale:r,borderColor:n}=e,i=a8(e,["background","scale","borderColor"]),a=fe.useMemo(()=>!!Kt.Util.colorToRGBA(t)||K1(t),[t]),o=fe.useMemo(()=>{const l=document.createElement("canvas"),u=30;l.width=60,l.height=60;const d=l.getContext("2d");return d&&(d.fillStyle="black",d.fillRect(u,0,u,u),d.fillRect(0,u,u,u)),l},[]);return fe.createElement(fe.Fragment,null,fe.createElement(xn,Object.assign({fillPatternImage:o},i,{opacity:.1,hideInExport:!0})),a?fe.createElement(kC,Object.assign({fill:t},i)):fe.createElement(CC,Object.assign({url:t},i)))},LC=Gn(({selection:e,fill:t="rgba(0, 161, 255, 0.3)",stroke:r="rgb(0, 161, 255)",strokeWidth:n=1})=>e.visible?fe.createElement(xn,{name:"selection",x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),width:Math.abs(e.x1-e.x2),height:Math.abs(e.y1-e.y2),fill:t,stroke:r,strokeWidth:n}):null),TC=Gn(({x:e,y:t,width:r,height:n,rotation:i,anchor:a,store:o,tagFill:l,textFill:u})=>{const d=a0({x:e,y:t,width:r,height:n,rotation:Kt.Util.radToDeg(i)});if(a===void 0)return null;const h=(n/2+70)*Math.cos(i-Math.PI/2),v=(n/2+70)*Math.sin(i-Math.PI/2),p=Lb({unit:o.unit,dpi:o.dpi,px:r/o.scale,precious:o.unit==="px"?0:1})+" x "+Lb({unit:o.unit,dpi:o.dpi,px:n/o.scale,precious:o.unit==="px"?0:1})+(o.unit==="px"?"":" "+o.unit);return fe.createElement(fe.Fragment,null,fe.createElement(A1,{x:(d.minX+d.maxX)/2+h,y:(d.minY+d.maxY)/2+v,offsetX:14,offsetY:14,visible:a==="rotater"},fe.createElement(O1,{cornerRadius:5,fill:l||"rgb(0, 161, 255)"}),fe.createElement(Nu,{align:"center",verticalAlign:"middle",fill:u||"white",padding:8,text:Math.round(Kt.Util.radToDeg(i)).toString()+"°"})),fe.createElement(A1,{x:(d.minX+d.maxX)/2,y:d.maxY+20,visible:a!=="rotater"},fe.createElement(O1,{cornerRadius:5,fill:l||"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),fe.createElement(Nu,{align:"center",verticalAlign:"middle",fill:u||"white",padding:8,text:p})))}),RC=Gn(({elements:e,store:t})=>{const r=e.filter(i=>i.alwaysOnTop),n=e.filter(i=>!i.alwaysOnTop).concat(r);return fe.createElement(fe.Fragment,null,n.map(i=>fe.createElement(i8,{key:i.id,store:t,element:i,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))}),MC=({store:e})=>{const[t,r]=fe.useState(!1),[n,i]=fe.useState({x:0,y:0});return{open:fe.useCallback(o=>{r(!0),i(o)},[]),close:fe.useCallback(()=>{r(!1)},[]),props:{isOpen:t,offset:n,setIsOpen:r}}},IC=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),qb=atob("cmVk"),jC=atob("djAuOS4y"),FC=e=>fe.createElement(fe.Fragment,null,fe.createElement(A1,{fill:qb,height:200},fe.createElement(O1,{fill:qb}),fe.createElement(Nu,Object.assign({},e,{fill:"white",text:IC,height:void 0,padding:10,fontSize:20})))),DC=Gn(({store:e,page:t,width:r,height:n,pageControlsEnabled:i,backColor:a,pageBorderColor:o,activePageBorderColor:l,components:u,bleedColor:d,altCloneEnabled:h,viewportSize:v,selectionRectFill:p,selectionRectStroke:f,selectionRectStrokeWidth:b,snapGuideStroke:_,snapGuideStrokeWidth:S,snapGuideDash:x,transformLabelFill:m,transformLabelTextFill:w})=>{const E=e.bleedVisible?t.bleed:0,P=t.computedWidth+2*E,R=t.computedHeight+2*E,k=(r-P*e.scale)/2,N=(n-R*e.scale)/2,M=fe.useRef(null),T=fe.useRef(null),C=fe.useRef(null),L=i==null||i,[H,G]=fe.useState(null),[J,se]=fe.useState({}),U=MC({store:e}),V=e.selectedElements.find(ke=>ke._cropModeEnabled),X=e.selectedShapes.filter(ke=>!ke.resizable).length>0,z=e.selectedShapes.filter(ke=>!ke.draggable).length>0,D=e.selectedElements.filter(ke=>!ke.visible).length>0;fe.useLayoutEffect(()=>{var ke,Se,le;if(!M.current)return;const Ee=M.current.getStage(),xe=e.selectedShapes.map(Ne=>Ne._cropModeEnabled?null:Ee.findOne("#"+Ne.id)).filter(Ne=>Ne),ye=e.selectedElements.length===1&&((ke=e.selectedElements[0])===null||ke===void 0?void 0:ke.type)||"many";N2[ye]?(M.current.setAttrs(Object.assign(Object.assign({},k2),N2[ye])),ye!=="svg"&&ye!=="image"&&ye!=="gif"||e.selectedElements[0].keepRatio||M.current.setAttrs({enabledAnchors:k2.enabledAnchors}),ye==="text"&&bi.textVerticalResizeEnabled&&M.current.setAttrs({enabledAnchors:(Se=N2.text.enabledAnchors)===null||Se===void 0?void 0:Se.concat(["bottom-center"])})):M.current.setAttrs(k2),X&&M.current.enabledAnchors([]),z&&M.current.rotateEnabled(!1),xe.find(Ne=>Ne?.isDragging())&&xe.forEach(Ne=>{Ne.isDragging()||Ne==null||Ne.startDrag()}),M.current.nodes(xe),(le=M.current.getLayer())===null||le===void 0||le.batchDraw()},[e.selectedShapes,V,X,D,z]);const F=m9(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),q=fe.useRef(!1),Q=af(),re=Dr(ke=>{var Se,le,Ee,xe;if(Q)return;q.current=!1;const ye=ke.target.findAncestor(".elements-container"),Ne=ke.target.findAncestor("Transformer"),Te=ke.target.findAncestor(".page-abs-container");if(ye||Ne||Te)return;const ge=(Se=ke.target.getStage())===null||Se===void 0?void 0:Se.getPointerPosition();ge.x-=(le=ke.target.getStage())===null||le===void 0?void 0:le.x(),ge.y-=(Ee=ke.target.getStage())===null||Ee===void 0?void 0:Ee.y(),ge&&(F.visible=!0,F.x1=ge.x,F.y1=ge.y,F.x2=ge.x,F.y2=ge.y,((xe=ke.target.getStage())===null||xe===void 0?void 0:xe.getPointersPositions().length)>=2&&(F.visible=!1))});(({stageRef:ke,containerRef:Se,viewportSize:le})=>{fe.useEffect(()=>{var Ee;const xe=(Ee=Se.current)===null||Ee===void 0?void 0:Ee.closest(".polotno-workspace-inner");function ye(){var Ne;if(!ke.current)return;const Te=(Ne=Se.current)===null||Ne===void 0?void 0:Ne.getBoundingClientRect(),ge=xe?.getBoundingClientRect(),Re=Math.max(0,ge.left-Te.left-100),Be=Math.max(0,ge.top-Te.top-100);ke.current.position({x:-Re,y:-Be}),ke.current.container().style.transform=`translate(${Re}px, ${Be}px)`}return ye(),xe.addEventListener("scroll",ye),()=>{xe.removeEventListener("scroll",ye)}},[le.width,le.height])})({stageRef:T,containerRef:C,viewportSize:v}),fe.useEffect(()=>{const ke=Dr(le=>{var Ee,xe,ye,Ne;if(!F.visible)return;(Ee=T.current)===null||Ee===void 0||Ee.setPointersPositions(le);let Te=(xe=T.current)===null||xe===void 0?void 0:xe.getPointerPosition();Te?(Te.x-=(ye=T.current)===null||ye===void 0?void 0:ye.x(),Te.y-=(Ne=T.current)===null||Ne===void 0?void 0:Ne.y()):Te={x:F.x2,y:F.y2},F.x2=Te.x,F.y2=Te.y}),Se=Dr(()=>{if(!F.visible||!T.current)return;const le=T.current.findOne(".selection"),Ee=le?le.getClientRect():{width:0,height:0,x:0,y:0};if(Ee.width&&Ee.height){const xe=[];T.current.find(".element").forEach(Ne=>{const Te=Ne.getClientRect(),ge=e.getElementById(Ne.id()),Re=ge?.draggable,Be=ge?.selectable;Kt.Util.haveIntersection(Ee,Te)&&Re&&Be&&xe.push(ge.top.id)});const ye=[...new Set(xe)];e.selectElements(ye)}F.visible=!1,q.current=!0});return window.addEventListener("mousemove",ke),window.addEventListener("touchmove",ke),window.addEventListener("mouseup",Se),window.addEventListener("touchend",Se),()=>{window.removeEventListener("mousemove",ke),window.removeEventListener("touchmove",ke),window.removeEventListener("mouseup",Se),window.removeEventListener("touchend",Se)}},[]);const Y=fe.useRef(!1);fe.useEffect(()=>{var ke;let Se;const le=(ke=C.current)===null||ke===void 0?void 0:ke.closest(".polotno-workspace-inner"),Ee=()=>{Y.current=!0,clearTimeout(Se),Se=setTimeout(()=>{Y.current=!1},300)};return le.addEventListener("scroll",Ee),()=>{clearTimeout(Se),le.removeEventListener("scroll",Ee)}},[]);const ee=ke=>{if(e.activePage!==t&&t.select(),Y.current||q.current)return;const Se=ke.evt.ctrlKey||ke.evt.metaKey||ke.evt.shiftKey,le=ke.target.findAncestor(".elements-container"),Ee=ke.target.findAncestor(".page-abs-container"),xe=ke.target.findAncestor("Transformer");if(!(Se||le||xe||Ee))return void e.selectElements([]);const ye=ke.target.findAncestor(".element",!0),Ne=e.getElementById(ye?.id()),Te=Ne?.top,ge=Te?.id,Re=e.selectedElementsIds.indexOf(ge)>=0;ge&&Se&&!Re?e.selectElements(e.selectedElementsIds.concat([ge])):ge&&Se&&Re?e.selectElements(e.selectedElementsIds.filter(Be=>Be!==ge)):!ge||Se||Re||e.selectElements([ge])};dO(M,e,{stroke:_,strokeWidth:S,dash:x});const ae=e.activePage===t,ue=u?.PageControls,ce=u?.Tooltip,pe=u?.ContextMenu,Ae=1/e.scale,Ce=0/e.scale;return fe.createElement("div",{ref:C,onDragOver:ke=>ke.preventDefault(),onDrop:ke=>{if(ke.preventDefault(),!T.current)return;T.current.setPointersPositions(ke),T.current.findOne(".elements-container").getRelativePointerPosition();const Se=T.current.getPointerPosition(),le=T.current.getAllIntersections(Se).map(xe=>xe.findAncestor(".element",!0)).filter(Boolean);[...new Set(le.reverse())].map(xe=>e.getElementById(xe.id()))[0]},style:{position:"relative",width:r+"px",height:n+"px",overflow:"hidden"},className:"polotno-page-container"+(ae?" active-page":"")},fe.createElement(fS,{ref:T,width:Math.min(r,v.width+200),height:Math.min(v.height+200,n),onClick:ee,onTap:ee,onContextMenu:ke=>{ke.evt.preventDefault();const Se=ke.target.findAncestor(".element",!0),le=e.getElementById(Se?.id()),Ee=le?.top,xe=Ee?.id;xe?e.selectedElementsIds.indexOf(xe)>=0||e.selectElements([xe]):e.selectElements([]),U.open({x:ke.evt.clientX,y:ke.evt.clientY})},onMouseDown:re,onMouseMove:ke=>{if(!ke.evt.altKey&&H)return void G(null);if(!ke.evt.altKey)return;const Se=ke.target.findAncestor(".element",!0),le=Se?.id();if(!e.selectedElements[0]||e.selectedElementsIds.includes(le))return;const Ee=o0(e.selectedShapes),xe=le?e.getElementById(le):{x:0,y:0,width:t.computedWidth,height:t.computedHeight,rotation:0},ye=a0(xe),Ne=[];Ee.minX>ye.maxX&&Ne.push({distance:Ee.minX-ye.maxX,box1:Ee,box2:ye,points:[{x:Ee.minX,y:Ee.minY+Ee.height/2},{x:ye.maxX,y:Ee.minY+Ee.height/2},{x:ye.maxX,y:ye.minY+ye.height/2}]}),Ee.maxX<ye.minX&&Ne.push({distance:ye.minX-Ee.maxX,box1:Ee,box2:ye,points:[{x:Ee.maxX,y:Ee.minY+Ee.height/2},{x:ye.minX,y:Ee.minY+Ee.height/2},{x:ye.minX,y:ye.minY+ye.height/2}]}),Ee.minY>ye.maxY&&Ne.push({box1:Ee,box2:ye,distance:Ee.minY-ye.maxY,points:[{x:Ee.minX+Ee.width/2,y:Ee.minY},{x:Ee.minX+Ee.width/2,y:ye.maxY},{x:ye.minX+ye.width/2,y:ye.maxY}]}),Ee.maxY<ye.minY&&Ne.push({box1:Ee,box2:ye,distance:ye.minY-Ee.maxY,points:[{x:Ee.minX+Ee.width/2,y:Ee.maxY},{x:Ee.minX+Ee.width/2,y:ye.minY},{x:ye.minX+ye.width/2,y:ye.minY}]}),Ee.minX>=ye.minX&&Ee.maxX<=ye.maxX&&Ee.minY>=ye.minY&&Ee.maxY<=ye.maxY&&(Ne.push({distance:Ee.minX-ye.minX,box1:Ee,box2:ye,points:[{x:Ee.minX,y:Ee.minY+Ee.height/2},{x:ye.minX,y:Ee.minY+Ee.height/2},{x:ye.minX,y:ye.minY+ye.height/2}]}),Ne.push({distance:ye.maxX-Ee.maxX,box1:Ee,box2:ye,points:[{x:Ee.maxX,y:Ee.minY+Ee.height/2},{x:ye.maxX,y:Ee.minY+Ee.height/2},{x:ye.maxX,y:ye.minY+ye.height/2}]}),Ne.push({box1:Ee,box2:ye,distance:Ee.minY-ye.minY,points:[{x:Ee.minX+Ee.width/2,y:Ee.minY},{x:Ee.minX+Ee.width/2,y:ye.minY},{x:ye.minX+ye.width/2,y:ye.minY}]}),Ne.push({box1:Ee,box2:ye,distance:ye.maxY-Ee.maxY,points:[{x:Ee.minX+Ee.width/2,y:Ee.maxY},{x:Ee.minX+Ee.width/2,y:ye.maxY},{x:ye.minX+ye.width/2,y:ye.maxY}]})),JSON.stringify(H)!==JSON.stringify(Ne)&&G(Ne)},onDragStart:ke=>{var Se;const le=ke.target.findAncestor(".element",!0);if(le){const Ee=e.getElementById(le?.id()),xe=Ee?.top,ye=xe?.id;!(e.selectedElementsIds.indexOf(ye)>=0)&&ye&&(e.selectElements([ye]),ke.target.stopDrag(),ke.target.startDrag(ke),(Se=M.current)===null||Se===void 0||Se.startDrag(ke))}H&&G(null)},pageId:t.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},fe.createElement(uS,null,fe.createElement(OC,{width:r,height:n,fill:a}),fe.createElement(dn,{x:k,y:N,scaleX:e.scale,scaleY:e.scale,name:"page-container"},fe.createElement(dn,{name:"page-container-2"},fe.createElement(dn,{name:"page-background-group",x:E,y:E},fe.createElement(NC,{x:-t.bleed,y:-t.bleed,width:t.computedWidth+2*t.bleed,height:t.computedHeight+2*t.bleed,background:t.background,name:"page-background",preventDefault:!1,scale:e.scale})),fe.createElement(dn,{x:E,y:E,name:"elements-container",listening:!e.isPlaying},fe.createElement(xn,{name:"elements-area",width:t.computedWidth,height:t.computedHeight,listening:!1}),fe.createElement(RC,{elements:t.children,store:e})),fe.createElement(xn,{stroke:d,name:"bleed",strokeWidth:t.bleed,x:t.bleed/2,y:t.bleed/2,width:t.computedWidth+t.bleed,height:t.computedHeight+t.bleed,listening:!1,visible:t.bleed>0&&e.bleedVisible,hideInExport:!0}),YO()===jC&&fe.createElement(FC,{name:"hit-detection",x:-Ae/2-Ce,y:-Ae/2-Ce,width:P+Ae+2*Ce,height:R+Ae+2*Ce}))),fe.createElement(Vc,{name:"workspace-background",points:[0,0,r,0,r,n,0,n,0,0,k,N,k,n-N,r-k,n-N,r-k,N,k,N],listening:!1,closed:!0,fill:a}),fe.createElement(dn,{x:k,y:N,scaleX:e.scale,scaleY:e.scale},fe.createElement(xn,{name:"page-highlight",hideInExport:!0,x:-Ae/2-Ce,y:-Ae/2-Ce,width:P+Ae+2*Ce,height:R+Ae+2*Ce,stroke:ae&&e.pages.length>1?l:o,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),fe.createElement(dn,{x:k+E*e.scale,y:N+E*e.scale,scaleX:e.scale,scaleY:e.scale,name:"page-abs-container"},fe.createElement(Jd,{ref:M,onDragStart:ke=>{var Se;!((Se=ke.evt)===null||Se===void 0)&&Se.altKey&&h&&e.selectedElements.forEach(le=>{const Ee=le.clone({},{skipSelect:!0}),xe=t.children.indexOf(le);t.setElementZIndex(Ee.id,xe)}),e.history.startTransaction()},onDragEnd:()=>{e.history.endTransaction()},onTransformStart:()=>{e.history.startTransaction(),G(null)},boundBoxFunc:(ke,Se)=>{const le=Math.abs(Se.width)<1||Math.abs(Se.height)<1,Ee=Math.abs(ke.width)<1||Math.abs(ke.height)<1;return le&&!Ee?ke:Se},onTransform:ke=>{var Se,le;const Ee=M.current.nodes(),xe=Ee[Ee.length-1];if(ke.target!==xe)return;const ye=(Se=M.current)===null||Se===void 0?void 0:Se.__getNodeRect(),Ne=(le=M.current)===null||le===void 0?void 0:le.getActiveAnchor();se({anchor:Ne,x:ye.x,y:ye.y,rotation:ye.rotation,width:ye.width,height:ye.height})},onTransformEnd:ke=>{se({}),e.history.endTransaction()},visible:!e.isPlaying}),H&&H.map(({points:ke,distance:Se,box1:le,box2:Ee},xe)=>fe.createElement(dn,{name:"distances-container",hideInExport:!0,key:xe,listening:!1},fe.createElement(xn,Object.assign({},le,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),fe.createElement(xn,Object.assign({},Ee,{stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1})),fe.createElement(Vc,{points:[ke[0].x,ke[0].y,ke[1].x,ke[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),fe.createElement(Vc,{points:[ke[1].x,ke[1].y,ke[2].x,ke[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),fe.createElement(A1,{x:(ke[0].x+ke[1].x)/2,y:(ke[0].y+ke[1].y)/2,offsetY:-10,scaleX:1/e.scale,scaleY:1/e.scale},fe.createElement(O1,{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),fe.createElement(Nu,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:nC({unit:e.unit,dpi:e.dpi,px:Se})})))),t._rendering&&fe.createElement(dn,null,fe.createElement(xn,{width:P,height:R,fill:"rgba(255,255,255,0.9)"}),fe.createElement(Nu,{text:"Rendering...",fontSize:60,width:P,height:R,align:"center",verticalAlign:"middle"})),ce&&fe.createElement(ce,{components:u,store:e,page:t,stageRef:T}),pe&&fe.createElement(C1,null,fe.createElement(pe,Object.assign({components:u,store:e},U.props)))),fe.createElement(TC,Object.assign({},J,{store:e,tagFill:m,textFill:w})),fe.createElement(LC,{selection:F,fill:p,stroke:f,strokeWidth:b}),XO()&&fe.createElement(Nu,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:r-170,y:n-18,onMouseEnter:ke=>{ke.target.getStage().container().style.cursor="pointer"},onMouseLeave:ke=>{ke.target.getStage().container().style.cursor=""},onTouchStart:ke=>{ke.cancelBubble=!0},onMouseDown:ke=>{ke.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),fe.createElement(dn,{name:"line-guides"}))),L&&ue&&fe.createElement(ue,{store:e,page:t,xPadding:k,yPadding:N}))}),BC=Mh("div",fe.forwardRef)`
375
- position: absolute;
376
- top: 0;
377
- left: 0;
378
- pointer-events: none;
379
- `,zC=Mh("div",fe.forwardRef)`
380
- height: 14px;
381
- position: sticky;
382
- font-size: 8px;
383
- line-height: 14px;
384
- top: 0;
385
- left: 0;
386
- color: grey;
387
- border-bottom: 1px solid grey;
388
- background-color: #e8e8e8;
389
- overflow: hidden;
390
- `,qC=Mh("div",fe.forwardRef)`
391
- left: 0;
392
- width: 14px;
393
- position: sticky;
394
- font-size: 8px;
395
- line-height: 14px;
396
- color: grey;
397
- border-right: 1px solid grey;
398
- background-color: #e8e8e8;
399
- overflow: hidden;
400
- `,UC=Mh("div",fe.forwardRef)`
401
- position: absolute;
402
- border-left: 1px solid grey;
403
- padding-left: 2px;
404
- `,HC=Mh("div",fe.forwardRef)`
405
- position: absolute;
406
- left: 14px;
407
- border-left: 1px solid grey;
408
- padding-left: 2px;
409
- transform: rotate(90deg);
410
- transform-origin: left top;
411
- overflow: hidden;
412
- `,VC=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4],GC=Gn(({store:e,width:t,height:r})=>{const n=fe.useRef(null);if(!e.activePage)return null;const i=e.activePage,a=(e.bleedVisible&&i.bleed,i.computedWidth*e.scale),o=i.computedHeight*e.scale,l=(t-a)/2,u=(d=b=>Tb({unitVal:b,dpi:e.dpi,unit:e.unit})*e.scale,VC.find(b=>d(b)>30)||1e4);var d;const h=Tb({unitVal:u,dpi:e.dpi,unit:e.unit})*e.scale,v=Math.round(a/h)+1,p=Math.round(o/h)+1,f=o0(e.selectedShapes);return fe.createElement(BC,{ref:n,className:"polotno-rulers"},fe.createElement(zC,{style:{width:t+"px"},className:"polotno-x-ruler"},[...Array(v)].map((b,_)=>fe.createElement(UC,{key:_,style:{left:l+_*h+"px",width:h+"px"}},e.unit==="px"||u>=1?Math.round(u*_):(u*_).toFixed(1))),!!e.selectedShapes.length&&fe.createElement("div",{style:{position:"absolute",left:l+f.x*e.scale+"px",height:"14px",width:f.width*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),e.pages.map((b,_)=>{var S;const x=b.computedHeight*e.scale,m=(r-x)/2;return fe.createElement(qC,{key:b.id,style:{height:r+"px"},className:"polotno-y-ruler"},[...Array(p)].map((w,E)=>fe.createElement(HC,{key:E,style:{top:m+E*h-14+"px",width:h+"px"}},e.unit==="px"||u>=1?Math.round(u*E):(u*E).toFixed(1))),((S=e.selectedShapes[0])===null||S===void 0?void 0:S.page)===b&&fe.createElement("div",{style:{position:"absolute",top:m+f.y*e.scale-14+"px",width:"14px",height:f.height*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),$C=Gn(({audio:e,store:t})=>{const[r,n]=function(i){const[a,o]=fe.useState(null),[l,u]=fe.useState("loading");return fe.useEffect(()=>{const d=new Audio(i),h=()=>{u("loaded"),o(d)},v=()=>{u("failed"),o(null)};return d.addEventListener("canplay",h),d.addEventListener("error",v),()=>{d.removeEventListener("canplay",h),d.removeEventListener("error",v)}},[i]),[a,l]}(e.src);return fe.useEffect(()=>{r&&t.history.ignore(()=>{e.set({duration:1e3*r.duration})})},[r,e,t.history]),fe.useEffect(()=>{if(!r)return;const i=()=>{r.currentTime=e.startTime*e.duration/1e3},a=()=>{const l=e.endTime*e.duration/1e3;r.currentTime>=l&&(r.pause(),r.currentTime=e.startTime*e.duration/1e3)};r.addEventListener("ended",i),r.addEventListener("timeupdate",a);const o=Mu(()=>{const l=t.animatedElementsIds;if(l.length&&!l.includes(e.id))return;const u=t.currentTime-e.delay,d=e.duration*(e.endTime-e.startTime),h=u>=0&&u<d;if(!t.isPlaying||t.animatedElementsIds.length!==0||!h)return void r.pause();r.volume=e.volume,r.paused&&r.play();const v=u%d/1e3+e.startTime*e.duration/1e3,p=r.currentTime;Math.abs(p-v)>.5&&v!==p&&(r.currentTime=v)});return()=>{r.pause(),r.removeEventListener("ended",i),r.removeEventListener("timeupdate",a),o()}},[t.isPlaying,e.startTime,e.endTime,e.volume,r]),null});let o8={data:[],pageId:""};const R1="polotno_clipboard",im=(e,t)=>{o8={data:JSON.parse(JSON.stringify(e)),pageId:t};try{localStorage.setItem(R1,JSON.stringify(e)),localStorage.setItem(R1+"_page",t)}catch{}},WC=()=>{try{const e=localStorage.getItem(R1),t=localStorage.getItem(R1+"_page");if(e)return{data:JSON.parse(e),pageId:t}}catch{}return o8},YC=e=>{var t;e.selectedElements.length!==0&&im(e.selectedElements.map(r=>r.toJSON()),(t=e.activePage)===null||t===void 0?void 0:t.id)},XC=e=>{var t;im(e.selectedElements.map(n=>n.toJSON()),(t=e.activePage)===null||t===void 0?void 0:t.id);let r=e.selectedElements.filter(n=>n.removable).map(n=>n.id);e.deleteElements(r)},KC=e=>{e.history.transaction(()=>{var t,r;let n=0,i=0;const{data:a,pageId:o}=WC();if(o===((t=e.activePage)===null||t===void 0?void 0:t.id))n=e.width/20,i=e.height/20;else{const u=[];yi({children:a},h=>{h.type!=="group"&&u.push(h)});const d=o0(u);d.maxX>e.width&&(n=-d.minX),d.maxY>e.height&&(i=-d.minY)}const l=[];yi({children:a},u=>{delete u.id,u.type!=="group"&&(u.x+=n,u.y+=i)}),a.forEach(u=>{var d;const h=(d=e.activePage)===null||d===void 0?void 0:d.addElement(u);h&&l.push(h.id)}),im(a,(r=e.activePage)===null||r===void 0?void 0:r.id),e.selectElements(l)})};function ZC(e,t){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=t.selectedElements.filter(d=>d.removable).map(d=>d.id);e.keyCode!==46&&e.keyCode!==8||t.deleteElements(o);const l=e.ctrlKey||e.metaKey,u=e.shiftKey;if(!l||u||e.key.toLowerCase()!=="z"&&e.key.toLowerCase()!=="y"||(e.preventDefault(),t.history.undo()),l&&u&&(e.key.toLowerCase()==="z"||e.key.toLowerCase()==="y")&&(e.preventDefault(),t.history.redo()),l&&e.code==="KeyA"){e.preventDefault();const d=(a=t.activePage)===null||a===void 0?void 0:a.children.filter(v=>v.selectable),h=d?.map(v=>v.id)||[];t.selectElements(h)}l&&e.code==="KeyC"&&(e.preventDefault(),YC(t)),l&&e.code==="KeyX"&&(e.preventDefault(),XC(t)),l&&e.code==="KeyV"&&(e.preventDefault(),KC(t)),e.code==="ArrowDown"&&(e.preventDefault(),t.selectedShapes.forEach(d=>{d.draggable&&d.set({y:d.y+1})})),e.code==="ArrowUp"&&(e.preventDefault(),t.selectedShapes.forEach(d=>{d.draggable&&d.set({y:d.y-1})})),e.code==="ArrowLeft"&&(e.preventDefault(),t.selectedShapes.forEach(d=>{d.draggable&&d.set({x:d.x-1})})),e.code==="ArrowRight"&&(e.preventDefault(),t.selectedShapes.forEach(d=>{d.draggable&&d.set({x:d.x+1})}))}const uv=Fr({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",filters:"Filters",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",copyStyle:"Copy style",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"}}),M1=e=>e&&typeof e=="object";function s8(e,t){Object.keys(t).forEach(r=>{const n=e[r],i=t[r];M1(i)&&M1(n)?s8(n,i):e[r]=i})}function l8(e,t,r=""){Object.keys(t).forEach(n=>{const i=t[n],a=r?`${r}.${n}`:n;M1(i)?M1(e[n])?l8(e[n],i,a):console.warn(`Missing nested translation object at '${a}'`):e[n]===void 0&&console.warn(`Missing translation '${a}'`)})}Dr((e,{validate:t=!1}={})=>{t&&l8(e,uv),s8(uv,e)});const Ub={},Hb=e=>{const t=function(i,a){var o,l=a.split("."),u=i;for(o=0;o<l.length;++o){if(u[l[o]]==null)return;u=u[l[o]]}return u}(uv,e);if(t!==void 0)return t;Ub[e]||(Ub[e]=!0,console.warn(`Missing translation '${e}'`));const r=e.split("."),n=r[r.length-1]||" ";return n.charAt(0).toUpperCase()+n.slice(1)},QC=({store:e})=>fe.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},fe.createElement("p",null,Hb("workspace.noPages")),fe.createElement("button",{onClick:()=>{e.addPage()}},Hb("workspace.addPage"))),JC=({width:e,height:t,xPadding:r,yPadding:n,backgroundColor:i})=>fe.createElement("div",{style:{width:e+"px",height:t+"px",backgroundColor:i,paddingLeft:r+"px",paddingRight:r+"px",paddingTop:n+"px",paddingBottom:n+"px"}},fe.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}})),ek=[4,6],tk=Gn(({store:e,pageControlsEnabled:t,backgroundColor:r,pageBorderColor:n,activePageBorderColor:i,bleedColor:a,snapGuideStroke:o,snapGuideStrokeWidth:l,snapGuideDash:u,selectionRectFill:d,selectionRectStroke:h,selectionRectStrokeWidth:v,transformLabelFill:p,transformLabelTextFill:f,components:b,onKeyDown:_,paddingX:S,paddingY:x,altCloneEnabled:m=!0,visiblePagesOffset:w,renderOnlyActivePage:E})=>{var P;const R=S??20,k=x??55,[N,M]=fe.useState({width:100,height:100}),T=fe.useRef(N),C=fe.useRef(null),L=fe.useRef(null),H=e.bleedVisible?Math.max(0,...e.pages.map(pe=>pe.bleed)):0,G=Math.max(...e.pages.map(pe=>pe.computedWidth)),J=Math.max(...e.pages.map(pe=>pe.computedHeight)),se=((P=e.activePage)===null||P===void 0?void 0:P.computedHeight)||0,U=G+2*H,V=(E?se:J)+2*H,X=async({skipTimeout:pe}={skipTimeout:!1})=>{if(pe||await new Promise(ye=>setTimeout(ye,50)),C.current===null)return;const Ae=C.current.getBoundingClientRect();Ae.width!==0&&Ae.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
413
- Width or height of parent elements is equal 0.
414
- Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
415
- For simpler debugging here is the log of the parent element:`),console.log(C.current));const Ce=L.current.clientWidth||Ae.width,ke={width:Ce,height:Ae.height};(T.current.width!==ke.width||T.current.height!==ke.height)&&(M(ke),T.current=ke);const Se=(Ce-2*R)/U,le=e.pages.length>1?3.1:2,Ee=(Ae.height-k*le)/V,xe=e.pages.length?Math.max(Math.min(Se,Ee),.01):1;e.scaleToFit!==xe&&(e.setScale(xe),e._setScaleToFit(xe))};fe.useLayoutEffect(()=>{X({skipTimeout:!0})},[]),fe.useEffect(()=>{X()},[U,V,x,S]),fe.useEffect(()=>{e.__()},[]),fe.useEffect(()=>{const pe=C.current;if(window.ResizeObserver){const Ae=new ResizeObserver(()=>{X({skipTimeout:!0})});return Ae.observe(pe),()=>Ae.unobserve(pe)}{const Ae=setInterval(()=>{X({skipTimeout:!0})},100);return()=>clearInterval(Ae)}},[U,V]);const z=Math.max(R,(N.width-U*e.scale)/2),D=E?1:e.pages.length,F=V*e.scale*D,q=Math.max(k,(N.height-F)/D/2);fe.useEffect(()=>{const pe=Ae=>{(_||ZC)(Ae,e)};return window.addEventListener("keydown",pe),()=>window.removeEventListener("keydown",pe)},[]),fe.useEffect(()=>{var pe;const Ae=Ce=>{if(Ce.ctrlKey||Ce.metaKey){Ce.preventDefault();const Ee=Math.max(5,e.scaleToFit),xe=Math.min(.1,e.scaleToFit),ye=.03,Ne=(ke=Ce.deltaY<0?e.scale*(1+ye):e.scale/(1+ye),Se=xe,le=Ee,Math.max(Se,Math.min(le,ke)));return void e.setScale(Ne)}var ke,Se,le};return(pe=L.current)===null||pe===void 0||pe.addEventListener("wheel",Ae),()=>{var Ce;return(Ce=L.current)===null||Ce===void 0?void 0:Ce.removeEventListener("wheel",Ae)}},[]);const Q=fe.useRef(!1);((pe,Ae,Ce,ke,Se,le)=>{const Ee=fe.useRef({width:Ae,height:Ce}),xe=fe.useRef({top:0,left:0}),ye=fe.useRef(!1),Ne=fe.useRef(Se.pages.length);ye.current=Ne.current!==Se.pages.length,Ne.current=Se.pages.length,fe.useEffect(()=>{const Te=pe.current,ge=Re=>{xe.current={top:Te.scrollTop,left:Te.scrollLeft}};return Te.addEventListener("scroll",ge),()=>{Te.removeEventListener("scroll",ge)}},[]),fe.useLayoutEffect(()=>{if(!pe.current||ye.current)return;const Te=pe.current,ge=(xe.current.left+Te.offsetWidth/2)/Ee.current.width,Re=(xe.current.top+Te.offsetHeight/2)/Ee.current.height;le.current=!0,Te.scrollLeft=ge*Ae-Te.offsetWidth/2,Te.scrollTop=Re*Ce-Te.offsetHeight/2,Ee.current={width:Ae,height:Ce}},[ke,Ae,Ce])})(L,U*e.scale+2*z,V*e.scale+2*q,e.scale,e,Q);const{handleScroll:re}=((pe,Ae,Ce,ke,Se,le)=>{const Ee=fe.useRef(!1),xe=fe.useRef(null),ye=fe.useRef(!1);fe.useEffect(()=>{const Te=pe.current,ge=()=>{Se.current};return Te.addEventListener("scroll",ge),()=>{Te.removeEventListener("scroll",ge)}},[]);const Ne=Ce.pages.indexOf(Ce.activePage);return fe.useLayoutEffect(()=>{if(le||!Ce.activePage||!pe.current||Ee.current)return;const Te=pe.current,ge=Ce.pages.indexOf(Ce.activePage)*Ae;let Re=()=>{};return(Math.abs(ge-Te.scrollTop)>.5*Ae||ye.current)&&(ye.current=!0,Re=(({element:Be,scrollTop:Qe=0,duration:ct=300,onFinish:mt=()=>{}})=>{const gt=Be.scrollTop,St=Qe-gt;let pt=0,ut=!1;if(ct===0)return Be.scrollTop=Qe,()=>{};const Br=()=>{if(ut)return;pt+=20;const Nr=rr(pt,gt,St,ct);Be.scrollTop=Nr,pt<ct?setTimeout(Br,20):mt()},rr=(Nr,ur,Ge,Ze)=>(Nr/=Ze/2)<1?Ge/2*Nr*Nr+ur:-Ge/2*(--Nr*(Nr-2)-1)+ur;return Br(),()=>{ut=!0}})({element:Te,scrollTop:ge,onFinish:()=>{ye.current=!1},duration:Ce.isPlaying?0:300})),Re},[Ce.activePage,Ne,Ce.isPlaying,le]),{handleScroll:Te=>{if(le||ye.current)return;Ee.current=!0,clearTimeout(xe.current),xe.current=setTimeout(()=>{Ee.current=!1},300);const ge=Te.currentTarget.childNodes[0].offsetHeight,Re=Te.currentTarget.scrollTop,Be=Math.floor((Re+ke.height/3)/ge),Qe=Ce.pages[Be];Qe&&Ce.activePage!==Qe&&Qe.select()}}})(L,V*e.scale+2*q,e,N,Q,E),Y=N.width>=U*e.scale+2*z,ee=r||"rgba(232, 232, 232, 0.9)",ae=e.pages.indexOf(e.activePage),ue=b?.NoPages||QC,ce=w??Math.min(3,Math.max(1,Math.ceil(N.height/2/(V*e.scale))));return fe.createElement("div",{ref:C,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:ee,overflow:"hidden"},tabIndex:0,className:"polotno-workspace-container"},fe.createElement("div",{ref:L,onScroll:re,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:Y?"hidden":"auto"},className:"polotno-workspace-inner"},e.pages.map((pe,Ae)=>{const Ce=pe===e.activePage;if(E&&!Ce&&!pe._exportingOrRendering&&!pe._forceMount)return null;if(!(Math.abs(Ae-ae)<=ce||pe._exportingOrRendering||pe._forceMount))return fe.createElement(JC,{key:pe.id,width:U*e.scale+2*z,height:V*e.scale+2*q,backgroundColor:ee,xPadding:z,yPadding:q});const ke=fe.createElement(DC,{key:pe.id,page:pe,xPadding:z,yPadding:q,width:U*e.scale+2*z,height:V*e.scale+2*q,store:e,pageControlsEnabled:t,backColor:ee,pageBorderColor:n||"lightgrey",activePageBorderColor:i||"rgb(0, 161, 255)",altCloneEnabled:m,bleedColor:a||"rgba(255, 0, 0, 0.1)",selectionRectFill:d,selectionRectStroke:h,selectionRectStrokeWidth:v,snapGuideStroke:o||"rgb(0, 161, 255)",snapGuideStrokeWidth:l||1,snapGuideDash:u||ek,transformLabelFill:p,transformLabelTextFill:f,components:b,viewportSize:N});return(pe._exportingOrRendering||pe._forceMount)&&!Ce&&E?fe.createElement("div",{style:{display:"none"},key:pe.id},ke):ke}),e.rulesVisible&&fe.createElement(GC,{store:e,xPadding:z,yPadding:q,width:U*e.scale+2*z,height:V*e.scale+2*q}),e.pages.length===0&&fe.createElement(ue,{store:e}),e.audios.map(pe=>fe.createElement($C,{key:pe.id,audio:pe,store:e}))))}),rk="modulepreload",nk=function(e,t){return new URL(e,t).href},Vb={},cv=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){let d=function(h){return Promise.all(h.map(v=>Promise.resolve(v).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),u=l?.nonce||l?.getAttribute("nonce");i=d(r.map(h=>{if(h=nk(h,n),h in Vb)return;Vb[h]=!0;const v=h.endsWith(".css"),p=v?'[rel="stylesheet"]':"";if(!!n)for(let _=o.length-1;_>=0;_--){const S=o[_];if(S.href===h&&(!v||S.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${p}`))return;const b=document.createElement("link");if(b.rel=v?"stylesheet":rk,v||(b.as="script"),b.crossOrigin="",b.href=h,u&&b.setAttribute("nonce",u),document.head.appendChild(b),v)return new Promise((_,S)=>{b.addEventListener("load",_),b.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})};function Sn(e){"@babel/helpers - typeof";return Sn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sn(e)}var ko=Uint8Array,Vs=Uint16Array,am=Int32Array,u0=new ko([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]),c0=new ko([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]),fv=new ko([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),u8=function(e,t){for(var r=new Vs(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var i=new am(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}},c8=u8(u0,2),f8=c8.b,hv=c8.r;f8[28]=258,hv[258]=28;var h8=u8(c0,0),ik=h8.b,Gb=h8.r,dv=new Vs(32768);for(var Qn=0;Qn<32768;++Qn){var Bc=(Qn&43690)>>1|(Qn&21845)<<1;Bc=(Bc&52428)>>2|(Bc&13107)<<2,Bc=(Bc&61680)>>4|(Bc&3855)<<4,dv[Qn]=((Bc&65280)>>8|(Bc&255)<<8)>>1}var Tu=function(e,t,r){for(var n=e.length,i=0,a=new Vs(t);i<n;++i)e[i]&&++a[e[i]-1];var o=new Vs(t);for(i=1;i<t;++i)o[i]=o[i-1]+a[i-1]<<1;var l;if(r){l=new Vs(1<<t);var u=15-t;for(i=0;i<n;++i)if(e[i])for(var d=i<<4|e[i],h=t-e[i],v=o[e[i]-1]++<<h,p=v|(1<<h)-1;v<=p;++v)l[dv[v]>>u]=d}else for(l=new Vs(n),i=0;i<n;++i)e[i]&&(l[i]=dv[o[e[i]-1]++]>>15-e[i]);return l},Jc=new ko(288);for(var Qn=0;Qn<144;++Qn)Jc[Qn]=8;for(var Qn=144;Qn<256;++Qn)Jc[Qn]=9;for(var Qn=256;Qn<280;++Qn)Jc[Qn]=7;for(var Qn=280;Qn<288;++Qn)Jc[Qn]=8;var ap=new ko(32);for(var Qn=0;Qn<32;++Qn)ap[Qn]=5;var ak=Tu(Jc,9,0),ok=Tu(Jc,9,1),sk=Tu(ap,5,0),lk=Tu(ap,5,1),L2=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},zl=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},T2=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},om=function(e){return(e+7)/8|0},d8=function(e,t,r){return(r==null||r>e.length)&&(r=e.length),new ko(e.subarray(t,r))},uk=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Hl=function(e,t,r){var n=new Error(t||uk[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Hl),!r)throw n;return n},ck=function(e,t,r,n){var i=e.length,a=0;if(!i||t.f&&!t.l)return r||new ko(0);var o=!r,l=o||t.i!=2,u=t.i;o&&(r=new ko(i*3));var d=function(pe){var Ae=r.length;if(pe>Ae){var Ce=new ko(Math.max(Ae*2,pe));Ce.set(r),r=Ce}},h=t.f||0,v=t.p||0,p=t.b||0,f=t.l,b=t.d,_=t.m,S=t.n,x=i*8;do{if(!f){h=zl(e,v,1);var m=zl(e,v+1,3);if(v+=3,m)if(m==1)f=ok,b=lk,_=9,S=5;else if(m==2){var R=zl(e,v,31)+257,k=zl(e,v+10,15)+4,N=R+zl(e,v+5,31)+1;v+=14;for(var M=new ko(N),T=new ko(19),C=0;C<k;++C)T[fv[C]]=zl(e,v+C*3,7);v+=k*3;for(var L=L2(T),H=(1<<L)-1,G=Tu(T,L,1),C=0;C<N;){var J=G[zl(e,v,H)];v+=J&15;var w=J>>4;if(w<16)M[C++]=w;else{var se=0,U=0;for(w==16?(U=3+zl(e,v,3),v+=2,se=M[C-1]):w==17?(U=3+zl(e,v,7),v+=3):w==18&&(U=11+zl(e,v,127),v+=7);U--;)M[C++]=se}}var V=M.subarray(0,R),X=M.subarray(R);_=L2(V),S=L2(X),f=Tu(V,_,1),b=Tu(X,S,1)}else Hl(1);else{var w=om(v)+4,E=e[w-4]|e[w-3]<<8,P=w+E;if(P>i){u&&Hl(0);break}l&&d(p+E),r.set(e.subarray(w,P),p),t.b=p+=E,t.p=v=P*8,t.f=h;continue}if(v>x){u&&Hl(0);break}}l&&d(p+131072);for(var z=(1<<_)-1,D=(1<<S)-1,F=v;;F=v){var se=f[T2(e,v)&z],q=se>>4;if(v+=se&15,v>x){u&&Hl(0);break}if(se||Hl(2),q<256)r[p++]=q;else if(q==256){F=v,f=null;break}else{var Q=q-254;if(q>264){var C=q-257,re=u0[C];Q=zl(e,v,(1<<re)-1)+f8[C],v+=re}var Y=b[T2(e,v)&D],ee=Y>>4;Y||Hl(3),v+=Y&15;var X=ik[ee];if(ee>3){var re=c0[ee];X+=T2(e,v)&(1<<re)-1,v+=re}if(v>x){u&&Hl(0);break}l&&d(p+131072);var ae=p+Q;if(p<X){var ue=a-X,ce=Math.min(X,ae);for(ue+p<0&&Hl(3);p<ce;++p)r[p]=n[ue+p]}for(;p<ae;++p)r[p]=r[p-X]}}t.l=f,t.p=F,t.b=p,t.f=h,f&&(h=1,t.m=_,t.d=b,t.n=S)}while(!h);return p!=r.length&&o?d8(r,0,p):r.subarray(0,p)},ic=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},jd=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},R2=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,a=r.slice();if(!i)return{t:g8,l:0};if(i==1){var o=new ko(r[0].s+1);return o[r[0].s]=1,{t:o,l:1}}r.sort(function(P,R){return P.f-R.f}),r.push({s:-1,f:25001});var l=r[0],u=r[1],d=0,h=1,v=2;for(r[0]={s:-1,f:l.f+u.f,l,r:u};h!=i-1;)l=r[r[d].f<r[v].f?d++:v++],u=r[d!=h&&r[d].f<r[v].f?d++:v++],r[h++]={s:-1,f:l.f+u.f,l,r:u};for(var p=a[0].s,n=1;n<i;++n)a[n].s>p&&(p=a[n].s);var f=new Vs(p+1),b=pv(r[h-1],f,0);if(b>t){var n=0,_=0,S=b-t,x=1<<S;for(a.sort(function(R,k){return f[k.s]-f[R.s]||R.f-k.f});n<i;++n){var m=a[n].s;if(f[m]>t)_+=x-(1<<b-f[m]),f[m]=t;else break}for(_>>=S;_>0;){var w=a[n].s;f[w]<t?_-=1<<t-f[w]++-1:++n}for(;n>=0&&_;--n){var E=a[n].s;f[E]==t&&(--f[E],++_)}b=t}return{t:new ko(f),l:b}},pv=function(e,t,r){return e.s==-1?Math.max(pv(e.l,t,r+1),pv(e.r,t,r+1)):t[e.s]=r},$b=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Vs(++t),n=0,i=e[0],a=1,o=function(u){r[n++]=u},l=1;l<=t;++l)if(e[l]==i&&l!=t)++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=e[l]}return{c:r.subarray(0,n),n:t}},Fd=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},p8=function(e,t,r){var n=r.length,i=om(t+2);e[i]=n&255,e[i+1]=n>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<n;++a)e[i+a+4]=r[a];return(i+4+n)*8},Wb=function(e,t,r,n,i,a,o,l,u,d,h){ic(t,h++,r),++i[256];for(var v=R2(i,15),p=v.t,f=v.l,b=R2(a,15),_=b.t,S=b.l,x=$b(p),m=x.c,w=x.n,E=$b(_),P=E.c,R=E.n,k=new Vs(19),N=0;N<m.length;++N)++k[m[N]&31];for(var N=0;N<P.length;++N)++k[P[N]&31];for(var M=R2(k,7),T=M.t,C=M.l,L=19;L>4&&!T[fv[L-1]];--L);var H=d+5<<3,G=Fd(i,Jc)+Fd(a,ap)+o,J=Fd(i,p)+Fd(a,_)+o+14+3*L+Fd(k,T)+2*k[16]+3*k[17]+7*k[18];if(u>=0&&H<=G&&H<=J)return p8(t,h,e.subarray(u,u+d));var se,U,V,X;if(ic(t,h,1+(J<G)),h+=2,J<G){se=Tu(p,f,0),U=p,V=Tu(_,S,0),X=_;var z=Tu(T,C,0);ic(t,h,w-257),ic(t,h+5,R-1),ic(t,h+10,L-4),h+=14;for(var N=0;N<L;++N)ic(t,h+3*N,T[fv[N]]);h+=3*L;for(var D=[m,P],F=0;F<2;++F)for(var q=D[F],N=0;N<q.length;++N){var Q=q[N]&31;ic(t,h,z[Q]),h+=T[Q],Q>15&&(ic(t,h,q[N]>>5&127),h+=q[N]>>12)}}else se=ak,U=Jc,V=sk,X=ap;for(var N=0;N<l;++N){var re=n[N];if(re>255){var Q=re>>18&31;jd(t,h,se[Q+257]),h+=U[Q+257],Q>7&&(ic(t,h,re>>23&31),h+=u0[Q]);var Y=re&31;jd(t,h,V[Y]),h+=X[Y],Y>3&&(jd(t,h,re>>5&8191),h+=c0[Y])}else jd(t,h,se[re]),h+=U[re]}return jd(t,h,se[256]),h+U[256]},fk=new am([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),g8=new ko(0),hk=function(e,t,r,n,i,a){var o=a.z||e.length,l=new ko(n+o+5*(1+Math.ceil(o/7e3))+i),u=l.subarray(n,l.length-i),d=a.l,h=(a.r||0)&7;if(t){h&&(u[0]=a.r>>3);for(var v=fk[t-1],p=v>>13,f=v&8191,b=(1<<r)-1,_=a.p||new Vs(32768),S=a.h||new Vs(b+1),x=Math.ceil(r/3),m=2*x,w=function(ke){return(e[ke]^e[ke+1]<<x^e[ke+2]<<m)&b},E=new am(25e3),P=new Vs(288),R=new Vs(32),k=0,N=0,M=a.i||0,T=0,C=a.w||0,L=0;M+2<o;++M){var H=w(M),G=M&32767,J=S[H];if(_[G]=J,S[H]=G,C<=M){var se=o-M;if((k>7e3||T>24576)&&(se>423||!d)){h=Wb(e,u,0,E,P,R,N,T,L,M-L,h),T=k=N=0,L=M;for(var U=0;U<286;++U)P[U]=0;for(var U=0;U<30;++U)R[U]=0}var V=2,X=0,z=f,D=G-J&32767;if(se>2&&H==w(M-D))for(var F=Math.min(p,se)-1,q=Math.min(32767,M),Q=Math.min(258,se);D<=q&&--z&&G!=J;){if(e[M+V]==e[M+V-D]){for(var re=0;re<Q&&e[M+re]==e[M+re-D];++re);if(re>V){if(V=re,X=D,re>F)break;for(var Y=Math.min(D,re-2),ee=0,U=0;U<Y;++U){var ae=M-D+U&32767,ue=_[ae],ce=ae-ue&32767;ce>ee&&(ee=ce,J=ae)}}}G=J,J=_[G],D+=G-J&32767}if(X){E[T++]=268435456|hv[V]<<18|Gb[X];var pe=hv[V]&31,Ae=Gb[X]&31;N+=u0[pe]+c0[Ae],++P[257+pe],++R[Ae],C=M+V,++k}else E[T++]=e[M],++P[e[M]]}}for(M=Math.max(M,C);M<o;++M)E[T++]=e[M],++P[e[M]];h=Wb(e,u,d,E,P,R,N,T,L,M-L,h),d||(a.r=h&7|u[h/8|0]<<3,h-=7,a.h=S,a.p=_,a.i=M,a.w=C)}else{for(var M=a.w||0;M<o+d;M+=65535){var Ce=M+65535;Ce>=o&&(u[h/8|0]=d,Ce=o),h=p8(u,h+1,e.subarray(M,Ce))}a.i=o}return d8(l,0,n+om(h)+i)},v8=function(){var e=1,t=0;return{p:function(r){for(var n=e,i=t,a=r.length|0,o=0;o!=a;){for(var l=Math.min(o+2655,a);o<l;++o)i+=n+=r[o];n=(n&65535)+15*(n>>16),i=(i&65535)+15*(i>>16)}e=n,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},dk=function(e,t,r,n,i){if(!i&&(i={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),o=new ko(a.length+e.length);o.set(a),o.set(e,a.length),e=o,i.w=a.length}return hk(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,i)},m8=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},pk=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;if(e[0]=120,e[1]=n<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=v8();i.p(t.dictionary),m8(e,2,i.d())}},gk=function(e,t){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&Hl(6,"invalid zlib data"),(e[1]>>5&1)==1&&Hl(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function gv(e,t){t||(t={});var r=v8();r.p(e);var n=dk(e,t,t.dictionary?6:2,4);return pk(n,t),m8(n,n.length-4,r.d()),n}function vk(e,t){return ck(e.subarray(gk(e),-4),{i:2},t,t)}var mk=typeof TextDecoder<"u"&&new TextDecoder,yk=0;try{mk.decode(g8,{stream:!0}),yk=1}catch{}var er=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function M2(){er.console&&typeof er.console.log=="function"&&er.console.log.apply(er.console,arguments)}var qn={log:M2,warn:function(e){er.console&&(typeof er.console.warn=="function"?er.console.warn.apply(er.console,arguments):M2.call(null,arguments))},error:function(e){er.console&&(typeof er.console.error=="function"?er.console.error.apply(er.console,arguments):M2(e))}};function I2(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){Af(n.response,t,r)},n.onerror=function(){qn.error("could not download file")},n.send()}function Yb(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function e1(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var Yd,vv,Af=er.saveAs||((typeof window>"u"?"undefined":Sn(window))!=="object"||window!==er?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,r){var n=er.URL||er.webkitURL,i=document.createElement("a");t=t||e.name||"download",i.download=t,i.rel="noopener",typeof e=="string"?(i.href=e,i.origin!==location.origin?Yb(i.href)?I2(e,t,r):e1(i,i.target="_blank"):e1(i)):(i.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(i.href)},4e4),setTimeout(function(){e1(i)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download",typeof e=="string")if(Yb(e))I2(e,t,r);else{var n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){e1(n)})}else navigator.msSaveOrOpenBlob(function(i,a){return a===void 0?a={autoBom:!1}:Sn(a)!=="object"&&(qn.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}(e,r),t)}:function(e,t,r,n){if((n=n||open("","_blank"))&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return I2(e,t,r);var i=e.type==="application/octet-stream",a=/constructor/i.test(er.HTMLElement)||er.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a)&&(typeof FileReader>"u"?"undefined":Sn(FileReader))==="object"){var l=new FileReader;l.onloadend=function(){var h=l.result;h=o?h:h.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=h:location=h,n=null},l.readAsDataURL(e)}else{var u=er.URL||er.webkitURL,d=u.createObjectURL(e);n?n.location=d:location.href=d,n=null,setTimeout(function(){u.revokeObjectURL(d)},4e4)}});/**
416
- * A class to parse color values
417
- * @author Stoyan Stefanov <sstoo@gmail.com>
418
- * {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
419
- * @license Use it if you like it
420
- */function y8(e){var t;e=e||"",this.ok=!1,e.charAt(0)=="#"&&(e=e.substr(1,6)),e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var 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(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(l){return[parseInt(l[1],16),parseInt(l[2],16),parseInt(l[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(l){return[parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16),parseInt(l[3]+l[3],16)]}}],n=0;n<r.length;n++){var i=r[n].re,a=r[n].process,o=i.exec(e);o&&(t=a(o),this.r=t[0],this.g=t[1],this.b=t[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 l=this.r.toString(16),u=this.g.toString(16),d=this.b.toString(16);return l.length==1&&(l="0"+l),u.length==1&&(u="0"+u),d.length==1&&(d="0"+d),"#"+l+u+d}}/**
421
- * @license
422
- * Joseph Myers does not specify a particular license for his work.
423
- *
424
- * Author: Joseph Myers
425
- * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
426
- *
427
- * Modified by: Owen Leong
428
- */function j2(e,t){var r=e[0],n=e[1],i=e[2],a=e[3];r=Po(r,n,i,a,t[0],7,-680876936),a=Po(a,r,n,i,t[1],12,-389564586),i=Po(i,a,r,n,t[2],17,606105819),n=Po(n,i,a,r,t[3],22,-1044525330),r=Po(r,n,i,a,t[4],7,-176418897),a=Po(a,r,n,i,t[5],12,1200080426),i=Po(i,a,r,n,t[6],17,-1473231341),n=Po(n,i,a,r,t[7],22,-45705983),r=Po(r,n,i,a,t[8],7,1770035416),a=Po(a,r,n,i,t[9],12,-1958414417),i=Po(i,a,r,n,t[10],17,-42063),n=Po(n,i,a,r,t[11],22,-1990404162),r=Po(r,n,i,a,t[12],7,1804603682),a=Po(a,r,n,i,t[13],12,-40341101),i=Po(i,a,r,n,t[14],17,-1502002290),r=Ao(r,n=Po(n,i,a,r,t[15],22,1236535329),i,a,t[1],5,-165796510),a=Ao(a,r,n,i,t[6],9,-1069501632),i=Ao(i,a,r,n,t[11],14,643717713),n=Ao(n,i,a,r,t[0],20,-373897302),r=Ao(r,n,i,a,t[5],5,-701558691),a=Ao(a,r,n,i,t[10],9,38016083),i=Ao(i,a,r,n,t[15],14,-660478335),n=Ao(n,i,a,r,t[4],20,-405537848),r=Ao(r,n,i,a,t[9],5,568446438),a=Ao(a,r,n,i,t[14],9,-1019803690),i=Ao(i,a,r,n,t[3],14,-187363961),n=Ao(n,i,a,r,t[8],20,1163531501),r=Ao(r,n,i,a,t[13],5,-1444681467),a=Ao(a,r,n,i,t[2],9,-51403784),i=Ao(i,a,r,n,t[7],14,1735328473),r=Oo(r,n=Ao(n,i,a,r,t[12],20,-1926607734),i,a,t[5],4,-378558),a=Oo(a,r,n,i,t[8],11,-2022574463),i=Oo(i,a,r,n,t[11],16,1839030562),n=Oo(n,i,a,r,t[14],23,-35309556),r=Oo(r,n,i,a,t[1],4,-1530992060),a=Oo(a,r,n,i,t[4],11,1272893353),i=Oo(i,a,r,n,t[7],16,-155497632),n=Oo(n,i,a,r,t[10],23,-1094730640),r=Oo(r,n,i,a,t[13],4,681279174),a=Oo(a,r,n,i,t[0],11,-358537222),i=Oo(i,a,r,n,t[3],16,-722521979),n=Oo(n,i,a,r,t[6],23,76029189),r=Oo(r,n,i,a,t[9],4,-640364487),a=Oo(a,r,n,i,t[12],11,-421815835),i=Oo(i,a,r,n,t[15],16,530742520),r=Co(r,n=Oo(n,i,a,r,t[2],23,-995338651),i,a,t[0],6,-198630844),a=Co(a,r,n,i,t[7],10,1126891415),i=Co(i,a,r,n,t[14],15,-1416354905),n=Co(n,i,a,r,t[5],21,-57434055),r=Co(r,n,i,a,t[12],6,1700485571),a=Co(a,r,n,i,t[3],10,-1894986606),i=Co(i,a,r,n,t[10],15,-1051523),n=Co(n,i,a,r,t[1],21,-2054922799),r=Co(r,n,i,a,t[8],6,1873313359),a=Co(a,r,n,i,t[15],10,-30611744),i=Co(i,a,r,n,t[6],15,-1560198380),n=Co(n,i,a,r,t[13],21,1309151649),r=Co(r,n,i,a,t[4],6,-145523070),a=Co(a,r,n,i,t[11],10,-1120210379),i=Co(i,a,r,n,t[2],15,718787259),n=Co(n,i,a,r,t[9],21,-343485551),e[0]=$c(r,e[0]),e[1]=$c(n,e[1]),e[2]=$c(i,e[2]),e[3]=$c(a,e[3])}function f0(e,t,r,n,i,a){return t=$c($c(t,e),$c(n,a)),$c(t<<i|t>>>32-i,r)}function Po(e,t,r,n,i,a,o){return f0(t&r|~t&n,e,t,i,a,o)}function Ao(e,t,r,n,i,a,o){return f0(t&n|r&~n,e,t,i,a,o)}function Oo(e,t,r,n,i,a,o){return f0(t^r^n,e,t,i,a,o)}function Co(e,t,r,n,i,a,o){return f0(r^(t|~n),e,t,i,a,o)}function b8(e){var t,r=e.length,n=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)j2(n,bk(e.substring(t-64,t)));e=e.substring(t-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)i[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(j2(n,i),t=0;t<16;t++)i[t]=0;return i[14]=8*r,j2(n,i),n}function bk(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}Yd=er.atob.bind(er),vv=er.btoa.bind(er);var Xb="0123456789abcdef".split("");function wk(e){for(var t="",r=0;r<4;r++)t+=Xb[e>>8*r+4&15]+Xb[e>>8*r&15];return t}function _k(e){return String.fromCharCode((255&e)>>0,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function mv(e){return b8(e).map(_k).join("")}var xk=function(e){for(var t=0;t<e.length;t++)e[t]=wk(e[t]);return e.join("")}(b8("hello"))!="5d41402abc4b2a76b9719d911017c592";function $c(e,t){if(xk){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}return e+t&4294967295}/**
429
- * @license
430
- * FPDF is released under a permissive license: there is no usage restriction.
431
- * You may embed it freely in your application (commercial or not), with or
432
- * without modifications.
433
- *
434
- * Reference: http://www.fpdf.org/en/script/script37.php
435
- */function yv(e,t){var r,n,i,a;if(e!==r){for(var o=(i=e,a=1+(256/e.length>>0),new Array(a+1).join(i)),l=[],u=0;u<256;u++)l[u]=u;var d=0;for(u=0;u<256;u++){var h=l[u];d=(d+h+o.charCodeAt(u))%256,l[u]=l[d],l[d]=h}r=e,n=l}else l=n;var v=t.length,p=0,f=0,b="";for(u=0;u<v;u++)f=(f+(h=l[p=(p+1)%256]))%256,l[p]=l[f],l[f]=h,o=l[(l[p]+l[f])%256],b+=String.fromCharCode(t.charCodeAt(u)^o);return b}/**
436
- * @license
437
- * Licensed under the MIT License.
438
- * http://opensource.org/licenses/mit-license
439
- * Author: Owen Leong (@owenl131)
440
- * Date: 15 Oct 2020
441
- * References:
442
- * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
443
- * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
444
- * http://www.fpdf.org/en/script/script37.php
445
- */var Kb={print:4,modify:8,copy:16,"annot-forms":32};function fh(e,t,r,n){this.v=1,this.r=2;var i=192;e.forEach(function(l){if(Kb.perm!==void 0)throw new Error("Invalid permission: "+l);i+=Kb[l]}),this.padding="(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";var a=(t+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=mv(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=yv(this.encryptionKey,this.padding)}function hh(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",r=e.length,n=0;n<r;n++){var i=e.charCodeAt(n);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?t+="#"+("0"+i.toString(16)).slice(-2):t+=e[n]}return t}function Zb(e){if(Sn(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};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)");t.hasOwnProperty(r)||(t[r]={});var a=Math.random().toString(35);return t[r][a]=[n,!!i],a},this.unsubscribe=function(r){for(var n in t)if(t[n][r])return delete t[n][r],Object.keys(t[n]).length===0&&delete t[n],!0;return!1},this.publish=function(r){if(t.hasOwnProperty(r)){var n=Array.prototype.slice.call(arguments,1),i=[];for(var a in t[r]){var o=t[r][a];try{o[0].apply(e,n)}catch(l){er.console&&qn.error("jsPDF PubSub Error",l.message,l)}o[1]&&i.push(a)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function I1(e){if(!(this instanceof I1))return new I1(e);var t="opacity,stroke-opacity".split(",");for(var r in e)e.hasOwnProperty(r)&&t.indexOf(r)>=0&&(this[r]=e[r]);this.id="",this.objectNumber=-1}function w8(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function Of(e,t,r,n,i){if(!(this instanceof Of))return new Of(e,t,r,n,i);this.type=e==="axial"?2:3,this.coords=t,this.colors=r,w8.call(this,n,i)}function mh(e,t,r,n,i){if(!(this instanceof mh))return new mh(e,t,r,n,i);this.boundingBox=e,this.xStep=t,this.yStep=r,this.stream="",this.cloneIndex=0,w8.call(this,n,i)}function Zt(e){var t,r=typeof arguments[0]=="string"?arguments[0]:"p",n=arguments[1],i=arguments[2],a=arguments[3],o=[],l=1,u=16,d="S",h=null;Sn(e=e||{})==="object"&&(r=e.orientation,n=e.unit||n,i=e.format||i,a=e.compress||e.compressPdf||a,(h=e.encryption||null)!==null&&(h.userPassword=h.userPassword||"",h.ownerPassword=h.ownerPassword||"",h.userPermissions=h.userPermissions||[]),l=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(t=e.precision),e.floatPrecision!==void 0&&(u=e.floatPrecision),d=e.defaultPathOperation||"S"),o=e.filters||(a===!0?["FlateEncode"]:o),n=n||"mm",r=(""+(r||"P")).toLowerCase();var v=e.putOnlyUsedFonts||!1,p={},f={internal:{},__private__:{}};f.__private__.PubSub=Zb;var b="1.3",_=f.__private__.getPdfVersion=function(){return b};f.__private__.setPdfVersion=function($){b=$};var S={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};f.__private__.getPageFormats=function(){return S};var x=f.__private__.getPageFormat=function($){return S[$]};i=i||"a4";var m={COMPAT:"compat",ADVANCED:"advanced"},w=m.COMPAT;function E(){this.saveGraphicsState(),le(new qt(ut,0,0,-ut,0,ts()*ut).toString()+" cm"),this.setFontSize(this.getFontSize()/ut),d="n",w=m.ADVANCED}function P(){this.restoreGraphicsState(),d="S",w=m.COMPAT}var R=f.__private__.combineFontStyleAndFontWeight=function($,de){if($=="bold"&&de=="normal"||$=="bold"&&de==400||$=="normal"&&de=="italic"||$=="bold"&&de=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return de&&($=de==400||de==="normal"?$==="italic"?"italic":"normal":de!=700&&de!=="bold"||$!=="normal"?(de==700?"bold":de)+""+$:"bold"),$};f.advancedAPI=function($){var de=w===m.COMPAT;return de&&E.call(this),typeof $!="function"||($(this),de&&P.call(this)),this},f.compatAPI=function($){var de=w===m.ADVANCED;return de&&P.call(this),typeof $!="function"||($(this),de&&E.call(this)),this},f.isAdvancedAPI=function(){return w===m.ADVANCED};var k,N=function($){if(w!==m.ADVANCED)throw new Error($+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},M=f.roundToPrecision=f.__private__.roundToPrecision=function($,de){var Le=t||de;if(isNaN($)||isNaN(Le))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return $.toFixed(Le).replace(/0+$/,"")};k=f.hpf=f.__private__.hpf=typeof u=="number"?function($){if(isNaN($))throw new Error("Invalid argument passed to jsPDF.hpf");return M($,u)}:u==="smart"?function($){if(isNaN($))throw new Error("Invalid argument passed to jsPDF.hpf");return M($,$>-1&&$<1?16:5)}:function($){if(isNaN($))throw new Error("Invalid argument passed to jsPDF.hpf");return M($,16)};var T=f.f2=f.__private__.f2=function($){if(isNaN($))throw new Error("Invalid argument passed to jsPDF.f2");return M($,2)},C=f.__private__.f3=function($){if(isNaN($))throw new Error("Invalid argument passed to jsPDF.f3");return M($,3)},L=f.scale=f.__private__.scale=function($){if(isNaN($))throw new Error("Invalid argument passed to jsPDF.scale");return w===m.COMPAT?$*ut:w===m.ADVANCED?$:void 0},H=function($){return w===m.COMPAT?ts()-$:w===m.ADVANCED?$:void 0},G=function($){return L(H($))};f.__private__.setPrecision=f.setPrecision=function($){typeof parseInt($,10)=="number"&&(t=parseInt($,10))};var J,se="00000000000000000000000000000000",U=f.__private__.getFileId=function(){return se},V=f.__private__.setFileId=function($){return se=$!==void 0&&/^[a-fA-F0-9]{32}$/.test($)?$.toUpperCase():se.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),h!==null&&(ln=new fh(h.userPermissions,h.userPassword,h.ownerPassword,se)),se};f.setFileId=function($){return V($),this},f.getFileId=function(){return U()};var X=f.__private__.convertDateToPDFDate=function($){var de=$.getTimezoneOffset(),Le=de<0?"+":"-",je=Math.floor(Math.abs(de/60)),Xe=Math.abs(de%60),at=[Le,Q(je),"'",Q(Xe),"'"].join("");return["D:",$.getFullYear(),Q($.getMonth()+1),Q($.getDate()),Q($.getHours()),Q($.getMinutes()),Q($.getSeconds()),at].join("")},z=f.__private__.convertPDFDateToDate=function($){var de=parseInt($.substr(2,4),10),Le=parseInt($.substr(6,2),10)-1,je=parseInt($.substr(8,2),10),Xe=parseInt($.substr(10,2),10),at=parseInt($.substr(12,2),10),ft=parseInt($.substr(14,2),10);return new Date(de,Le,je,Xe,at,ft,0)},D=f.__private__.setCreationDate=function($){var de;if($===void 0&&($=new Date),$ instanceof Date)de=X($);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test($))throw new Error("Invalid argument passed to jsPDF.setCreationDate");de=$}return J=de},F=f.__private__.getCreationDate=function($){var de=J;return $==="jsDate"&&(de=z(J)),de};f.setCreationDate=function($){return D($),this},f.getCreationDate=function($){return F($)};var q,Q=f.__private__.padd2=function($){return("0"+parseInt($)).slice(-2)},re=f.__private__.padd2Hex=function($){return("00"+($=$.toString())).substr($.length)},Y=0,ee=[],ae=[],ue=0,ce=[],pe=[],Ae=!1,Ce=ae,ke=function(){Y=0,ue=0,ae=[],ee=[],ce=[],lo=sn(),fa=sn()};f.__private__.setCustomOutputDestination=function($){Ae=!0,Ce=$};var Se=function($){Ae||(Ce=$)};f.__private__.resetCustomOutputDestination=function(){Ae=!1,Ce=ae};var le=f.__private__.out=function($){return $=$.toString(),ue+=$.length+1,Ce.push($),Ce},Ee=f.__private__.write=function($){return le(arguments.length===1?$.toString():Array.prototype.join.call(arguments," "))},xe=f.__private__.getArrayBuffer=function($){for(var de=$.length,Le=new ArrayBuffer(de),je=new Uint8Array(Le);de--;)je[de]=$.charCodeAt(de);return Le},ye=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];f.__private__.getStandardFonts=function(){return ye};var Ne=e.fontSize||16;f.__private__.setFontSize=f.setFontSize=function($){return Ne=w===m.ADVANCED?$/ut:$,this};var Te,ge=f.__private__.getFontSize=f.getFontSize=function(){return w===m.COMPAT?Ne:Ne*ut},Re=e.R2L||!1;f.__private__.setR2L=f.setR2L=function($){return Re=$,this},f.__private__.getR2L=f.getR2L=function(){return Re};var Be,Qe=f.__private__.setZoomMode=function($){var de=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test($))Te=$;else if(isNaN($)){if(de.indexOf($)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+$+'" is not recognized.');Te=$}else Te=parseInt($,10)};f.__private__.getZoomMode=function(){return Te};var ct,mt=f.__private__.setPageMode=function($){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf($)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+$+'" is not recognized.');Be=$};f.__private__.getPageMode=function(){return Be};var gt=f.__private__.setLayoutMode=function($){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf($)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+$+'" is not recognized.');ct=$};f.__private__.getLayoutMode=function(){return ct},f.__private__.setDisplayMode=f.setDisplayMode=function($,de,Le){return Qe($),gt(de),mt(Le),this};var St={title:"",subject:"",author:"",keywords:"",creator:""};f.__private__.getDocumentProperty=function($){if(Object.keys(St).indexOf($)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return St[$]},f.__private__.getDocumentProperties=function(){return St},f.__private__.setDocumentProperties=f.setProperties=f.setDocumentProperties=function($){for(var de in St)St.hasOwnProperty(de)&&$[de]&&(St[de]=$[de]);return this},f.__private__.setDocumentProperty=function($,de){if(Object.keys(St).indexOf($)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return St[$]=de};var pt,ut,Br,rr,Nr,ur={},Ge={},Ze=[],Lt={},gr={},Wt={},Ut={},kn=null,Rr=0,It=[],lr=new Zb(f),so=e.hotfixes||[],on={},pn={},ca=[],qt=function $(de,Le,je,Xe,at,ft){if(!(this instanceof $))return new $(de,Le,je,Xe,at,ft);isNaN(de)&&(de=1),isNaN(Le)&&(Le=0),isNaN(je)&&(je=0),isNaN(Xe)&&(Xe=1),isNaN(at)&&(at=0),isNaN(ft)&&(ft=0),this._matrix=[de,Le,je,Xe,at,ft]};Object.defineProperty(qt.prototype,"sx",{get:function(){return this._matrix[0]},set:function($){this._matrix[0]=$}}),Object.defineProperty(qt.prototype,"shy",{get:function(){return this._matrix[1]},set:function($){this._matrix[1]=$}}),Object.defineProperty(qt.prototype,"shx",{get:function(){return this._matrix[2]},set:function($){this._matrix[2]=$}}),Object.defineProperty(qt.prototype,"sy",{get:function(){return this._matrix[3]},set:function($){this._matrix[3]=$}}),Object.defineProperty(qt.prototype,"tx",{get:function(){return this._matrix[4]},set:function($){this._matrix[4]=$}}),Object.defineProperty(qt.prototype,"ty",{get:function(){return this._matrix[5]},set:function($){this._matrix[5]=$}}),Object.defineProperty(qt.prototype,"a",{get:function(){return this._matrix[0]},set:function($){this._matrix[0]=$}}),Object.defineProperty(qt.prototype,"b",{get:function(){return this._matrix[1]},set:function($){this._matrix[1]=$}}),Object.defineProperty(qt.prototype,"c",{get:function(){return this._matrix[2]},set:function($){this._matrix[2]=$}}),Object.defineProperty(qt.prototype,"d",{get:function(){return this._matrix[3]},set:function($){this._matrix[3]=$}}),Object.defineProperty(qt.prototype,"e",{get:function(){return this._matrix[4]},set:function($){this._matrix[4]=$}}),Object.defineProperty(qt.prototype,"f",{get:function(){return this._matrix[5]},set:function($){this._matrix[5]=$}}),Object.defineProperty(qt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(qt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(qt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(qt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),qt.prototype.join=function($){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(k).join($)},qt.prototype.multiply=function($){var de=$.sx*this.sx+$.shy*this.shx,Le=$.sx*this.shy+$.shy*this.sy,je=$.shx*this.sx+$.sy*this.shx,Xe=$.shx*this.shy+$.sy*this.sy,at=$.tx*this.sx+$.ty*this.shx+this.tx,ft=$.tx*this.shy+$.ty*this.sy+this.ty;return new qt(de,Le,je,Xe,at,ft)},qt.prototype.decompose=function(){var $=this.sx,de=this.shy,Le=this.shx,je=this.sy,Xe=this.tx,at=this.ty,ft=Math.sqrt($*$+de*de),Et=($/=ft)*Le+(de/=ft)*je;Le-=$*Et,je-=de*Et;var Dt=Math.sqrt(Le*Le+je*je);return Et/=Dt,$*(je/=Dt)<de*(Le/=Dt)&&($=-$,de=-de,Et=-Et,ft=-ft),{scale:new qt(ft,0,0,Dt,0,0),translate:new qt(1,0,0,1,Xe,at),rotate:new qt($,de,-de,$,0,0),skew:new qt(1,0,Et,1,0,0)}},qt.prototype.toString=function($){return this.join(" ")},qt.prototype.inversed=function(){var $=this.sx,de=this.shy,Le=this.shx,je=this.sy,Xe=this.tx,at=this.ty,ft=1/($*je-de*Le),Et=je*ft,Dt=-de*ft,tr=-Le*ft,Jt=$*ft;return new qt(Et,Dt,tr,Jt,-Et*Xe-tr*at,-Dt*Xe-Jt*at)},qt.prototype.applyToPoint=function($){var de=$.x*this.sx+$.y*this.shx+this.tx,Le=$.x*this.shy+$.y*this.sy+this.ty;return new Un(de,Le)},qt.prototype.applyToRectangle=function($){var de=this.applyToPoint($),Le=this.applyToPoint(new Un($.x+$.w,$.y+$.h));return new di(de.x,de.y,Le.x-de.x,Le.y-de.y)},qt.prototype.clone=function(){var $=this.sx,de=this.shy,Le=this.shx,je=this.sy,Xe=this.tx,at=this.ty;return new qt($,de,Le,je,Xe,at)},f.Matrix=qt;var Ji=f.matrixMult=function($,de){return de.multiply($)},Jn=new qt(1,0,0,1,0,0);f.unitMatrix=f.identityMatrix=Jn;var ci=function($,de){if(!gr[$]){var Le=(de instanceof Of?"Sh":"P")+(Object.keys(Lt).length+1).toString(10);de.id=Le,gr[$]=Le,Lt[Le]=de,lr.publish("addPattern",de)}};f.ShadingPattern=Of,f.TilingPattern=mh,f.addShadingPattern=function($,de){return N("addShadingPattern()"),ci($,de),this},f.beginTilingPattern=function($){N("beginTilingPattern()"),tl($.boundingBox[0],$.boundingBox[1],$.boundingBox[2]-$.boundingBox[0],$.boundingBox[3]-$.boundingBox[1],$.matrix)},f.endTilingPattern=function($,de){N("endTilingPattern()"),de.stream=pe[q].join(`
446
- `),ci($,de),lr.publish("endTilingPattern",de),ca.pop().restore()};var zr=f.__private__.newObject=function(){var $=sn();return ei($,!0),$},sn=f.__private__.newObjectDeferred=function(){return Y++,ee[Y]=function(){return ue},Y},ei=function($,de){return de=typeof de=="boolean"&&de,ee[$]=ue,de&&le($+" 0 obj"),$},xa=f.__private__.newAdditionalObject=function(){var $={objId:sn(),content:""};return ce.push($),$},lo=sn(),fa=sn(),Sa=f.__private__.decodeColorString=function($){var de=$.split(" ");if(de.length!==2||de[1]!=="g"&&de[1]!=="G")de.length===5&&(de[4]==="k"||de[4]==="K")&&(de=[(1-de[0])*(1-de[3]),(1-de[1])*(1-de[3]),(1-de[2])*(1-de[3]),"r"]);else{var Le=parseFloat(de[0]);de=[Le,Le,Le,"r"]}for(var je="#",Xe=0;Xe<3;Xe++)je+=("0"+Math.floor(255*parseFloat(de[Xe])).toString(16)).slice(-2);return je},Yn=f.__private__.encodeColorString=function($){var de;typeof $=="string"&&($={ch1:$});var Le=$.ch1,je=$.ch2,Xe=$.ch3,at=$.ch4,ft=$.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof Le=="string"&&Le.charAt(0)!=="#"){var Et=new y8(Le);if(Et.ok)Le=Et.toHex();else if(!/^\d*\.?\d*$/.test(Le))throw new Error('Invalid color "'+Le+'" passed to jsPDF.encodeColorString.')}if(typeof Le=="string"&&/^#[0-9A-Fa-f]{3}$/.test(Le)&&(Le="#"+Le[1]+Le[1]+Le[2]+Le[2]+Le[3]+Le[3]),typeof Le=="string"&&/^#[0-9A-Fa-f]{6}$/.test(Le)){var Dt=parseInt(Le.substr(1),16);Le=Dt>>16&255,je=Dt>>8&255,Xe=255&Dt}if(je===void 0||at===void 0&&Le===je&&je===Xe)if(typeof Le=="string")de=Le+" "+ft[0];else switch($.precision){case 2:de=T(Le/255)+" "+ft[0];break;case 3:default:de=C(Le/255)+" "+ft[0]}else if(at===void 0||Sn(at)==="object"){if(at&&!isNaN(at.a)&&at.a===0)return de=["1.","1.","1.",ft[1]].join(" ");if(typeof Le=="string")de=[Le,je,Xe,ft[1]].join(" ");else switch($.precision){case 2:de=[T(Le/255),T(je/255),T(Xe/255),ft[1]].join(" ");break;default:case 3:de=[C(Le/255),C(je/255),C(Xe/255),ft[1]].join(" ")}}else if(typeof Le=="string")de=[Le,je,Xe,at,ft[2]].join(" ");else switch($.precision){case 2:de=[T(Le),T(je),T(Xe),T(at),ft[2]].join(" ");break;case 3:default:de=[C(Le),C(je),C(Xe),C(at),ft[2]].join(" ")}return de},Ea=f.__private__.getFilters=function(){return o},ha=f.__private__.putStream=function($){var de=($=$||{}).data||"",Le=$.filters||Ea(),je=$.alreadyAppliedFilters||[],Xe=$.addLength1||!1,at=de.length,ft=$.objectId,Et=function(Xn){return Xn};if(h!==null&&ft===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");h!==null&&(Et=ln.encryptor(ft,0));var Dt={};Le===!0&&(Le=["FlateEncode"]);var tr=$.additionalKeyValues||[],Jt=(Dt=Zt.API.processDataByFilters!==void 0?Zt.API.processDataByFilters(de,Le):{data:de,reverseChain:[]}).reverseChain+(Array.isArray(je)?je.join(" "):je.toString());if(Dt.data.length!==0&&(tr.push({key:"Length",value:Dt.data.length}),Xe===!0&&tr.push({key:"Length1",value:at})),Jt.length!=0)if(Jt.split("/").length-1==1)tr.push({key:"Filter",value:Jt});else{tr.push({key:"Filter",value:"["+Jt+"]"});for(var cr=0;cr<tr.length;cr+=1)if(tr[cr].key==="DecodeParms"){for(var En=[],mn=0;mn<Dt.reverseChain.split("/").length-1;mn+=1)En.push("null");En.push(tr[cr].value),tr[cr].value="["+En.join(" ")+"]"}}le("<<");for(var Tn=0;Tn<tr.length;Tn++)le("/"+tr[Tn].key+" "+tr[Tn].value);le(">>"),Dt.data.length!==0&&(le("stream"),le(Et(Dt.data)),le("endstream"))},Pa=f.__private__.putPage=function($){var de=$.number,Le=$.data,je=$.objId,Xe=$.contentsObjId;ei(je,!0),le("<</Type /Page"),le("/Parent "+$.rootDictionaryObjId+" 0 R"),le("/Resources "+$.resourceDictionaryObjId+" 0 R"),le("/MediaBox ["+parseFloat(k($.mediaBox.bottomLeftX))+" "+parseFloat(k($.mediaBox.bottomLeftY))+" "+k($.mediaBox.topRightX)+" "+k($.mediaBox.topRightY)+"]"),$.cropBox!==null&&le("/CropBox ["+k($.cropBox.bottomLeftX)+" "+k($.cropBox.bottomLeftY)+" "+k($.cropBox.topRightX)+" "+k($.cropBox.topRightY)+"]"),$.bleedBox!==null&&le("/BleedBox ["+k($.bleedBox.bottomLeftX)+" "+k($.bleedBox.bottomLeftY)+" "+k($.bleedBox.topRightX)+" "+k($.bleedBox.topRightY)+"]"),$.trimBox!==null&&le("/TrimBox ["+k($.trimBox.bottomLeftX)+" "+k($.trimBox.bottomLeftY)+" "+k($.trimBox.topRightX)+" "+k($.trimBox.topRightY)+"]"),$.artBox!==null&&le("/ArtBox ["+k($.artBox.bottomLeftX)+" "+k($.artBox.bottomLeftY)+" "+k($.artBox.topRightX)+" "+k($.artBox.topRightY)+"]"),typeof $.userUnit=="number"&&$.userUnit!==1&&le("/UserUnit "+$.userUnit),lr.publish("putPage",{objId:je,pageContext:It[de],pageNumber:de,page:Le}),le("/Contents "+Xe+" 0 R"),le(">>"),le("endobj");var at=Le.join(`
447
- `);return w===m.ADVANCED&&(at+=`
448
- Q`),ei(Xe,!0),ha({data:at,filters:Ea(),objectId:Xe}),le("endobj"),je},da=f.__private__.putPages=function(){var $,de,Le=[];for($=1;$<=Rr;$++)It[$].objId=sn(),It[$].contentsObjId=sn();for($=1;$<=Rr;$++)Le.push(Pa({number:$,data:pe[$],objId:It[$].objId,contentsObjId:It[$].contentsObjId,mediaBox:It[$].mediaBox,cropBox:It[$].cropBox,bleedBox:It[$].bleedBox,trimBox:It[$].trimBox,artBox:It[$].artBox,userUnit:It[$].userUnit,rootDictionaryObjId:lo,resourceDictionaryObjId:fa}));ei(lo,!0),le("<</Type /Pages");var je="/Kids [";for(de=0;de<Rr;de++)je+=Le[de]+" 0 R ";le(je+"]"),le("/Count "+Rr),le(">>"),le("endobj"),lr.publish("postPutPages")},uo=function($){lr.publish("putFont",{font:$,out:le,newObject:zr,putStream:ha}),$.isAlreadyPutted!==!0&&($.objectNumber=zr(),le("<<"),le("/Type /Font"),le("/BaseFont /"+hh($.postScriptName)),le("/Subtype /Type1"),typeof $.encoding=="string"&&le("/Encoding /"+$.encoding),le("/FirstChar 32"),le("/LastChar 255"),le(">>"),le("endobj"))},As=function(){for(var $ in ur)ur.hasOwnProperty($)&&(v===!1||v===!0&&p.hasOwnProperty($))&&uo(ur[$])},Ko=function($){$.objectNumber=zr();var de=[];de.push({key:"Type",value:"/XObject"}),de.push({key:"Subtype",value:"/Form"}),de.push({key:"BBox",value:"["+[k($.x),k($.y),k($.x+$.width),k($.y+$.height)].join(" ")+"]"}),de.push({key:"Matrix",value:"["+$.matrix.toString()+"]"});var Le=$.pages[1].join(`
449
- `);ha({data:Le,additionalKeyValues:de,objectId:$.objectNumber}),le("endobj")},Zl=function(){for(var $ in on)on.hasOwnProperty($)&&Ko(on[$])},gc=function($,de){var Le,je=[],Xe=1/(de-1);for(Le=0;Le<1;Le+=Xe)je.push(Le);if(je.push(1),$[0].offset!=0){var at={offset:0,color:$[0].color};$.unshift(at)}if($[$.length-1].offset!=1){var ft={offset:1,color:$[$.length-1].color};$.push(ft)}for(var Et="",Dt=0,tr=0;tr<je.length;tr++){for(Le=je[tr];Le>$[Dt+1].offset;)Dt++;var Jt=$[Dt].offset,cr=(Le-Jt)/($[Dt+1].offset-Jt),En=$[Dt].color,mn=$[Dt+1].color;Et+=re(Math.round((1-cr)*En[0]+cr*mn[0]).toString(16))+re(Math.round((1-cr)*En[1]+cr*mn[1]).toString(16))+re(Math.round((1-cr)*En[2]+cr*mn[2]).toString(16))}return Et.trim()},Nn=function($,de){de||(de=21);var Le=zr(),je=gc($.colors,de),Xe=[];Xe.push({key:"FunctionType",value:"0"}),Xe.push({key:"Domain",value:"[0.0 1.0]"}),Xe.push({key:"Size",value:"["+de+"]"}),Xe.push({key:"BitsPerSample",value:"8"}),Xe.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Xe.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ha({data:je,additionalKeyValues:Xe,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:Le}),le("endobj"),$.objectNumber=zr(),le("<< /ShadingType "+$.type),le("/ColorSpace /DeviceRGB");var at="/Coords ["+k(parseFloat($.coords[0]))+" "+k(parseFloat($.coords[1]))+" ";$.type===2?at+=k(parseFloat($.coords[2]))+" "+k(parseFloat($.coords[3])):at+=k(parseFloat($.coords[2]))+" "+k(parseFloat($.coords[3]))+" "+k(parseFloat($.coords[4]))+" "+k(parseFloat($.coords[5])),le(at+="]"),$.matrix&&le("/Matrix ["+$.matrix.toString()+"]"),le("/Function "+Le+" 0 R"),le("/Extend [true true]"),le(">>"),le("endobj")},Bu=function($,de){var Le=sn(),je=zr();de.push({resourcesOid:Le,objectOid:je}),$.objectNumber=je;var Xe=[];Xe.push({key:"Type",value:"/Pattern"}),Xe.push({key:"PatternType",value:"1"}),Xe.push({key:"PaintType",value:"1"}),Xe.push({key:"TilingType",value:"1"}),Xe.push({key:"BBox",value:"["+$.boundingBox.map(k).join(" ")+"]"}),Xe.push({key:"XStep",value:k($.xStep)}),Xe.push({key:"YStep",value:k($.yStep)}),Xe.push({key:"Resources",value:Le+" 0 R"}),$.matrix&&Xe.push({key:"Matrix",value:"["+$.matrix.toString()+"]"}),ha({data:$.stream,additionalKeyValues:Xe,objectId:$.objectNumber}),le("endobj")},co=function($){var de;for(de in Lt)Lt.hasOwnProperty(de)&&(Lt[de]instanceof Of?Nn(Lt[de]):Lt[de]instanceof mh&&Bu(Lt[de],$))},ml=function($){for(var de in $.objectNumber=zr(),le("<<"),$)switch(de){case"opacity":le("/ca "+T($[de]));break;case"stroke-opacity":le("/CA "+T($[de]))}le(">>"),le("endobj")},Ws=function(){var $;for($ in Wt)Wt.hasOwnProperty($)&&ml(Wt[$])},zu=function(){for(var $ in le("/XObject <<"),on)on.hasOwnProperty($)&&on[$].objectNumber>=0&&le("/"+$+" "+on[$].objectNumber+" 0 R");lr.publish("putXobjectDict"),le(">>")},Ql=function(){ln.oid=zr(),le("<<"),le("/Filter /Standard"),le("/V "+ln.v),le("/R "+ln.r),le("/U <"+ln.toHexString(ln.U)+">"),le("/O <"+ln.toHexString(ln.O)+">"),le("/P "+ln.P),le(">>"),le("endobj")},fo=function(){for(var $ in le("/Font <<"),ur)ur.hasOwnProperty($)&&(v===!1||v===!0&&p.hasOwnProperty($))&&le("/"+$+" "+ur[$].objectNumber+" 0 R");le(">>")},fi=function(){if(Object.keys(Lt).length>0){for(var $ in le("/Shading <<"),Lt)Lt.hasOwnProperty($)&&Lt[$]instanceof Of&&Lt[$].objectNumber>=0&&le("/"+$+" "+Lt[$].objectNumber+" 0 R");lr.publish("putShadingPatternDict"),le(">>")}},qr=function($){if(Object.keys(Lt).length>0){for(var de in le("/Pattern <<"),Lt)Lt.hasOwnProperty(de)&&Lt[de]instanceof f.TilingPattern&&Lt[de].objectNumber>=0&&Lt[de].objectNumber<$&&le("/"+de+" "+Lt[de].objectNumber+" 0 R");lr.publish("putTilingPatternDict"),le(">>")}},dr=function(){if(Object.keys(Wt).length>0){var $;for($ in le("/ExtGState <<"),Wt)Wt.hasOwnProperty($)&&Wt[$].objectNumber>=0&&le("/"+$+" "+Wt[$].objectNumber+" 0 R");lr.publish("putGStateDict"),le(">>")}},Qr=function($){ei($.resourcesOid,!0),le("<<"),le("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),fo(),fi(),qr($.objectOid),dr(),zu(),le(">>"),le("endobj")},hi=function(){var $=[];As(),Ws(),Zl(),co($),lr.publish("putResources"),$.forEach(Qr),Qr({resourcesOid:fa,objectOid:Number.MAX_SAFE_INTEGER}),lr.publish("postPutResources")},Li=function(){lr.publish("putAdditionalObjects");for(var $=0;$<ce.length;$++){var de=ce[$];ei(de.objId,!0),le(de.content),le("endobj")}lr.publish("postPutAdditionalObjects")},Fa=function($){Ge[$.fontName]=Ge[$.fontName]||{},Ge[$.fontName][$.fontStyle]=$.id},Da=function($,de,Le,je,Xe){var at={id:"F"+(Object.keys(ur).length+1).toString(10),postScriptName:$,fontName:de,fontStyle:Le,encoding:je,isStandardFont:Xe||!1,metadata:{}};return lr.publish("addFont",{font:at,instance:this}),ur[at.id]=at,Fa(at),at.id},ti=function($){for(var de=0,Le=ye.length;de<Le;de++){var je=Da.call(this,$[de][0],$[de][1],$[de][2],ye[de][3],!0);v===!1&&(p[je]=!0);var Xe=$[de][0].split("-");Fa({id:je,fontName:Xe[0],fontStyle:Xe[1]||""})}lr.publish("addFonts",{fonts:ur,dictionary:Ge})},Ti=function($){return $.foo=function(){try{return $.apply(this,arguments)}catch(je){var de=je.stack||"";~de.indexOf(" at ")&&(de=de.split(" at ")[1]);var Le="Error in function "+de.split(`
450
- `)[0].split("<")[0]+": "+je.message;if(!er.console)throw new Error(Le);er.console.error(Le,je),er.alert&&alert(Le)}},$.foo.bar=$,$.foo},yl=function($,de){var Le,je,Xe,at,ft,Et,Dt,tr,Jt;if(Xe=(de=de||{}).sourceEncoding||"Unicode",ft=de.outputEncoding,(de.autoencode||ft)&&ur[pt].metadata&&ur[pt].metadata[Xe]&&ur[pt].metadata[Xe].encoding&&(at=ur[pt].metadata[Xe].encoding,!ft&&ur[pt].encoding&&(ft=ur[pt].encoding),!ft&&at.codePages&&(ft=at.codePages[0]),typeof ft=="string"&&(ft=at[ft]),ft)){for(Dt=!1,Et=[],Le=0,je=$.length;Le<je;Le++)(tr=ft[$.charCodeAt(Le)])?Et.push(String.fromCharCode(tr)):Et.push($[Le]),Et[Le].charCodeAt(0)>>8&&(Dt=!0);$=Et.join("")}for(Le=$.length;Dt===void 0&&Le!==0;)$.charCodeAt(Le-1)>>8&&(Dt=!0),Le--;if(!Dt)return $;for(Et=de.noBOM?[]:[254,255],Le=0,je=$.length;Le<je;Le++){if((Jt=(tr=$.charCodeAt(Le))>>8)>>8)throw new Error("Character at position "+Le+" of string '"+$+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");Et.push(Jt),Et.push(tr-(Jt<<8))}return String.fromCharCode.apply(void 0,Et)},pa=f.__private__.pdfEscape=f.pdfEscape=function($,de){return yl($,de).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Zo=f.__private__.beginPage=function($){pe[++Rr]=[],It[Rr]={objId:0,contentsObjId:0,userUnit:Number(l),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number($[0]),topRightY:Number($[1])}},Ys(Rr),Se(pe[q])},Jl=function($,de){var Le,je,Xe;switch(r=de||r,typeof $=="string"&&(Le=x($.toLowerCase()),Array.isArray(Le)&&(je=Le[0],Xe=Le[1])),Array.isArray($)&&(je=$[0]*ut,Xe=$[1]*ut),isNaN(je)&&(je=i[0],Xe=i[1]),(je>14400||Xe>14400)&&(qn.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),je=Math.min(14400,je),Xe=Math.min(14400,Xe)),i=[je,Xe],r.substr(0,1)){case"l":Xe>je&&(i=[Xe,je]);break;case"p":je>Xe&&(i=[Xe,je])}Zo(i),Ls(qa),le(gn),iu!==0&&le(iu+" J"),Ts!==0&&le(Ts+" j"),lr.publish("addPage",{pageNumber:Rr})},ga=function($){$>0&&$<=Rr&&(pe.splice($,1),It.splice($,1),Rr--,q>Rr&&(q=Rr),this.setPage(q))},Ys=function($){$>0&&$<=Rr&&(q=$)},sf=f.__private__.getNumberOfPages=f.getNumberOfPages=function(){return pe.length-1},eu=function($,de,Le){var je,Xe=void 0;return Le=Le||{},$=$!==void 0?$:ur[pt].fontName,de=de!==void 0?de:ur[pt].fontStyle,je=$.toLowerCase(),Ge[je]!==void 0&&Ge[je][de]!==void 0?Xe=Ge[je][de]:Ge[$]!==void 0&&Ge[$][de]!==void 0?Xe=Ge[$][de]:Le.disableWarning===!1&&qn.warn("Unable to look up font label for font '"+$+"', '"+de+"'. Refer to getFontList() for available fonts."),Xe||Le.noFallback||(Xe=Ge.times[de])==null&&(Xe=Ge.times.normal),Xe},wr=f.__private__.putInfo=function(){var $=zr(),de=function(je){return je};for(var Le in h!==null&&(de=ln.encryptor($,0)),le("<<"),le("/Producer ("+pa(de("jsPDF "+Zt.version))+")"),St)St.hasOwnProperty(Le)&&St[Le]&&le("/"+Le.substr(0,1).toUpperCase()+Le.substr(1)+" ("+pa(de(St[Le]))+")");le("/CreationDate ("+pa(de(J))+")"),le(">>"),le("endobj")},Os=f.__private__.putCatalog=function($){var de=($=$||{}).rootDictionaryObjId||lo;switch(zr(),le("<<"),le("/Type /Catalog"),le("/Pages "+de+" 0 R"),Te||(Te="fullwidth"),Te){case"fullwidth":le("/OpenAction [3 0 R /FitH null]");break;case"fullheight":le("/OpenAction [3 0 R /FitV null]");break;case"fullpage":le("/OpenAction [3 0 R /Fit]");break;case"original":le("/OpenAction [3 0 R /XYZ null null 1]");break;default:var Le=""+Te;Le.substr(Le.length-1)==="%"&&(Te=parseInt(Te)/100),typeof Te=="number"&&le("/OpenAction [3 0 R /XYZ null null "+T(Te)+"]")}switch(ct||(ct="continuous"),ct){case"continuous":le("/PageLayout /OneColumn");break;case"single":le("/PageLayout /SinglePage");break;case"two":case"twoleft":le("/PageLayout /TwoColumnLeft");break;case"tworight":le("/PageLayout /TwoColumnRight")}Be&&le("/PageMode /"+Be),lr.publish("putCatalog"),le(">>"),le("endobj")},Xs=f.__private__.putTrailer=function(){le("trailer"),le("<<"),le("/Size "+(Y+1)),le("/Root "+Y+" 0 R"),le("/Info "+(Y-1)+" 0 R"),h!==null&&le("/Encrypt "+ln.oid+" 0 R"),le("/ID [ <"+se+"> <"+se+"> ]"),le(">>")},Ks=f.__private__.putHeader=function(){le("%PDF-"+b),le("%ºß¬à")},vc=f.__private__.putXRef=function(){var $="0000000000";le("xref"),le("0 "+(Y+1)),le("0000000000 65535 f ");for(var de=1;de<=Y;de++)typeof ee[de]=="function"?le(($+ee[de]()).slice(-10)+" 00000 n "):ee[de]!==void 0?le(($+ee[de]).slice(-10)+" 00000 n "):le("0000000000 00000 n ")},Qo=f.__private__.buildDocument=function(){ke(),Se(ae),lr.publish("buildDocument"),Ks(),da(),Li(),hi(),h!==null&&Ql(),wr(),Os();var $=ue;return vc(),Xs(),le("startxref"),le(""+$),le("%%EOF"),Se(pe[q]),ae.join(`
451
- `)},Cs=f.__private__.getBlob=function($){return new Blob([xe($)],{type:"application/pdf"})},ks=f.output=f.__private__.output=Ti(function($,de){switch(typeof(de=de||{})=="string"?de={filename:de}:de.filename=de.filename||"generated.pdf",$){case void 0:return Qo();case"save":f.save(de.filename);break;case"arraybuffer":return xe(Qo());case"blob":return Cs(Qo());case"bloburi":case"bloburl":if(er.URL!==void 0&&typeof er.URL.createObjectURL=="function")return er.URL&&er.URL.createObjectURL(Cs(Qo()))||void 0;qn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var Le="",je=Qo();try{Le=vv(je)}catch{Le=vv(unescape(encodeURIComponent(je)))}return"data:application/pdf;filename="+de.filename+";base64,"+Le;case"pdfobjectnewwindow":if(Object.prototype.toString.call(er)==="[object Window]"){var Xe="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"';de.pdfObjectUrl&&(Xe=de.pdfObjectUrl,at="");var ft='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+Xe+'"'+at+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(de)+");<\/script></body></html>",Et=er.open();return Et!==null&&Et.document.write(ft),Et}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(er)==="[object Window]"){var Dt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(de.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+de.filename+'" width="500px" height="400px" /></body></html>',tr=er.open();if(tr!==null){tr.document.write(Dt);var Jt=this;tr.document.documentElement.querySelector("#pdfViewer").onload=function(){tr.document.title=de.filename,tr.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(Jt.output("bloburl"))}}return tr}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(er)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var cr='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",de)+'"></iframe></body></html>',En=er.open();if(En!==null&&(En.document.write(cr),En.document.title=de.filename),En||typeof safari>"u")return En;break;case"datauri":case"dataurl":return er.document.location.href=this.output("datauristring",de);default:return null}}),Ns=function($){return Array.isArray(so)===!0&&so.indexOf($)>-1};switch(n){case"pt":ut=1;break;case"mm":ut=72/25.4;break;case"cm":ut=72/2.54;break;case"in":ut=72;break;case"px":ut=Ns("px_scaling")==1?.75:96/72;break;case"pc":case"em":ut=12;break;case"ex":ut=6;break;default:if(typeof n!="number")throw new Error("Invalid unit: "+n);ut=n}var ln=null;D(),V();var Jo=function($){return h!==null?ln.encryptor($,0):function(de){return de}},Ba=f.__private__.getPageInfo=f.getPageInfo=function($){if(isNaN($)||$%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:It[$].objId,pageNumber:$,pageContext:It[$]}},_t=f.__private__.getPageInfoByObjId=function($){if(isNaN($)||$%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var de in It)if(It[de].objId===$)break;return Ba(de)},Zs=f.__private__.getCurrentPageInfo=f.getCurrentPageInfo=function(){return{objId:It[q].objId,pageNumber:q,pageContext:It[q]}};f.addPage=function(){return Jl.apply(this,arguments),this},f.setPage=function(){return Ys.apply(this,arguments),Se.call(this,pe[q]),this},f.insertPage=function($){return this.addPage(),this.movePage(q,$),this},f.movePage=function($,de){var Le,je;if($>de){Le=pe[$],je=It[$];for(var Xe=$;Xe>de;Xe--)pe[Xe]=pe[Xe-1],It[Xe]=It[Xe-1];pe[de]=Le,It[de]=je,this.setPage(de)}else if($<de){Le=pe[$],je=It[$];for(var at=$;at<de;at++)pe[at]=pe[at+1],It[at]=It[at+1];pe[de]=Le,It[de]=je,this.setPage(de)}return this},f.deletePage=function(){return ga.apply(this,arguments),this},f.__private__.text=f.text=function($,de,Le,je,Xe){var at,ft,Et,Dt,tr,Jt,cr,En,mn,Tn=(je=je||{}).scope||this;if(typeof $=="number"&&typeof de=="number"&&(typeof Le=="string"||Array.isArray(Le))){var Xn=Le;Le=de,de=$,$=Xn}if(arguments[3]instanceof qt?(N("The transform parameter of text() with a Matrix value"),mn=Xe):(Et=arguments[4],Dt=arguments[5],Sn(cr=arguments[3])==="object"&&cr!==null||(typeof Et=="string"&&(Dt=Et,Et=null),typeof cr=="string"&&(Dt=cr,cr=null),typeof cr=="number"&&(Et=cr,cr=null),je={flags:cr,angle:Et,align:Dt})),isNaN(de)||isNaN(Le)||$==null)throw new Error("Invalid arguments passed to jsPDF.text");if($.length===0)return Tn;var ii="",Va=!1,Oa=typeof je.lineHeightFactor=="number"?je.lineHeightFactor:Ri,Ca=Tn.internal.scaleFactor;function rs(Yr){return Yr=Yr.split(" ").join(Array(je.TabLen||9).join(" ")),pa(Yr,cr)}function ns(Yr){for(var Ir,Rn=Yr.concat(),Kn=[],Bo=Rn.length;Bo--;)typeof(Ir=Rn.shift())=="string"?Kn.push(Ir):Array.isArray(Yr)&&(Ir.length===1||Ir[1]===void 0&&Ir[2]===void 0)?Kn.push(Ir[0]):Kn.push([Ir[0],Ir[1],Ir[2]]);return Kn}function Fi(Yr,Ir){var Rn;if(typeof Yr=="string")Rn=Ir(Yr)[0];else if(Array.isArray(Yr)){for(var Kn,Bo,Pl=Yr.concat(),ol=[],ou=Pl.length;ou--;)typeof(Kn=Pl.shift())=="string"?ol.push(Ir(Kn)[0]):Array.isArray(Kn)&&typeof Kn[0]=="string"&&(Bo=Ir(Kn[0],Kn[1],Kn[2]),ol.push([Bo[0],Bo[1],Bo[2]]));Rn=ol}return Rn}var Ga=!1,rl=!0;if(typeof $=="string")Ga=!0;else if(Array.isArray($)){var Sl=$.concat();ft=[];for(var ra,Wr=Sl.length;Wr--;)(typeof(ra=Sl.shift())!="string"||Array.isArray(ra)&&typeof ra[0]!="string")&&(rl=!1);Ga=rl}if(Ga===!1)throw new Error('Type of text must be string or Array. "'+$+'" is not recognized.');typeof $=="string"&&($=$.match(/[\r?\n]/)?$.split(/\r\n|\r|\n/g):[$]);var nl=Ne/Tn.internal.scaleFactor,El=nl*(Oa-1);switch(je.baseline){case"bottom":Le-=El;break;case"top":Le+=nl-El;break;case"hanging":Le+=nl-2*El;break;case"middle":Le+=nl/2-El}if((Jt=je.maxWidth||0)>0&&(typeof $=="string"?$=Tn.splitTextToSize($,Jt):Object.prototype.toString.call($)==="[object Array]"&&($=$.reduce(function(Yr,Ir){return Yr.concat(Tn.splitTextToSize(Ir,Jt))},[]))),at={text:$,x:de,y:Le,options:je,mutex:{pdfEscape:pa,activeFontKey:pt,fonts:ur,activeFontSize:Ne}},lr.publish("preProcessText",at),$=at.text,Et=(je=at.options).angle,!(mn instanceof qt)&&Et&&typeof Et=="number"){Et*=Math.PI/180,je.rotationDirection===0&&(Et=-Et),w===m.ADVANCED&&(Et=-Et);var ka=Math.cos(Et),$a=Math.sin(Et);mn=new qt(ka,$a,-$a,ka,0,0)}else Et&&Et instanceof qt&&(mn=Et);w!==m.ADVANCED||mn||(mn=Jn),(tr=je.charSpace||ta)!==void 0&&(ii+=k(L(tr))+` Tc
452
- `,this.setCharSpace(this.getCharSpace()||0)),(En=je.horizontalScale)!==void 0&&(ii+=k(100*En)+` Tz
453
- `),je.lang;var xi=-1,il=je.renderingMode!==void 0?je.renderingMode:je.stroke,go=Tn.internal.getCurrentPageInfo().pageContext;switch(il){case 0:case!1:case"fill":xi=0;break;case 1:case!0:case"stroke":xi=1;break;case 2:case"fillThenStroke":xi=2;break;case 3:case"invisible":xi=3;break;case 4:case"fillAndAddForClipping":xi=4;break;case 5:case"strokeAndAddPathForClipping":xi=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":xi=6;break;case 7:case"addToPathForClipping":xi=7}var Hu=go.usedRenderingMode!==void 0?go.usedRenderingMode:-1;xi!==-1?ii+=xi+` Tr
454
- `:Hu!==-1&&(ii+=`0 Tr
455
- `),xi!==-1&&(go.usedRenderingMode=xi),Dt=je.align||"left";var pi,Di=Ne*Oa,Rs=Tn.internal.pageSize.getWidth(),To=ur[pt];tr=je.charSpace||ta,Jt=je.maxWidth||0,cr=Object.assign({autoencode:!0,noBOM:!0},je.flags);var gi=[],is=function(Yr){return Tn.getStringUnitWidth(Yr,{font:To,charSpace:tr,fontSize:Ne,doKerning:!1})*Ne/Ca};if(Object.prototype.toString.call($)==="[object Array]"){var ai;ft=ns($),Dt!=="left"&&(pi=ft.map(is));var Bi,as=0;if(Dt==="right"){de-=pi[0],$=[],Wr=ft.length;for(var Mr=0;Mr<Wr;Mr++)Mr===0?(Bi=Mi(de),ai=Ii(Le)):(Bi=L(as-pi[Mr]),ai=-Di),$.push([ft[Mr],Bi,ai]),as=pi[Mr]}else if(Dt==="center"){de-=pi[0]/2,$=[],Wr=ft.length;for(var vo=0;vo<Wr;vo++)vo===0?(Bi=Mi(de),ai=Ii(Le)):(Bi=L((as-pi[vo])/2),ai=-Di),$.push([ft[vo],Bi,ai]),as=pi[vo]}else if(Dt==="left"){$=[],Wr=ft.length;for(var al=0;al<Wr;al++)$.push(ft[al])}else if(Dt==="justify"&&To.encoding==="Identity-H"){$=[],Wr=ft.length,Jt=Jt!==0?Jt:Rs;for(var Ro=0,_r=0;_r<Wr;_r++)if(ai=_r===0?Ii(Le):-Di,Bi=_r===0?Mi(de):Ro,_r<Wr-1){var Mo=L((Jt-pi[_r])/(ft[_r].split(" ").length-1)),Hn=ft[_r].split(" ");$.push([Hn[0]+" ",Bi,ai]),Ro=0;for(var vr=1;vr<Hn.length;vr++){var yn=(is(Hn[vr-1]+" "+Hn[vr])-is(Hn[vr]))*Ca+Mo;vr==Hn.length-1?$.push([Hn[vr],yn,0]):$.push([Hn[vr]+" ",yn,0]),Ro-=yn}}else $.push([ft[_r],Bi,ai]);$.push(["",Ro,0])}else{if(Dt!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for($=[],Wr=ft.length,Jt=Jt!==0?Jt:Rs,_r=0;_r<Wr;_r++)ai=_r===0?Ii(Le):-Di,Bi=_r===0?Mi(de):0,_r<Wr-1?gi.push(k(L((Jt-pi[_r])/(ft[_r].split(" ").length-1)))):gi.push(0),$.push([ft[_r],Bi,ai])}}var Vn=typeof je.R2L=="boolean"?je.R2L:Re;Vn===!0&&($=Fi($,function(Yr,Ir,Rn){return[Yr.split("").reverse().join(""),Ir,Rn]})),at={text:$,x:de,y:Le,options:je,mutex:{pdfEscape:pa,activeFontKey:pt,fonts:ur,activeFontSize:Ne}},lr.publish("postProcessText",at),$=at.text,Va=at.mutex.isHex||!1;var os=ur[pt].encoding;os!=="WinAnsiEncoding"&&os!=="StandardEncoding"||($=Fi($,function(Yr,Ir,Rn){return[rs(Yr),Ir,Rn]})),ft=ns($),$=[];for(var Io,jo,Wa,Pn=0,mo=1,Fo=Array.isArray(ft[0])?mo:Pn,Do="",zi=function(Yr,Ir,Rn){var Kn="";return Rn instanceof qt?(Rn=typeof je.angle=="number"?Ji(Rn,new qt(1,0,0,1,Yr,Ir)):Ji(new qt(1,0,0,1,Yr,Ir),Rn),w===m.ADVANCED&&(Rn=Ji(new qt(1,0,0,-1,0,0),Rn)),Kn=Rn.join(" ")+` Tm
456
- `):Kn=k(Yr)+" "+k(Ir)+` Td
457
- `,Kn},Jr=0;Jr<ft.length;Jr++){switch(Do="",Fo){case mo:Wa=(Va?"<":"(")+ft[Jr][0]+(Va?">":")"),Io=parseFloat(ft[Jr][1]),jo=parseFloat(ft[Jr][2]);break;case Pn:Wa=(Va?"<":"(")+ft[Jr]+(Va?">":")"),Io=Mi(de),jo=Ii(Le)}gi!==void 0&&gi[Jr]!==void 0&&(Do=gi[Jr]+` Tw
458
- `),Jr===0?$.push(Do+zi(Io,jo,mn)+Wa):Fo===Pn?$.push(Do+Wa):Fo===mo&&$.push(Do+zi(Io,jo,mn)+Wa)}$=Fo===Pn?$.join(` Tj
459
- T* `):$.join(` Tj
460
- `),$+=` Tj
461
- `;var Si=`BT
462
- /`;return Si+=pt+" "+Ne+` Tf
463
- `,Si+=k(Ne*Oa)+` TL
464
- `,Si+=vn+`
465
- `,Si+=ii,Si+=$,le(Si+="ET"),p[pt]=!0,Tn};var ho=f.__private__.clip=f.clip=function($){return le($==="evenodd"?"W*":"W"),this};f.clipEvenOdd=function(){return ho("evenodd")},f.__private__.discardPath=f.discardPath=function(){return le("n"),this};var No=f.__private__.isValidStyle=function($){var de=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf($)!==-1&&(de=!0),de};f.__private__.setDefaultPathOperation=f.setDefaultPathOperation=function($){return No($)&&(d=$),this};var qu=f.__private__.getStyle=f.getStyle=function($){var de=d;switch($){case"D":case"S":de="S";break;case"F":de="f";break;case"FD":case"DF":de="B";break;case"f":case"f*":case"B":case"B*":de=$}return de},Qs=f.close=function(){return le("h"),this};f.stroke=function(){return le("S"),this},f.fill=function($){return Ln("f",$),this},f.fillEvenOdd=function($){return Ln("f*",$),this},f.fillStroke=function($){return Ln("B",$),this},f.fillStrokeEvenOdd=function($){return Ln("B*",$),this};var Ln=function($,de){Sn(de)==="object"?ru(de,$):le($)},Js=function($){$===null||w===m.ADVANCED&&$===void 0||($=qu($),le($))};function tu($,de,Le,je,Xe){var at=new mh(de||this.boundingBox,Le||this.xStep,je||this.yStep,this.gState,Xe||this.matrix);at.stream=this.stream;var ft=$+"$$"+this.cloneIndex+++"$$";return ci(ft,at),at}var ru=function($,de){var Le=gr[$.key],je=Lt[Le];if(je instanceof Of)le("q"),le(lf(de)),je.gState&&f.setGState(je.gState),le($.matrix.toString()+" cm"),le("/"+Le+" sh"),le("Q");else if(je instanceof mh){var Xe=new qt(1,0,0,-1,0,ts());$.matrix&&(Xe=Xe.multiply($.matrix||Jn),Le=tu.call(je,$.key,$.boundingBox,$.xStep,$.yStep,Xe).id),le("q"),le("/Pattern cs"),le("/"+Le+" scn"),je.gState&&f.setGState(je.gState),le(de),le("Q")}},lf=function($){switch($){case"f":case"F":return"W n";case"f*":return"W* n";case"B":return"W S";case"B*":return"W* S";case"S":return"W S";case"n":return"W n"}},po=f.moveTo=function($,de){return le(k(L($))+" "+k(G(de))+" m"),this},ri=f.lineTo=function($,de){return le(k(L($))+" "+k(G(de))+" l"),this},za=f.curveTo=function($,de,Le,je,Xe,at){return le([k(L($)),k(G(de)),k(L(Le)),k(G(je)),k(L(Xe)),k(G(at)),"c"].join(" ")),this};f.__private__.line=f.line=function($,de,Le,je,Xe){if(isNaN($)||isNaN(de)||isNaN(Le)||isNaN(je)||!No(Xe))throw new Error("Invalid arguments passed to jsPDF.line");return w===m.COMPAT?this.lines([[Le-$,je-de]],$,de,[1,1],Xe||"S"):this.lines([[Le-$,je-de]],$,de,[1,1]).stroke()},f.__private__.lines=f.lines=function($,de,Le,je,Xe,at){var ft,Et,Dt,tr,Jt,cr,En,mn,Tn,Xn,ii,Va;if(typeof $=="number"&&(Va=Le,Le=de,de=$,$=Va),je=je||[1,1],at=at||!1,isNaN(de)||isNaN(Le)||!Array.isArray($)||!Array.isArray(je)||!No(Xe)||typeof at!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(po(de,Le),ft=je[0],Et=je[1],tr=$.length,Xn=de,ii=Le,Dt=0;Dt<tr;Dt++)(Jt=$[Dt]).length===2?(Xn=Jt[0]*ft+Xn,ii=Jt[1]*Et+ii,ri(Xn,ii)):(cr=Jt[0]*ft+Xn,En=Jt[1]*Et+ii,mn=Jt[2]*ft+Xn,Tn=Jt[3]*Et+ii,Xn=Jt[4]*ft+Xn,ii=Jt[5]*Et+ii,za(cr,En,mn,Tn,Xn,ii));return at&&Qs(),Js(Xe),this},f.path=function($){for(var de=0;de<$.length;de++){var Le=$[de],je=Le.c;switch(Le.op){case"m":po(je[0],je[1]);break;case"l":ri(je[0],je[1]);break;case"c":za.apply(this,je);break;case"h":Qs()}}return this},f.__private__.rect=f.rect=function($,de,Le,je,Xe){if(isNaN($)||isNaN(de)||isNaN(Le)||isNaN(je)||!No(Xe))throw new Error("Invalid arguments passed to jsPDF.rect");return w===m.COMPAT&&(je=-je),le([k(L($)),k(G(de)),k(L(Le)),k(L(je)),"re"].join(" ")),Js(Xe),this},f.__private__.triangle=f.triangle=function($,de,Le,je,Xe,at,ft){if(isNaN($)||isNaN(de)||isNaN(Le)||isNaN(je)||isNaN(Xe)||isNaN(at)||!No(ft))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[Le-$,je-de],[Xe-Le,at-je],[$-Xe,de-at]],$,de,[1,1],ft,!0),this},f.__private__.roundedRect=f.roundedRect=function($,de,Le,je,Xe,at,ft){if(isNaN($)||isNaN(de)||isNaN(Le)||isNaN(je)||isNaN(Xe)||isNaN(at)||!No(ft))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var Et=4/3*(Math.SQRT2-1);return Xe=Math.min(Xe,.5*Le),at=Math.min(at,.5*je),this.lines([[Le-2*Xe,0],[Xe*Et,0,Xe,at-at*Et,Xe,at],[0,je-2*at],[0,at*Et,-Xe*Et,at,-Xe,at],[2*Xe-Le,0],[-Xe*Et,0,-Xe,-at*Et,-Xe,-at],[0,2*at-je],[0,-at*Et,Xe*Et,-at,Xe,-at]],$+Xe,de,[1,1],ft,!0),this},f.__private__.ellipse=f.ellipse=function($,de,Le,je,Xe){if(isNaN($)||isNaN(de)||isNaN(Le)||isNaN(je)||!No(Xe))throw new Error("Invalid arguments passed to jsPDF.ellipse");var at=4/3*(Math.SQRT2-1)*Le,ft=4/3*(Math.SQRT2-1)*je;return po($+Le,de),za($+Le,de-ft,$+at,de-je,$,de-je),za($-at,de-je,$-Le,de-ft,$-Le,de),za($-Le,de+ft,$-at,de+je,$,de+je),za($+at,de+je,$+Le,de+ft,$+Le,de),Js(Xe),this},f.__private__.circle=f.circle=function($,de,Le,je){if(isNaN($)||isNaN(de)||isNaN(Le)||!No(je))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse($,de,Le,Le,je)},f.setFont=function($,de,Le){return Le&&(de=R(de,Le)),pt=eu($,de,{disableWarning:!1}),this};var nu=f.__private__.getFont=f.getFont=function(){return ur[eu.apply(f,arguments)]};f.__private__.getFontList=f.getFontList=function(){var $,de,Le={};for($ in Ge)if(Ge.hasOwnProperty($))for(de in Le[$]=[],Ge[$])Ge[$].hasOwnProperty(de)&&Le[$].push(de);return Le},f.addFont=function($,de,Le,je,Xe){var at=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&at.indexOf(arguments[3])!==-1?Xe=arguments[3]:arguments[3]&&at.indexOf(arguments[3])==-1&&(Le=R(Le,je)),Xe=Xe||"Identity-H",Da.call(this,$,de,Le,Xe)};var Ri,qa=e.lineWidth||.200025,Lo=f.__private__.getLineWidth=f.getLineWidth=function(){return qa},Ls=f.__private__.setLineWidth=f.setLineWidth=function($){return qa=$,le(k(L($))+" w"),this};f.__private__.setLineDash=Zt.API.setLineDash=Zt.API.setLineDashPattern=function($,de){if($=$||[],de=de||0,isNaN(de)||!Array.isArray($))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return $=$.map(function(Le){return k(L(Le))}).join(" "),de=k(L(de)),le("["+$+"] "+de+" d"),this};var bl=f.__private__.getLineHeight=f.getLineHeight=function(){return Ne*Ri};f.__private__.getLineHeight=f.getLineHeight=function(){return Ne*Ri};var Uu=f.__private__.setLineHeightFactor=f.setLineHeightFactor=function($){return typeof($=$||1.15)=="number"&&(Ri=$),this},ni=f.__private__.getLineHeightFactor=f.getLineHeightFactor=function(){return Ri};Uu(e.lineHeight);var Mi=f.__private__.getHorizontalCoordinate=function($){return L($)},Ii=f.__private__.getVerticalCoordinate=function($){return w===m.ADVANCED?$:It[q].mediaBox.topRightY-It[q].mediaBox.bottomLeftY-L($)},wl=f.__private__.getHorizontalCoordinateString=f.getHorizontalCoordinateString=function($){return k(Mi($))},Aa=f.__private__.getVerticalCoordinateString=f.getVerticalCoordinateString=function($){return k(Ii($))},gn=e.strokeColor||"0 G";f.__private__.getStrokeColor=f.getDrawColor=function(){return Sa(gn)},f.__private__.setStrokeColor=f.setDrawColor=function($,de,Le,je){return gn=Yn({ch1:$,ch2:de,ch3:Le,ch4:je,pdfColorType:"draw",precision:2}),le(gn),this};var ji=e.fillColor||"0 g";f.__private__.getFillColor=f.getFillColor=function(){return Sa(ji)},f.__private__.setFillColor=f.setFillColor=function($,de,Le,je){return ji=Yn({ch1:$,ch2:de,ch3:Le,ch4:je,pdfColorType:"fill",precision:2}),le(ji),this};var vn=e.textColor||"0 g",ea=f.__private__.getTextColor=f.getTextColor=function(){return Sa(vn)};f.__private__.setTextColor=f.setTextColor=function($,de,Le,je){return vn=Yn({ch1:$,ch2:de,ch3:Le,ch4:je,pdfColorType:"text",precision:3}),this};var ta=e.charSpace,Ua=f.__private__.getCharSpace=f.getCharSpace=function(){return parseFloat(ta||0)};f.__private__.setCharSpace=f.setCharSpace=function($){if(isNaN($))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return ta=$,this};var iu=0;f.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},f.__private__.setLineCap=f.setLineCap=function($){var de=f.CapJoinStyles[$];if(de===void 0)throw new Error("Line cap style of '"+$+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return iu=de,le(de+" J"),this};var Ts=0;f.__private__.setLineJoin=f.setLineJoin=function($){var de=f.CapJoinStyles[$];if(de===void 0)throw new Error("Line join style of '"+$+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Ts=de,le(de+" j"),this},f.__private__.setLineMiterLimit=f.__private__.setMiterLimit=f.setLineMiterLimit=f.setMiterLimit=function($){if($=$||0,isNaN($))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return le(k(L($))+" M"),this},f.GState=I1,f.setGState=function($){($=typeof $=="string"?Wt[Ut[$]]:el(null,$)).equals(kn)||(le("/"+$.id+" gs"),kn=$)};var el=function($,de){if(!$||!Ut[$]){var Le=!1;for(var je in Wt)if(Wt.hasOwnProperty(je)&&Wt[je].equals(de)){Le=!0;break}if(Le)de=Wt[je];else{var Xe="GS"+(Object.keys(Wt).length+1).toString(10);Wt[Xe]=de,de.id=Xe}return $&&(Ut[$]=de.id),lr.publish("addGState",de),de}};f.addGState=function($,de){return el($,de),this},f.saveGraphicsState=function(){return le("q"),Ze.push({key:pt,size:Ne,color:vn}),this},f.restoreGraphicsState=function(){le("Q");var $=Ze.pop();return pt=$.key,Ne=$.size,vn=$.color,kn=null,this},f.setCurrentTransformationMatrix=function($){return le($.toString()+" cm"),this},f.comment=function($){return le("#"+$),this};var Un=function($,de){var Le=$||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return Le},set:function(at){isNaN(at)||(Le=parseFloat(at))}});var je=de||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return je},set:function(at){isNaN(at)||(je=parseFloat(at))}});var Xe="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return Xe},set:function(at){Xe=at.toString()}}),this},di=function($,de,Le,je){Un.call(this,$,de),this.type="rect";var Xe=Le||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return Xe},set:function(ft){isNaN(ft)||(Xe=parseFloat(ft))}});var at=je||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return at},set:function(ft){isNaN(ft)||(at=parseFloat(ft))}}),this},$r=function(){this.page=Rr,this.currentPage=q,this.pages=pe.slice(0),this.pagesContext=It.slice(0),this.x=Br,this.y=rr,this.matrix=Nr,this.width=es(q),this.height=ts(q),this.outputDestination=Ce,this.id="",this.objectNumber=-1};$r.prototype.restore=function(){Rr=this.page,q=this.currentPage,It=this.pagesContext,pe=this.pages,Br=this.x,rr=this.y,Nr=this.matrix,xl(q,this.width),au(q,this.height),Ce=this.outputDestination};var tl=function($,de,Le,je,Xe){ca.push(new $r),Rr=q=0,pe=[],Br=$,rr=de,Nr=Xe,Zo([Le,je])},Ha=function($){if(pn[$])ca.pop().restore();else{var de=new $r,Le="Xo"+(Object.keys(on).length+1).toString(10);de.id=Le,pn[$]=Le,on[Le]=de,lr.publish("addFormObject",de),ca.pop().restore()}};for(var _l in f.beginFormObject=function($,de,Le,je,Xe){return tl($,de,Le,je,Xe),this},f.endFormObject=function($){return Ha($),this},f.doFormObject=function($,de){var Le=on[pn[$]];return le("q"),le(de.toString()+" cm"),le("/"+Le.id+" Do"),le("Q"),this},f.getFormObject=function($){var de=on[pn[$]];return{x:de.x,y:de.y,width:de.width,height:de.height,matrix:de.matrix}},f.save=function($,de){return $=$||"generated.pdf",(de=de||{}).returnPromise=de.returnPromise||!1,de.returnPromise===!1?(Af(Cs(Qo()),$),typeof Af.unload=="function"&&er.setTimeout&&setTimeout(Af.unload,911),this):new Promise(function(Le,je){try{var Xe=Af(Cs(Qo()),$);typeof Af.unload=="function"&&er.setTimeout&&setTimeout(Af.unload,911),Le(Xe)}catch(at){je(at.message)}})},Zt.API)Zt.API.hasOwnProperty(_l)&&(_l==="events"&&Zt.API.events.length?function($,de){var Le,je,Xe;for(Xe=de.length-1;Xe!==-1;Xe--)Le=de[Xe][0],je=de[Xe][1],$.subscribe.apply($,[Le].concat(typeof je=="function"?[je]:je))}(lr,Zt.API.events):f[_l]=Zt.API[_l]);var es=f.getPageWidth=function($){return(It[$=$||q].mediaBox.topRightX-It[$].mediaBox.bottomLeftX)/ut},xl=f.setPageWidth=function($,de){It[$].mediaBox.topRightX=de*ut+It[$].mediaBox.bottomLeftX},ts=f.getPageHeight=function($){return(It[$=$||q].mediaBox.topRightY-It[$].mediaBox.bottomLeftY)/ut},au=f.setPageHeight=function($,de){It[$].mediaBox.topRightY=de*ut+It[$].mediaBox.bottomLeftY};return f.internal={pdfEscape:pa,getStyle:qu,getFont:nu,getFontSize:ge,getCharSpace:Ua,getTextColor:ea,getLineHeight:bl,getLineHeightFactor:ni,getLineWidth:Lo,write:Ee,getHorizontalCoordinate:Mi,getVerticalCoordinate:Ii,getCoordinateString:wl,getVerticalCoordinateString:Aa,collections:{},newObject:zr,newAdditionalObject:xa,newObjectDeferred:sn,newObjectDeferredBegin:ei,getFilters:Ea,putStream:ha,events:lr,scaleFactor:ut,pageSize:{getWidth:function(){return es(q)},setWidth:function($){xl(q,$)},getHeight:function(){return ts(q)},setHeight:function($){au(q,$)}},encryptionOptions:h,encryption:ln,getEncryptor:Jo,output:ks,getNumberOfPages:sf,pages:pe,out:le,f2:T,f3:C,getPageInfo:Ba,getPageInfoByObjId:_t,getCurrentPageInfo:Zs,getPDFVersion:_,Point:Un,Rectangle:di,Matrix:qt,hasHotfix:Ns},Object.defineProperty(f.internal.pageSize,"width",{get:function(){return es(q)},set:function($){xl(q,$)},enumerable:!0,configurable:!0}),Object.defineProperty(f.internal.pageSize,"height",{get:function(){return ts(q)},set:function($){au(q,$)},enumerable:!0,configurable:!0}),ti.call(f,ye),pt="F1",Jl(i,r),lr.publish("initialized"),f}fh.prototype.lsbFirstWord=function(e){return String.fromCharCode(e>>0&255,e>>8&255,e>>16&255,e>>24&255)},fh.prototype.toHexString=function(e){return e.split("").map(function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)}).join("")},fh.prototype.hexToBytes=function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(String.fromCharCode(parseInt(e.substr(r,2),16)));return t.join("")},fh.prototype.processOwnerPassword=function(e,t){return yv(mv(t).substr(0,5),e)},fh.prototype.encryptor=function(e,t){var r=mv(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(n){return yv(r,n)}},I1.prototype.equals=function(e){var t,r="id,objectNumber,equals";if(!e||Sn(e)!==Sn(this))return!1;var n=0;for(t in this)if(!(r.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t)||this[t]!==e[t])return!1;n++}for(t in e)e.hasOwnProperty(t)&&r.indexOf(t)<0&&n--;return n===0},Zt.API={events:[]},Zt.version="3.0.1";var Ci=Zt.API,sm=1,Hf=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},uh=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},hr=function(e){return e.toFixed(2)},zc=function(e){return e.toFixed(5)};Ci.__acroform__={};var Ps=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},Qb=function(e){return e*sm},xu=function(e){var t=new x8,r=Ft.internal.getHeight(e)||0,n=Ft.internal.getWidth(e)||0;return t.BBox=[0,0,Number(hr(n)),Number(hr(r))],t},Sk=Ci.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|=1<<t},Ek=Ci.__acroform__.clearBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&=~(1<<t)},Pk=Ci.__acroform__.getBit=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return(e&1<<t)==0?0:1},Xi=Ci.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return Pk(e,t-1)},Ki=Ci.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return Sk(e,t-1)},Zi=Ci.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return Ek(e,t-1)},Ak=Ci.__acroform__.calculateCoordinates=function(e,t){var r=t.internal.getHorizontalCoordinate,n=t.internal.getVerticalCoordinate,i=e[0],a=e[1],o=e[2],l=e[3],u={};return u.lowerLeft_X=r(i)||0,u.lowerLeft_Y=n(a+l)||0,u.upperRight_X=r(i+o)||0,u.upperRight_Y=n(a)||0,[Number(hr(u.lowerLeft_X)),Number(hr(u.lowerLeft_Y)),Number(hr(u.upperRight_X)),Number(hr(u.upperRight_Y))]},Ok=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],r=e._V||e.DV,n=bv(e,r),i=e.scope.internal.getFont(e.fontName,e.fontStyle).id;t.push("/Tx BMC"),t.push("q"),t.push("BT"),t.push(e.scope.__private__.encodeColorString(e.color)),t.push("/"+i+" "+hr(n.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(n.text),t.push("ET"),t.push("Q"),t.push("EMC");var a=xu(e);return a.scope=e.scope,a.stream=t.join(`
466
- `),a}},bv=function(e,t){var r=e.fontSize===0?e.maxFontSize:e.fontSize,n={text:"",fontSize:""},i=(t=(t=t.substr(0,1)=="("?t.substr(1):t).substr(t.length-1)==")"?t.substr(0,t.length-1):t).split(" ");i=e.multiline?i.map(function(C){return C.split(`
467
- `)}):i.map(function(C){return[C]});var a=r,o=Ft.internal.getHeight(e)||0;o=o<0?-o:o;var l=Ft.internal.getWidth(e)||0;l=l<0?-l:l;var u=function(C,L,H){if(C+1<i.length){var G=L+" "+i[C+1][0];return t1(G,e,H).width<=l-4}return!1};a++;e:for(;a>0;){t="",a--;var d,h,v=t1("3",e,a).height,p=e.multiline?o-a:(o-v)/2,f=p+=2,b=0,_=0,S=0;if(a<=0){t=`(...) Tj
468
- `,t+="% Width of Text: "+t1(t,e,a=12).width+", FieldWidth:"+l+`
469
- `;break}for(var x="",m=0,w=0;w<i.length;w++)if(i.hasOwnProperty(w)){var E=!1;if(i[w].length!==1&&S!==i[w].length-1){if((v+2)*(m+2)+2>o)continue e;x+=i[w][S],E=!0,_=w,w--}else{x=(x+=i[w][S]+" ").substr(x.length-1)==" "?x.substr(0,x.length-1):x;var P=parseInt(w),R=u(P,x,a),k=w>=i.length-1;if(R&&!k){x+=" ",S=0;continue}if(R||k){if(k)_=P;else if(e.multiline&&(v+2)*(m+2)+2>o)continue e}else{if(!e.multiline||(v+2)*(m+2)+2>o)continue e;_=P}}for(var N="",M=b;M<=_;M++){var T=i[M];if(e.multiline){if(M===_){N+=T[S]+" ",S=(S+1)%T.length;continue}if(M===b){N+=T[T.length-1]+" ";continue}}N+=T[0]+" "}switch(N=N.substr(N.length-1)==" "?N.substr(0,N.length-1):N,h=t1(N,e,a).width,e.textAlign){case"right":d=l-h-2;break;case"center":d=(l-h)/2;break;case"left":default:d=2}t+=hr(d)+" "+hr(f)+` Td
470
- `,t+="("+Hf(N)+`) Tj
471
- `,t+=-hr(d)+` 0 Td
472
- `,f=-(a+2),h=0,b=E?_:_+1,m++,x=""}break}return n.text=t,n.fontSize=a,n},t1=function(e,t,r){var n=t.scope.internal.getFont(t.fontName,t.fontStyle),i=t.scope.getStringUnitWidth(e,{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r);return{height:t.scope.getStringUnitWidth("3",{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r)*1.5,width:i}},Ck={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},kk=function(e,t){var r={type:"reference",object:e};t.internal.getPageInfo(e.page).pageContext.annotations.find(function(n){return n.type===r.type&&n.object===r.object})===void 0&&t.internal.getPageInfo(e.page).pageContext.annotations.push(r)},Nk=function(e,t){for(var r in e)if(e.hasOwnProperty(r)){var n=r,i=e[r];t.internal.newObjectDeferredBegin(i.objId,!0),Sn(i)==="object"&&typeof i.putStream=="function"&&i.putStream(),delete e[n]}},Lk=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(Xl.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(Ck)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");sm=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new S8,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.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})(e)}),e.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&&kk(a,r)}})(e)}),e.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")})(e)}),e.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 l=n[o],u=[],d=l.Rect;if(l.Rect&&(l.Rect=Ak(l.Rect,i)),i.internal.newObjectDeferredBegin(l.objId,!0),l.DA=Ft.createDefaultAppearanceStream(l),Sn(l)==="object"&&typeof l.getKeyValueListForStream=="function"&&(u=l.getKeyValueListForStream()),l.Rect=d,l.hasAppearanceStream&&!l.appearanceStreamContent){var h=Ok(l);u.push({key:"AP",value:"<</N "+h+">>"}),i.internal.acroformPlugin.xForms.push(h)}if(l.appearanceStreamContent){var v="";for(var p in l.appearanceStreamContent)if(l.appearanceStreamContent.hasOwnProperty(p)){var f=l.appearanceStreamContent[p];if(v+="/"+p+" ",v+="<<",Object.keys(f).length>=1||Array.isArray(f)){for(var o in f)if(f.hasOwnProperty(o)){var b=f[o];typeof b=="function"&&(b=b.call(i,l)),v+="/"+o+" "+b+" ",i.internal.acroformPlugin.xForms.indexOf(b)>=0||i.internal.acroformPlugin.xForms.push(b)}}else typeof(b=f)=="function"&&(b=b.call(i,l)),v+="/"+o+" "+b,i.internal.acroformPlugin.xForms.indexOf(b)>=0||i.internal.acroformPlugin.xForms.push(b);v+=">>"}u.push({key:"AP",value:`<<
473
- `+v+">>"})}i.internal.putStream({additionalKeyValues:u,objectId:l.objId}),i.internal.out("endobj")}a&&Nk(i.internal.acroformPlugin.xForms,i)})(r,e)}),e.internal.acroformPlugin.isInitialized=!0}},_8=Ci.__acroform__.arrayToPdfArray=function(e,t,r){var n=function(o){return o};if(Array.isArray(e)){for(var i="[",a=0;a<e.length;a++)switch(a!==0&&(i+=" "),Sn(e[a])){case"boolean":case"number":case"object":i+=e[a].toString();break;case"string":e[a].substr(0,1)!=="/"?(t!==void 0&&r&&(n=r.internal.getEncryptor(t)),i+="("+Hf(n(e[a].toString()))+")"):i+=e[a].toString()}return i+="]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},F2=function(e,t,r){var n=function(i){return i};return t!==void 0&&r&&(n=r.internal.getEncryptor(t)),(e=e||"").toString(),e="("+Hf(n(e))+")"},Au=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};Au.prototype.toString=function(){return this.objId+" 0 R"},Au.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},Au.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(a){return a!="content"&&a!="appearanceStreamContent"&&a!="scope"&&a!="objId"&&a.substring(0,1)!="_"});for(var r in t)if(Object.getOwnPropertyDescriptor(this,t[r]).configurable===!1){var n=t[r],i=this[n];i&&(Array.isArray(i)?e.push({key:n,value:_8(i,this.objId,this.scope)}):i instanceof Au?(i.scope=this.scope,e.push({key:n,value:i.objId+" 0 R"})):typeof i!="function"&&e.push({key:n,value:i}))}return e};var x8=function(){Au.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(r){t=r}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(r){e=r.trim()},get:function(){return e||null}})};Ps(x8,Au);var S8=function(){Au.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var r=function(n){return n};return this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),"("+Hf(r(e))+")"}},set:function(r){e=r}})};Ps(S8,Au);var Xl=function e(){Au.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(x){if(isNaN(x))throw new Error('Invalid value "'+x+'" for attribute F supplied.');t=x}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Xi(t,3)},set:function(x){x?this.F=Ki(t,3):this.F=Zi(t,3)}});var r=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return r},set:function(x){if(isNaN(x))throw new Error('Invalid value "'+x+'" for attribute Ff supplied.');r=x}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(n.length!==0)return n},set:function(x){n=x!==void 0?x:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:n[0]},set:function(x){n[0]=x}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:n[1]},set:function(x){n[1]=x}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:n[2]},set:function(x){n[2]=x}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:n[3]},set:function(x){n[3]=x}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(x){switch(x){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=x;break;default:throw new Error('Invalid value "'+x+'" 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 j1)return;a="FieldObject"+e.FieldNum++}var x=function(m){return m};return this.scope&&(x=this.scope.internal.getEncryptor(this.objId)),"("+Hf(x(a))+")"},set:function(x){a=x.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return a},set:function(x){a=x}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(x){o=x}});var l="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return l},set:function(x){l=x}});var u=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return u},set:function(x){u=x}});var d=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return d===void 0?50/sm:d},set:function(x){d=x}});var h="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return h},set:function(x){h=x}});var v="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!v||this instanceof j1||this instanceof Mf))return F2(v,this.objId,this.scope)},set:function(x){x=x.toString(),v=x}});var p=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(p)return this instanceof Ia?p:F2(p,this.objId,this.scope)},set:function(x){x=x.toString(),p=this instanceof Ia?x:x.substr(0,1)==="("?uh(x.substr(1,x.length-2)):uh(x)}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ia?uh(p.substr(1,p.length-1)):p},set:function(x){x=x.toString(),p=this instanceof Ia?"/"+x:x}});var f=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(f)return f},set:function(x){this.V=x}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof Ia?f:F2(f,this.objId,this.scope)},set:function(x){x=x.toString(),f=this instanceof Ia?x:x.substr(0,1)==="("?uh(x.substr(1,x.length-2)):uh(x)}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ia?uh(f.substr(1,f.length-1)):f},set:function(x){x=x.toString(),f=this instanceof Ia?"/"+x:x}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var b,_=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return _},set:function(x){x=!!x,_=x}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(b)return b},set:function(x){b=x}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,1)},set:function(x){x?this.Ff=Ki(this.Ff,1):this.Ff=Zi(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,2)},set:function(x){x?this.Ff=Ki(this.Ff,2):this.Ff=Zi(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,3)},set:function(x){x?this.Ff=Ki(this.Ff,3):this.Ff=Zi(this.Ff,3)}});var S=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(S!==null)return S},set:function(x){if([0,1,2].indexOf(x)===-1)throw new Error('Invalid value "'+x+'" for attribute Q supplied.');S=x}}),Object.defineProperty(this,"textAlign",{get:function(){var x;switch(S){case 0:default:x="left";break;case 1:x="center";break;case 2:x="right"}return x},configurable:!0,enumerable:!0,set:function(x){switch(x){case"right":case 2:S=2;break;case"center":case 1:S=1;break;case"left":case 0:default:S=0}}})};Ps(Xl,Au);var yh=function(){Xl.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(r){e=r}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(r){e=r}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return _8(t,this.objId,this.scope)},set:function(r){var n,i;i=[],typeof(n=r)=="string"&&(i=function(a,o,l){l||(l=1);for(var u,d=[];u=o.exec(a);)d.push(u[l]);return d}(n,/\((.*?)\)/g)),t=i}}),this.getOptions=function(){return t},this.setOptions=function(r){t=r,this.sort&&t.sort()},this.addOption=function(r){r=(r=r||"").toString(),t.push(r),this.sort&&t.sort()},this.removeOption=function(r,n){for(n=n||!1,r=(r=r||"").toString();t.indexOf(r)!==-1&&(t.splice(t.indexOf(r),1),n!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,18)},set:function(r){r?this.Ff=Ki(this.Ff,18):this.Ff=Zi(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,19)},set:function(r){this.combo===!0&&(r?this.Ff=Ki(this.Ff,19):this.Ff=Zi(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,20)},set:function(r){r?(this.Ff=Ki(this.Ff,20),t.sort()):this.Ff=Zi(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,22)},set:function(r){r?this.Ff=Ki(this.Ff,22):this.Ff=Zi(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,23)},set:function(r){r?this.Ff=Ki(this.Ff,23):this.Ff=Zi(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,27)},set:function(r){r?this.Ff=Ki(this.Ff,27):this.Ff=Zi(this.Ff,27)}}),this.hasAppearanceStream=!1};Ps(yh,Xl);var bh=function(){yh.call(this),this.fontName="helvetica",this.combo=!1};Ps(bh,yh);var wh=function(){bh.call(this),this.combo=!0};Ps(wh,bh);var d1=function(){wh.call(this),this.edit=!0};Ps(d1,wh);var Ia=function(){Xl.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,15)},set:function(r){r?this.Ff=Ki(this.Ff,15):this.Ff=Zi(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,16)},set:function(r){r?this.Ff=Ki(this.Ff,16):this.Ff=Zi(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,17)},set:function(r){r?this.Ff=Ki(this.Ff,17):this.Ff=Zi(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,26)},set:function(r){r?this.Ff=Ki(this.Ff,26):this.Ff=Zi(this.Ff,26)}});var e,t={};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(t).length!==0){var n,i=[];for(n in i.push("<<"),t)i.push("/"+n+" ("+Hf(r(t[n]))+")");return i.push(">>"),i.join(`
474
- `)}},set:function(r){Sn(r)==="object"&&(t=r)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(r){typeof r=="string"&&(t.CA=r)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(r){e=r}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(r){e="/"+r}})};Ps(Ia,Xl);var p1=function(){Ia.call(this),this.pushButton=!0};Ps(p1,Ia);var _h=function(){Ia.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t!==void 0?t:[]}})};Ps(_h,Ia);var j1=function(){var e,t;Xl.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(i){e=i}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(i){t=i}});var r,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var i=function(l){return l};this.scope&&(i=this.scope.internal.getEncryptor(this.objId));var a,o=[];for(a in o.push("<<"),n)o.push("/"+a+" ("+Hf(i(n[a]))+")");return o.push(">>"),o.join(`
475
- `)},set:function(i){Sn(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=Ft.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Ps(j1,Xl),_h.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var r=this.Kids[t];r.appearanceStreamContent=e.createAppearanceStream(r.optionName),r.caption=e.getCA()}},_h.prototype.createOption=function(e){var t=new j1;return t.Parent=this,t.optionName=e,this.Kids.push(t),Tk.call(this.scope,t),t};var g1=function(){Ia.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Ft.CheckBox.createAppearanceStream()};Ps(g1,Ia);var Mf=function(){Xl.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,13)},set:function(t){t?this.Ff=Ki(this.Ff,13):this.Ff=Zi(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,21)},set:function(t){t?this.Ff=Ki(this.Ff,21):this.Ff=Zi(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,23)},set:function(t){t?this.Ff=Ki(this.Ff,23):this.Ff=Zi(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,24)},set:function(t){t?this.Ff=Ki(this.Ff,24):this.Ff=Zi(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,25)},set:function(t){t?this.Ff=Ki(this.Ff,25):this.Ff=Zi(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,26)},set:function(t){t?this.Ff=Ki(this.Ff,26):this.Ff=Zi(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Ps(Mf,Xl);var v1=function(){Mf.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Xi(this.Ff,14)},set:function(e){e?this.Ff=Ki(this.Ff,14):this.Ff=Zi(this.Ff,14)}}),this.password=!0};Ps(v1,Mf);var Ft={CheckBox:{createAppearanceStream:function(){return{N:{On:Ft.CheckBox.YesNormal},D:{On:Ft.CheckBox.YesPushDown,Off:Ft.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=xu(e);t.scope=e.scope;var r=[],n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,i=e.scope.__private__.encodeColorString(e.color),a=bv(e,e.caption);return r.push("0.749023 g"),r.push("0 0 "+hr(Ft.internal.getWidth(e))+" "+hr(Ft.internal.getHeight(e))+" re"),r.push("f"),r.push("BMC"),r.push("q"),r.push("0 0 1 rg"),r.push("/"+n+" "+hr(a.fontSize)+" Tf "+i),r.push("BT"),r.push(a.text),r.push("ET"),r.push("Q"),r.push("EMC"),t.stream=r.join(`
476
- `),t},YesNormal:function(e){var t=xu(e);t.scope=e.scope;var r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color),i=[],a=Ft.internal.getHeight(e),o=Ft.internal.getWidth(e),l=bv(e,e.caption);return i.push("1 g"),i.push("0 0 "+hr(o)+" "+hr(a)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+hr(o-1)+" "+hr(a-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+r+" "+hr(l.fontSize)+" Tf "+n),i.push(l.text),i.push("ET"),i.push("Q"),t.stream=i.join(`
477
- `),t},OffPushDown:function(e){var t=xu(e);t.scope=e.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+hr(Ft.internal.getWidth(e))+" "+hr(Ft.internal.getHeight(e))+" re"),r.push("f"),t.stream=r.join(`
478
- `),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:Ft.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=Ft.RadioButton.Circle.YesNormal,t.D[e]=Ft.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=xu(e);t.scope=e.scope;var r=[],n=Ft.internal.getWidth(e)<=Ft.internal.getHeight(e)?Ft.internal.getWidth(e)/4:Ft.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var i=Ft.internal.Bezier_C,a=Number((n*i).toFixed(5));return r.push("q"),r.push("1 0 0 1 "+zc(Ft.internal.getWidth(e)/2)+" "+zc(Ft.internal.getHeight(e)/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"),t.stream=r.join(`
479
- `),t},YesPushDown:function(e){var t=xu(e);t.scope=e.scope;var r=[],n=Ft.internal.getWidth(e)<=Ft.internal.getHeight(e)?Ft.internal.getWidth(e)/4:Ft.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var i=Number((2*n).toFixed(5)),a=Number((i*Ft.internal.Bezier_C).toFixed(5)),o=Number((n*Ft.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+zc(Ft.internal.getWidth(e)/2)+" "+zc(Ft.internal.getHeight(e)/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 "+zc(Ft.internal.getWidth(e)/2)+" "+zc(Ft.internal.getHeight(e)/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"),t.stream=r.join(`
480
- `),t},OffPushDown:function(e){var t=xu(e);t.scope=e.scope;var r=[],n=Ft.internal.getWidth(e)<=Ft.internal.getHeight(e)?Ft.internal.getWidth(e)/4:Ft.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var i=Number((2*n).toFixed(5)),a=Number((i*Ft.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+zc(Ft.internal.getWidth(e)/2)+" "+zc(Ft.internal.getHeight(e)/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"),t.stream=r.join(`
481
- `),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:Ft.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=Ft.RadioButton.Cross.YesNormal,t.D[e]=Ft.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=xu(e);t.scope=e.scope;var r=[],n=Ft.internal.calculateCross(e);return r.push("q"),r.push("1 1 "+hr(Ft.internal.getWidth(e)-2)+" "+hr(Ft.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(hr(n.x1.x)+" "+hr(n.x1.y)+" m"),r.push(hr(n.x2.x)+" "+hr(n.x2.y)+" l"),r.push(hr(n.x4.x)+" "+hr(n.x4.y)+" m"),r.push(hr(n.x3.x)+" "+hr(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join(`
482
- `),t},YesPushDown:function(e){var t=xu(e);t.scope=e.scope;var r=Ft.internal.calculateCross(e),n=[];return n.push("0.749023 g"),n.push("0 0 "+hr(Ft.internal.getWidth(e))+" "+hr(Ft.internal.getHeight(e))+" re"),n.push("f"),n.push("q"),n.push("1 1 "+hr(Ft.internal.getWidth(e)-2)+" "+hr(Ft.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(hr(r.x1.x)+" "+hr(r.x1.y)+" m"),n.push(hr(r.x2.x)+" "+hr(r.x2.y)+" l"),n.push(hr(r.x4.x)+" "+hr(r.x4.y)+" m"),n.push(hr(r.x3.x)+" "+hr(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join(`
483
- `),t},OffPushDown:function(e){var t=xu(e);t.scope=e.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+hr(Ft.internal.getWidth(e))+" "+hr(Ft.internal.getHeight(e))+" re"),r.push("f"),t.stream=r.join(`
484
- `),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+r}};Ft.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=Ft.internal.getWidth(e),r=Ft.internal.getHeight(e),n=Math.min(t,r);return{x1:{x:(t-n)/2,y:(r-n)/2+n},x2:{x:(t-n)/2+n,y:(r-n)/2},x3:{x:(t-n)/2,y:(r-n)/2},x4:{x:(t-n)/2+n,y:(r-n)/2+n}}}},Ft.internal.getWidth=function(e){var t=0;return Sn(e)==="object"&&(t=Qb(e.Rect[2])),t},Ft.internal.getHeight=function(e){var t=0;return Sn(e)==="object"&&(t=Qb(e.Rect[3])),t};var Tk=Ci.addField=function(e){if(Lk(this,e),!(e instanceof Xl))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};Ci.AcroFormChoiceField=yh,Ci.AcroFormListBox=bh,Ci.AcroFormComboBox=wh,Ci.AcroFormEditBox=d1,Ci.AcroFormButton=Ia,Ci.AcroFormPushButton=p1,Ci.AcroFormRadioButton=_h,Ci.AcroFormCheckBox=g1,Ci.AcroFormTextField=Mf,Ci.AcroFormPasswordField=v1,Ci.AcroFormAppearance=Ft,Ci.AcroForm={ChoiceField:yh,ListBox:bh,ComboBox:wh,EditBox:d1,Button:Ia,PushButton:p1,RadioButton:_h,CheckBox:g1,TextField:Mf,PasswordField:v1,Appearance:Ft},Zt.AcroForm={ChoiceField:yh,ListBox:bh,ComboBox:wh,EditBox:d1,Button:Ia,PushButton:p1,RadioButton:_h,CheckBox:g1,TextField:Mf,PasswordField:v1,Appearance:Ft};Zt.AcroForm;function E8(e){return e.reduce(function(t,r,n){return t[r]=n,t},{})}(function(e){e.__addimage__={};var t="UNKNOWN",r={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},n=e.__addimage__.getImageFileTypeByImageData=function(C,L){var H,G,J,se,U,V=t;if((L=L||t)==="RGBA"||C.data!==void 0&&C.data instanceof Uint8ClampedArray&&"height"in C&&"width"in C)return"RGBA";if(R(C))for(U in r)for(J=r[U],H=0;H<J.length;H+=1){for(se=!0,G=0;G<J[H].length;G+=1)if(J[H][G]!==void 0&&J[H][G]!==C[G]){se=!1;break}if(se===!0){V=U;break}}else for(U in r)for(J=r[U],H=0;H<J.length;H+=1){for(se=!0,G=0;G<J[H].length;G+=1)if(J[H][G]!==void 0&&J[H][G]!==C.charCodeAt(G)){se=!1;break}if(se===!0){V=U;break}}return V===t&&L!==t&&(V=L),V},i=function C(L){for(var H=this.internal.write,G=this.internal.putStream,J=(0,this.internal.getFilters)();J.indexOf("FlateEncode")!==-1;)J.splice(J.indexOf("FlateEncode"),1);L.objectId=this.internal.newObject();var se=[];if(se.push({key:"Type",value:"/XObject"}),se.push({key:"Subtype",value:"/Image"}),se.push({key:"Width",value:L.width}),se.push({key:"Height",value:L.height}),L.colorSpace===S.INDEXED?se.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(L.palette.length/3-1)+" "+("sMask"in L&&L.sMask!==void 0?L.objectId+2:L.objectId+1)+" 0 R]"}):(se.push({key:"ColorSpace",value:"/"+L.colorSpace}),L.colorSpace===S.DEVICE_CMYK&&se.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),se.push({key:"BitsPerComponent",value:L.bitsPerComponent}),"decodeParameters"in L&&L.decodeParameters!==void 0&&se.push({key:"DecodeParms",value:"<<"+L.decodeParameters+">>"}),"transparency"in L&&Array.isArray(L.transparency)){for(var U="",V=0,X=L.transparency.length;V<X;V++)U+=L.transparency[V]+" "+L.transparency[V]+" ";se.push({key:"Mask",value:"["+U+"]"})}L.sMask!==void 0&&se.push({key:"SMask",value:L.objectId+1+" 0 R"});var z=L.filter!==void 0?["/"+L.filter]:void 0;if(G({data:L.data,additionalKeyValues:se,alreadyAppliedFilters:z,objectId:L.objectId}),H("endobj"),"sMask"in L&&L.sMask!==void 0){var D="/Predictor "+L.predictor+" /Colors 1 /BitsPerComponent "+L.bitsPerComponent+" /Columns "+L.width,F={width:L.width,height:L.height,colorSpace:"DeviceGray",bitsPerComponent:L.bitsPerComponent,decodeParameters:D,data:L.sMask};"filter"in L&&(F.filter=L.filter),C.call(this,F)}if(L.colorSpace===S.INDEXED){var q=this.internal.newObject();G({data:N(new Uint8Array(L.palette)),objectId:q}),H("endobj")}},a=function(){var C=this.internal.collections.addImage_images;for(var L in C)i.call(this,C[L])},o=function(){var C,L=this.internal.collections.addImage_images,H=this.internal.write;for(var G in L)H("/I"+(C=L[G]).index,C.objectId,"0","R")},l=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",a),this.internal.events.subscribe("putXobjectDict",o))},u=function(){var C=this.internal.collections.addImage_images;return l.call(this),C},d=function(){return Object.keys(this.internal.collections.addImage_images).length},h=function(C){return typeof e["process"+C.toUpperCase()]=="function"},v=function(C){return Sn(C)==="object"&&C.nodeType===1},p=function(C,L){if(C.nodeName==="IMG"&&C.hasAttribute("src")){var H=""+C.getAttribute("src");if(H.indexOf("data:image/")===0)return Yd(unescape(H).split("base64,").pop());var G=e.loadFile(H,!0);if(G!==void 0)return G}if(C.nodeName==="CANVAS"){if(C.width===0||C.height===0)throw new Error("Given canvas must have data. Canvas width: "+C.width+", height: "+C.height);var J;switch(L){case"PNG":J="image/png";break;case"WEBP":J="image/webp";break;case"JPEG":case"JPG":default:J="image/jpeg"}return Yd(C.toDataURL(J,1).split("base64,").pop())}},f=function(C){var L=this.internal.collections.addImage_images;if(L){for(var H in L)if(C===L[H].alias)return L[H]}},b=function(C,L,H){return C||L||(C=-96,L=-96),C<0&&(C=-1*H.width*72/C/this.internal.scaleFactor),L<0&&(L=-1*H.height*72/L/this.internal.scaleFactor),C===0&&(C=L*H.width/H.height),L===0&&(L=C*H.height/H.width),[C,L]},_=function(C,L,H,G,J,se){var U=b.call(this,H,G,J),V=this.internal.getCoordinateString,X=this.internal.getVerticalCoordinateString,z=u.call(this);if(H=U[0],G=U[1],z[J.index]=J,se){se*=Math.PI/180;var D=Math.cos(se),F=Math.sin(se),q=function(re){return re.toFixed(4)},Q=[q(D),q(F),q(-1*F),q(D),0,0,"cm"]}this.internal.write("q"),se?(this.internal.write([1,"0","0",1,V(C),X(L+G),"cm"].join(" ")),this.internal.write(Q.join(" ")),this.internal.write([V(H),"0","0",V(G),"0","0","cm"].join(" "))):this.internal.write([V(H),"0","0",V(G),V(C),X(L+G),"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")},S=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var x=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},m=e.__addimage__.sHashCode=function(C){var L,H,G=0;if(typeof C=="string")for(H=C.length,L=0;L<H;L++)G=(G<<5)-G+C.charCodeAt(L),G|=0;else if(R(C))for(H=C.byteLength/2,L=0;L<H;L++)G=(G<<5)-G+C[L],G|=0;return G},w=e.__addimage__.validateStringAsBase64=function(C){(C=C||"").toString().trim();var L=!0;return C.length===0&&(L=!1),C.length%4!=0&&(L=!1),/^[A-Za-z0-9+/]+$/.test(C.substr(0,C.length-2))===!1&&(L=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(C.substr(-2))===!1&&(L=!1),L},E=e.__addimage__.extractImageFromDataUrl=function(C){if(C==null||!(C=C.trim()).startsWith("data:"))return null;var L=C.indexOf(",");return L<0?null:C.substring(0,L).trim().endsWith("base64")?C.substring(L+1):null},P=e.__addimage__.supportsArrayBuffer=function(){return typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"};e.__addimage__.isArrayBuffer=function(C){return P()&&C instanceof ArrayBuffer};var R=e.__addimage__.isArrayBufferView=function(C){return P()&&typeof Uint32Array<"u"&&(C instanceof Int8Array||C instanceof Uint8Array||typeof Uint8ClampedArray<"u"&&C instanceof Uint8ClampedArray||C instanceof Int16Array||C instanceof Uint16Array||C instanceof Int32Array||C instanceof Uint32Array||C instanceof Float32Array||C instanceof Float64Array)},k=e.__addimage__.binaryStringToUint8Array=function(C){for(var L=C.length,H=new Uint8Array(L),G=0;G<L;G++)H[G]=C.charCodeAt(G);return H},N=e.__addimage__.arrayBufferToBinaryString=function(C){for(var L="",H=R(C)?C:new Uint8Array(C),G=0;G<H.length;G+=8192)L+=String.fromCharCode.apply(null,H.subarray(G,G+8192));return L};e.addImage=function(){var C,L,H,G,J,se,U,V,X;if(typeof arguments[1]=="number"?(L=t,H=arguments[1],G=arguments[2],J=arguments[3],se=arguments[4],U=arguments[5],V=arguments[6],X=arguments[7]):(L=arguments[1],H=arguments[2],G=arguments[3],J=arguments[4],se=arguments[5],U=arguments[6],V=arguments[7],X=arguments[8]),Sn(C=arguments[0])==="object"&&!v(C)&&"imageData"in C){var z=C;C=z.imageData,L=z.format||L||t,H=z.x||H||0,G=z.y||G||0,J=z.w||z.width||J,se=z.h||z.height||se,U=z.alias||U,V=z.compression||V,X=z.rotation||z.angle||X}var D=this.internal.getFilters();if(V===void 0&&D.indexOf("FlateEncode")!==-1&&(V="SLOW"),isNaN(H)||isNaN(G))throw new Error("Invalid coordinates passed to jsPDF.addImage");l.call(this);var F=M.call(this,C,L,U,V);return _.call(this,H,G,J,se,F,X),this};var M=function(C,L,H,G){var J,se,U;if(typeof C=="string"&&n(C)===t){C=unescape(C);var V=T(C,!1);(V!==""||(V=e.loadFile(C,!0))!==void 0)&&(C=V)}if(v(C)&&(C=p(C,L)),L=n(C,L),!h(L))throw new Error("addImage does not support files of type '"+L+"', please ensure that a plugin for '"+L+"' support is added.");if(((U=H)==null||U.length===0)&&(H=function(X){return typeof X=="string"||R(X)?m(X):R(X.data)?m(X.data):null}(C)),(J=f.call(this,H))||(P()&&(C instanceof Uint8Array||L==="RGBA"||(se=C,C=k(C))),J=this["process"+L.toUpperCase()](C,d.call(this),H,function(X){return X&&typeof X=="string"&&(X=X.toUpperCase()),X in e.image_compression?X:x.NONE}(G),se)),!J)throw new Error("An unknown error occurred whilst processing the image.");return J},T=e.__addimage__.convertBase64ToBinaryString=function(C,L){L=typeof L!="boolean"||L;var H,G="";if(typeof C=="string"){var J;H=(J=E(C))!==null&&J!==void 0?J:C;try{G=Yd(H)}catch(se){if(L)throw w(H)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+se.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return G};e.getImageProperties=function(C){var L,H,G="";if(v(C)&&(C=p(C)),typeof C=="string"&&n(C)===t&&((G=T(C,!1))===""&&(G=e.loadFile(C)||""),C=G),H=n(C),!h(H))throw new Error("addImage does not support files of type '"+H+"', please ensure that a plugin for '"+H+"' support is added.");if(!P()||C instanceof Uint8Array||(C=k(C)),!(L=this["process"+H.toUpperCase()](C)))throw new Error("An unknown error occurred whilst processing the image");return L.fileType=H,L}})(Zt.API),function(e){var t=function(r){if(r!==void 0&&r!="")return!0};Zt.API.events.push(["addPage",function(r){this.internal.getPageInfo(r.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(r){for(var n,i,a,o=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString,u=this.internal.getPageInfoByObjId(r.objId),d=r.pageContext.annotations,h=!1,v=0;v<d.length&&!h;v++)switch((n=d[v]).type){case"link":(t(n.options.url)||t(n.options.pageNumber))&&(h=!0);break;case"reference":case"text":case"freetext":h=!0}if(h!=0){this.internal.write("/Annots [");for(var p=0;p<d.length;p++){n=d[p];var f=this.internal.pdfEscape,b=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(),S=this.internal.newAdditionalObject(),x=this.internal.getEncryptor(_.objId),m=n.title||"Note";a="<</Type /Annot /Subtype /Text "+(i="/Rect ["+o(n.bounds.x)+" "+l(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w)+" "+l(n.bounds.y)+"] ")+"/Contents ("+f(x(n.contents))+")",a+=" /Popup "+S.objId+" 0 R",a+=" /P "+u.objId+" 0 R",a+=" /T ("+f(x(m))+") >>",_.content=a;var w=_.objId+" 0 R";a="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+o(n.bounds.x+30)+" "+l(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w+30)+" "+l(n.bounds.y)+"] ")+" /Parent "+w,n.open&&(a+=" /Open true"),a+=" >>",S.content=a,this.internal.write(_.objId,"0 R",S.objId,"0 R");break;case"freetext":i="/Rect ["+o(n.bounds.x)+" "+l(n.bounds.y)+" "+o(n.bounds.x+n.bounds.w)+" "+l(n.bounds.y+n.bounds.h)+"] ";var E=n.color||"#000000";a="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+f(b(n.contents))+")",a+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+E+")",a+=" /Border [0 0 0]",a+=" >>",this.internal.write(a);break;case"link":if(n.options.name){var P=this.annotations._nameMap[n.options.name];n.options.pageNumber=P.page,n.options.top=P.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 ("+f(b(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;case"XYZ":default:var R=l(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),a+=" /XYZ "+n.options.left+" "+R+" "+n.options.zoom+"]"}a!=""&&(a+=" >>",this.internal.write(a))}}this.internal.write("]")}}]),e.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)}},e.link=function(r,n,i,a,o){var l=this.internal.getCurrentPageInfo(),u=this.internal.getCoordinateString,d=this.internal.getVerticalCoordinateString;l.pageContext.annotations.push({finalBounds:{x:u(r),y:d(n),w:u(r+i),h:d(n+a)},options:o,type:"link"})},e.textWithLink=function(r,n,i,a){var o,l,u=this.getTextWidth(r),d=this.internal.getLineHeight()/this.internal.scaleFactor;if(a.maxWidth!==void 0){l=a.maxWidth;var h=this.splitTextToSize(r,l).length;o=Math.ceil(d*h)}else l=u,o=d;return this.text(r,n,i,a),i+=.2*d,a.align==="center"&&(n-=u/2),a.align==="right"&&(n-=u),this.link(n,i-d,l,o,a),u},e.getTextWidth=function(r){var n=this.internal.getFontSize();return this.getStringUnitWidth(r)*n/this.internal.scaleFactor}}(Zt.API),function(e){var t={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];e.__arabicParser__={};var a=e.__arabicParser__.isInArabicSubstitutionA=function(_){return t[_.charCodeAt(0)]!==void 0},o=e.__arabicParser__.isArabicLetter=function(_){return typeof _=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(_)},l=e.__arabicParser__.isArabicEndLetter=function(_){return o(_)&&a(_)&&t[_.charCodeAt(0)].length<=2},u=e.__arabicParser__.isArabicAlfLetter=function(_){return o(_)&&i.indexOf(_.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(_){return o(_)&&a(_)&&t[_.charCodeAt(0)].length>=1};var d=e.__arabicParser__.arabicLetterHasFinalForm=function(_){return o(_)&&a(_)&&t[_.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(_){return o(_)&&a(_)&&t[_.charCodeAt(0)].length>=3};var h=e.__arabicParser__.arabicLetterHasMedialForm=function(_){return o(_)&&a(_)&&t[_.charCodeAt(0)].length==4},v=e.__arabicParser__.resolveLigatures=function(_){var S=0,x=r,m="",w=0;for(S=0;S<_.length;S+=1)x[_.charCodeAt(S)]!==void 0?(w++,typeof(x=x[_.charCodeAt(S)])=="number"&&(m+=String.fromCharCode(x),x=r,w=0),S===_.length-1&&(x=r,m+=_.charAt(S-(w-1)),S-=w-1,w=0)):(x=r,m+=_.charAt(S-w),S-=w,w=0);return m};e.__arabicParser__.isArabicDiacritic=function(_){return _!==void 0&&n[_.charCodeAt(0)]!==void 0};var p=e.__arabicParser__.getCorrectForm=function(_,S,x){return o(_)?a(_)===!1?-1:!d(_)||!o(S)&&!o(x)||!o(x)&&l(S)||l(_)&&!o(S)||l(_)&&u(S)||l(_)&&l(S)?0:h(_)&&o(S)&&!l(S)&&o(x)&&d(x)?3:l(_)||!o(x)?1:2:-1},f=function(_){var S=0,x=0,m=0,w="",E="",P="",R=(_=_||"").split("\\s+"),k=[];for(S=0;S<R.length;S+=1){for(k.push(""),x=0;x<R[S].length;x+=1)w=R[S][x],E=R[S][x-1],P=R[S][x+1],o(w)?(m=p(w,E,P),k[S]+=m!==-1?String.fromCharCode(t[w.charCodeAt(0)][m]):w):k[S]+=w;k[S]=v(k[S])}return k.join(" ")},b=e.__arabicParser__.processArabic=e.processArabic=function(){var _,S=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,x=[];if(Array.isArray(S)){var m=0;for(x=[],m=0;m<S.length;m+=1)Array.isArray(S[m])?x.push([f(S[m][0]),S[m][1],S[m][2]]):x.push([f(S[m])]);_=x}else _=f(S);return typeof arguments[0]=="string"?_:(arguments[0].text=_,arguments[0])};e.events.push(["preProcessText",b])}(Zt.API),Zt.API.autoPrint=function(e){var t;switch((e=e||{}).variant=e.variant||"non-conform",e.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){t=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 "+t+" 0 R")})}return this},function(e){var t=function(){var r=void 0;Object.defineProperty(this,"pdf",{get:function(){return r},set:function(l){r=l}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(l){n=isNaN(l)||Number.isInteger(l)===!1||l<0?150:l,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(l){i=isNaN(l)||Number.isInteger(l)===!1||l<0?300:l,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var a=[];Object.defineProperty(this,"childNodes",{get:function(){return a},set:function(l){a=l}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(l){o=l}}),Object.defineProperty(this,"parentNode",{})};t.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},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])}(Zt.API),function(e){var t={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({},t),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 d=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return d},set:function(_){d=_}});var h=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return h},set:function(_){h=_}});var v=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return v},set:function(_){v=_}});var p=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return p},set:function(_){p=_}});var f=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return f},set:function(_){f=_}});var b=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return b},set:function(_){b=_}}),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]},e.setHeaderFunction=function(u){return n.call(this),this.internal.__cell__.headerFunction=typeof u=="function"?u:void 0,this},e.getTextDimensions=function(u,d){n.call(this);var h=(d=d||{}).fontSize||this.getFontSize(),v=d.font||this.getFont(),p=d.scaleFactor||this.internal.scaleFactor,f=0,b=0,_=0,S=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 x=d.maxWidth;x>0?typeof u=="string"?u=this.splitTextToSize(u,x):Object.prototype.toString.call(u)==="[object Array]"&&(u=u.reduce(function(w,E){return w.concat(S.splitTextToSize(E,x))},[])):u=Array.isArray(u)?u:[u];for(var m=0;m<u.length;m++)f<(_=this.getStringUnitWidth(u[m],{font:v})*h)&&(f=_);return f!==0&&(b=u.length),{w:f/=p,h:Math.max((b*h*this.getLineHeightFactor()-h*(this.getLineHeightFactor()-1))/p,0)}},e.cellAddPage=function(){n.call(this),this.addPage();var u=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new a(u.left,u.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var o=e.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 d=this.internal.__cell__.lastCell,h=this.internal.__cell__.padding,v=this.internal.__cell__.margins||t,p=this.internal.__cell__.tableHeaderRow,f=this.internal.__cell__.printHeaders;return d.lineNumber!==void 0&&(d.lineNumber===u.lineNumber?(u.x=(d.x||0)+(d.width||0),u.y=d.y||0):d.y+d.height+u.height+v.bottom>this.getPageHeight()?(this.cellAddPage(),u.y=v.top,f&&p&&(this.printHeaderRow(u.lineNumber,!0),u.y+=p[0].height)):u.y=d.y+d.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-h,u.y+h,{align:"right",baseline:"top"}):u.align==="center"?this.text(u.text,u.x+u.width/2,u.y+h,{align:"center",baseline:"top",maxWidth:u.width-h-h}):this.text(u.text,u.x+h,u.y+h,{align:"left",baseline:"top",maxWidth:u.width-h-h})),this.internal.__cell__.lastCell=u,this};e.table=function(u,d,h,v,p){if(n.call(this),!h)throw new Error("No data for PDF table.");var f,b,_,S,x=[],m=[],w=[],E={},P={},R=[],k=[],N=(p=p||{}).autoSize||!1,M=p.printHeaders!==!1,T=p.css&&p.css["font-size"]!==void 0?16*p.css["font-size"]:p.fontSize||12,C=p.margins||Object.assign({width:this.getPageWidth()},t),L=typeof p.padding=="number"?p.padding:3,H=p.headerBackgroundColor||"#c8c8c8",G=p.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=M,this.internal.__cell__.margins=C,this.internal.__cell__.table_font_size=T,this.internal.__cell__.padding=L,this.internal.__cell__.headerBackgroundColor=H,this.internal.__cell__.headerTextColor=G,this.setFontSize(T),v==null)m=x=Object.keys(h[0]),w=x.map(function(){return"left"});else if(Array.isArray(v)&&Sn(v[0])==="object")for(x=v.map(function(z){return z.name}),m=v.map(function(z){return z.prompt||z.name||""}),w=v.map(function(z){return z.align||"left"}),f=0;f<v.length;f+=1)P[v[f].name]=v[f].width*(19.049976/25.4);else Array.isArray(v)&&typeof v[0]=="string"&&(m=x=v,w=x.map(function(){return"left"}));if(N||Array.isArray(v)&&typeof v[0]=="string")for(f=0;f<x.length;f+=1){for(E[S=x[f]]=h.map(function(z){return z[S]}),this.setFont(void 0,"bold"),R.push(this.getTextDimensions(m[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),b=E[S],this.setFont(void 0,"normal"),_=0;_<b.length;_+=1)R.push(this.getTextDimensions(b[_],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);P[S]=Math.max.apply(null,R)+L+L,R=[]}if(M){var J={};for(f=0;f<x.length;f+=1)J[x[f]]={},J[x[f]].text=m[f],J[x[f]].align=w[f];var se=l.call(this,J,P);k=x.map(function(z){return new a(u,d,P[z],se,J[z].text,void 0,J[z].align)}),this.setTableHeaderRow(k),this.printHeaderRow(1,!1)}var U=v.reduce(function(z,D){return z[D.name]=D.align,z},{});for(f=0;f<h.length;f+=1){"rowStart"in p&&p.rowStart instanceof Function&&p.rowStart({row:f,data:h[f]},this);var V=l.call(this,h[f],P);for(_=0;_<x.length;_+=1){var X=h[f][x[_]];"cellStart"in p&&p.cellStart instanceof Function&&p.cellStart({row:f,col:_,data:X},this),o.call(this,new a(u,d,P[x[_]],V,X,f+2,U[x[_]]))}}return this.internal.__cell__.table_x=u,this.internal.__cell__.table_y=d,this};var l=function(u,d){var h=this.internal.__cell__.padding,v=this.internal.__cell__.table_font_size,p=this.internal.scaleFactor;return Object.keys(u).map(function(f){var b=u[f];return this.splitTextToSize(b.hasOwnProperty("text")?b.text:b,d[f]-h-h)},this).map(function(f){return this.getLineHeightFactor()*f.length*v/p+h+h},this).reduce(function(f,b){return Math.max(f,b)},0)};e.setTableHeaderRow=function(u){n.call(this),this.internal.__cell__.tableHeaderRow=u},e.printHeaderRow=function(u,d){if(n.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var h;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 p=[],f=0;f<this.internal.__cell__.tableHeaderRow.length;f+=1){h=this.internal.__cell__.tableHeaderRow[f].clone(),d&&(h.y=this.internal.__cell__.margins.top||0,p.push(h)),h.lineNumber=u;var b=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),o.call(this,h),this.setTextColor(b)}p.length>0&&this.setTableHeaderRow(p),this.setFont(void 0,"normal"),r=!1}}(Zt.API);var P8={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},A8=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],wv=E8(A8),O8=[100,200,300,400,500,600,700,800,900],Rk=E8(O8);function _v(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),r=function(a){return P8[a=a||"normal"]?a:"normal"}(e.style),n=function(a){if(!a)return 400;if(typeof a=="number")return a>=100&&a<=900&&a%100==0?a:400;if(/^\d00$/.test(a))return parseInt(a);switch(a){case"bold":return 700;case"normal":default:return 400}}(e.weight),i=function(a){return typeof wv[a=a||"normal"]=="number"?a:"normal"}(e.stretch);return{family:t,style:r,weight:n,stretch:i,src:e.src||[],ref:e.ref||{name:t,style:[i,r,n].join(" ")}}}function Jb(e,t,r,n){var i;for(i=r;i>=0&&i<t.length;i+=n)if(e[t[i]])return e[t[i]];for(i=r;i>=0&&i<t.length;i-=n)if(e[t[i]])return e[t[i]]}var Mk={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},e4={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function t4(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function Ik(e,t,r){for(var n=(r=r||{}).defaultFontFamily||"times",i=Object.assign({},Mk,r.genericFontFamilies||{}),a=null,o=null,l=0;l<t.length;++l)if(i[(a=_v(t[l])).family]&&(a.family=i[a.family]),e.hasOwnProperty(a.family)){o=e[a.family];break}if(!(o=o||e[n]))throw new Error("Could not find a font-family for the rule '"+t4(a)+"' and default family '"+n+"'.");if(o=function(u,d){if(d[u])return d[u];var h=wv[u],v=h<=wv.normal?-1:1,p=Jb(d,A8,h,v);if(!p)throw new Error("Could not find a matching font-stretch value for "+u);return p}(a.stretch,o),o=function(u,d){if(d[u])return d[u];for(var h=P8[u],v=0;v<h.length;++v)if(d[h[v]])return d[h[v]];throw new Error("Could not find a matching font-style for "+u)}(a.style,o),!(o=function(u,d){if(d[u])return d[u];if(u===400&&d[500])return d[500];if(u===500&&d[400])return d[400];var h=Rk[u],v=Jb(d,O8,h,u<400?-1:1);if(!v)throw new Error("Could not find a matching font-weight for value "+u);return v}(a.weight,o)))throw new Error("Failed to resolve a font for the rule '"+t4(a)+"'.");return o}function r4(e){return e.trimLeft()}function jk(e,t){for(var r=0;r<e.length;){if(e.charAt(r)===t)return[e.substring(0,r),e.substring(r+1)];r+=1}return null}function Fk(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return t===null?null:[t[0],e.substring(t[0].length)]}var r1,n4,i4,D2=["times"];(function(e){var t,r,n,i,a,o,l,u,d,h=function(F){return F=F||{},this.isStrokeTransparent=F.isStrokeTransparent||!1,this.strokeOpacity=F.strokeOpacity||1,this.strokeStyle=F.strokeStyle||"#000000",this.fillStyle=F.fillStyle||"#000000",this.isFillTransparent=F.isFillTransparent||!1,this.fillOpacity=F.fillOpacity||1,this.font=F.font||"10px sans-serif",this.textBaseline=F.textBaseline||"alphabetic",this.textAlign=F.textAlign||"left",this.lineWidth=F.lineWidth||1,this.lineJoin=F.lineJoin||"miter",this.lineCap=F.lineCap||"butt",this.path=F.path||[],this.transform=F.transform!==void 0?F.transform.clone():new u,this.globalCompositeOperation=F.globalCompositeOperation||"normal",this.globalAlpha=F.globalAlpha||1,this.clip_path=F.clip_path||[],this.currentPoint=F.currentPoint||new o,this.miterLimit=F.miterLimit||10,this.lastPoint=F.lastPoint||new o,this.lineDashOffset=F.lineDashOffset||0,this.lineDash=F.lineDash||[],this.margin=F.margin||[0,0,0,0],this.prevPageLastElemOffset=F.prevPageLastElemOffset||0,this.ignoreClearRect=typeof F.ignoreClearRect!="boolean"||F.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new v(this),t=this.internal.f2,r=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,a=this.internal.getVerticalCoordinate,o=this.internal.Point,l=this.internal.Rectangle,u=this.internal.Matrix,d=new h}]);var v=function(F){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var q=F;Object.defineProperty(this,"pdf",{get:function(){return q}});var Q=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return Q},set:function(Se){Q=!!Se}});var re=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return re},set:function(Se){re=!!Se}});var Y=0;Object.defineProperty(this,"posX",{get:function(){return Y},set:function(Se){isNaN(Se)||(Y=Se)}});var ee=0;Object.defineProperty(this,"posY",{get:function(){return ee},set:function(Se){isNaN(Se)||(ee=Se)}}),Object.defineProperty(this,"margin",{get:function(){return d.margin},set:function(Se){var le;typeof Se=="number"?le=[Se,Se,Se,Se]:((le=new Array(4))[0]=Se[0],le[1]=Se.length>=2?Se[1]:le[0],le[2]=Se.length>=3?Se[2]:le[0],le[3]=Se.length>=4?Se[3]:le[1]),d.margin=le}});var ae=!1;Object.defineProperty(this,"autoPaging",{get:function(){return ae},set:function(Se){ae=Se}});var ue=0;Object.defineProperty(this,"lastBreak",{get:function(){return ue},set:function(Se){ue=Se}});var ce=[];Object.defineProperty(this,"pageBreaks",{get:function(){return ce},set:function(Se){ce=Se}}),Object.defineProperty(this,"ctx",{get:function(){return d},set:function(Se){Se instanceof h&&(d=Se)}}),Object.defineProperty(this,"path",{get:function(){return d.path},set:function(Se){d.path=Se}});var pe=[];Object.defineProperty(this,"ctxStack",{get:function(){return pe},set:function(Se){pe=Se}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(Se){var le;le=p(Se),this.ctx.fillStyle=le.style,this.ctx.isFillTransparent=le.a===0,this.ctx.fillOpacity=le.a,this.pdf.setFillColor(le.r,le.g,le.b,{a:le.a}),this.pdf.setTextColor(le.r,le.g,le.b,{a:le.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(Se){var le=p(Se);this.ctx.strokeStyle=le.style,this.ctx.isStrokeTransparent=le.a===0,this.ctx.strokeOpacity=le.a,le.a===0?this.pdf.setDrawColor(255,255,255):(le.a,this.pdf.setDrawColor(le.r,le.g,le.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(Se){["butt","round","square"].indexOf(Se)!==-1&&(this.ctx.lineCap=Se,this.pdf.setLineCap(Se))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(Se){isNaN(Se)||(this.ctx.lineWidth=Se,this.pdf.setLineWidth(Se))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(Se){["bevel","round","miter"].indexOf(Se)!==-1&&(this.ctx.lineJoin=Se,this.pdf.setLineJoin(Se))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(Se){isNaN(Se)||(this.ctx.miterLimit=Se,this.pdf.setMiterLimit(Se))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(Se){this.ctx.textBaseline=Se}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(Se){["right","end","center","left","start"].indexOf(Se)!==-1&&(this.ctx.textAlign=Se)}});var Ae=null;function Ce(Se,le){if(Ae===null){var Ee=function(xe){var ye=[];return Object.keys(xe).forEach(function(Ne){xe[Ne].forEach(function(Te){var ge=null;switch(Te){case"bold":ge={family:Ne,weight:"bold"};break;case"italic":ge={family:Ne,style:"italic"};break;case"bolditalic":ge={family:Ne,weight:"bold",style:"italic"};break;case"":case"normal":ge={family:Ne}}ge!==null&&(ge.ref={name:Ne,style:Te},ye.push(ge))})}),ye}(Se.getFontList());Ae=function(xe){for(var ye={},Ne=0;Ne<xe.length;++Ne){var Te=_v(xe[Ne]),ge=Te.family,Re=Te.stretch,Be=Te.style,Qe=Te.weight;ye[ge]=ye[ge]||{},ye[ge][Re]=ye[ge][Re]||{},ye[ge][Re][Be]=ye[ge][Re][Be]||{},ye[ge][Re][Be][Qe]=Te}return ye}(Ee.concat(le))}return Ae}var ke=null;Object.defineProperty(this,"fontFaces",{get:function(){return ke},set:function(Se){Ae=null,ke=Se}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(Se){var le;if(this.ctx.font=Se,(le=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(Se))!==null){var Ee=le[1];le[2];var xe=le[3],ye=le[4];le[5];var Ne=le[6],Te=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(ye)[2];ye=Math.floor(Te==="px"?parseFloat(ye)*this.pdf.internal.scaleFactor:Te==="em"?parseFloat(ye)*this.pdf.getFontSize():parseFloat(ye)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(ye);var ge=function(St){var pt,ut,Br=[],rr=St.trim();if(rr==="")return D2;if(rr in e4)return[e4[rr]];for(;rr!=="";){switch(ut=null,pt=(rr=r4(rr)).charAt(0)){case'"':case"'":ut=jk(rr.substring(1),pt);break;default:ut=Fk(rr)}if(ut===null||(Br.push(ut[0]),(rr=r4(ut[1]))!==""&&rr.charAt(0)!==","))return D2;rr=rr.replace(/^,/,"")}return Br}(Ne);if(this.fontFaces){var Re=Ik(Ce(this.pdf,this.fontFaces),ge.map(function(St){return{family:St,stretch:"normal",weight:xe,style:Ee}}));this.pdf.setFont(Re.ref.name,Re.ref.style)}else{var Be="";(xe==="bold"||parseInt(xe,10)>=700||Ee==="bold")&&(Be="bold"),Ee==="italic"&&(Be+="italic"),Be.length===0&&(Be="normal");for(var Qe="",ct={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"},mt=0;mt<ge.length;mt++){if(this.pdf.internal.getFont(ge[mt],Be,{noFallback:!0,disableWarning:!0})!==void 0){Qe=ge[mt];break}if(Be==="bolditalic"&&this.pdf.internal.getFont(ge[mt],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Qe=ge[mt],Be="bold";else if(this.pdf.internal.getFont(ge[mt],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Qe=ge[mt],Be="normal";break}}if(Qe===""){for(var gt=0;gt<ge.length;gt++)if(ct[ge[gt]]){Qe=ct[ge[gt]];break}}Qe=Qe===""?"Times":Qe,this.pdf.setFont(Qe,Be)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(Se){this.ctx.globalCompositeOperation=Se}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(Se){this.ctx.globalAlpha=Se}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(Se){this.ctx.lineDashOffset=Se,D.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(Se){this.ctx.lineDash=Se,D.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(Se){this.ctx.ignoreClearRect=!!Se}})};v.prototype.setLineDash=function(F){this.lineDash=F},v.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},v.prototype.fill=function(){E.call(this,"fill",!1)},v.prototype.stroke=function(){E.call(this,"stroke",!1)},v.prototype.beginPath=function(){this.path=[{type:"begin"}]},v.prototype.moveTo=function(F,q){if(isNaN(F)||isNaN(q))throw qn.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var Q=this.ctx.transform.applyToPoint(new o(F,q));this.path.push({type:"mt",x:Q.x,y:Q.y}),this.ctx.lastPoint=new o(F,q)},v.prototype.closePath=function(){var F=new o(0,0),q=0;for(q=this.path.length-1;q!==-1;q--)if(this.path[q].type==="begin"&&Sn(this.path[q+1])==="object"&&typeof this.path[q+1].x=="number"){F=new o(this.path[q+1].x,this.path[q+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(F.x,F.y)},v.prototype.lineTo=function(F,q){if(isNaN(F)||isNaN(q))throw qn.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var Q=this.ctx.transform.applyToPoint(new o(F,q));this.path.push({type:"lt",x:Q.x,y:Q.y}),this.ctx.lastPoint=new o(Q.x,Q.y)},v.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),E.call(this,null,!0)},v.prototype.quadraticCurveTo=function(F,q,Q,re){if(isNaN(Q)||isNaN(re)||isNaN(F)||isNaN(q))throw qn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var Y=this.ctx.transform.applyToPoint(new o(Q,re)),ee=this.ctx.transform.applyToPoint(new o(F,q));this.path.push({type:"qct",x1:ee.x,y1:ee.y,x:Y.x,y:Y.y}),this.ctx.lastPoint=new o(Y.x,Y.y)},v.prototype.bezierCurveTo=function(F,q,Q,re,Y,ee){if(isNaN(Y)||isNaN(ee)||isNaN(F)||isNaN(q)||isNaN(Q)||isNaN(re))throw qn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var ae=this.ctx.transform.applyToPoint(new o(Y,ee)),ue=this.ctx.transform.applyToPoint(new o(F,q)),ce=this.ctx.transform.applyToPoint(new o(Q,re));this.path.push({type:"bct",x1:ue.x,y1:ue.y,x2:ce.x,y2:ce.y,x:ae.x,y:ae.y}),this.ctx.lastPoint=new o(ae.x,ae.y)},v.prototype.arc=function(F,q,Q,re,Y,ee){if(isNaN(F)||isNaN(q)||isNaN(Q)||isNaN(re)||isNaN(Y))throw qn.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(ee=!!ee,!this.ctx.transform.isIdentity){var ae=this.ctx.transform.applyToPoint(new o(F,q));F=ae.x,q=ae.y;var ue=this.ctx.transform.applyToPoint(new o(0,Q)),ce=this.ctx.transform.applyToPoint(new o(0,0));Q=Math.sqrt(Math.pow(ue.x-ce.x,2)+Math.pow(ue.y-ce.y,2))}Math.abs(Y-re)>=2*Math.PI&&(re=0,Y=2*Math.PI),this.path.push({type:"arc",x:F,y:q,radius:Q,startAngle:re,endAngle:Y,counterclockwise:ee})},v.prototype.arcTo=function(F,q,Q,re,Y){throw new Error("arcTo not implemented.")},v.prototype.rect=function(F,q,Q,re){if(isNaN(F)||isNaN(q)||isNaN(Q)||isNaN(re))throw qn.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(F,q),this.lineTo(F+Q,q),this.lineTo(F+Q,q+re),this.lineTo(F,q+re),this.lineTo(F,q),this.lineTo(F+Q,q),this.lineTo(F,q)},v.prototype.fillRect=function(F,q,Q,re){if(isNaN(F)||isNaN(q)||isNaN(Q)||isNaN(re))throw qn.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!f.call(this)){var Y={};this.lineCap!=="butt"&&(Y.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(Y.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(F,q,Q,re),this.fill(),Y.hasOwnProperty("lineCap")&&(this.lineCap=Y.lineCap),Y.hasOwnProperty("lineJoin")&&(this.lineJoin=Y.lineJoin)}},v.prototype.strokeRect=function(F,q,Q,re){if(isNaN(F)||isNaN(q)||isNaN(Q)||isNaN(re))throw qn.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");b.call(this)||(this.beginPath(),this.rect(F,q,Q,re),this.stroke())},v.prototype.clearRect=function(F,q,Q,re){if(isNaN(F)||isNaN(q)||isNaN(Q)||isNaN(re))throw qn.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(F,q,Q,re))},v.prototype.save=function(F){F=typeof F!="boolean"||F;for(var q=this.pdf.internal.getCurrentPageInfo().pageNumber,Q=0;Q<this.pdf.internal.getNumberOfPages();Q++)this.pdf.setPage(Q+1),this.pdf.internal.out("q");if(this.pdf.setPage(q),F){this.ctx.fontSize=this.pdf.internal.getFontSize();var re=new h(this.ctx);this.ctxStack.push(this.ctx),this.ctx=re}},v.prototype.restore=function(F){F=typeof F!="boolean"||F;for(var q=this.pdf.internal.getCurrentPageInfo().pageNumber,Q=0;Q<this.pdf.internal.getNumberOfPages();Q++)this.pdf.setPage(Q+1),this.pdf.internal.out("Q");this.pdf.setPage(q),F&&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 p=function(F){var q,Q,re,Y;if(F.isCanvasGradient===!0&&(F=F.getColor()),!F)return{r:0,g:0,b:0,a:0,style:F};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(F))q=0,Q=0,re=0,Y=0;else{var ee=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(F);if(ee!==null)q=parseInt(ee[1]),Q=parseInt(ee[2]),re=parseInt(ee[3]),Y=1;else if((ee=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(F))!==null)q=parseInt(ee[1]),Q=parseInt(ee[2]),re=parseInt(ee[3]),Y=parseFloat(ee[4]);else{if(Y=1,typeof F=="string"&&F.charAt(0)!=="#"){var ae=new y8(F);F=ae.ok?ae.toHex():"#000000"}F.length===4?(q=F.substring(1,2),q+=q,Q=F.substring(2,3),Q+=Q,re=F.substring(3,4),re+=re):(q=F.substring(1,3),Q=F.substring(3,5),re=F.substring(5,7)),q=parseInt(q,16),Q=parseInt(Q,16),re=parseInt(re,16)}}return{r:q,g:Q,b:re,a:Y,style:F}},f=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},b=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};v.prototype.fillText=function(F,q,Q,re){if(isNaN(q)||isNaN(Q)||typeof F!="string")throw qn.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(re=isNaN(re)?void 0:re,!f.call(this)){var Y=V(this.ctx.transform.rotation),ee=this.ctx.transform.scaleX;L.call(this,{text:F,x:q,y:Q,scale:ee,angle:Y,align:this.textAlign,maxWidth:re})}},v.prototype.strokeText=function(F,q,Q,re){if(isNaN(q)||isNaN(Q)||typeof F!="string")throw qn.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!b.call(this)){re=isNaN(re)?void 0:re;var Y=V(this.ctx.transform.rotation),ee=this.ctx.transform.scaleX;L.call(this,{text:F,x:q,y:Q,scale:ee,renderingMode:"stroke",angle:Y,align:this.textAlign,maxWidth:re})}},v.prototype.measureText=function(F){if(typeof F!="string")throw qn.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var q=this.pdf,Q=this.pdf.internal.scaleFactor,re=q.internal.getFontSize(),Y=q.getStringUnitWidth(F)*re/q.internal.scaleFactor,ee=function(ae){var ue=(ae=ae||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return ue}}),this};return new ee({width:Y*=Math.round(96*Q/72*1e4)/1e4})},v.prototype.scale=function(F,q){if(isNaN(F)||isNaN(q))throw qn.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var Q=new u(F,0,0,q,0,0);this.ctx.transform=this.ctx.transform.multiply(Q)},v.prototype.rotate=function(F){if(isNaN(F))throw qn.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var q=new u(Math.cos(F),Math.sin(F),-Math.sin(F),Math.cos(F),0,0);this.ctx.transform=this.ctx.transform.multiply(q)},v.prototype.translate=function(F,q){if(isNaN(F)||isNaN(q))throw qn.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var Q=new u(1,0,0,1,F,q);this.ctx.transform=this.ctx.transform.multiply(Q)},v.prototype.transform=function(F,q,Q,re,Y,ee){if(isNaN(F)||isNaN(q)||isNaN(Q)||isNaN(re)||isNaN(Y)||isNaN(ee))throw qn.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var ae=new u(F,q,Q,re,Y,ee);this.ctx.transform=this.ctx.transform.multiply(ae)},v.prototype.setTransform=function(F,q,Q,re,Y,ee){F=isNaN(F)?1:F,q=isNaN(q)?0:q,Q=isNaN(Q)?0:Q,re=isNaN(re)?1:re,Y=isNaN(Y)?0:Y,ee=isNaN(ee)?0:ee,this.ctx.transform=new u(F,q,Q,re,Y,ee)};var _=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};v.prototype.drawImage=function(F,q,Q,re,Y,ee,ae,ue,ce){var pe=this.pdf.getImageProperties(F),Ae=1,Ce=1,ke=1,Se=1;re!==void 0&&ue!==void 0&&(ke=ue/re,Se=ce/Y,Ae=pe.width/re*ue/re,Ce=pe.height/Y*ce/Y),ee===void 0&&(ee=q,ae=Q,q=0,Q=0),re!==void 0&&ue===void 0&&(ue=re,ce=Y),re===void 0&&ue===void 0&&(ue=pe.width,ce=pe.height);for(var le,Ee=this.ctx.transform.decompose(),xe=V(Ee.rotate.shx),ye=new u,Ne=(ye=(ye=(ye=ye.multiply(Ee.translate)).multiply(Ee.skew)).multiply(Ee.scale)).applyToRectangle(new l(ee-q*ke,ae-Q*Se,re*Ae,Y*Ce)),Te=S.call(this,Ne),ge=[],Re=0;Re<Te.length;Re+=1)ge.indexOf(Te[Re])===-1&&ge.push(Te[Re]);if(w(ge),this.autoPaging)for(var Be=ge[0],Qe=ge[ge.length-1],ct=Be;ct<Qe+1;ct++){this.pdf.setPage(ct);var mt=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],gt=ct===1?this.posY+this.margin[0]:this.margin[0],St=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],pt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ut=ct===1?0:St+(ct-2)*pt;if(this.ctx.clip_path.length!==0){var Br=this.path;le=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=m(le,this.posX+this.margin[3],-ut+gt+this.ctx.prevPageLastElemOffset),P.call(this,"fill",!0),this.path=Br}var rr=JSON.parse(JSON.stringify(Ne));rr=m([rr],this.posX+this.margin[3],-ut+gt+this.ctx.prevPageLastElemOffset)[0];var Nr=(ct>Be||ct<Qe)&&_.call(this);Nr&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],mt,pt,null).clip().discardPath()),this.pdf.addImage(F,"JPEG",rr.x,rr.y,rr.w,rr.h,null,null,xe),Nr&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(F,"JPEG",Ne.x,Ne.y,Ne.w,Ne.h,null,null,xe)};var S=function(F,q,Q){var re=[];q=q||this.pdf.internal.pageSize.width,Q=Q||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var Y=this.posY+this.ctx.prevPageLastElemOffset;switch(F.type){default:case"mt":case"lt":re.push(Math.floor((F.y+Y)/Q)+1);break;case"arc":re.push(Math.floor((F.y+Y-F.radius)/Q)+1),re.push(Math.floor((F.y+Y+F.radius)/Q)+1);break;case"qct":var ee=X(this.ctx.lastPoint.x,this.ctx.lastPoint.y,F.x1,F.y1,F.x,F.y);re.push(Math.floor((ee.y+Y)/Q)+1),re.push(Math.floor((ee.y+ee.h+Y)/Q)+1);break;case"bct":var ae=z(this.ctx.lastPoint.x,this.ctx.lastPoint.y,F.x1,F.y1,F.x2,F.y2,F.x,F.y);re.push(Math.floor((ae.y+Y)/Q)+1),re.push(Math.floor((ae.y+ae.h+Y)/Q)+1);break;case"rect":re.push(Math.floor((F.y+Y)/Q)+1),re.push(Math.floor((F.y+F.h+Y)/Q)+1)}for(var ue=0;ue<re.length;ue+=1)for(;this.pdf.internal.getNumberOfPages()<re[ue];)x.call(this);return re},x=function(){var F=this.fillStyle,q=this.strokeStyle,Q=this.font,re=this.lineCap,Y=this.lineWidth,ee=this.lineJoin;this.pdf.addPage(),this.fillStyle=F,this.strokeStyle=q,this.font=Q,this.lineCap=re,this.lineWidth=Y,this.lineJoin=ee},m=function(F,q,Q){for(var re=0;re<F.length;re++)switch(F[re].type){case"bct":F[re].x2+=q,F[re].y2+=Q;case"qct":F[re].x1+=q,F[re].y1+=Q;case"mt":case"lt":case"arc":default:F[re].x+=q,F[re].y+=Q}return F},w=function(F){return F.sort(function(q,Q){return q-Q})},E=function(F,q){for(var Q,re,Y=this.fillStyle,ee=this.strokeStyle,ae=this.lineCap,ue=this.lineWidth,ce=Math.abs(ue*this.ctx.transform.scaleX),pe=this.lineJoin,Ae=JSON.parse(JSON.stringify(this.path)),Ce=JSON.parse(JSON.stringify(this.path)),ke=[],Se=0;Se<Ce.length;Se++)if(Ce[Se].x!==void 0)for(var le=S.call(this,Ce[Se]),Ee=0;Ee<le.length;Ee+=1)ke.indexOf(le[Ee])===-1&&ke.push(le[Ee]);for(var xe=0;xe<ke.length;xe++)for(;this.pdf.internal.getNumberOfPages()<ke[xe];)x.call(this);if(w(ke),this.autoPaging)for(var ye=ke[0],Ne=ke[ke.length-1],Te=ye;Te<Ne+1;Te++){this.pdf.setPage(Te),this.fillStyle=Y,this.strokeStyle=ee,this.lineCap=ae,this.lineWidth=ce,this.lineJoin=pe;var ge=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Re=Te===1?this.posY+this.margin[0]:this.margin[0],Be=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Qe=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ct=Te===1?0:Be+(Te-2)*Qe;if(this.ctx.clip_path.length!==0){var mt=this.path;Q=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=m(Q,this.posX+this.margin[3],-ct+Re+this.ctx.prevPageLastElemOffset),P.call(this,F,!0),this.path=mt}if(re=JSON.parse(JSON.stringify(Ae)),this.path=m(re,this.posX+this.margin[3],-ct+Re+this.ctx.prevPageLastElemOffset),q===!1||Te===0){var gt=(Te>ye||Te<Ne)&&_.call(this);gt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ge,Qe,null).clip().discardPath()),P.call(this,F,q),gt&&this.pdf.restoreGraphicsState()}this.lineWidth=ue}else this.lineWidth=ce,P.call(this,F,q),this.lineWidth=ue;this.path=Ae},P=function(F,q){if((F!=="stroke"||q||!b.call(this))&&(F==="stroke"||q||!f.call(this))){for(var Q,re,Y=[],ee=this.path,ae=0;ae<ee.length;ae++){var ue=ee[ae];switch(ue.type){case"begin":Y.push({begin:!0});break;case"close":Y.push({close:!0});break;case"mt":Y.push({start:ue,deltas:[],abs:[]});break;case"lt":var ce=Y.length;if(ee[ae-1]&&!isNaN(ee[ae-1].x)&&(Q=[ue.x-ee[ae-1].x,ue.y-ee[ae-1].y],ce>0)){for(;ce>=0;ce--)if(Y[ce-1].close!==!0&&Y[ce-1].begin!==!0){Y[ce-1].deltas.push(Q),Y[ce-1].abs.push(ue);break}}break;case"bct":Q=[ue.x1-ee[ae-1].x,ue.y1-ee[ae-1].y,ue.x2-ee[ae-1].x,ue.y2-ee[ae-1].y,ue.x-ee[ae-1].x,ue.y-ee[ae-1].y],Y[Y.length-1].deltas.push(Q);break;case"qct":var pe=ee[ae-1].x+2/3*(ue.x1-ee[ae-1].x),Ae=ee[ae-1].y+2/3*(ue.y1-ee[ae-1].y),Ce=ue.x+2/3*(ue.x1-ue.x),ke=ue.y+2/3*(ue.y1-ue.y),Se=ue.x,le=ue.y;Q=[pe-ee[ae-1].x,Ae-ee[ae-1].y,Ce-ee[ae-1].x,ke-ee[ae-1].y,Se-ee[ae-1].x,le-ee[ae-1].y],Y[Y.length-1].deltas.push(Q);break;case"arc":Y.push({deltas:[],abs:[],arc:!0}),Array.isArray(Y[Y.length-1].abs)&&Y[Y.length-1].abs.push(ue)}}re=q?null:F==="stroke"?"stroke":"fill";for(var Ee=!1,xe=0;xe<Y.length;xe++)if(Y[xe].arc)for(var ye=Y[xe].abs,Ne=0;Ne<ye.length;Ne++){var Te=ye[Ne];Te.type==="arc"?N.call(this,Te.x,Te.y,Te.radius,Te.startAngle,Te.endAngle,Te.counterclockwise,void 0,q,!Ee):H.call(this,Te.x,Te.y),Ee=!0}else if(Y[xe].close===!0)this.pdf.internal.out("h"),Ee=!1;else if(Y[xe].begin!==!0){var ge=Y[xe].start.x,Re=Y[xe].start.y;G.call(this,Y[xe].deltas,ge,Re),Ee=!0}re&&M.call(this,re),q&&T.call(this)}},R=function(F){var q=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,Q=q*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return F-Q;case"top":return F+q-Q;case"hanging":return F+q-2*Q;case"middle":return F+q/2-Q;case"ideographic":return F;case"alphabetic":default:return F}},k=function(F){return F+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};v.prototype.createLinearGradient=function(){var F=function(){};return F.colorStops=[],F.addColorStop=function(q,Q){this.colorStops.push([q,Q])},F.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},F.isCanvasGradient=!0,F},v.prototype.createPattern=function(){return this.createLinearGradient()},v.prototype.createRadialGradient=function(){return this.createLinearGradient()};var N=function(F,q,Q,re,Y,ee,ae,ue,ce){for(var pe=se.call(this,Q,re,Y,ee),Ae=0;Ae<pe.length;Ae++){var Ce=pe[Ae];Ae===0&&(ce?C.call(this,Ce.x1+F,Ce.y1+q):H.call(this,Ce.x1+F,Ce.y1+q)),J.call(this,F,q,Ce.x2,Ce.y2,Ce.x3,Ce.y3,Ce.x4,Ce.y4)}ue?T.call(this):M.call(this,ae)},M=function(F){switch(F){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},T=function(){this.pdf.clip(),this.pdf.discardPath()},C=function(F,q){this.pdf.internal.out(r(F)+" "+n(q)+" m")},L=function(F){var q;switch(F.align){case"right":case"end":q="right";break;case"center":q="center";break;case"left":case"start":default:q="left"}var Q=this.pdf.getTextDimensions(F.text),re=R.call(this,F.y),Y=k.call(this,re)-Q.h,ee=this.ctx.transform.applyToPoint(new o(F.x,re)),ae=this.ctx.transform.decompose(),ue=new u;ue=(ue=(ue=ue.multiply(ae.translate)).multiply(ae.skew)).multiply(ae.scale);for(var ce,pe,Ae,Ce=this.ctx.transform.applyToRectangle(new l(F.x,re,Q.w,Q.h)),ke=ue.applyToRectangle(new l(F.x,Y,Q.w,Q.h)),Se=S.call(this,ke),le=[],Ee=0;Ee<Se.length;Ee+=1)le.indexOf(Se[Ee])===-1&&le.push(Se[Ee]);if(w(le),this.autoPaging)for(var xe=le[0],ye=le[le.length-1],Ne=xe;Ne<ye+1;Ne++){this.pdf.setPage(Ne);var Te=Ne===1?this.posY+this.margin[0]:this.margin[0],ge=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Re=this.pdf.internal.pageSize.height-this.margin[2],Be=Re-this.margin[0],Qe=this.pdf.internal.pageSize.width-this.margin[1],ct=Qe-this.margin[3],mt=Ne===1?0:ge+(Ne-2)*Be;if(this.ctx.clip_path.length!==0){var gt=this.path;ce=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=m(ce,this.posX+this.margin[3],-1*mt+Te),P.call(this,"fill",!0),this.path=gt}var St=m([JSON.parse(JSON.stringify(ke))],this.posX+this.margin[3],-mt+Te+this.ctx.prevPageLastElemOffset)[0];F.scale>=.01&&(pe=this.pdf.internal.getFontSize(),this.pdf.setFontSize(pe*F.scale),Ae=this.lineWidth,this.lineWidth=Ae*F.scale);var pt=this.autoPaging!=="text";if(pt||St.y+St.h<=Re){if(pt||St.y>=Te&&St.x<=Qe){var ut=pt?F.text:this.pdf.splitTextToSize(F.text,F.maxWidth||Qe-St.x)[0],Br=m([JSON.parse(JSON.stringify(Ce))],this.posX+this.margin[3],-mt+Te+this.ctx.prevPageLastElemOffset)[0],rr=pt&&(Ne>xe||Ne<ye)&&_.call(this);rr&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ct,Be,null).clip().discardPath()),this.pdf.text(ut,Br.x,Br.y,{angle:F.angle,align:q,renderingMode:F.renderingMode}),rr&&this.pdf.restoreGraphicsState()}}else St.y<Re&&(this.ctx.prevPageLastElemOffset+=Re-St.y);F.scale>=.01&&(this.pdf.setFontSize(pe),this.lineWidth=Ae)}else F.scale>=.01&&(pe=this.pdf.internal.getFontSize(),this.pdf.setFontSize(pe*F.scale),Ae=this.lineWidth,this.lineWidth=Ae*F.scale),this.pdf.text(F.text,ee.x+this.posX,ee.y+this.posY,{angle:F.angle,align:q,renderingMode:F.renderingMode,maxWidth:F.maxWidth}),F.scale>=.01&&(this.pdf.setFontSize(pe),this.lineWidth=Ae)},H=function(F,q,Q,re){Q=Q||0,re=re||0,this.pdf.internal.out(r(F+Q)+" "+n(q+re)+" l")},G=function(F,q,Q){return this.pdf.lines(F,q,Q,null,null)},J=function(F,q,Q,re,Y,ee,ae,ue){this.pdf.internal.out([t(i(Q+F)),t(a(re+q)),t(i(Y+F)),t(a(ee+q)),t(i(ae+F)),t(a(ue+q)),"c"].join(" "))},se=function(F,q,Q,re){for(var Y=2*Math.PI,ee=Math.PI/2;q>Q;)q-=Y;var ae=Math.abs(Q-q);ae<Y&&re&&(ae=Y-ae);for(var ue=[],ce=re?-1:1,pe=q;ae>1e-5;){var Ae=pe+ce*Math.min(ae,ee);ue.push(U.call(this,F,pe,Ae)),ae-=Math.abs(Ae-pe),pe=Ae}return ue},U=function(F,q,Q){var re=(Q-q)/2,Y=F*Math.cos(re),ee=F*Math.sin(re),ae=Y,ue=-ee,ce=ae*ae+ue*ue,pe=ce+ae*Y+ue*ee,Ae=4/3*(Math.sqrt(2*ce*pe)-pe)/(ae*ee-ue*Y),Ce=ae-Ae*ue,ke=ue+Ae*ae,Se=Ce,le=-ke,Ee=re+q,xe=Math.cos(Ee),ye=Math.sin(Ee);return{x1:F*Math.cos(q),y1:F*Math.sin(q),x2:Ce*xe-ke*ye,y2:Ce*ye+ke*xe,x3:Se*xe-le*ye,y3:Se*ye+le*xe,x4:F*Math.cos(Q),y4:F*Math.sin(Q)}},V=function(F){return 180*F/Math.PI},X=function(F,q,Q,re,Y,ee){var ae=F+.5*(Q-F),ue=q+.5*(re-q),ce=Y+.5*(Q-Y),pe=ee+.5*(re-ee),Ae=Math.min(F,Y,ae,ce),Ce=Math.max(F,Y,ae,ce),ke=Math.min(q,ee,ue,pe),Se=Math.max(q,ee,ue,pe);return new l(Ae,ke,Ce-Ae,Se-ke)},z=function(F,q,Q,re,Y,ee,ae,ue){var ce,pe,Ae,Ce,ke,Se,le,Ee,xe,ye,Ne,Te,ge,Re,Be=Q-F,Qe=re-q,ct=Y-Q,mt=ee-re,gt=ae-Y,St=ue-ee;for(pe=0;pe<41;pe++)xe=(le=(Ae=F+(ce=pe/40)*Be)+ce*((ke=Q+ce*ct)-Ae))+ce*(ke+ce*(Y+ce*gt-ke)-le),ye=(Ee=(Ce=q+ce*Qe)+ce*((Se=re+ce*mt)-Ce))+ce*(Se+ce*(ee+ce*St-Se)-Ee),pe==0?(Ne=xe,Te=ye,ge=xe,Re=ye):(Ne=Math.min(Ne,xe),Te=Math.min(Te,ye),ge=Math.max(ge,xe),Re=Math.max(Re,ye));return new l(Math.round(Ne),Math.round(Te),Math.round(ge-Ne),Math.round(Re-Te))},D=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var F,q,Q=(F=this.ctx.lineDash,q=this.ctx.lineDashOffset,JSON.stringify({lineDash:F,lineDashOffset:q}));this.prevLineDash!==Q&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=Q)}}})(Zt.API),function(e){var t=function(a){var o,l,u,d,h,v,p,f,b,_;for(l=[],u=0,d=(a+=o="\0\0\0\0".slice(a.length%4||4)).length;d>u;u+=4)(h=(a.charCodeAt(u)<<24)+(a.charCodeAt(u+1)<<16)+(a.charCodeAt(u+2)<<8)+a.charCodeAt(u+3))!==0?(v=(h=((h=((h=((h=(h-(_=h%85))/85)-(b=h%85))/85)-(f=h%85))/85)-(p=h%85))/85)%85,l.push(v+33,p+33,f+33,b+33,_+33)):l.push(122);return function(S,x){for(var m=x;m>0;m--)S.pop()}(l,o.length),String.fromCharCode.apply(String,l)+"~>"},r=function(a){var o,l,u,d,h,v=String,p="length",f=255,b="charCodeAt",_="slice",S="replace";for(a[_](-2),a=a[_](0,-2)[S](/\s/g,"")[S]("z","!!!!!"),u=[],d=0,h=(a+=o="uuuuu"[_](a[p]%5||5))[p];h>d;d+=5)l=52200625*(a[b](d)-33)+614125*(a[b](d+1)-33)+7225*(a[b](d+2)-33)+85*(a[b](d+3)-33)+(a[b](d+4)-33),u.push(f&l>>24,f&l>>16,f&l>>8,f&l);return function(x,m){for(var w=m;w>0;w--)x.pop()}(u,o[p]),v.fromCharCode.apply(v,u)},n=function(a){var o=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((a=a.replace(/\s/g,"")).indexOf(">")!==-1&&(a=a.substr(0,a.indexOf(">"))),a.length%2&&(a+="0"),o.test(a)===!1)return"";for(var l="",u=0;u<a.length;u+=2)l+=String.fromCharCode("0x"+(a[u]+a[u+1]));return l},i=function(a){for(var o=new Uint8Array(a.length),l=a.length;l--;)o[l]=a.charCodeAt(l);return a=(o=gv(o)).reduce(function(u,d){return u+String.fromCharCode(d)},"")};e.processDataByFilters=function(a,o){var l=0,u=a||"",d=[];for(typeof(o=o||[])=="string"&&(o=[o]),l=0;l<o.length;l+=1)switch(o[l]){case"ASCII85Decode":case"/ASCII85Decode":u=r(u),d.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":u=t(u),d.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":u=n(u),d.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":u=u.split("").map(function(h){return("0"+h.charCodeAt().toString(16)).slice(-2)}).join("")+">",d.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":u=i(u),d.push("/FlateDecode");break;default:throw new Error('The filter: "'+o[l]+'" is not implemented')}return{data:u,reverseChain:d.reverse().join(" ")}}}(Zt.API),function(e){e.loadFile=function(t,r,n){return function(i,a,o){a=a!==!1,o=typeof o=="function"?o:function(){};var l=void 0;try{l=function(u,d,h){var v=new XMLHttpRequest,p=0,f=function(b){var _=b.length,S=[],x=String.fromCharCode;for(p=0;p<_;p+=1)S.push(x(255&b.charCodeAt(p)));return S.join("")};if(v.open("GET",u,!d),v.overrideMimeType("text/plain; charset=x-user-defined"),d===!1&&(v.onload=function(){v.status===200?h(f(this.responseText)):h(void 0)}),v.send(null),d&&v.status===200)return f(v.responseText)}(i,a,o)}catch{}return l}(t,r,n)},e.loadImageFile=e.loadFile}(Zt.API),function(e){function t(){return(er.html2canvas?Promise.resolve(er.html2canvas):cv(()=>import("./html2canvas.esm-BfxBtG_O.js"),[],import.meta.url)).catch(function(o){return Promise.reject(new Error("Could not load html2canvas: "+o))}).then(function(o){return o.default?o.default:o})}function r(){return(er.DOMPurify?Promise.resolve(er.DOMPurify):cv(()=>import("./purify.es-CQJ0hv7W.js"),[],import.meta.url)).catch(function(o){return Promise.reject(new Error("Could not load dompurify: "+o))}).then(function(o){return o.default?o.default:o})}var n=function(o){var l=Sn(o);return l==="undefined"?"undefined":l==="string"||o instanceof String?"string":l==="number"||o instanceof Number?"number":l==="function"||o instanceof Function?"function":o&&o.constructor===Array?"array":o&&o.nodeType===1?"element":l==="object"?"object":"unknown"},i=function(o,l){var u=document.createElement(o);for(var d in l.className&&(u.className=l.className),l.innerHTML&&l.dompurify&&(u.innerHTML=l.dompurify.sanitize(l.innerHTML)),l.style)u.style[d]=l.style[d];return u},a=function o(l){var u=Object.assign(o.convert(Promise.resolve()),JSON.parse(JSON.stringify(o.template))),d=o.convert(Promise.resolve(),u);return d=(d=d.setProgress(1,o,1,[o])).set(l)};(a.prototype=Object.create(Promise.prototype)).constructor=a,a.convert=function(o,l){return o.__proto__=l||a.prototype,o},a.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"}},a.prototype.from=function(o,l){return this.then(function(){switch(l=l||function(u){switch(n(u)){case"string":return"string";case"element":return u.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(o)){case"string":return this.then(r).then(function(u){return this.set({src:i("div",{innerHTML:o,dompurify:u})})});case"element":return this.set({src:o});case"canvas":return this.set({canvas:o});case"img":return this.set({img:o});default:return this.error("Unknown source type.")}})},a.prototype.to=function(o){switch(o){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},a.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var o={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},l=function u(d,h){for(var v=d.nodeType===3?document.createTextNode(d.nodeValue):d.cloneNode(!1),p=d.firstChild;p;p=p.nextSibling)h!==!0&&p.nodeType===1&&p.nodeName==="SCRIPT"||v.appendChild(u(p,h));return d.nodeType===1&&(d.nodeName==="CANVAS"?(v.width=d.width,v.height=d.height,v.getContext("2d").drawImage(d,0,0)):d.nodeName!=="TEXTAREA"&&d.nodeName!=="SELECT"||(v.value=d.value),v.addEventListener("load",function(){v.scrollTop=d.scrollTop,v.scrollLeft=d.scrollLeft},!0)),v}(this.prop.src,this.opt.html2canvas.javascriptEnabled);l.tagName==="BODY"&&(o.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=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:o}),this.prop.container.appendChild(l),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"})},a.prototype.toCanvas=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(t).then(function(l){var u=Object.assign({},this.opt.html2canvas);return delete u.onrendered,l(this.prop.container,u)}).then(function(l){(this.opt.html2canvas.onrendered||function(){})(l),this.prop.canvas=l,document.body.removeChild(this.prop.overlay)})},a.prototype.toContext2d=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(t).then(function(l){var u=this.opt.jsPDF,d=this.opt.fontFaces,h=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,v=Object.assign({async:!0,allowTaint:!0,scale:h,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 v.onrendered,u.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,u.context2d.posX=this.opt.x,u.context2d.posY=this.opt.y,u.context2d.margin=this.opt.margin,u.context2d.fontFaces=d,d)for(var p=0;p<d.length;++p){var f=d[p],b=f.src.find(function(_){return _.format==="truetype"});b&&u.addFont(b.url,f.ref.name,f.ref.style)}return v.windowHeight=v.windowHeight||0,v.windowHeight=v.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):v.windowHeight,u.context2d.save(!0),l(this.prop.container,v)}).then(function(l){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(l),this.prop.canvas=l,document.body.removeChild(this.prop.overlay)})},a.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var o=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=o})},a.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},a.prototype.output=function(o,l,u){return(u=u||"pdf").toLowerCase()==="img"||u.toLowerCase()==="image"?this.outputImg(o,l):this.outputPdf(o,l)},a.prototype.outputPdf=function(o,l){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(o,l)})},a.prototype.outputImg=function(o){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(o){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+o+'" is not supported.'}})},a.prototype.save=function(o){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(o?{filename:o}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},a.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},a.prototype.set=function(o){if(n(o)!=="object")return this;var l=Object.keys(o||{}).map(function(u){if(u in a.template.prop)return function(){this.prop[u]=o[u]};switch(u){case"margin":return this.setMargin.bind(this,o.margin);case"jsPDF":return function(){return this.opt.jsPDF=o.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,o.pageSize);default:return function(){this.opt[u]=o[u]}}},this);return this.then(function(){return this.thenList(l)})},a.prototype.get=function(o,l){return this.then(function(){var u=o in a.template.prop?this.prop[o]:this.opt[o];return l?l(u):u})},a.prototype.setMargin=function(o){return this.then(function(){switch(n(o)){case"number":o=[o,o,o,o];case"array":if(o.length===2&&(o=[o[0],o[1],o[0],o[1]]),o.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=o}).then(this.setPageSize)},a.prototype.setPageSize=function(o){function l(u,d){return Math.floor(u*d/72*96)}return this.then(function(){(o=o||Zt.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(o.inner={width:o.width-this.opt.margin[1]-this.opt.margin[3],height:o.height-this.opt.margin[0]-this.opt.margin[2]},o.inner.px={width:l(o.inner.width,o.k),height:l(o.inner.height,o.k)},o.inner.ratio=o.inner.height/o.inner.width),this.prop.pageSize=o})},a.prototype.setProgress=function(o,l,u,d){return o!=null&&(this.progress.val=o),l!=null&&(this.progress.state=l),u!=null&&(this.progress.n=u),d!=null&&(this.progress.stack=d),this.progress.ratio=this.progress.val/this.progress.state,this},a.prototype.updateProgress=function(o,l,u,d){return this.setProgress(o?this.progress.val+o:null,l||null,u?this.progress.n+u:null,d?this.progress.stack.concat(d):null)},a.prototype.then=function(o,l){var u=this;return this.thenCore(o,l,function(d,h){return u.updateProgress(null,null,1,[d]),Promise.prototype.then.call(this,function(v){return u.updateProgress(null,d),v}).then(d,h).then(function(v){return u.updateProgress(1),v})})},a.prototype.thenCore=function(o,l,u){u=u||Promise.prototype.then,o&&(o=o.bind(this)),l&&(l=l.bind(this));var d=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?this:a.convert(Object.assign({},this),Promise.prototype),h=u.call(d,o,l);return a.convert(h,this.__proto__)},a.prototype.thenExternal=function(o,l){return Promise.prototype.then.call(this,o,l)},a.prototype.thenList=function(o){var l=this;return o.forEach(function(u){l=l.thenCore(u)}),l},a.prototype.catch=function(o){o&&(o=o.bind(this));var l=Promise.prototype.catch.call(this,o);return a.convert(l,this)},a.prototype.catchExternal=function(o){return Promise.prototype.catch.call(this,o)},a.prototype.error=function(o){return this.then(function(){throw new Error(o)})},a.prototype.using=a.prototype.set,a.prototype.saveAs=a.prototype.save,a.prototype.export=a.prototype.output,a.prototype.run=a.prototype.then,Zt.getPageSize=function(o,l,u){if(Sn(o)==="object"){var d=o;o=d.orientation,l=d.unit||l,u=d.format||u}l=l||"mm",u=u||"a4",o=(""+(o||"P")).toLowerCase();var h,v=(""+u).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(l){case"pt":h=1;break;case"mm":h=72/25.4;break;case"cm":h=72/2.54;break;case"in":h=72;break;case"px":h=.75;break;case"pc":case"em":h=12;break;case"ex":h=6;break;default:throw"Invalid unit: "+l}var f,b=0,_=0;if(p.hasOwnProperty(v))b=p[v][1]/h,_=p[v][0]/h;else try{b=u[1],_=u[0]}catch{throw new Error("Invalid format: "+u)}if(o==="p"||o==="portrait")o="p",_>b&&(f=_,_=b,b=f);else{if(o!=="l"&&o!=="landscape")throw"Invalid orientation: "+o;o="l",b>_&&(f=_,_=b,b=f)}return{width:_,height:b,unit:l,k:h,orientation:o}},e.html=function(o,l){(l=l||{}).callback=l.callback||function(){},l.html2canvas=l.html2canvas||{},l.html2canvas.canvas=l.html2canvas.canvas||this.canvas,l.jsPDF=l.jsPDF||this,l.fontFaces=l.fontFaces?l.fontFaces.map(_v):null;var u=new a(l);return l.worker?u:u.from(o).doCallback()}}(Zt.API),Zt.API.addJS=function(e){return i4=e,this.internal.events.subscribe("postPutResources",function(){r1=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(r1+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),n4=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+i4+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){r1!==void 0&&n4!==void 0&&this.internal.out("/Names <</JavaScript "+r1+" 0 R>>")}),this},function(e){var t;e.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],l=n.exec(o);if(l!=null){var u=l[1];r.internal.newObjectDeferredBegin(u,!1)}r.internal.write(o)}if(this.outline.createNamedDestinations){var d=this.internal.pages.length,h=[];for(a=0;a<d;a++){var v=r.internal.newObject();h.push(v);var p=r.internal.getPageInfo(a+1);r.internal.write("<< /D["+p.objId+" 0 R /XYZ null null null]>> endobj")}var f=r.internal.newObject();for(r.internal.write("<< /Names [ "),a=0;a<h.length;a++)r.internal.write("(page_"+(a+1)+")"+h[a]+" 0 R");r.internal.write(" ] >>","endobj"),t=r.internal.newObject(),r.internal.write("<< /Dests "+f+" 0 R"),r.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+t+" 0 R"))}]),e.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 l=this.count=this.count_r({count:0},o);if(l>0&&this.line("/Count "+l),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 d=0;d<n.children.length;d++)this.renderItems(n.children[d])},r.outline.line=function(n){this.ctx.val+=n+`\r
485
- `},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
486
- `+n.id+` 0 obj\r
487
- <<\r
488
- `},r.outline.objEnd=function(){this.ctx.val+=`>> \r
489
- endobj\r
490
- `},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}}])}(Zt.API),function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(r,n,i,a,o,l){var u,d=this.decode.DCT_DECODE,h=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 p,f=256*v.charCodeAt(4)+v.charCodeAt(5),b=v.length,_={width:0,height:0,numcomponents:1},S=4;S<b;S+=2){if(S+=f,t.indexOf(v.charCodeAt(S+1))!==-1){p=256*v.charCodeAt(S+5)+v.charCodeAt(S+6),_={width:256*v.charCodeAt(S+7)+v.charCodeAt(S+8),height:p,numcomponents:v.charCodeAt(S+9)};break}f=256*v.charCodeAt(S+2)+v.charCodeAt(S+3)}return _}(r=this.__addimage__.isArrayBufferView(r)?this.__addimage__.arrayBufferToBinaryString(r):r)).numcomponents){case 1:l=this.color_spaces.DEVICE_GRAY;break;case 4:l=this.color_spaces.DEVICE_CMYK;break;case 3:l=this.color_spaces.DEVICE_RGB}h={data:r,width:u.width,height:u.height,colorSpace:l,bitsPerComponent:8,filter:d,index:n,alias:i}}return h}}(Zt.API);var ch,n1,a4,o4,s4,Dk=function(){var e,t,r;function n(a){var o,l,u,d,h,v,p,f,b,_,S,x,m,w;for(this.data=a,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},v=null;;){switch(o=this.readUInt32(),b=(function(){var E,P;for(P=[],E=0;E<4;++E)P.push(String.fromCharCode(this.data[this.pos++]));return P}).call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(o);break;case"fcTL":v&&this.animation.frames.push(v),this.pos+=4,v={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},h=this.readUInt16(),d=this.readUInt16()||100,v.delay=1e3*h/d,v.disposeOp=this.data[this.pos++],v.blendOp=this.data[this.pos++],v.data=[];break;case"IDAT":case"fdAT":for(b==="fdAT"&&(this.pos+=4,o-=4),a=v?.data||this.imgData,x=0;0<=o?x<o:x>o;0<=o?++x:--x)a.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(u=this.palette.length/3,this.transparency.indexed=this.read(o),this.transparency.indexed.length>u)throw new Error("More transparent colors than palette size");if((_=u-this.transparency.indexed.length)>0)for(m=0;0<=_?m<_:m>_;0<=_?++m:--m)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(o)[0];break;case 2:this.transparency.rgb=this.read(o)}break;case"tEXt":p=(S=this.read(o)).indexOf(0),f=String.fromCharCode.apply(String,S.slice(0,p)),this.text[f]=String.fromCharCode.apply(String,S.slice(p+1));break;case"IEND":return v&&this.animation.frames.push(v),this.colors=(function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}).call(this),this.hasAlphaChannel=(w=this.colorType)===4||w===6,l=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*l,this.colorSpace=(function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}).call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=o}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}n.prototype.read=function(a){var o,l;for(l=[],o=0;0<=a?o<a:o>a;0<=a?++o:--o)l.push(this.data[this.pos++]);return l},n.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.decodePixels=function(a){var o=this.pixelBitlength/8,l=new Uint8Array(this.width*this.height*o),u=0,d=this;if(a==null&&(a=this.imgData),a.length===0)return new Uint8Array(0);function h(v,p,f,b){var _,S,x,m,w,E,P,R,k,N,M,T,C,L,H,G,J,se,U,V,X,z=Math.ceil((d.width-v)/f),D=Math.ceil((d.height-p)/b),F=d.width==z&&d.height==D;for(L=o*z,T=F?l:new Uint8Array(L*D),E=a.length,C=0,S=0;C<D&&u<E;){switch(a[u++]){case 0:for(m=J=0;J<L;m=J+=1)T[S++]=a[u++];break;case 1:for(m=se=0;se<L;m=se+=1)_=a[u++],w=m<o?0:T[S-o],T[S++]=(_+w)%256;break;case 2:for(m=U=0;U<L;m=U+=1)_=a[u++],x=(m-m%o)/o,H=C&&T[(C-1)*L+x*o+m%o],T[S++]=(H+_)%256;break;case 3:for(m=V=0;V<L;m=V+=1)_=a[u++],x=(m-m%o)/o,w=m<o?0:T[S-o],H=C&&T[(C-1)*L+x*o+m%o],T[S++]=(_+Math.floor((w+H)/2))%256;break;case 4:for(m=X=0;X<L;m=X+=1)_=a[u++],x=(m-m%o)/o,w=m<o?0:T[S-o],C===0?H=G=0:(H=T[(C-1)*L+x*o+m%o],G=x&&T[(C-1)*L+(x-1)*o+m%o]),P=w+H-G,R=Math.abs(P-w),N=Math.abs(P-H),M=Math.abs(P-G),k=R<=N&&R<=M?w:N<=M?H:G,T[S++]=(_+k)%256;break;default:throw new Error("Invalid filter algorithm: "+a[u-1])}if(!F){var q=((p+C*b)*d.width+v)*o,Q=C*L;for(m=0;m<z;m+=1){for(var re=0;re<o;re+=1)l[q++]=T[Q++];q+=(f-1)*o}}C++}}return a=vk(a),d.interlaceMethod==1?(h(0,0,8,8),h(4,0,8,8),h(0,4,4,8),h(2,0,4,4),h(0,2,2,4),h(1,0,2,2),h(0,1,1,2)):h(0,0,1,1),l},n.prototype.decodePalette=function(){var a,o,l,u,d,h,v,p,f;for(l=this.palette,h=this.transparency.indexed||[],d=new Uint8Array((h.length||0)+l.length),u=0,a=0,o=v=0,p=l.length;v<p;o=v+=3)d[u++]=l[o],d[u++]=l[o+1],d[u++]=l[o+2],d[u++]=(f=h[a++])!=null?f:255;return d},n.prototype.copyToImageData=function(a,o){var l,u,d,h,v,p,f,b,_,S,x;if(u=this.colors,_=null,l=this.hasAlphaChannel,this.palette.length&&(_=(x=this._decodedPalette)!=null?x:this._decodedPalette=this.decodePalette(),u=4,l=!0),b=(d=a.data||a).length,v=_||o,h=p=0,u===1)for(;h<b;)f=_?4*o[h/4]:p,S=v[f++],d[h++]=S,d[h++]=S,d[h++]=S,d[h++]=l?v[f++]:255,p=f;else for(;h<b;)f=_?4*o[h/4]:p,d[h++]=v[f++],d[h++]=v[f++],d[h++]=v[f++],d[h++]=l?v[f++]:255,p=f},n.prototype.decode=function(){var a;return a=new Uint8Array(this.width*this.height*4),this.copyToImageData(a,this.decodePixels()),a};var i=function(){if(Object.prototype.toString.call(er)==="[object Window]"){try{t=er.document.createElement("canvas"),r=t.getContext("2d")}catch{return!1}return!0}return!1};return i(),e=function(a){var o;if(i()===!0)return r.width=a.width,r.height=a.height,r.clearRect(0,0,a.width,a.height),r.putImageData(a,0,0),(o=new Image).src=t.toDataURL(),o;throw new Error("This method requires a Browser with Canvas-capability.")},n.prototype.decodeFrames=function(a){var o,l,u,d,h,v,p,f;if(this.animation){for(f=[],l=h=0,v=(p=this.animation.frames).length;h<v;l=++h)o=p[l],u=a.createImageData(o.width,o.height),d=this.decodePixels(new Uint8Array(o.data)),this.copyToImageData(u,d),o.imageData=u,f.push(o.image=e(u));return f}},n.prototype.renderFrame=function(a,o){var l,u,d;return l=(u=this.animation.frames)[o],d=u[o-1],o===0&&a.clearRect(0,0,this.width,this.height),d?.disposeOp===1?a.clearRect(d.xOffset,d.yOffset,d.width,d.height):d?.disposeOp===2&&a.putImageData(d.imageData,d.xOffset,d.yOffset),l.blendOp===0&&a.clearRect(l.xOffset,l.yOffset,l.width,l.height),a.drawImage(l.image,l.xOffset,l.yOffset)},n.prototype.animate=function(a){var o,l,u,d,h,v,p=this;return l=0,v=this.animation,d=v.numFrames,u=v.frames,h=v.numPlays,(o=function(){var f,b;if(f=l++%d,b=u[f],p.renderFrame(a,f),d>1&&l/d<h)return p.animation._timeout=setTimeout(o,b.delay)})()},n.prototype.stopAnimation=function(){var a;return clearTimeout((a=this.animation)!=null?a._timeout:void 0)},n.prototype.render=function(a){var o,l;return a._png&&a._png.stopAnimation(),a._png=this,a.width=this.width,a.height=this.height,o=a.getContext("2d"),this.animation?(this.decodeFrames(o),this.animate(o)):(l=o.createImageData(this.width,this.height),this.copyToImageData(l,this.decodePixels()),o.putImageData(l,0,0))},n}();/**
491
- * @license
492
- *
493
- * Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
494
- *
495
- * Permission is hereby granted, free of charge, to any person obtaining
496
- * a copy of this software and associated documentation files (the
497
- * "Software"), to deal in the Software without restriction, including
498
- * without limitation the rights to use, copy, modify, merge, publish,
499
- * distribute, sublicense, and/or sell copies of the Software, and to
500
- * permit persons to whom the Software is furnished to do so, subject to
501
- * the following conditions:
502
- *
503
- * The above copyright notice and this permission notice shall be
504
- * included in all copies or substantial portions of the Software.
505
- *
506
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
507
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
508
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
509
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
510
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
511
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
512
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
513
- * ====================================================================
514
- *//**
515
- * @license
516
- * (c) Dean McNamee <dean@gmail.com>, 2013.
517
- *
518
- * https://github.com/deanm/omggif
519
- *
520
- * Permission is hereby granted, free of charge, to any person obtaining a copy
521
- * of this software and associated documentation files (the "Software"), to
522
- * deal in the Software without restriction, including without limitation the
523
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
524
- * sell copies of the Software, and to permit persons to whom the Software is
525
- * furnished to do so, subject to the following conditions:
526
- *
527
- * The above copyright notice and this permission notice shall be included in
528
- * all copies or substantial portions of the Software.
529
- *
530
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
531
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
532
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
533
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
534
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
535
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
536
- * IN THE SOFTWARE.
537
- *
538
- * omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
539
- * including animation and compression. It does not rely on any specific
540
- * underlying system, so should run in the browser, Node, or Plask.
541
- */function Bk(e){var t=0;if(e[t++]!==71||e[t++]!==73||e[t++]!==70||e[t++]!==56||(e[t++]+1&253)!=56||e[t++]!==97)throw new Error("Invalid GIF 87a/89a header.");var r=e[t++]|e[t++]<<8,n=e[t++]|e[t++]<<8,i=e[t++],a=i>>7,o=1<<(7&i)+1;e[t++],e[t++];var l=null,u=null;a&&(l=t,u=o,t+=3*o);var d=!0,h=[],v=0,p=null,f=0,b=null;for(this.width=r,this.height=n;d&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(e[t]!==11||e[t+1]==78&&e[t+2]==69&&e[t+3]==84&&e[t+4]==83&&e[t+5]==67&&e[t+6]==65&&e[t+7]==80&&e[t+8]==69&&e[t+9]==50&&e[t+10]==46&&e[t+11]==48&&e[t+12]==3&&e[t+13]==1&&e[t+16]==0)t+=14,b=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((C=e[t++])>=0))throw Error("Invalid block size");if(C===0)break;t+=C}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw new Error("Invalid graphics extension block.");var _=e[t++];v=e[t++]|e[t++]<<8,p=e[t++],(1&_)==0&&(p=null),f=_>>2&7,t++;break;case 254:for(;;){if(!((C=e[t++])>=0))throw Error("Invalid block size");if(C===0)break;t+=C}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var S=e[t++]|e[t++]<<8,x=e[t++]|e[t++]<<8,m=e[t++]|e[t++]<<8,w=e[t++]|e[t++]<<8,E=e[t++],P=E>>6&1,R=1<<(7&E)+1,k=l,N=u,M=!1;E>>7&&(M=!0,k=t,N=R,t+=3*R);var T=t;for(t++;;){var C;if(!((C=e[t++])>=0))throw Error("Invalid block size");if(C===0)break;t+=C}h.push({x:S,y:x,width:m,height:w,has_local_palette:M,palette_offset:k,palette_size:N,data_offset:T,data_length:t-T,transparent_index:p,interlaced:!!P,delay:v,disposal:f});break;case 59:d=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return h.length},this.loopCount=function(){return b},this.frameInfo=function(L){if(L<0||L>=h.length)throw new Error("Frame index out of range.");return h[L]},this.decodeAndBlitFrameBGRA=function(L,H){var G=this.frameInfo(L),J=G.width*G.height,se=new Uint8Array(J);l4(e,G.data_offset,se,J);var U=G.palette_offset,V=G.transparent_index;V===null&&(V=256);var X=G.width,z=r-X,D=X,F=4*(G.y*r+G.x),q=4*((G.y+G.height)*r+G.x),Q=F,re=4*z;G.interlaced===!0&&(re+=4*r*7);for(var Y=8,ee=0,ae=se.length;ee<ae;++ee){var ue=se[ee];if(D===0&&(D=X,(Q+=re)>=q&&(re=4*z+4*r*(Y-1),Q=F+(X+z)*(Y<<1),Y>>=1)),ue===V)Q+=4;else{var ce=e[U+3*ue],pe=e[U+3*ue+1],Ae=e[U+3*ue+2];H[Q++]=Ae,H[Q++]=pe,H[Q++]=ce,H[Q++]=255}--D}},this.decodeAndBlitFrameRGBA=function(L,H){var G=this.frameInfo(L),J=G.width*G.height,se=new Uint8Array(J);l4(e,G.data_offset,se,J);var U=G.palette_offset,V=G.transparent_index;V===null&&(V=256);var X=G.width,z=r-X,D=X,F=4*(G.y*r+G.x),q=4*((G.y+G.height)*r+G.x),Q=F,re=4*z;G.interlaced===!0&&(re+=4*r*7);for(var Y=8,ee=0,ae=se.length;ee<ae;++ee){var ue=se[ee];if(D===0&&(D=X,(Q+=re)>=q&&(re=4*z+4*r*(Y-1),Q=F+(X+z)*(Y<<1),Y>>=1)),ue===V)Q+=4;else{var ce=e[U+3*ue],pe=e[U+3*ue+1],Ae=e[U+3*ue+2];H[Q++]=ce,H[Q++]=pe,H[Q++]=Ae,H[Q++]=255}--D}}}function l4(e,t,r,n){for(var i=e[t++],a=1<<i,o=a+1,l=o+1,u=i+1,d=(1<<u)-1,h=0,v=0,p=0,f=e[t++],b=new Int32Array(4096),_=null;;){for(;h<16&&f!==0;)v|=e[t++]<<h,h+=8,f===1?f=e[t++]:--f;if(h<u)break;var S=v&d;if(v>>=u,h-=u,S!==a){if(S===o)break;for(var x=S<l?S:_,m=0,w=x;w>a;)w=b[w]>>8,++m;var E=w;if(p+m+(x!==S?1:0)>n)return void qn.log("Warning, gif stream longer than expected.");r[p++]=E;var P=p+=m;for(x!==S&&(r[p++]=E),w=x;m--;)w=b[w],r[--P]=255&w,w>>=8;_!==null&&l<4096&&(b[l++]=_<<8|E,l>=d+1&&u<12&&(++u,d=d<<1|1)),_=S}else l=o+1,d=(1<<(u=i+1))-1,_=null}return p!==n&&qn.log("Warning, gif stream shorter than expected."),r}/**
542
- * @license
543
- Copyright (c) 2008, Adobe Systems Incorporated
544
- All rights reserved.
545
-
546
- Redistribution and use in source and binary forms, with or without
547
- modification, are permitted provided that the following conditions are
548
- met:
549
-
550
- * Redistributions of source code must retain the above copyright notice,
551
- this list of conditions and the following disclaimer.
552
-
553
- * Redistributions in binary form must reproduce the above copyright
554
- notice, this list of conditions and the following disclaimer in the
555
- documentation and/or other materials provided with the distribution.
556
-
557
- * Neither the name of Adobe Systems Incorporated nor the names of its
558
- contributors may be used to endorse or promote products derived from
559
- this software without specific prior written permission.
560
-
561
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
562
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
563
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
564
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
565
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
566
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
567
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
568
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
569
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
570
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
571
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
572
- */function B2(e){var t,r,n,i,a,o=Math.floor,l=new Array(64),u=new Array(64),d=new Array(64),h=new Array(64),v=new Array(65535),p=new Array(65535),f=new Array(64),b=new Array(64),_=[],S=0,x=7,m=new Array(64),w=new Array(64),E=new Array(64),P=new Array(256),R=new Array(2048),k=[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],N=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],M=[0,1,2,3,4,5,6,7,8,9,10,11],T=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],C=[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],L=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],H=[0,1,2,3,4,5,6,7,8,9,10,11],G=[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 se(F,q){for(var Q=0,re=0,Y=new Array,ee=1;ee<=16;ee++){for(var ae=1;ae<=F[ee];ae++)Y[q[re]]=[],Y[q[re]][0]=Q,Y[q[re]][1]=ee,re++,Q++;Q*=2}return Y}function U(F){for(var q=F[0],Q=F[1]-1;Q>=0;)q&1<<Q&&(S|=1<<x),Q--,--x<0&&(S==255?(V(255),V(0)):V(S),x=7,S=0)}function V(F){_.push(F)}function X(F){V(F>>8&255),V(255&F)}function z(F,q,Q,re,Y){for(var ee,ae=Y[0],ue=Y[240],ce=function(ye,Ne){var Te,ge,Re,Be,Qe,ct,mt,gt,St,pt,ut=0;for(St=0;St<8;++St){Te=ye[ut],ge=ye[ut+1],Re=ye[ut+2],Be=ye[ut+3],Qe=ye[ut+4],ct=ye[ut+5],mt=ye[ut+6];var Br=Te+(gt=ye[ut+7]),rr=Te-gt,Nr=ge+mt,ur=ge-mt,Ge=Re+ct,Ze=Re-ct,Lt=Be+Qe,gr=Be-Qe,Wt=Br+Lt,Ut=Br-Lt,kn=Nr+Ge,Rr=Nr-Ge;ye[ut]=Wt+kn,ye[ut+4]=Wt-kn;var It=.707106781*(Rr+Ut);ye[ut+2]=Ut+It,ye[ut+6]=Ut-It;var lr=.382683433*((Wt=gr+Ze)-(Rr=ur+rr)),so=.5411961*Wt+lr,on=1.306562965*Rr+lr,pn=.707106781*(kn=Ze+ur),ca=rr+pn,qt=rr-pn;ye[ut+5]=qt+so,ye[ut+3]=qt-so,ye[ut+1]=ca+on,ye[ut+7]=ca-on,ut+=8}for(ut=0,St=0;St<8;++St){Te=ye[ut],ge=ye[ut+8],Re=ye[ut+16],Be=ye[ut+24],Qe=ye[ut+32],ct=ye[ut+40],mt=ye[ut+48];var Ji=Te+(gt=ye[ut+56]),Jn=Te-gt,ci=ge+mt,zr=ge-mt,sn=Re+ct,ei=Re-ct,xa=Be+Qe,lo=Be-Qe,fa=Ji+xa,Sa=Ji-xa,Yn=ci+sn,Ea=ci-sn;ye[ut]=fa+Yn,ye[ut+32]=fa-Yn;var ha=.707106781*(Ea+Sa);ye[ut+16]=Sa+ha,ye[ut+48]=Sa-ha;var Pa=.382683433*((fa=lo+ei)-(Ea=zr+Jn)),da=.5411961*fa+Pa,uo=1.306562965*Ea+Pa,As=.707106781*(Yn=ei+zr),Ko=Jn+As,Zl=Jn-As;ye[ut+40]=Zl+da,ye[ut+24]=Zl-da,ye[ut+8]=Ko+uo,ye[ut+56]=Ko-uo,ut++}for(St=0;St<64;++St)pt=ye[St]*Ne[St],f[St]=pt>0?pt+.5|0:pt-.5|0;return f}(F,q),pe=0;pe<64;++pe)b[k[pe]]=ce[pe];var Ae=b[0]-Q;Q=b[0],Ae==0?U(re[0]):(U(re[p[ee=32767+Ae]]),U(v[ee]));for(var Ce=63;Ce>0&&b[Ce]==0;)Ce--;if(Ce==0)return U(ae),Q;for(var ke,Se=1;Se<=Ce;){for(var le=Se;b[Se]==0&&Se<=Ce;)++Se;var Ee=Se-le;if(Ee>=16){ke=Ee>>4;for(var xe=1;xe<=ke;++xe)U(ue);Ee&=15}ee=32767+b[Se],U(Y[(Ee<<4)+p[ee]]),U(v[ee]),Se++}return Ce!=63&&U(ae),Q}function D(F){F=Math.min(Math.max(F,1),100),a!=F&&(function(q){for(var Q=[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],re=0;re<64;re++){var Y=o((Q[re]*q+50)/100);Y=Math.min(Math.max(Y,1),255),l[k[re]]=Y}for(var ee=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],ae=0;ae<64;ae++){var ue=o((ee[ae]*q+50)/100);ue=Math.min(Math.max(ue,1),255),u[k[ae]]=ue}for(var ce=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],pe=0,Ae=0;Ae<8;Ae++)for(var Ce=0;Ce<8;Ce++)d[pe]=1/(l[k[pe]]*ce[Ae]*ce[Ce]*8),h[pe]=1/(u[k[pe]]*ce[Ae]*ce[Ce]*8),pe++}(F<50?Math.floor(5e3/F):Math.floor(200-2*F)),a=F)}this.encode=function(F,q){q&&D(q),_=new Array,S=0,x=7,X(65496),X(65504),X(16),V(74),V(70),V(73),V(70),V(0),V(1),V(1),V(0),X(1),X(1),V(0),V(0),function(){X(65499),X(132),V(0);for(var ge=0;ge<64;ge++)V(l[ge]);V(1);for(var Re=0;Re<64;Re++)V(u[Re])}(),function(ge,Re){X(65472),X(17),V(8),X(Re),X(ge),V(3),V(1),V(17),V(0),V(2),V(17),V(1),V(3),V(17),V(1)}(F.width,F.height),function(){X(65476),X(418),V(0);for(var ge=0;ge<16;ge++)V(N[ge+1]);for(var Re=0;Re<=11;Re++)V(M[Re]);V(16);for(var Be=0;Be<16;Be++)V(T[Be+1]);for(var Qe=0;Qe<=161;Qe++)V(C[Qe]);V(1);for(var ct=0;ct<16;ct++)V(L[ct+1]);for(var mt=0;mt<=11;mt++)V(H[mt]);V(17);for(var gt=0;gt<16;gt++)V(G[gt+1]);for(var St=0;St<=161;St++)V(J[St])}(),X(65498),X(12),V(3),V(1),V(0),V(2),V(17),V(3),V(17),V(0),V(63),V(0);var Q=0,re=0,Y=0;S=0,x=7,this.encode.displayName="_encode_";for(var ee,ae,ue,ce,pe,Ae,Ce,ke,Se,le=F.data,Ee=F.width,xe=F.height,ye=4*Ee,Ne=0;Ne<xe;){for(ee=0;ee<ye;){for(pe=ye*Ne+ee,Ce=-1,ke=0,Se=0;Se<64;Se++)Ae=pe+(ke=Se>>3)*ye+(Ce=4*(7&Se)),Ne+ke>=xe&&(Ae-=ye*(Ne+1+ke-xe)),ee+Ce>=ye&&(Ae-=ee+Ce-ye+4),ae=le[Ae++],ue=le[Ae++],ce=le[Ae++],m[Se]=(R[ae]+R[ue+256>>0]+R[ce+512>>0]>>16)-128,w[Se]=(R[ae+768>>0]+R[ue+1024>>0]+R[ce+1280>>0]>>16)-128,E[Se]=(R[ae+1280>>0]+R[ue+1536>>0]+R[ce+1792>>0]>>16)-128;Q=z(m,d,Q,t,n),re=z(w,h,re,r,i),Y=z(E,h,Y,r,i),ee+=32}Ne+=8}if(x>=0){var Te=[];Te[1]=x+1,Te[0]=(1<<x+1)-1,U(Te)}return X(65497),new Uint8Array(_)},e=e||50,function(){for(var F=String.fromCharCode,q=0;q<256;q++)P[q]=F(q)}(),t=se(N,M),r=se(L,H),n=se(T,C),i=se(G,J),function(){for(var F=1,q=2,Q=1;Q<=15;Q++){for(var re=F;re<q;re++)p[32767+re]=Q,v[32767+re]=[],v[32767+re][1]=Q,v[32767+re][0]=re;for(var Y=-(q-1);Y<=-F;Y++)p[32767+Y]=Q,v[32767+Y]=[],v[32767+Y][1]=Q,v[32767+Y][0]=q-1+Y;F<<=1,q<<=1}}(),function(){for(var F=0;F<256;F++)R[F]=19595*F,R[F+256>>0]=38470*F,R[F+512>>0]=7471*F+32768,R[F+768>>0]=-11059*F,R[F+1024>>0]=-21709*F,R[F+1280>>0]=32768*F+8421375,R[F+1536>>0]=-27439*F,R[F+1792>>0]=-5329*F}(),D(e)}/**
573
- * @license
574
- * Copyright (c) 2017 Aras Abbasi
575
- *
576
- * Licensed under the MIT License.
577
- * http://opensource.org/licenses/mit-license
578
- */function ql(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,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 u4(e){function t(N){if(!N)throw Error("assert :P")}function r(N,M,T){for(var C=0;4>C;C++)if(N[M+C]!=T.charCodeAt(C))return!0;return!1}function n(N,M,T,C,L){for(var H=0;H<L;H++)N[M+H]=T[C+H]}function i(N,M,T,C){for(var L=0;L<C;L++)N[M+L]=T}function a(N){return new Int32Array(N)}function o(N,M){for(var T=[],C=0;C<N;C++)T.push(new M);return T}function l(N,M){var T=[];return function C(L,H,G){for(var J=G[H],se=0;se<J&&(L.push(G.length>H+1?[]:new M),!(G.length<H+1));se++)C(L[se],H+1,G)}(T,0,N),T}var u=function(){var N=this;function M(O,B){for(var Z=1<<B-1>>>0;O&Z;)Z>>>=1;return Z?(O&Z-1)+Z:O}function T(O,B,Z,ie,he){t(!(ie%Z));do O[B+(ie-=Z)]=he;while(0<ie)}function C(O,B,Z,ie,he){if(t(2328>=he),512>=he)var ve=a(512);else if((ve=a(he))==null)return 0;return function(be,we,_e,Oe,Fe,Ye){var Ve,He,lt=we,rt=1<<_e,Ie=a(16),ze=a(16);for(t(Fe!=0),t(Oe!=null),t(be!=null),t(0<_e),He=0;He<Fe;++He){if(15<Oe[He])return 0;++Ie[Oe[He]]}if(Ie[0]==Fe)return 0;for(ze[1]=0,Ve=1;15>Ve;++Ve){if(Ie[Ve]>1<<Ve)return 0;ze[Ve+1]=ze[Ve]+Ie[Ve]}for(He=0;He<Fe;++He)Ve=Oe[He],0<Oe[He]&&(Ye[ze[Ve]++]=He);if(ze[15]==1)return(Oe=new L).g=0,Oe.value=Ye[0],T(be,lt,1,rt,Oe),rt;var qe,it=-1,st=rt-1,At=0,xt=1,Bt=1,wt=1<<_e;for(He=0,Ve=1,Fe=2;Ve<=_e;++Ve,Fe<<=1){if(xt+=Bt<<=1,0>(Bt-=Ie[Ve]))return 0;for(;0<Ie[Ve];--Ie[Ve])(Oe=new L).g=Ve,Oe.value=Ye[He++],T(be,lt+At,Fe,wt,Oe),At=M(At,Ve)}for(Ve=_e+1,Fe=2;15>=Ve;++Ve,Fe<<=1){if(xt+=Bt<<=1,0>(Bt-=Ie[Ve]))return 0;for(;0<Ie[Ve];--Ie[Ve]){if(Oe=new L,(At&st)!=it){for(lt+=wt,qe=1<<(it=Ve)-_e;15>it&&!(0>=(qe-=Ie[it]));)++it,qe<<=1;rt+=wt=1<<(qe=it-_e),be[we+(it=At&st)].g=qe+_e,be[we+it].value=lt-we-it}Oe.g=Ve-_e,Oe.value=Ye[He++],T(be,lt+(At>>_e),Fe,wt,Oe),At=M(At,Ve)}}return xt!=2*ze[15]-1?0:rt}(O,B,Z,ie,he,ve)}function L(){this.value=this.g=0}function H(){this.value=this.g=0}function G(){this.G=o(5,L),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(Wr,H)}function J(O,B,Z,ie){t(O!=null),t(B!=null),t(2147483648>ie),O.Ca=254,O.I=0,O.b=-8,O.Ka=0,O.oa=B,O.pa=Z,O.Jd=B,O.Yc=Z+ie,O.Zc=4<=ie?Z+ie-4+1:Z,ee(O)}function se(O,B){for(var Z=0;0<B--;)Z|=ue(O,128)<<B;return Z}function U(O,B){var Z=se(O,B);return ae(O)?-Z:Z}function V(O,B,Z,ie){var he,ve=0;for(t(O!=null),t(B!=null),t(4294967288>ie),O.Sb=ie,O.Ra=0,O.u=0,O.h=0,4<ie&&(ie=4),he=0;he<ie;++he)ve+=B[Z+he]<<8*he;O.Ra=ve,O.bb=ie,O.oa=B,O.pa=Z}function X(O){for(;8<=O.u&&O.bb<O.Sb;)O.Ra>>>=8,O.Ra+=O.oa[O.pa+O.bb]<<ka-8>>>0,++O.bb,O.u-=8;Q(O)&&(O.h=1,O.u=0)}function z(O,B){if(t(0<=B),!O.h&&B<=El){var Z=q(O)&nl[B];return O.u+=B,X(O),Z}return O.h=1,O.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 F(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function q(O){return O.Ra>>>(O.u&ka-1)>>>0}function Q(O){return t(O.bb<=O.Sb),O.h||O.bb==O.Sb&&O.u>ka}function re(O,B){O.u=B,O.h=Q(O)}function Y(O){O.u>=$a&&(t(O.u>=$a),X(O))}function ee(O){t(O!=null&&O.oa!=null),O.pa<O.Zc?(O.I=(O.oa[O.pa++]|O.I<<8)>>>0,O.b+=8):(t(O!=null&&O.oa!=null),O.pa<O.Yc?(O.b+=8,O.I=O.oa[O.pa++]|O.I<<8):O.Ka?O.b=0:(O.I<<=8,O.b+=8,O.Ka=1))}function ae(O){return se(O,1)}function ue(O,B){var Z=O.Ca;0>O.b&&ee(O);var ie=O.b,he=Z*B>>>8,ve=(O.I>>>ie>he)+0;for(ve?(Z-=he,O.I-=he+1<<ie>>>0):Z=he+1,ie=Z,he=0;256<=ie;)he+=8,ie>>=8;return ie=7^he+xi[ie],O.b-=ie,O.Ca=(Z<<ie)-1,ve}function ce(O,B,Z){O[B+0]=Z>>24&255,O[B+1]=Z>>16&255,O[B+2]=Z>>8&255,O[B+3]=Z>>0&255}function pe(O,B){return O[B+0]<<0|O[B+1]<<8}function Ae(O,B){return pe(O,B)|O[B+2]<<16}function Ce(O,B){return pe(O,B)|pe(O,B+2)<<16}function ke(O,B){var Z=1<<B;return t(O!=null),t(0<B),O.X=a(Z),O.X==null?0:(O.Mb=32-B,O.Xa=B,1)}function Se(O,B){t(O!=null),t(B!=null),t(O.Xa==B.Xa),n(B.X,0,O.X,0,1<<B.Xa)}function le(){this.X=[],this.Xa=this.Mb=0}function Ee(O,B,Z,ie){t(Z!=null),t(ie!=null);var he=Z[0],ve=ie[0];return he==0&&(he=(O*ve+B/2)/B),ve==0&&(ve=(B*he+O/2)/O),0>=he||0>=ve?0:(Z[0]=he,ie[0]=ve,1)}function xe(O,B){return O+(1<<B)-1>>>B}function ye(O,B){return((4278255360&O)+(4278255360&B)>>>0&4278255360)+((16711935&O)+(16711935&B)>>>0&16711935)>>>0}function Ne(O,B){N[B]=function(Z,ie,he,ve,be,we,_e){var Oe;for(Oe=0;Oe<be;++Oe){var Fe=N[O](we[_e+Oe-1],he,ve+Oe);we[_e+Oe]=ye(Z[ie+Oe],Fe)}}}function Te(){this.ud=this.hd=this.jd=0}function ge(O,B){return((4278124286&(O^B))>>>1)+(O&B)>>>0}function Re(O){return 0<=O&&256>O?O:0>O?0:255<O?255:void 0}function Be(O,B){return Re(O+(O-B+.5>>1))}function Qe(O,B,Z){return Math.abs(B-Z)-Math.abs(O-Z)}function ct(O,B,Z,ie,he,ve,be){for(ie=ve[be-1],Z=0;Z<he;++Z)ve[be+Z]=ie=ye(O[B+Z],ie)}function mt(O,B,Z,ie,he){var ve;for(ve=0;ve<Z;++ve){var be=O[B+ve],we=be>>8&255,_e=16711935&(_e=(_e=16711935&be)+((we<<16)+we));ie[he+ve]=(4278255360&be)+_e>>>0}}function gt(O,B){B.jd=O>>0&255,B.hd=O>>8&255,B.ud=O>>16&255}function St(O,B,Z,ie,he,ve){var be;for(be=0;be<ie;++be){var we=B[Z+be],_e=we>>>8,Oe=we,Fe=255&(Fe=(Fe=we>>>16)+((O.jd<<24>>24)*(_e<<24>>24)>>>5));Oe=255&(Oe=(Oe=Oe+((O.hd<<24>>24)*(_e<<24>>24)>>>5))+((O.ud<<24>>24)*(Fe<<24>>24)>>>5)),he[ve+be]=(4278255360&we)+(Fe<<16)+Oe}}function pt(O,B,Z,ie,he){N[B]=function(ve,be,we,_e,Oe,Fe,Ye,Ve,He){for(_e=Ye;_e<Ve;++_e)for(Ye=0;Ye<He;++Ye)Oe[Fe++]=he(we[ie(ve[be++])])},N[O]=function(ve,be,we,_e,Oe,Fe,Ye){var Ve=8>>ve.b,He=ve.Ea,lt=ve.K[0],rt=ve.w;if(8>Ve)for(ve=(1<<ve.b)-1,rt=(1<<Ve)-1;be<we;++be){var Ie,ze=0;for(Ie=0;Ie<He;++Ie)Ie&ve||(ze=ie(_e[Oe++])),Fe[Ye++]=he(lt[ze&rt]),ze>>=Ve}else N["VP8LMapColor"+Z](_e,Oe,lt,rt,Fe,Ye,be,we,He)}}function ut(O,B,Z,ie,he){for(Z=B+Z;B<Z;){var ve=O[B++];ie[he++]=ve>>16&255,ie[he++]=ve>>8&255,ie[he++]=ve>>0&255}}function Br(O,B,Z,ie,he){for(Z=B+Z;B<Z;){var ve=O[B++];ie[he++]=ve>>16&255,ie[he++]=ve>>8&255,ie[he++]=ve>>0&255,ie[he++]=ve>>24&255}}function rr(O,B,Z,ie,he){for(Z=B+Z;B<Z;){var ve=(be=O[B++])>>16&240|be>>12&15,be=be>>0&240|be>>28&15;ie[he++]=ve,ie[he++]=be}}function Nr(O,B,Z,ie,he){for(Z=B+Z;B<Z;){var ve=(be=O[B++])>>16&248|be>>13&7,be=be>>5&224|be>>3&31;ie[he++]=ve,ie[he++]=be}}function ur(O,B,Z,ie,he){for(Z=B+Z;B<Z;){var ve=O[B++];ie[he++]=ve>>0&255,ie[he++]=ve>>8&255,ie[he++]=ve>>16&255}}function Ge(O,B,Z,ie,he,ve){if(ve==0)for(Z=B+Z;B<Z;)ce(ie,((ve=O[B++])[0]>>24|ve[1]>>8&65280|ve[2]<<8&16711680|ve[3]<<24)>>>0),he+=32;else n(ie,he,O,B,Z)}function Ze(O,B){N[B][0]=N[O+"0"],N[B][1]=N[O+"1"],N[B][2]=N[O+"2"],N[B][3]=N[O+"3"],N[B][4]=N[O+"4"],N[B][5]=N[O+"5"],N[B][6]=N[O+"6"],N[B][7]=N[O+"7"],N[B][8]=N[O+"8"],N[B][9]=N[O+"9"],N[B][10]=N[O+"10"],N[B][11]=N[O+"11"],N[B][12]=N[O+"12"],N[B][13]=N[O+"13"],N[B][14]=N[O+"0"],N[B][15]=N[O+"0"]}function Lt(O){return O==kl||O==Ms||O==lu||O==uu}function gr(){this.eb=[],this.size=this.A=this.fb=0}function Wt(){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 Ut(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new gr,this.f.kb=new Wt,this.sd=null}function kn(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Rr(){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 It(O){return alert("todo:WebPSamplerProcessPlane"),O.T}function lr(O,B){var Z=O.T,ie=B.ba.f.RGBA,he=ie.eb,ve=ie.fb+O.ka*ie.A,be=va[B.ba.S],we=O.y,_e=O.O,Oe=O.f,Fe=O.N,Ye=O.ea,Ve=O.W,He=B.cc,lt=B.dc,rt=B.Mc,Ie=B.Nc,ze=O.ka,qe=O.ka+O.T,it=O.U,st=it+1>>1;for(ze==0?be(we,_e,null,null,Oe,Fe,Ye,Ve,Oe,Fe,Ye,Ve,he,ve,null,null,it):(be(B.ec,B.fc,we,_e,He,lt,rt,Ie,Oe,Fe,Ye,Ve,he,ve-ie.A,he,ve,it),++Z);ze+2<qe;ze+=2)He=Oe,lt=Fe,rt=Ye,Ie=Ve,Fe+=O.Rc,Ve+=O.Rc,ve+=2*ie.A,be(we,(_e+=2*O.fa)-O.fa,we,_e,He,lt,rt,Ie,Oe,Fe,Ye,Ve,he,ve-ie.A,he,ve,it);return _e+=O.fa,O.j+qe<O.o?(n(B.ec,B.fc,we,_e,it),n(B.cc,B.dc,Oe,Fe,st),n(B.Mc,B.Nc,Ye,Ve,st),Z--):1&qe||be(we,_e,null,null,Oe,Fe,Ye,Ve,Oe,Fe,Ye,Ve,he,ve+ie.A,null,null,it),Z}function so(O,B,Z){var ie=O.F,he=[O.J];if(ie!=null){var ve=O.U,be=B.ba.S,we=be==su||be==lu;B=B.ba.f.RGBA;var _e=[0],Oe=O.ka;_e[0]=O.T,O.Kb&&(Oe==0?--_e[0]:(--Oe,he[0]-=O.width),O.j+O.ka+O.T==O.o&&(_e[0]=O.o-O.j-Oe));var Fe=B.eb;Oe=B.fb+Oe*B.A,O=Ir(ie,he[0],O.width,ve,_e,Fe,Oe+(we?0:3),B.A),t(Z==_e),O&&Lt(be)&&Si(Fe,Oe,we,ve,_e,B.A)}return 0}function on(O){var B=O.ma,Z=B.ba.S,ie=11>Z,he=Z==qo||Z==Cl||Z==su||Z==en||Z==12||Lt(Z);if(B.memory=null,B.Ib=null,B.Jb=null,B.Nd=null,!rl(B.Oa,O,he?11:12))return 0;if(he&&Lt(Z)&&ft(),O.da)alert("todo:use_scaling");else{if(ie){if(B.Ib=It,O.Kb){if(Z=O.U+1>>1,B.memory=a(O.U+2*Z),B.memory==null)return 0;B.ec=B.memory,B.fc=0,B.cc=B.ec,B.dc=B.fc+O.U,B.Mc=B.cc,B.Nc=B.dc+Z,B.Ib=lr,ft()}}else alert("todo:EmitYUV");he&&(B.Jb=so,ie&&Xe())}if(ie&&!Ei){for(O=0;256>O;++O)ia[O]=89858*(O-128)+bo>>ss,aa[O]=-22014*(O-128)+bo,Ll[O]=-45773*(O-128),ll[O]=113618*(O-128)+bo>>ss;for(O=Ur;O<Xr;++O)B=76283*(O-16)+bo>>ss,du[O-Ur]=Oa(B,255),hf[O-Ur]=Oa(B+8>>4,15);Ei=1}return 1}function pn(O){var B=O.ma,Z=O.U,ie=O.T;return t(!(1&O.ka)),0>=Z||0>=ie?0:(Z=B.Ib(O,B),B.Jb!=null&&B.Jb(O,B,Z),B.Dc+=Z,1)}function ca(O){O.ma.memory=null}function qt(O,B,Z,ie){return z(O,8)!=47?0:(B[0]=z(O,14)+1,Z[0]=z(O,14)+1,ie[0]=z(O,1),z(O,3)!=0?0:!O.h)}function Ji(O,B){if(4>O)return O+1;var Z=O-2>>1;return(2+(1&O)<<Z)+z(B,Z)+1}function Jn(O,B){return 120<B?B-120:1<=(Z=((Z=Gf[B-1])>>4)*O+(8-(15&Z)))?Z:1;var Z}function ci(O,B,Z){var ie=q(Z),he=O[B+=255&ie].g-8;return 0<he&&(re(Z,Z.u+8),ie=q(Z),B+=O[B].value,B+=ie&(1<<he)-1),re(Z,Z.u+O[B].g),O[B].value}function zr(O,B,Z){return Z.g+=O.g,Z.value+=O.value<<B>>>0,t(8>=Z.g),O.g}function sn(O,B,Z){var ie=O.xc;return t((B=ie==0?0:O.vc[O.md*(Z>>ie)+(B>>ie)])<O.Wb),O.Ya[B]}function ei(O,B,Z,ie){var he=O.ab,ve=O.c*B,be=O.C;B=be+B;var we=Z,_e=ie;for(ie=O.Ta,Z=O.Ua;0<he--;){var Oe=O.gc[he],Fe=be,Ye=B,Ve=we,He=_e,lt=(_e=ie,we=Z,Oe.Ea);switch(t(Fe<Ye),t(Ye<=Oe.nc),Oe.hc){case 2:Hu(Ve,He,(Ye-Fe)*lt,_e,we);break;case 0:var rt=Fe,Ie=Ye,ze=_e,qe=we,it=(wt=Oe).Ea;rt==0&&(il(Ve,He,null,null,1,ze,qe),ct(Ve,He+1,0,0,it-1,ze,qe+1),He+=it,qe+=it,++rt);for(var st=1<<wt.b,At=st-1,xt=xe(it,wt.b),Bt=wt.K,wt=wt.w+(rt>>wt.b)*xt;rt<Ie;){var xr=Bt,Ar=wt,mr=1;for(go(Ve,He,ze,qe-it,1,ze,qe);mr<it;){var ar=(mr&~At)+st;ar>it&&(ar=it),(0,gi[xr[Ar++]>>8&15])(Ve,He+ +mr,ze,qe+mr-it,ar-mr,ze,qe+mr),mr=ar}He+=it,qe+=it,++rt&At||(wt+=xt)}Ye!=Oe.nc&&n(_e,we-lt,_e,we+(Ye-Fe-1)*lt,lt);break;case 1:for(lt=Ve,Ie=He,it=(Ve=Oe.Ea)-(qe=Ve&~(ze=(He=1<<Oe.b)-1)),rt=xe(Ve,Oe.b),st=Oe.K,Oe=Oe.w+(Fe>>Oe.b)*rt;Fe<Ye;){for(At=st,xt=Oe,Bt=new Te,wt=Ie+qe,xr=Ie+Ve;Ie<wt;)gt(At[xt++],Bt),is(Bt,lt,Ie,He,_e,we),Ie+=He,we+=He;Ie<xr&&(gt(At[xt++],Bt),is(Bt,lt,Ie,it,_e,we),Ie+=it,we+=it),++Fe&ze||(Oe+=rt)}break;case 3:if(Ve==_e&&He==we&&0<Oe.b){for(Ie=_e,Ve=lt=we+(Ye-Fe)*lt-(qe=(Ye-Fe)*xe(Oe.Ea,Oe.b)),He=_e,ze=we,rt=[],qe=(it=qe)-1;0<=qe;--qe)rt[qe]=He[ze+qe];for(qe=it-1;0<=qe;--qe)Ie[Ve+qe]=rt[qe];pi(Oe,Fe,Ye,_e,lt,_e,we)}else pi(Oe,Fe,Ye,Ve,He,_e,we)}we=ie,_e=Z}_e!=Z&&n(ie,Z,we,_e,ve)}function xa(O,B){var Z=O.V,ie=O.Ba+O.c*O.C,he=B-O.C;if(t(B<=O.l.o),t(16>=he),0<he){var ve=O.l,be=O.Ta,we=O.Ua,_e=ve.width;if(ei(O,he,Z,ie),he=we=[we],t((Z=O.C)<(ie=B)),t(ve.v<ve.va),ie>ve.o&&(ie=ve.o),Z<ve.j){var Oe=ve.j-Z;Z=ve.j,he[0]+=Oe*_e}if(Z>=ie?Z=0:(he[0]+=4*ve.v,ve.ka=Z-ve.j,ve.U=ve.va-ve.v,ve.T=ie-Z,Z=1),Z){if(we=we[0],11>(Z=O.ca).S){var Fe=Z.f.RGBA,Ye=(ie=Z.S,he=ve.U,ve=ve.T,Oe=Fe.eb,Fe.A),Ve=ve;for(Fe=Fe.fb+O.Ma*Fe.A;0<Ve--;){var He=be,lt=we,rt=he,Ie=Oe,ze=Fe;switch(ie){case Ol:ai(He,lt,rt,Ie,ze);break;case qo:Bi(He,lt,rt,Ie,ze);break;case kl:Bi(He,lt,rt,Ie,ze),Si(Ie,ze,0,rt,1,0);break;case uf:vo(He,lt,rt,Ie,ze);break;case Cl:Ge(He,lt,rt,Ie,ze,1);break;case Ms:Ge(He,lt,rt,Ie,ze,1),Si(Ie,ze,0,rt,1,0);break;case su:Ge(He,lt,rt,Ie,ze,0);break;case lu:Ge(He,lt,rt,Ie,ze,0),Si(Ie,ze,1,rt,1,0);break;case en:as(He,lt,rt,Ie,ze);break;case uu:as(He,lt,rt,Ie,ze),Yr(Ie,ze,rt,1,0);break;case Vu:Mr(He,lt,rt,Ie,ze);break;default:t(0)}we+=_e,Fe+=Ye}O.Ma+=ve}else alert("todo:EmitRescaledRowsYUVA");t(O.Ma<=Z.height)}}O.C=B,t(O.C<=O.i)}function lo(O){var B;if(0<O.ua)return 0;for(B=0;B<O.Wb;++B){var Z=O.Ya[B].G,ie=O.Ya[B].H;if(0<Z[1][ie[1]+0].g||0<Z[2][ie[2]+0].g||0<Z[3][ie[3]+0].g)return 0}return 1}function fa(O,B,Z,ie,he,ve){if(O.Z!=0){var be=O.qd,we=O.rd;for(t(Hi[O.Z]!=null);B<Z;++B)Hi[O.Z](be,we,ie,he,ie,he,ve),be=ie,we=he,he+=ve;O.qd=be,O.rd=we}}function Sa(O,B){var Z=O.l.ma,ie=Z.Z==0||Z.Z==1?O.l.j:O.C;if(ie=O.C<ie?ie:O.C,t(B<=O.l.o),B>ie){var he=O.l.width,ve=Z.ca,be=Z.tb+he*ie,we=O.V,_e=O.Ba+O.c*ie,Oe=O.gc;t(O.ab==1),t(Oe[0].hc==3),Rs(Oe[0],ie,B,we,_e,ve,be),fa(Z,ie,B,ve,be,he)}O.C=O.Ma=B}function Yn(O,B,Z,ie,he,ve,be){var we=O.$/ie,_e=O.$%ie,Oe=O.m,Fe=O.s,Ye=Z+O.$,Ve=Ye;he=Z+ie*he;var He=Z+ie*ve,lt=280+Fe.ua,rt=O.Pb?we:16777216,Ie=0<Fe.ua?Fe.Wa:null,ze=Fe.wc,qe=Ye<He?sn(Fe,_e,we):null;t(O.C<ve),t(He<=he);var it=!1;e:for(;;){for(;it||Ye<He;){var st=0;if(we>=rt){var At=Ye-Z;t((rt=O).Pb),rt.wd=rt.m,rt.xd=At,0<rt.s.ua&&Se(rt.s.Wa,rt.s.vb),rt=we+Gu}if(_e&ze||(qe=sn(Fe,_e,we)),t(qe!=null),qe.Qb&&(B[Ye]=qe.qb,it=!0),!it)if(Y(Oe),qe.jc){st=Oe,At=B;var xt=Ye,Bt=qe.pd[q(st)&Wr-1];t(qe.jc),256>Bt.g?(re(st,st.u+Bt.g),At[xt]=Bt.value,st=0):(re(st,st.u+Bt.g-256),t(256<=Bt.value),st=Bt.value),st==0&&(it=!0)}else st=ci(qe.G[0],qe.H[0],Oe);if(Oe.h)break;if(it||256>st){if(!it)if(qe.nd)B[Ye]=(qe.qb|st<<8)>>>0;else{if(Y(Oe),it=ci(qe.G[1],qe.H[1],Oe),Y(Oe),At=ci(qe.G[2],qe.H[2],Oe),xt=ci(qe.G[3],qe.H[3],Oe),Oe.h)break;B[Ye]=(xt<<24|it<<16|st<<8|At)>>>0}if(it=!1,++Ye,++_e>=ie&&(_e=0,++we,be!=null&&we<=ve&&!(we%16)&&be(O,we),Ie!=null))for(;Ve<Ye;)st=B[Ve++],Ie.X[(506832829*st&4294967295)>>>Ie.Mb]=st}else if(280>st){if(st=Ji(st-256,Oe),At=ci(qe.G[4],qe.H[4],Oe),Y(Oe),At=Jn(ie,At=Ji(At,Oe)),Oe.h)break;if(Ye-Z<At||he-Ye<st)break e;for(xt=0;xt<st;++xt)B[Ye+xt]=B[Ye+xt-At];for(Ye+=st,_e+=st;_e>=ie;)_e-=ie,++we,be!=null&&we<=ve&&!(we%16)&&be(O,we);if(t(Ye<=he),_e&ze&&(qe=sn(Fe,_e,we)),Ie!=null)for(;Ve<Ye;)st=B[Ve++],Ie.X[(506832829*st&4294967295)>>>Ie.Mb]=st}else{if(!(st<lt))break e;for(it=st-280,t(Ie!=null);Ve<Ye;)st=B[Ve++],Ie.X[(506832829*st&4294967295)>>>Ie.Mb]=st;st=Ye,t(!(it>>>(At=Ie).Xa)),B[st]=At.X[it],it=!0}it||t(Oe.h==Q(Oe))}if(O.Pb&&Oe.h&&Ye<he)t(O.m.h),O.a=5,O.m=O.wd,O.$=O.xd,0<O.s.ua&&Se(O.s.vb,O.s.Wa);else{if(Oe.h)break e;be?.(O,we>ve?ve:we),O.a=0,O.$=Ye-Z}return 1}return O.a=3,0}function Ea(O){t(O!=null),O.vc=null,O.yc=null,O.Ya=null;var B=O.Wa;B!=null&&(B.X=null),O.vb=null,t(O!=null)}function ha(){var O=new Ha;return O==null?null:(O.a=0,O.xb=fu,Ze("Predictor","VP8LPredictors"),Ze("Predictor","VP8LPredictors_C"),Ze("PredictorAdd","VP8LPredictorsAdd"),Ze("PredictorAdd","VP8LPredictorsAdd_C"),Hu=mt,is=St,ai=ut,Bi=Br,as=rr,Mr=Nr,vo=ur,N.VP8LMapColor32b=Di,N.VP8LMapColor8b=To,O)}function Pa(O,B,Z,ie,he){var ve=1,be=[O],we=[B],_e=ie.m,Oe=ie.s,Fe=null,Ye=0;e:for(;;){if(Z)for(;ve&&z(_e,1);){var Ve=be,He=we,lt=ie,rt=1,Ie=lt.m,ze=lt.gc[lt.ab],qe=z(Ie,2);if(lt.Oc&1<<qe)ve=0;else{switch(lt.Oc|=1<<qe,ze.hc=qe,ze.Ea=Ve[0],ze.nc=He[0],ze.K=[null],++lt.ab,t(4>=lt.ab),qe){case 0:case 1:ze.b=z(Ie,3)+2,rt=Pa(xe(ze.Ea,ze.b),xe(ze.nc,ze.b),0,lt,ze.K),ze.K=ze.K[0];break;case 3:var it,st=z(Ie,8)+1,At=16<st?0:4<st?1:2<st?2:3;if(Ve[0]=xe(ze.Ea,At),ze.b=At,it=rt=Pa(st,1,0,lt,ze.K)){var xt,Bt=st,wt=ze,xr=1<<(8>>wt.b),Ar=a(xr);if(Ar==null)it=0;else{var mr=wt.K[0],ar=wt.w;for(Ar[0]=wt.K[0][0],xt=1;xt<1*Bt;++xt)Ar[xt]=ye(mr[ar+xt],Ar[xt-1]);for(;xt<4*xr;++xt)Ar[xt]=0;wt.K[0]=null,wt.K[0]=Ar,it=1}}rt=it;break;case 2:break;default:t(0)}ve=rt}}if(be=be[0],we=we[0],ve&&z(_e,1)&&!(ve=1<=(Ye=z(_e,4))&&11>=Ye)){ie.a=3;break e}var jr;if(jr=ve)t:{var Hr,Rt,Or,An=ie,Mn=be,si=we,fr=Ye,Vi=Z,bn=An.m,In=An.s,li=[null],Pi=1,ma=0,Ka=cf[fr];r:for(;;){if(Vi&&z(bn,1)){var fn=z(bn,3)+2,jn=xe(Mn,fn),oa=xe(si,fn),Uo=jn*oa;if(!Pa(jn,oa,0,An,li))break r;for(li=li[0],In.xc=fn,Hr=0;Hr<Uo;++Hr){var wo=li[Hr]>>8&65535;li[Hr]=wo,wo>=Pi&&(Pi=wo+1)}}if(bn.h)break r;for(Rt=0;5>Rt;++Rt){var Sr=sl[Rt];!Rt&&0<fr&&(Sr+=1<<fr),ma<Sr&&(ma=Sr)}var _o=o(Pi*Ka,L),pu=Pi,Xu=o(pu,G);if(Xu==null)var Za=null;else t(65536>=pu),Za=Xu;var Na=a(ma);if(Za==null||Na==null||_o==null){An.a=1;break r}var Rl=_o;for(Hr=Or=0;Hr<Pi;++Hr){var ya=Za[Hr],Ho=ya.G,un=ya.H,nr=0,Vr=1,wn=0;for(Rt=0;5>Rt;++Rt){Sr=sl[Rt],Ho[Rt]=Rl,un[Rt]=Or,!Rt&&0<fr&&(Sr+=1<<fr);i:{var On,Zn=Sr,Vo=An,tn=Na,gu=Rl,Fs=Or,rn=0,Qa=Vo.m,Ml=z(Qa,1);if(i(tn,0,0,Zn),Ml){var sa=z(Qa,1)+1,vu=z(Qa,1),mu=z(Qa,vu==0?1:8);tn[mu]=1,sa==2&&(tn[mu=z(Qa,8)]=1);var Ai=1}else{var Kr=a(19),Fn=z(Qa,4)+4;if(19<Fn){Vo.a=3;var Dn=0;break i}for(On=0;On<Fn;++On)Kr[Ih[On]]=z(Qa,3);var Ja=void 0,xo=void 0,eo=Vo,_c=Kr,Bn=Zn,yu=tn,ul=0,to=eo.m,hn=8,ui=o(128,L);n:for(;C(ui,0,7,_c,19);){if(z(to,1)){var la=2+2*z(to,3);if((Ja=2+z(to,la))>Bn)break n}else Ja=Bn;for(xo=0;xo<Bn&&Ja--;){Y(to);var Gi=ui[0+(127&q(to))];re(to,to.u+Gi.g);var Ds=Gi.value;if(16>Ds)yu[xo++]=Ds,Ds!=0&&(hn=Ds);else{var xc=Ds==16,Ku=Ds-16,Zf=mc[Ku],fs=z(to,cu[Ku])+Zf;if(xo+fs>Bn)break n;for(var df=xc?hn:0;0<fs--;)yu[xo++]=df}}ul=1;break n}ul||(eo.a=3),Ai=ul}(Ai=Ai&&!Qa.h)&&(rn=C(gu,Fs,8,tn,Zn)),Ai&&rn!=0?Dn=rn:(Vo.a=3,Dn=0)}if(Dn==0)break r;if(Vr&&Vf[Rt]==1&&(Vr=Rl[Or].g==0),nr+=Rl[Or].g,Or+=Dn,3>=Rt){var Il,bu=Na[0];for(Il=1;Il<Sr;++Il)Na[Il]>bu&&(bu=Na[Il]);wn+=bu}}if(ya.nd=Vr,ya.Qb=0,Vr&&(ya.qb=(Ho[3][un[3]+0].value<<24|Ho[1][un[1]+0].value<<16|Ho[2][un[2]+0].value)>>>0,nr==0&&256>Ho[0][un[0]+0].value&&(ya.Qb=1,ya.qb+=Ho[0][un[0]+0].value<<8)),ya.jc=!ya.Qb&&6>wn,ya.jc){var Go,La=ya;for(Go=0;Go<Wr;++Go){var hs=Go,ro=La.pd[hs],ds=La.G[0][La.H[0]+hs];256<=ds.value?(ro.g=ds.g+256,ro.value=ds.value):(ro.g=0,ro.value=0,hs>>=zr(ds,8,ro),hs>>=zr(La.G[1][La.H[1]+hs],16,ro),hs>>=zr(La.G[2][La.H[2]+hs],0,ro),zr(La.G[3][La.H[3]+hs],24,ro))}}}In.vc=li,In.Wb=Pi,In.Ya=Za,In.yc=_o,jr=1;break t}jr=0}if(!(ve=jr)){ie.a=3;break e}if(0<Ye){if(Oe.ua=1<<Ye,!ke(Oe.Wa,Ye)){ie.a=1,ve=0;break e}}else Oe.ua=0;var Sc=ie,Ec=be,pf=we,Zu=Sc.s,ps=Zu.xc;if(Sc.c=Ec,Sc.i=pf,Zu.md=xe(Ec,ps),Zu.wc=ps==0?-1:(1<<ps)-1,Z){ie.xb=yo;break e}if((Fe=a(be*we))==null){ie.a=1,ve=0;break e}ve=(ve=Yn(ie,Fe,0,be,we,we,null))&&!_e.h;break e}return ve?(he!=null?he[0]=Fe:(t(Fe==null),t(Z)),ie.$=0,Z||Ea(Oe)):Ea(Oe),ve}function da(O,B){var Z=O.c*O.i,ie=Z+B+16*B;return t(O.c<=B),O.V=a(ie),O.V==null?(O.Ta=null,O.Ua=0,O.a=1,0):(O.Ta=O.V,O.Ua=O.Ba+Z+B,1)}function uo(O,B){var Z=O.C,ie=B-Z,he=O.V,ve=O.Ba+O.c*Z;for(t(B<=O.l.o);0<ie;){var be=16<ie?16:ie,we=O.l.ma,_e=O.l.width,Oe=_e*be,Fe=we.ca,Ye=we.tb+_e*Z,Ve=O.Ta,He=O.Ua;ei(O,be,he,ve),Rn(Ve,He,Fe,Ye,Oe),fa(we,Z,Z+be,Fe,Ye,_e),ie-=be,he+=be*O.c,Z+=be}t(Z==B),O.C=O.Ma=B}function As(){this.ub=this.yd=this.td=this.Rb=0}function Ko(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Zl(){this.Fb=this.Bb=this.Cb=0,this.Zb=a(4),this.Lb=a(4)}function gc(){this.Yb=function(){var O=[];return function B(Z,ie,he){for(var ve=he[ie],be=0;be<ve&&(Z.push(he.length>ie+1?[]:0),!(he.length<ie+1));be++)B(Z[be],ie+1,he)}(O,0,[3,11]),O}()}function Nn(){this.jb=a(3),this.Wc=l([4,8],gc),this.Xc=l([4,17],gc)}function Bu(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new a(4),this.od=new a(4)}function co(){this.ld=this.La=this.dd=this.tc=0}function ml(){this.Na=this.la=0}function Ws(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function zu(){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 Ql(){this.uc=this.M=this.Nb=0,this.wa=Array(new co),this.Y=0,this.ya=Array(new zu),this.aa=0,this.l=new qr}function fo(){this.y=a(16),this.f=a(8),this.ea=a(8)}function fi(){this.cb=this.a=0,this.sc="",this.m=new D,this.Od=new As,this.Kc=new Ko,this.ed=new Bu,this.Qa=new Zl,this.Ic=this.$c=this.Aa=0,this.D=new Ql,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,Ws),this.Pa=new Nn,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new fo),this.Hd=0,this.rb=Array(new ml),this.sb=0,this.wa=Array(new co),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 zu),this.L=this.aa=0,this.gd=l([4,2],co),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 qr(){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 dr(){var O=new fi;return O!=null&&(O.a=0,O.sc="OK",O.cb=0,O.Xb=0,Nl||(Nl=Fa)),O}function Qr(O,B,Z){return O.a==0&&(O.a=B,O.sc=Z,O.cb=0),0}function hi(O,B,Z){return 3<=Z&&O[B+0]==157&&O[B+1]==1&&O[B+2]==42}function Li(O,B){if(O==null)return 0;if(O.a=0,O.sc="OK",B==null)return Qr(O,2,"null VP8Io passed to VP8GetHeaders()");var Z=B.data,ie=B.w,he=B.ha;if(4>he)return Qr(O,7,"Truncated header.");var ve=Z[ie+0]|Z[ie+1]<<8|Z[ie+2]<<16,be=O.Od;if(be.Rb=!(1&ve),be.td=ve>>1&7,be.yd=ve>>4&1,be.ub=ve>>5,3<be.td)return Qr(O,3,"Incorrect keyframe parameters.");if(!be.yd)return Qr(O,4,"Frame not displayable.");ie+=3,he-=3;var we=O.Kc;if(be.Rb){if(7>he)return Qr(O,7,"cannot parse picture header");if(!hi(Z,ie,he))return Qr(O,3,"Bad code word");we.c=16383&(Z[ie+4]<<8|Z[ie+3]),we.Td=Z[ie+4]>>6,we.i=16383&(Z[ie+6]<<8|Z[ie+5]),we.Ud=Z[ie+6]>>6,ie+=7,he-=7,O.za=we.c+15>>4,O.Ub=we.i+15>>4,B.width=we.c,B.height=we.i,B.Da=0,B.j=0,B.v=0,B.va=B.width,B.o=B.height,B.da=0,B.ib=B.width,B.hb=B.height,B.U=B.width,B.T=B.height,i((ve=O.Pa).jb,0,255,ve.jb.length),t((ve=O.Qa)!=null),ve.Cb=0,ve.Bb=0,ve.Fb=1,i(ve.Zb,0,0,ve.Zb.length),i(ve.Lb,0,0,ve.Lb)}if(be.ub>he)return Qr(O,7,"bad partition length");J(ve=O.m,Z,ie,be.ub),ie+=be.ub,he-=be.ub,be.Rb&&(we.Ld=ae(ve),we.Kd=ae(ve)),we=O.Qa;var _e,Oe=O.Pa;if(t(ve!=null),t(we!=null),we.Cb=ae(ve),we.Cb){if(we.Bb=ae(ve),ae(ve)){for(we.Fb=ae(ve),_e=0;4>_e;++_e)we.Zb[_e]=ae(ve)?U(ve,7):0;for(_e=0;4>_e;++_e)we.Lb[_e]=ae(ve)?U(ve,6):0}if(we.Bb)for(_e=0;3>_e;++_e)Oe.jb[_e]=ae(ve)?se(ve,8):255}else we.Bb=0;if(ve.Ka)return Qr(O,3,"cannot parse segment header");if((we=O.ed).zd=ae(ve),we.Tb=se(ve,6),we.wb=se(ve,3),we.Pc=ae(ve),we.Pc&&ae(ve)){for(Oe=0;4>Oe;++Oe)ae(ve)&&(we.vd[Oe]=U(ve,6));for(Oe=0;4>Oe;++Oe)ae(ve)&&(we.od[Oe]=U(ve,6))}if(O.L=we.Tb==0?0:we.zd?1:2,ve.Ka)return Qr(O,3,"cannot parse filter header");var Fe=he;if(he=_e=ie,ie=_e+Fe,we=Fe,O.Xb=(1<<se(O.m,2))-1,Fe<3*(Oe=O.Xb))Z=7;else{for(_e+=3*Oe,we-=3*Oe,Fe=0;Fe<Oe;++Fe){var Ye=Z[he+0]|Z[he+1]<<8|Z[he+2]<<16;Ye>we&&(Ye=we),J(O.Jc[+Fe],Z,_e,Ye),_e+=Ye,we-=Ye,he+=3}J(O.Jc[+Oe],Z,_e,we),Z=_e<ie?0:5}if(Z!=0)return Qr(O,Z,"cannot parse partitions");for(Z=se(_e=O.m,7),he=ae(_e)?U(_e,4):0,ie=ae(_e)?U(_e,4):0,we=ae(_e)?U(_e,4):0,Oe=ae(_e)?U(_e,4):0,_e=ae(_e)?U(_e,4):0,Fe=O.Qa,Ye=0;4>Ye;++Ye){if(Fe.Cb){var Ve=Fe.Zb[Ye];Fe.Fb||(Ve+=Z)}else{if(0<Ye){O.pb[Ye]=O.pb[0];continue}Ve=Z}var He=O.pb[Ye];He.Sc[0]=Is[Oa(Ve+he,127)],He.Sc[1]=$u[Oa(Ve+0,127)],He.Eb[0]=2*Is[Oa(Ve+ie,127)],He.Eb[1]=101581*$u[Oa(Ve+we,127)]>>16,8>He.Eb[1]&&(He.Eb[1]=8),He.Qc[0]=Is[Oa(Ve+Oe,117)],He.Qc[1]=$u[Oa(Ve+_e,127)],He.lc=Ve+_e}if(!be.Rb)return Qr(O,4,"Not a key frame.");for(ae(ve),be=O.Pa,Z=0;4>Z;++Z){for(he=0;8>he;++he)for(ie=0;3>ie;++ie)for(we=0;11>we;++we)Oe=ue(ve,Wf[Z][he][ie][we])?se(ve,8):Wu[Z][he][ie][we],be.Wc[Z][he].Yb[ie][we]=Oe;for(he=0;17>he;++he)be.Xc[Z][he]=be.Wc[Z][bc[he]]}return O.kc=ae(ve),O.kc&&(O.Bd=se(ve,8)),O.cb=1}function Fa(O,B,Z,ie,he,ve,be){var we=B[he].Yb[Z];for(Z=0;16>he;++he){if(!ue(O,we[Z+0]))return he;for(;!ue(O,we[Z+1]);)if(we=B[++he].Yb[0],Z=0,he==16)return 16;var _e=B[he+1].Yb;if(ue(O,we[Z+2])){var Oe=O,Fe=0;if(ue(Oe,(Ve=we)[(Ye=Z)+3]))if(ue(Oe,Ve[Ye+6])){for(we=0,Ye=2*(Fe=ue(Oe,Ve[Ye+8]))+(Ve=ue(Oe,Ve[Ye+9+Fe])),Fe=0,Ve=ff[Ye];Ve[we];++we)Fe+=Fe+ue(Oe,Ve[we]);Fe+=3+(8<<Ye)}else ue(Oe,Ve[Ye+7])?(Fe=7+2*ue(Oe,165),Fe+=ue(Oe,145)):Fe=5+ue(Oe,159);else Fe=ue(Oe,Ve[Ye+4])?3+ue(Oe,Ve[Ye+5]):2;we=_e[2]}else Fe=1,we=_e[1];_e=be+Xa[he],0>(Oe=O).b&&ee(Oe);var Ye,Ve=Oe.b,He=(Ye=Oe.Ca>>1)-(Oe.I>>Ve)>>31;--Oe.b,Oe.Ca+=He,Oe.Ca|=1,Oe.I-=(Ye+1&He)<<Ve,ve[_e]=((Fe^He)-He)*ie[(0<he)+0]}return 16}function Da(O){var B=O.rb[O.sb-1];B.la=0,B.Na=0,i(O.zc,0,0,O.zc.length),O.ja=0}function ti(O,B){if(O==null)return 0;if(B==null)return Qr(O,2,"NULL VP8Io parameter in VP8Decode().");if(!O.cb&&!Li(O,B))return 0;if(t(O.cb),B.ac==null||B.ac(B)){B.ob&&(O.L=0);var Z=us[O.L];if(O.L==2?(O.yb=0,O.zb=0):(O.yb=B.v-Z>>4,O.zb=B.j-Z>>4,0>O.yb&&(O.yb=0),0>O.zb&&(O.zb=0)),O.Va=B.o+15+Z>>4,O.Hb=B.va+15+Z>>4,O.Hb>O.za&&(O.Hb=O.za),O.Va>O.Ub&&(O.Va=O.Ub),0<O.L){var ie=O.ed;for(Z=0;4>Z;++Z){var he;if(O.Qa.Cb){var ve=O.Qa.Lb[Z];O.Qa.Fb||(ve+=ie.Tb)}else ve=ie.Tb;for(he=0;1>=he;++he){var be=O.gd[Z][he],we=ve;if(ie.Pc&&(we+=ie.vd[0],he&&(we+=ie.od[0])),0<(we=0>we?0:63<we?63:we)){var _e=we;0<ie.wb&&(_e=4<ie.wb?_e>>2:_e>>1)>9-ie.wb&&(_e=9-ie.wb),1>_e&&(_e=1),be.dd=_e,be.tc=2*we+_e,be.ld=40<=we?2:15<=we?1:0}else be.tc=0;be.La=he}}}Z=0}else Qr(O,6,"Frame setup failed"),Z=O.a;if(Z=Z==0){if(Z){O.$c=0,0<O.Aa||(O.Ic=cs);e:{Z=O.Ic,ie=4*(_e=O.za);var Oe=32*_e,Fe=_e+1,Ye=0<O.L?_e*(0<O.Aa?2:1):0,Ve=(O.Aa==2?2:1)*_e;if((be=ie+832+(he=3*(16*Z+us[O.L])/2*Oe)+(ve=O.Fa!=null&&0<O.Fa.length?O.Kc.c*O.Kc.i:0))!=be)Z=0;else{if(be>O.Vb){if(O.Vb=0,O.Ec=a(be),O.Fc=0,O.Ec==null){Z=Qr(O,1,"no memory during frame initialization.");break e}O.Vb=be}be=O.Ec,we=O.Fc,O.Ac=be,O.Bc=we,we+=ie,O.Gd=o(Oe,fo),O.Hd=0,O.rb=o(Fe+1,ml),O.sb=1,O.wa=Ye?o(Ye,co):null,O.Y=0,O.D.Nb=0,O.D.wa=O.wa,O.D.Y=O.Y,0<O.Aa&&(O.D.Y+=_e),t(!0),O.oc=be,O.pc=we,we+=832,O.ya=o(Ve,zu),O.aa=0,O.D.ya=O.ya,O.D.aa=O.aa,O.Aa==2&&(O.D.aa+=_e),O.R=16*_e,O.B=8*_e,_e=(Oe=us[O.L])*O.R,Oe=Oe/2*O.B,O.sa=be,O.ta=we+_e,O.qa=O.sa,O.ra=O.ta+16*Z*O.R+Oe,O.Ha=O.qa,O.Ia=O.ra+8*Z*O.B+Oe,O.$c=0,we+=he,O.mb=ve?be:null,O.nb=ve?we:null,t(we+ve<=O.Fc+O.Vb),Da(O),i(O.Ac,O.Bc,0,ie),Z=1}}if(Z){if(B.ka=0,B.y=O.sa,B.O=O.ta,B.f=O.qa,B.N=O.ra,B.ea=O.Ha,B.Vd=O.Ia,B.fa=O.R,B.Rc=O.B,B.F=null,B.J=0,!ou){for(Z=-255;255>=Z;++Z)Kn[255+Z]=0>Z?-Z:Z;for(Z=-1020;1020>=Z;++Z)Bo[1020+Z]=-128>Z?-128:127<Z?127:Z;for(Z=-112;112>=Z;++Z)Pl[112+Z]=-16>Z?-16:15<Z?15:Z;for(Z=-255;510>=Z;++Z)ol[255+Z]=0>Z?0:255<Z?255:Z;ou=1}al=wr,Ro=ga,Mo=Ys,Hn=sf,vr=eu,_r=Jl,yn=ji,Vn=vn,os=Ua,Io=iu,jo=ea,Wa=ta,Pn=Ts,mo=el,Fo=ni,Do=Mi,zi=Ii,Jr=wl,Ui[0]=No,Ui[1]=Xs,Ui[2]=Zs,Ui[3]=ho,Ui[4]=qu,Ui[5]=Ln,Ui[6]=Qs,Ui[7]=Js,Ui[8]=ru,Ui[9]=tu,qi[0]=Ns,qi[1]=vc,qi[2]=Qo,qi[3]=Cs,qi[4]=ln,qi[5]=Jo,qi[6]=Ba,na[0]=za,na[1]=Ks,na[2]=lf,na[3]=po,na[4]=Ri,na[5]=nu,na[6]=qa,Z=1}else Z=0}Z&&(Z=function(He,lt){for(He.M=0;He.M<He.Va;++He.M){var rt,Ie=He.Jc[He.M&He.Xb],ze=He.m,qe=He;for(rt=0;rt<qe.za;++rt){var it=ze,st=qe,At=st.Ac,xt=st.Bc+4*rt,Bt=st.zc,wt=st.ya[st.aa+rt];if(st.Qa.Bb?wt.$b=ue(it,st.Pa.jb[0])?2+ue(it,st.Pa.jb[2]):ue(it,st.Pa.jb[1]):wt.$b=0,st.kc&&(wt.Ad=ue(it,st.Bd)),wt.Za=!ue(it,145)+0,wt.Za){var xr=wt.Ob,Ar=0;for(st=0;4>st;++st){var mr,ar=Bt[0+st];for(mr=0;4>mr;++mr){ar=$f[At[xt+mr]][ar];for(var jr=yc[ue(it,ar[0])];0<jr;)jr=yc[2*jr+ue(it,ar[jr])];ar=-jr,At[xt+mr]=ar}n(xr,Ar,At,xt,4),Ar+=4,Bt[0+st]=ar}}else ar=ue(it,156)?ue(it,128)?1:3:ue(it,163)?2:0,wt.Ob[0]=ar,i(At,xt,ar,4),i(Bt,0,ar,4);wt.Dd=ue(it,142)?ue(it,114)?ue(it,183)?1:3:2:0}if(qe.m.Ka)return Qr(He,7,"Premature end-of-partition0 encountered.");for(;He.ja<He.za;++He.ja){if(qe=Ie,it=(ze=He).rb[ze.sb-1],At=ze.rb[ze.sb+ze.ja],rt=ze.ya[ze.aa+ze.ja],xt=ze.kc?rt.Ad:0)it.la=At.la=0,rt.Za||(it.Na=At.Na=0),rt.Hc=0,rt.Gc=0,rt.ia=0;else{var Hr,Rt;if(it=At,At=qe,xt=ze.Pa.Xc,Bt=ze.ya[ze.aa+ze.ja],wt=ze.pb[Bt.$b],st=Bt.ad,xr=0,Ar=ze.rb[ze.sb-1],ar=mr=0,i(st,xr,0,384),Bt.Za)var Or=0,An=xt[3];else{jr=a(16);var Mn=it.Na+Ar.Na;if(Mn=Nl(At,xt[1],Mn,wt.Eb,0,jr,0),it.Na=Ar.Na=(0<Mn)+0,1<Mn)al(jr,0,st,xr);else{var si=jr[0]+3>>3;for(jr=0;256>jr;jr+=16)st[xr+jr]=si}Or=1,An=xt[0]}var fr=15&it.la,Vi=15&Ar.la;for(jr=0;4>jr;++jr){var bn=1&Vi;for(si=Rt=0;4>si;++si)fr=fr>>1|(bn=(Mn=Nl(At,An,Mn=bn+(1&fr),wt.Sc,Or,st,xr))>Or)<<7,Rt=Rt<<2|(3<Mn?3:1<Mn?2:st[xr+0]!=0),xr+=16;fr>>=4,Vi=Vi>>1|bn<<7,mr=(mr<<8|Rt)>>>0}for(An=fr,Or=Vi>>4,Hr=0;4>Hr;Hr+=2){for(Rt=0,fr=it.la>>4+Hr,Vi=Ar.la>>4+Hr,jr=0;2>jr;++jr){for(bn=1&Vi,si=0;2>si;++si)Mn=bn+(1&fr),fr=fr>>1|(bn=0<(Mn=Nl(At,xt[2],Mn,wt.Qc,0,st,xr)))<<3,Rt=Rt<<2|(3<Mn?3:1<Mn?2:st[xr+0]!=0),xr+=16;fr>>=2,Vi=Vi>>1|bn<<5}ar|=Rt<<4*Hr,An|=fr<<4<<Hr,Or|=(240&Vi)<<Hr}it.la=An,Ar.la=Or,Bt.Hc=mr,Bt.Gc=ar,Bt.ia=43690&ar?0:wt.ia,xt=!(mr|ar)}if(0<ze.L&&(ze.wa[ze.Y+ze.ja]=ze.gd[rt.$b][rt.Za],ze.wa[ze.Y+ze.ja].La|=!xt),qe.Ka)return Qr(He,7,"Premature end-of-file encountered.")}if(Da(He),ze=lt,qe=1,rt=(Ie=He).D,it=0<Ie.L&&Ie.M>=Ie.zb&&Ie.M<=Ie.Va,Ie.Aa==0)e:{if(rt.M=Ie.M,rt.uc=it,Fi(Ie,rt),qe=1,rt=(Rt=Ie.D).Nb,it=(ar=us[Ie.L])*Ie.R,At=ar/2*Ie.B,jr=16*rt*Ie.R,si=8*rt*Ie.B,xt=Ie.sa,Bt=Ie.ta-it+jr,wt=Ie.qa,st=Ie.ra-At+si,xr=Ie.Ha,Ar=Ie.Ia-At+si,Vi=(fr=Rt.M)==0,mr=fr>=Ie.Va-1,Ie.Aa==2&&Fi(Ie,Rt),Rt.uc)for(bn=(Mn=Ie).D.M,t(Mn.D.uc),Rt=Mn.yb;Rt<Mn.Hb;++Rt){Or=Rt,An=bn;var In=(li=(Sr=Mn).D).Nb;Hr=Sr.R;var li=li.wa[li.Y+Or],Pi=Sr.sa,ma=Sr.ta+16*In*Hr+16*Or,Ka=li.dd,fn=li.tc;if(fn!=0)if(t(3<=fn),Sr.L==1)0<Or&&Do(Pi,ma,Hr,fn+4),li.La&&Jr(Pi,ma,Hr,fn),0<An&&Fo(Pi,ma,Hr,fn+4),li.La&&zi(Pi,ma,Hr,fn);else{var jn=Sr.B,oa=Sr.qa,Uo=Sr.ra+8*In*jn+8*Or,wo=Sr.Ha,Sr=Sr.Ia+8*In*jn+8*Or;In=li.ld,0<Or&&(Vn(Pi,ma,Hr,fn+4,Ka,In),Io(oa,Uo,wo,Sr,jn,fn+4,Ka,In)),li.La&&(Wa(Pi,ma,Hr,fn,Ka,In),mo(oa,Uo,wo,Sr,jn,fn,Ka,In)),0<An&&(yn(Pi,ma,Hr,fn+4,Ka,In),os(oa,Uo,wo,Sr,jn,fn+4,Ka,In)),li.La&&(jo(Pi,ma,Hr,fn,Ka,In),Pn(oa,Uo,wo,Sr,jn,fn,Ka,In))}}if(Ie.ia&&alert("todo:DitherRow"),ze.put!=null){if(Rt=16*fr,fr=16*(fr+1),Vi?(ze.y=Ie.sa,ze.O=Ie.ta+jr,ze.f=Ie.qa,ze.N=Ie.ra+si,ze.ea=Ie.Ha,ze.W=Ie.Ia+si):(Rt-=ar,ze.y=xt,ze.O=Bt,ze.f=wt,ze.N=st,ze.ea=xr,ze.W=Ar),mr||(fr-=ar),fr>ze.o&&(fr=ze.o),ze.F=null,ze.J=null,Ie.Fa!=null&&0<Ie.Fa.length&&Rt<fr&&(ze.J=au(Ie,ze,Rt,fr-Rt),ze.F=Ie.mb,ze.F==null&&ze.F.length==0)){qe=Qr(Ie,3,"Could not decode alpha data.");break e}Rt<ze.j&&(ar=ze.j-Rt,Rt=ze.j,t(!(1&ar)),ze.O+=Ie.R*ar,ze.N+=Ie.B*(ar>>1),ze.W+=Ie.B*(ar>>1),ze.F!=null&&(ze.J+=ze.width*ar)),Rt<fr&&(ze.O+=ze.v,ze.N+=ze.v>>1,ze.W+=ze.v>>1,ze.F!=null&&(ze.J+=ze.v),ze.ka=Rt-ze.j,ze.U=ze.va-ze.v,ze.T=fr-Rt,qe=ze.put(ze))}rt+1!=Ie.Ic||mr||(n(Ie.sa,Ie.ta-it,xt,Bt+16*Ie.R,it),n(Ie.qa,Ie.ra-At,wt,st+8*Ie.B,At),n(Ie.Ha,Ie.Ia-At,xr,Ar+8*Ie.B,At))}if(!qe)return Qr(He,6,"Output aborted.")}return 1}(O,B)),B.bc!=null&&B.bc(B),Z&=1}return Z?(O.cb=0,Z):0}function Ti(O,B,Z,ie,he){he=O[B+Z+32*ie]+(he>>3),O[B+Z+32*ie]=-256&he?0>he?0:255:he}function yl(O,B,Z,ie,he,ve){Ti(O,B,0,Z,ie+he),Ti(O,B,1,Z,ie+ve),Ti(O,B,2,Z,ie-ve),Ti(O,B,3,Z,ie-he)}function pa(O){return(20091*O>>16)+O}function Zo(O,B,Z,ie){var he,ve=0,be=a(16);for(he=0;4>he;++he){var we=O[B+0]+O[B+8],_e=O[B+0]-O[B+8],Oe=(35468*O[B+4]>>16)-pa(O[B+12]),Fe=pa(O[B+4])+(35468*O[B+12]>>16);be[ve+0]=we+Fe,be[ve+1]=_e+Oe,be[ve+2]=_e-Oe,be[ve+3]=we-Fe,ve+=4,B++}for(he=ve=0;4>he;++he)we=(O=be[ve+0]+4)+be[ve+8],_e=O-be[ve+8],Oe=(35468*be[ve+4]>>16)-pa(be[ve+12]),Ti(Z,ie,0,0,we+(Fe=pa(be[ve+4])+(35468*be[ve+12]>>16))),Ti(Z,ie,1,0,_e+Oe),Ti(Z,ie,2,0,_e-Oe),Ti(Z,ie,3,0,we-Fe),ve++,ie+=32}function Jl(O,B,Z,ie){var he=O[B+0]+4,ve=35468*O[B+4]>>16,be=pa(O[B+4]),we=35468*O[B+1]>>16;yl(Z,ie,0,he+be,O=pa(O[B+1]),we),yl(Z,ie,1,he+ve,O,we),yl(Z,ie,2,he-ve,O,we),yl(Z,ie,3,he-be,O,we)}function ga(O,B,Z,ie,he){Zo(O,B,Z,ie),he&&Zo(O,B+16,Z,ie+4)}function Ys(O,B,Z,ie){Ro(O,B+0,Z,ie,1),Ro(O,B+32,Z,ie+128,1)}function sf(O,B,Z,ie){var he;for(O=O[B+0]+4,he=0;4>he;++he)for(B=0;4>B;++B)Ti(Z,ie,B,he,O)}function eu(O,B,Z,ie){O[B+0]&&Hn(O,B+0,Z,ie),O[B+16]&&Hn(O,B+16,Z,ie+4),O[B+32]&&Hn(O,B+32,Z,ie+128),O[B+48]&&Hn(O,B+48,Z,ie+128+4)}function wr(O,B,Z,ie){var he,ve=a(16);for(he=0;4>he;++he){var be=O[B+0+he]+O[B+12+he],we=O[B+4+he]+O[B+8+he],_e=O[B+4+he]-O[B+8+he],Oe=O[B+0+he]-O[B+12+he];ve[0+he]=be+we,ve[8+he]=be-we,ve[4+he]=Oe+_e,ve[12+he]=Oe-_e}for(he=0;4>he;++he)be=(O=ve[0+4*he]+3)+ve[3+4*he],we=ve[1+4*he]+ve[2+4*he],_e=ve[1+4*he]-ve[2+4*he],Oe=O-ve[3+4*he],Z[ie+0]=be+we>>3,Z[ie+16]=Oe+_e>>3,Z[ie+32]=be-we>>3,Z[ie+48]=Oe-_e>>3,ie+=64}function Os(O,B,Z){var ie,he=B-32,ve=vi,be=255-O[he-1];for(ie=0;ie<Z;++ie){var we,_e=ve,Oe=be+O[B-1];for(we=0;we<Z;++we)O[B+we]=_e[Oe+O[he+we]];B+=32}}function Xs(O,B){Os(O,B,4)}function Ks(O,B){Os(O,B,8)}function vc(O,B){Os(O,B,16)}function Qo(O,B){var Z;for(Z=0;16>Z;++Z)n(O,B+32*Z,O,B-32,16)}function Cs(O,B){var Z;for(Z=16;0<Z;--Z)i(O,B,O[B-1],16),B+=32}function ks(O,B,Z){var ie;for(ie=0;16>ie;++ie)i(B,Z+32*ie,O,16)}function Ns(O,B){var Z,ie=16;for(Z=0;16>Z;++Z)ie+=O[B-1+32*Z]+O[B+Z-32];ks(ie>>5,O,B)}function ln(O,B){var Z,ie=8;for(Z=0;16>Z;++Z)ie+=O[B-1+32*Z];ks(ie>>4,O,B)}function Jo(O,B){var Z,ie=8;for(Z=0;16>Z;++Z)ie+=O[B+Z-32];ks(ie>>4,O,B)}function Ba(O,B){ks(128,O,B)}function _t(O,B,Z){return O+2*B+Z+2>>2}function Zs(O,B){var Z,ie=B-32;for(ie=new Uint8Array([_t(O[ie-1],O[ie+0],O[ie+1]),_t(O[ie+0],O[ie+1],O[ie+2]),_t(O[ie+1],O[ie+2],O[ie+3]),_t(O[ie+2],O[ie+3],O[ie+4])]),Z=0;4>Z;++Z)n(O,B+32*Z,ie,0,ie.length)}function ho(O,B){var Z=O[B-1],ie=O[B-1+32],he=O[B-1+64],ve=O[B-1+96];ce(O,B+0,16843009*_t(O[B-1-32],Z,ie)),ce(O,B+32,16843009*_t(Z,ie,he)),ce(O,B+64,16843009*_t(ie,he,ve)),ce(O,B+96,16843009*_t(he,ve,ve))}function No(O,B){var Z,ie=4;for(Z=0;4>Z;++Z)ie+=O[B+Z-32]+O[B-1+32*Z];for(ie>>=3,Z=0;4>Z;++Z)i(O,B+32*Z,ie,4)}function qu(O,B){var Z=O[B-1+0],ie=O[B-1+32],he=O[B-1+64],ve=O[B-1-32],be=O[B+0-32],we=O[B+1-32],_e=O[B+2-32],Oe=O[B+3-32];O[B+0+96]=_t(ie,he,O[B-1+96]),O[B+1+96]=O[B+0+64]=_t(Z,ie,he),O[B+2+96]=O[B+1+64]=O[B+0+32]=_t(ve,Z,ie),O[B+3+96]=O[B+2+64]=O[B+1+32]=O[B+0+0]=_t(be,ve,Z),O[B+3+64]=O[B+2+32]=O[B+1+0]=_t(we,be,ve),O[B+3+32]=O[B+2+0]=_t(_e,we,be),O[B+3+0]=_t(Oe,_e,we)}function Qs(O,B){var Z=O[B+1-32],ie=O[B+2-32],he=O[B+3-32],ve=O[B+4-32],be=O[B+5-32],we=O[B+6-32],_e=O[B+7-32];O[B+0+0]=_t(O[B+0-32],Z,ie),O[B+1+0]=O[B+0+32]=_t(Z,ie,he),O[B+2+0]=O[B+1+32]=O[B+0+64]=_t(ie,he,ve),O[B+3+0]=O[B+2+32]=O[B+1+64]=O[B+0+96]=_t(he,ve,be),O[B+3+32]=O[B+2+64]=O[B+1+96]=_t(ve,be,we),O[B+3+64]=O[B+2+96]=_t(be,we,_e),O[B+3+96]=_t(we,_e,_e)}function Ln(O,B){var Z=O[B-1+0],ie=O[B-1+32],he=O[B-1+64],ve=O[B-1-32],be=O[B+0-32],we=O[B+1-32],_e=O[B+2-32],Oe=O[B+3-32];O[B+0+0]=O[B+1+64]=ve+be+1>>1,O[B+1+0]=O[B+2+64]=be+we+1>>1,O[B+2+0]=O[B+3+64]=we+_e+1>>1,O[B+3+0]=_e+Oe+1>>1,O[B+0+96]=_t(he,ie,Z),O[B+0+64]=_t(ie,Z,ve),O[B+0+32]=O[B+1+96]=_t(Z,ve,be),O[B+1+32]=O[B+2+96]=_t(ve,be,we),O[B+2+32]=O[B+3+96]=_t(be,we,_e),O[B+3+32]=_t(we,_e,Oe)}function Js(O,B){var Z=O[B+0-32],ie=O[B+1-32],he=O[B+2-32],ve=O[B+3-32],be=O[B+4-32],we=O[B+5-32],_e=O[B+6-32],Oe=O[B+7-32];O[B+0+0]=Z+ie+1>>1,O[B+1+0]=O[B+0+64]=ie+he+1>>1,O[B+2+0]=O[B+1+64]=he+ve+1>>1,O[B+3+0]=O[B+2+64]=ve+be+1>>1,O[B+0+32]=_t(Z,ie,he),O[B+1+32]=O[B+0+96]=_t(ie,he,ve),O[B+2+32]=O[B+1+96]=_t(he,ve,be),O[B+3+32]=O[B+2+96]=_t(ve,be,we),O[B+3+64]=_t(be,we,_e),O[B+3+96]=_t(we,_e,Oe)}function tu(O,B){var Z=O[B-1+0],ie=O[B-1+32],he=O[B-1+64],ve=O[B-1+96];O[B+0+0]=Z+ie+1>>1,O[B+2+0]=O[B+0+32]=ie+he+1>>1,O[B+2+32]=O[B+0+64]=he+ve+1>>1,O[B+1+0]=_t(Z,ie,he),O[B+3+0]=O[B+1+32]=_t(ie,he,ve),O[B+3+32]=O[B+1+64]=_t(he,ve,ve),O[B+3+64]=O[B+2+64]=O[B+0+96]=O[B+1+96]=O[B+2+96]=O[B+3+96]=ve}function ru(O,B){var Z=O[B-1+0],ie=O[B-1+32],he=O[B-1+64],ve=O[B-1+96],be=O[B-1-32],we=O[B+0-32],_e=O[B+1-32],Oe=O[B+2-32];O[B+0+0]=O[B+2+32]=Z+be+1>>1,O[B+0+32]=O[B+2+64]=ie+Z+1>>1,O[B+0+64]=O[B+2+96]=he+ie+1>>1,O[B+0+96]=ve+he+1>>1,O[B+3+0]=_t(we,_e,Oe),O[B+2+0]=_t(be,we,_e),O[B+1+0]=O[B+3+32]=_t(Z,be,we),O[B+1+32]=O[B+3+64]=_t(ie,Z,be),O[B+1+64]=O[B+3+96]=_t(he,ie,Z),O[B+1+96]=_t(ve,he,ie)}function lf(O,B){var Z;for(Z=0;8>Z;++Z)n(O,B+32*Z,O,B-32,8)}function po(O,B){var Z;for(Z=0;8>Z;++Z)i(O,B,O[B-1],8),B+=32}function ri(O,B,Z){var ie;for(ie=0;8>ie;++ie)i(B,Z+32*ie,O,8)}function za(O,B){var Z,ie=8;for(Z=0;8>Z;++Z)ie+=O[B+Z-32]+O[B-1+32*Z];ri(ie>>4,O,B)}function nu(O,B){var Z,ie=4;for(Z=0;8>Z;++Z)ie+=O[B+Z-32];ri(ie>>3,O,B)}function Ri(O,B){var Z,ie=4;for(Z=0;8>Z;++Z)ie+=O[B-1+32*Z];ri(ie>>3,O,B)}function qa(O,B){ri(128,O,B)}function Lo(O,B,Z){var ie=O[B-Z],he=O[B+0],ve=3*(he-ie)+zo[1020+O[B-2*Z]-O[B+Z]],be=Al[112+(ve+4>>3)];O[B-Z]=vi[255+ie+Al[112+(ve+3>>3)]],O[B+0]=vi[255+he-be]}function Ls(O,B,Z,ie){var he=O[B+0],ve=O[B+Z];return Ya[255+O[B-2*Z]-O[B-Z]]>ie||Ya[255+ve-he]>ie}function bl(O,B,Z,ie){return 4*Ya[255+O[B-Z]-O[B+0]]+Ya[255+O[B-2*Z]-O[B+Z]]<=ie}function Uu(O,B,Z,ie,he){var ve=O[B-3*Z],be=O[B-2*Z],we=O[B-Z],_e=O[B+0],Oe=O[B+Z],Fe=O[B+2*Z],Ye=O[B+3*Z];return 4*Ya[255+we-_e]+Ya[255+be-Oe]>ie?0:Ya[255+O[B-4*Z]-ve]<=he&&Ya[255+ve-be]<=he&&Ya[255+be-we]<=he&&Ya[255+Ye-Fe]<=he&&Ya[255+Fe-Oe]<=he&&Ya[255+Oe-_e]<=he}function ni(O,B,Z,ie){var he=2*ie+1;for(ie=0;16>ie;++ie)bl(O,B+ie,Z,he)&&Lo(O,B+ie,Z)}function Mi(O,B,Z,ie){var he=2*ie+1;for(ie=0;16>ie;++ie)bl(O,B+ie*Z,1,he)&&Lo(O,B+ie*Z,1)}function Ii(O,B,Z,ie){var he;for(he=3;0<he;--he)ni(O,B+=4*Z,Z,ie)}function wl(O,B,Z,ie){var he;for(he=3;0<he;--he)Mi(O,B+=4,Z,ie)}function Aa(O,B,Z,ie,he,ve,be,we){for(ve=2*ve+1;0<he--;){if(Uu(O,B,Z,ve,be))if(Ls(O,B,Z,we))Lo(O,B,Z);else{var _e=O,Oe=B,Fe=Z,Ye=_e[Oe-2*Fe],Ve=_e[Oe-Fe],He=_e[Oe+0],lt=_e[Oe+Fe],rt=_e[Oe+2*Fe],Ie=27*(qe=zo[1020+3*(He-Ve)+zo[1020+Ye-lt]])+63>>7,ze=18*qe+63>>7,qe=9*qe+63>>7;_e[Oe-3*Fe]=vi[255+_e[Oe-3*Fe]+qe],_e[Oe-2*Fe]=vi[255+Ye+ze],_e[Oe-Fe]=vi[255+Ve+Ie],_e[Oe+0]=vi[255+He-Ie],_e[Oe+Fe]=vi[255+lt-ze],_e[Oe+2*Fe]=vi[255+rt-qe]}B+=ie}}function gn(O,B,Z,ie,he,ve,be,we){for(ve=2*ve+1;0<he--;){if(Uu(O,B,Z,ve,be))if(Ls(O,B,Z,we))Lo(O,B,Z);else{var _e=O,Oe=B,Fe=Z,Ye=_e[Oe-Fe],Ve=_e[Oe+0],He=_e[Oe+Fe],lt=Al[112+((rt=3*(Ve-Ye))+4>>3)],rt=Al[112+(rt+3>>3)],Ie=lt+1>>1;_e[Oe-2*Fe]=vi[255+_e[Oe-2*Fe]+Ie],_e[Oe-Fe]=vi[255+Ye+rt],_e[Oe+0]=vi[255+Ve-lt],_e[Oe+Fe]=vi[255+He-Ie]}B+=ie}}function ji(O,B,Z,ie,he,ve){Aa(O,B,Z,1,16,ie,he,ve)}function vn(O,B,Z,ie,he,ve){Aa(O,B,1,Z,16,ie,he,ve)}function ea(O,B,Z,ie,he,ve){var be;for(be=3;0<be;--be)gn(O,B+=4*Z,Z,1,16,ie,he,ve)}function ta(O,B,Z,ie,he,ve){var be;for(be=3;0<be;--be)gn(O,B+=4,1,Z,16,ie,he,ve)}function Ua(O,B,Z,ie,he,ve,be,we){Aa(O,B,he,1,8,ve,be,we),Aa(Z,ie,he,1,8,ve,be,we)}function iu(O,B,Z,ie,he,ve,be,we){Aa(O,B,1,he,8,ve,be,we),Aa(Z,ie,1,he,8,ve,be,we)}function Ts(O,B,Z,ie,he,ve,be,we){gn(O,B+4*he,he,1,8,ve,be,we),gn(Z,ie+4*he,he,1,8,ve,be,we)}function el(O,B,Z,ie,he,ve,be,we){gn(O,B+4,1,he,8,ve,be,we),gn(Z,ie+4,1,he,8,ve,be,we)}function Un(){this.ba=new Ut,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Rr,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function di(){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 $r(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function tl(){this.ua=0,this.Wa=new le,this.vb=new le,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new G,this.yc=new L}function Ha(){this.xb=this.a=0,this.l=new qr,this.ca=new Ut,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new F,this.Pb=0,this.wd=new F,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new tl,this.ab=0,this.gc=o(4,$r),this.Oc=0}function _l(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new qr,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function es(O,B,Z,ie,he,ve,be){for(O=O==null?0:O[B+0],B=0;B<be;++B)he[ve+B]=O+Z[ie+B]&255,O=he[ve+B]}function xl(O,B,Z,ie,he,ve,be){var we;if(O==null)es(null,null,Z,ie,he,ve,be);else for(we=0;we<be;++we)he[ve+we]=O[B+we]+Z[ie+we]&255}function ts(O,B,Z,ie,he,ve,be){if(O==null)es(null,null,Z,ie,he,ve,be);else{var we,_e=O[B+0],Oe=_e,Fe=_e;for(we=0;we<be;++we)Oe=Fe+(_e=O[B+we])-Oe,Fe=Z[ie+we]+(-256&Oe?0>Oe?0:255:Oe)&255,Oe=_e,he[ve+we]=Fe}}function au(O,B,Z,ie){var he=B.width,ve=B.o;if(t(O!=null&&B!=null),0>Z||0>=ie||Z+ie>ve)return null;if(!O.Cc){if(O.ga==null){var be;if(O.ga=new _l,(be=O.ga==null)||(be=B.width*B.o,t(O.Gb.length==0),O.Gb=a(be),O.Uc=0,O.Gb==null?be=0:(O.mb=O.Gb,O.nb=O.Uc,O.rc=null,be=1),be=!be),!be){be=O.ga;var we=O.Fa,_e=O.P,Oe=O.qc,Fe=O.mb,Ye=O.nb,Ve=_e+1,He=Oe-1,lt=be.l;if(t(we!=null&&Fe!=null&&B!=null),Hi[0]=null,Hi[1]=es,Hi[2]=xl,Hi[3]=ts,be.ca=Fe,be.tb=Ye,be.c=B.width,be.i=B.height,t(0<be.c&&0<be.i),1>=Oe)B=0;else if(be.$a=we[_e+0]>>0&3,be.Z=we[_e+0]>>2&3,be.Lc=we[_e+0]>>4&3,_e=we[_e+0]>>6&3,0>be.$a||1<be.$a||4<=be.Z||1<be.Lc||_e)B=0;else if(lt.put=pn,lt.ac=on,lt.bc=ca,lt.ma=be,lt.width=B.width,lt.height=B.height,lt.Da=B.Da,lt.v=B.v,lt.va=B.va,lt.j=B.j,lt.o=B.o,be.$a)e:{t(be.$a==1),B=ha();t:for(;;){if(B==null){B=0;break e}if(t(be!=null),be.mc=B,B.c=be.c,B.i=be.i,B.l=be.l,B.l.ma=be,B.l.width=be.c,B.l.height=be.i,B.a=0,V(B.m,we,Ve,He),!Pa(be.c,be.i,1,B,null)||(B.ab==1&&B.gc[0].hc==3&&lo(B.s)?(be.ic=1,we=B.c*B.i,B.Ta=null,B.Ua=0,B.V=a(we),B.Ba=0,B.V==null?(B.a=1,B=0):B=1):(be.ic=0,B=da(B,be.c)),!B))break t;B=1;break e}be.mc=null,B=0}else B=He>=be.c*be.i;be=!B}if(be)return null;O.ga.Lc!=1?O.Ga=0:ie=ve-Z}t(O.ga!=null),t(Z+ie<=ve);e:{if(B=(we=O.ga).c,ve=we.l.o,we.$a==0){if(Ve=O.rc,He=O.Vc,lt=O.Fa,_e=O.P+1+Z*B,Oe=O.mb,Fe=O.nb+Z*B,t(_e<=O.P+O.qc),we.Z!=0)for(t(Hi[we.Z]!=null),be=0;be<ie;++be)Hi[we.Z](Ve,He,lt,_e,Oe,Fe,B),Ve=Oe,He=Fe,Fe+=B,_e+=B;else for(be=0;be<ie;++be)n(Oe,Fe,lt,_e,B),Ve=Oe,He=Fe,Fe+=B,_e+=B;O.rc=Ve,O.Vc=He}else{if(t(we.mc!=null),B=Z+ie,t((be=we.mc)!=null),t(B<=be.i),be.C>=B)B=1;else if(we.ic||Xe(),we.ic){we=be.V,Ve=be.Ba,He=be.c;var rt=be.i,Ie=(lt=1,_e=be.$/He,Oe=be.$%He,Fe=be.m,Ye=be.s,be.$),ze=He*rt,qe=He*B,it=Ye.wc,st=Ie<qe?sn(Ye,Oe,_e):null;t(Ie<=ze),t(B<=rt),t(lo(Ye));t:for(;;){for(;!Fe.h&&Ie<qe;){if(Oe&it||(st=sn(Ye,Oe,_e)),t(st!=null),Y(Fe),256>(rt=ci(st.G[0],st.H[0],Fe)))we[Ve+Ie]=rt,++Ie,++Oe>=He&&(Oe=0,++_e<=B&&!(_e%16)&&Sa(be,_e));else{if(!(280>rt)){lt=0;break t}rt=Ji(rt-256,Fe);var At,xt=ci(st.G[4],st.H[4],Fe);if(Y(Fe),!(Ie>=(xt=Jn(He,xt=Ji(xt,Fe)))&&ze-Ie>=rt)){lt=0;break t}for(At=0;At<rt;++At)we[Ve+Ie+At]=we[Ve+Ie+At-xt];for(Ie+=rt,Oe+=rt;Oe>=He;)Oe-=He,++_e<=B&&!(_e%16)&&Sa(be,_e);Ie<qe&&Oe&it&&(st=sn(Ye,Oe,_e))}t(Fe.h==Q(Fe))}Sa(be,_e>B?B:_e);break t}!lt||Fe.h&&Ie<ze?(lt=0,be.a=Fe.h?5:3):be.$=Ie,B=lt}else B=Yn(be,be.V,be.Ba,be.c,be.i,B,uo);if(!B){ie=0;break e}}Z+ie>=ve&&(O.Cc=1),ie=1}if(!ie)return null;if(O.Cc&&((ie=O.ga)!=null&&(ie.mc=null),O.ga=null,0<O.Ga))return alert("todo:WebPDequantizeLevels"),null}return O.nb+Z*he}function $(O,B,Z,ie,he,ve){for(;0<he--;){var be,we=O,_e=B+(Z?1:0),Oe=O,Fe=B+(Z?0:3);for(be=0;be<ie;++be){var Ye=Oe[Fe+4*be];Ye!=255&&(Ye*=32897,we[_e+4*be+0]=we[_e+4*be+0]*Ye>>23,we[_e+4*be+1]=we[_e+4*be+1]*Ye>>23,we[_e+4*be+2]=we[_e+4*be+2]*Ye>>23)}B+=ve}}function de(O,B,Z,ie,he){for(;0<ie--;){var ve;for(ve=0;ve<Z;++ve){var be=O[B+2*ve+0],we=15&(Oe=O[B+2*ve+1]),_e=4369*we,Oe=(240&Oe|Oe>>4)*_e>>16;O[B+2*ve+0]=(240&be|be>>4)*_e>>16&240|(15&be|be<<4)*_e>>16>>4&15,O[B+2*ve+1]=240&Oe|we}B+=he}}function Le(O,B,Z,ie,he,ve,be,we){var _e,Oe,Fe=255;for(Oe=0;Oe<he;++Oe){for(_e=0;_e<ie;++_e){var Ye=O[B+_e];ve[be+4*_e]=Ye,Fe&=Ye}B+=Z,be+=we}return Fe!=255}function je(O,B,Z,ie,he){var ve;for(ve=0;ve<he;++ve)Z[ie+ve]=O[B+ve]>>8}function Xe(){Si=$,Yr=de,Ir=Le,Rn=je}function at(O,B,Z){N[O]=function(ie,he,ve,be,we,_e,Oe,Fe,Ye,Ve,He,lt,rt,Ie,ze,qe,it){var st,At=it-1>>1,xt=we[_e+0]|Oe[Fe+0]<<16,Bt=Ye[Ve+0]|He[lt+0]<<16;t(ie!=null);var wt=3*xt+Bt+131074>>2;for(B(ie[he+0],255&wt,wt>>16,rt,Ie),ve!=null&&(wt=3*Bt+xt+131074>>2,B(ve[be+0],255&wt,wt>>16,ze,qe)),st=1;st<=At;++st){var xr=we[_e+st]|Oe[Fe+st]<<16,Ar=Ye[Ve+st]|He[lt+st]<<16,mr=xt+xr+Bt+Ar+524296,ar=mr+2*(xr+Bt)>>3;wt=ar+xt>>1,xt=(mr=mr+2*(xt+Ar)>>3)+xr>>1,B(ie[he+2*st-1],255&wt,wt>>16,rt,Ie+(2*st-1)*Z),B(ie[he+2*st-0],255&xt,xt>>16,rt,Ie+(2*st-0)*Z),ve!=null&&(wt=mr+Bt>>1,xt=ar+Ar>>1,B(ve[be+2*st-1],255&wt,wt>>16,ze,qe+(2*st-1)*Z),B(ve[be+2*st+0],255&xt,xt>>16,ze,qe+(2*st+0)*Z)),xt=xr,Bt=Ar}1&it||(wt=3*xt+Bt+131074>>2,B(ie[he+it-1],255&wt,wt>>16,rt,Ie+(it-1)*Z),ve!=null&&(wt=3*Bt+xt+131074>>2,B(ve[be+it-1],255&wt,wt>>16,ze,qe+(it-1)*Z)))}}function ft(){va[Ol]=Yf,va[qo]=js,va[uf]=Xf,va[Cl]=hu,va[su]=oi,va[en]=mi,va[Vu]=wc,va[kl]=js,va[Ms]=hu,va[lu]=oi,va[uu]=mi}function Et(O){return O&-16384?0>O?0:255:O>>ls}function Dt(O,B){return Et((19077*O>>8)+(26149*B>>8)-14234)}function tr(O,B,Z){return Et((19077*O>>8)-(6419*B>>8)-(13320*Z>>8)+8708)}function Jt(O,B){return Et((19077*O>>8)+(33050*B>>8)-17685)}function cr(O,B,Z,ie,he){ie[he+0]=Dt(O,Z),ie[he+1]=tr(O,B,Z),ie[he+2]=Jt(O,B)}function En(O,B,Z,ie,he){ie[he+0]=Jt(O,B),ie[he+1]=tr(O,B,Z),ie[he+2]=Dt(O,Z)}function mn(O,B,Z,ie,he){var ve=tr(O,B,Z);B=ve<<3&224|Jt(O,B)>>3,ie[he+0]=248&Dt(O,Z)|ve>>5,ie[he+1]=B}function Tn(O,B,Z,ie,he){var ve=240&Jt(O,B)|15;ie[he+0]=240&Dt(O,Z)|tr(O,B,Z)>>4,ie[he+1]=ve}function Xn(O,B,Z,ie,he){ie[he+0]=255,cr(O,B,Z,ie,he+1)}function ii(O,B,Z,ie,he){En(O,B,Z,ie,he),ie[he+3]=255}function Va(O,B,Z,ie,he){cr(O,B,Z,ie,he),ie[he+3]=255}function Oa(O,B){return 0>O?0:O>B?B:O}function Ca(O,B,Z){N[O]=function(ie,he,ve,be,we,_e,Oe,Fe,Ye){for(var Ve=Fe+(-2&Ye)*Z;Fe!=Ve;)B(ie[he+0],ve[be+0],we[_e+0],Oe,Fe),B(ie[he+1],ve[be+0],we[_e+0],Oe,Fe+Z),he+=2,++be,++_e,Fe+=2*Z;1&Ye&&B(ie[he+0],ve[be+0],we[_e+0],Oe,Fe)}}function rs(O,B,Z){return Z==0?O==0?B==0?6:5:B==0?4:0:Z}function ns(O,B,Z,ie,he){switch(O>>>30){case 3:Ro(B,Z,ie,he,0);break;case 2:_r(B,Z,ie,he);break;case 1:Hn(B,Z,ie,he)}}function Fi(O,B){var Z,ie,he=B.M,ve=B.Nb,be=O.oc,we=O.pc+40,_e=O.oc,Oe=O.pc+584,Fe=O.oc,Ye=O.pc+600;for(Z=0;16>Z;++Z)be[we+32*Z-1]=129;for(Z=0;8>Z;++Z)_e[Oe+32*Z-1]=129,Fe[Ye+32*Z-1]=129;for(0<he?be[we-1-32]=_e[Oe-1-32]=Fe[Ye-1-32]=129:(i(be,we-32-1,127,21),i(_e,Oe-32-1,127,9),i(Fe,Ye-32-1,127,9)),ie=0;ie<O.za;++ie){var Ve=B.ya[B.aa+ie];if(0<ie){for(Z=-1;16>Z;++Z)n(be,we+32*Z-4,be,we+32*Z+12,4);for(Z=-1;8>Z;++Z)n(_e,Oe+32*Z-4,_e,Oe+32*Z+4,4),n(Fe,Ye+32*Z-4,Fe,Ye+32*Z+4,4)}var He=O.Gd,lt=O.Hd+ie,rt=Ve.ad,Ie=Ve.Hc;if(0<he&&(n(be,we-32,He[lt].y,0,16),n(_e,Oe-32,He[lt].f,0,8),n(Fe,Ye-32,He[lt].ea,0,8)),Ve.Za){var ze=be,qe=we-32+16;for(0<he&&(ie>=O.za-1?i(ze,qe,He[lt].y[15],4):n(ze,qe,He[lt+1].y,0,4)),Z=0;4>Z;Z++)ze[qe+128+Z]=ze[qe+256+Z]=ze[qe+384+Z]=ze[qe+0+Z];for(Z=0;16>Z;++Z,Ie<<=2)ze=be,qe=we+Yu[Z],Ui[Ve.Ob[Z]](ze,qe),ns(Ie,rt,16*+Z,ze,qe)}else if(ze=rs(ie,he,Ve.Ob[0]),qi[ze](be,we),Ie!=0)for(Z=0;16>Z;++Z,Ie<<=2)ns(Ie,rt,16*+Z,be,we+Yu[Z]);for(Z=Ve.Gc,ze=rs(ie,he,Ve.Dd),na[ze](_e,Oe),na[ze](Fe,Ye),Ie=rt,ze=_e,qe=Oe,255&(Ve=Z>>0)&&(170&Ve?Mo(Ie,256,ze,qe):vr(Ie,256,ze,qe)),Ve=Fe,Ie=Ye,255&(Z>>=8)&&(170&Z?Mo(rt,320,Ve,Ie):vr(rt,320,Ve,Ie)),he<O.Ub-1&&(n(He[lt].y,0,be,we+480,16),n(He[lt].f,0,_e,Oe+224,8),n(He[lt].ea,0,Fe,Ye+224,8)),Z=8*ve*O.B,He=O.sa,lt=O.ta+16*ie+16*ve*O.R,rt=O.qa,Ve=O.ra+8*ie+Z,Ie=O.Ha,ze=O.Ia+8*ie+Z,Z=0;16>Z;++Z)n(He,lt+Z*O.R,be,we+32*Z,16);for(Z=0;8>Z;++Z)n(rt,Ve+Z*O.B,_e,Oe+32*Z,8),n(Ie,ze+Z*O.B,Fe,Ye+32*Z,8)}}function Ga(O,B,Z,ie,he,ve,be,we,_e){var Oe=[0],Fe=[0],Ye=0,Ve=_e!=null?_e.kd:0,He=_e??new di;if(O==null||12>Z)return 7;He.data=O,He.w=B,He.ha=Z,B=[B],Z=[Z],He.gb=[He.gb];e:{var lt=B,rt=Z,Ie=He.gb;if(t(O!=null),t(rt!=null),t(Ie!=null),Ie[0]=0,12<=rt[0]&&!r(O,lt[0],"RIFF")){if(r(O,lt[0]+8,"WEBP")){Ie=3;break e}var ze=Ce(O,lt[0]+4);if(12>ze||4294967286<ze){Ie=3;break e}if(Ve&&ze>rt[0]-8){Ie=7;break e}Ie[0]=ze,lt[0]+=12,rt[0]-=12}Ie=0}if(Ie!=0)return Ie;for(ze=0<He.gb[0],Z=Z[0];;){e:{var qe=O;rt=B,Ie=Z;var it=Oe,st=Fe,At=lt=[0];if((wt=Ye=[Ye])[0]=0,8>Ie[0])Ie=7;else{if(!r(qe,rt[0],"VP8X")){if(Ce(qe,rt[0]+4)!=10){Ie=3;break e}if(18>Ie[0]){Ie=7;break e}var xt=Ce(qe,rt[0]+8),Bt=1+Ae(qe,rt[0]+12);if(2147483648<=Bt*(qe=1+Ae(qe,rt[0]+15))){Ie=3;break e}At!=null&&(At[0]=xt),it!=null&&(it[0]=Bt),st!=null&&(st[0]=qe),rt[0]+=18,Ie[0]-=18,wt[0]=1}Ie=0}}if(Ye=Ye[0],lt=lt[0],Ie!=0)return Ie;if(rt=!!(2&lt),!ze&&Ye)return 3;if(ve!=null&&(ve[0]=!!(16&lt)),be!=null&&(be[0]=rt),we!=null&&(we[0]=0),be=Oe[0],lt=Fe[0],Ye&&rt&&_e==null){Ie=0;break}if(4>Z){Ie=7;break}if(ze&&Ye||!ze&&!Ye&&!r(O,B[0],"ALPH")){Z=[Z],He.na=[He.na],He.P=[He.P],He.Sa=[He.Sa];e:{xt=O,Ie=B,ze=Z;var wt=He.gb;it=He.na,st=He.P,At=He.Sa,Bt=22,t(xt!=null),t(ze!=null),qe=Ie[0];var xr=ze[0];for(t(it!=null),t(At!=null),it[0]=null,st[0]=null,At[0]=0;;){if(Ie[0]=qe,ze[0]=xr,8>xr){Ie=7;break e}var Ar=Ce(xt,qe+4);if(4294967286<Ar){Ie=3;break e}var mr=8+Ar+1&-2;if(Bt+=mr,0<wt&&Bt>wt){Ie=3;break e}if(!r(xt,qe,"VP8 ")||!r(xt,qe,"VP8L")){Ie=0;break e}if(xr[0]<mr){Ie=7;break e}r(xt,qe,"ALPH")||(it[0]=xt,st[0]=qe+8,At[0]=Ar),qe+=mr,xr-=mr}}if(Z=Z[0],He.na=He.na[0],He.P=He.P[0],He.Sa=He.Sa[0],Ie!=0)break}Z=[Z],He.Ja=[He.Ja],He.xa=[He.xa];e:if(wt=O,Ie=B,ze=Z,it=He.gb[0],st=He.Ja,At=He.xa,xt=Ie[0],qe=!r(wt,xt,"VP8 "),Bt=!r(wt,xt,"VP8L"),t(wt!=null),t(ze!=null),t(st!=null),t(At!=null),8>ze[0])Ie=7;else{if(qe||Bt){if(wt=Ce(wt,xt+4),12<=it&&wt>it-12){Ie=3;break e}if(Ve&&wt>ze[0]-8){Ie=7;break e}st[0]=wt,Ie[0]+=8,ze[0]-=8,At[0]=Bt}else At[0]=5<=ze[0]&&wt[xt+0]==47&&!(wt[xt+4]>>5),st[0]=ze[0];Ie=0}if(Z=Z[0],He.Ja=He.Ja[0],He.xa=He.xa[0],B=B[0],Ie!=0)break;if(4294967286<He.Ja)return 3;if(we==null||rt||(we[0]=He.xa?2:1),be=[be],lt=[lt],He.xa){if(5>Z){Ie=7;break}we=be,Ve=lt,rt=ve,O==null||5>Z?O=0:5<=Z&&O[B+0]==47&&!(O[B+4]>>5)?(ze=[0],wt=[0],it=[0],V(st=new F,O,B,Z),qt(st,ze,wt,it)?(we!=null&&(we[0]=ze[0]),Ve!=null&&(Ve[0]=wt[0]),rt!=null&&(rt[0]=it[0]),O=1):O=0):O=0}else{if(10>Z){Ie=7;break}we=lt,O==null||10>Z||!hi(O,B+3,Z-3)?O=0:(Ve=O[B+0]|O[B+1]<<8|O[B+2]<<16,rt=16383&(O[B+7]<<8|O[B+6]),O=16383&(O[B+9]<<8|O[B+8]),1&Ve||3<(Ve>>1&7)||!(Ve>>4&1)||Ve>>5>=He.Ja||!rt||!O?O=0:(be&&(be[0]=rt),we&&(we[0]=O),O=1))}if(!O||(be=be[0],lt=lt[0],Ye&&(Oe[0]!=be||Fe[0]!=lt)))return 3;_e!=null&&(_e[0]=He,_e.offset=B-_e.w,t(4294967286>B-_e.w),t(_e.offset==_e.ha-Z));break}return Ie==0||Ie==7&&Ye&&_e==null?(ve!=null&&(ve[0]|=He.na!=null&&0<He.na.length),ie!=null&&(ie[0]=be),he!=null&&(he[0]=lt),0):Ie}function rl(O,B,Z){var ie=B.width,he=B.height,ve=0,be=0,we=ie,_e=he;if(B.Da=O!=null&&0<O.Da,B.Da&&(we=O.cd,_e=O.bd,ve=O.v,be=O.j,11>Z||(ve&=-2,be&=-2),0>ve||0>be||0>=we||0>=_e||ve+we>ie||be+_e>he))return 0;if(B.v=ve,B.j=be,B.va=ve+we,B.o=be+_e,B.U=we,B.T=_e,B.da=O!=null&&0<O.da,B.da){if(!Ee(we,_e,Z=[O.ib],ve=[O.hb]))return 0;B.ib=Z[0],B.hb=ve[0]}return B.ob=O!=null&&O.ob,B.Kb=O==null||!O.Sd,B.da&&(B.ob=B.ib<3*ie/4&&B.hb<3*he/4,B.Kb=0),1}function Sl(O){if(O==null)return 2;if(11>O.S){var B=O.f.RGBA;B.fb+=(O.height-1)*B.A,B.A=-B.A}else B=O.f.kb,O=O.height,B.O+=(O-1)*B.fa,B.fa=-B.fa,B.N+=(O-1>>1)*B.Ab,B.Ab=-B.Ab,B.W+=(O-1>>1)*B.Db,B.Db=-B.Db,B.F!=null&&(B.J+=(O-1)*B.lb,B.lb=-B.lb);return 0}function ra(O,B,Z,ie){if(ie==null||0>=O||0>=B)return 2;if(Z!=null){if(Z.Da){var he=Z.cd,ve=Z.bd,be=-2&Z.v,we=-2&Z.j;if(0>be||0>we||0>=he||0>=ve||be+he>O||we+ve>B)return 2;O=he,B=ve}if(Z.da){if(!Ee(O,B,he=[Z.ib],ve=[Z.hb]))return 2;O=he[0],B=ve[0]}}ie.width=O,ie.height=B;e:{var _e=ie.width,Oe=ie.height;if(O=ie.S,0>=_e||0>=Oe||!(O>=Ol&&13>O))O=2;else{if(0>=ie.Rd&&ie.sd==null){be=ve=he=B=0;var Fe=(we=_e*Tl[O])*Oe;if(11>O||(ve=(Oe+1)/2*(B=(_e+1)/2),O==12&&(be=(he=_e)*Oe)),(Oe=a(Fe+2*ve+be))==null){O=1;break e}ie.sd=Oe,11>O?((_e=ie.f.RGBA).eb=Oe,_e.fb=0,_e.A=we,_e.size=Fe):((_e=ie.f.kb).y=Oe,_e.O=0,_e.fa=we,_e.Fd=Fe,_e.f=Oe,_e.N=0+Fe,_e.Ab=B,_e.Cd=ve,_e.ea=Oe,_e.W=0+Fe+ve,_e.Db=B,_e.Ed=ve,O==12&&(_e.F=Oe,_e.J=0+Fe+2*ve),_e.Tc=be,_e.lb=he)}if(B=1,he=ie.S,ve=ie.width,be=ie.height,he>=Ol&&13>he)if(11>he)O=ie.f.RGBA,B&=(we=Math.abs(O.A))*(be-1)+ve<=O.size,B&=we>=ve*Tl[he],B&=O.eb!=null;else{O=ie.f.kb,we=(ve+1)/2,Fe=(be+1)/2,_e=Math.abs(O.fa),Oe=Math.abs(O.Ab);var Ye=Math.abs(O.Db),Ve=Math.abs(O.lb),He=Ve*(be-1)+ve;B&=_e*(be-1)+ve<=O.Fd,B&=Oe*(Fe-1)+we<=O.Cd,B=(B&=Ye*(Fe-1)+we<=O.Ed)&_e>=ve&Oe>=we&Ye>=we,B&=O.y!=null,B&=O.f!=null,B&=O.ea!=null,he==12&&(B&=Ve>=ve,B&=He<=O.Tc,B&=O.F!=null)}else B=0;O=B?0:2}}return O!=0||Z!=null&&Z.fd&&(O=Sl(ie)),O}var Wr=64,nl=[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],El=24,ka=32,$a=8,xi=[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"),N.Predictor0=function(){return 4278190080},N.Predictor1=function(O){return O},N.Predictor2=function(O,B,Z){return B[Z+0]},N.Predictor3=function(O,B,Z){return B[Z+1]},N.Predictor4=function(O,B,Z){return B[Z-1]},N.Predictor5=function(O,B,Z){return ge(ge(O,B[Z+1]),B[Z+0])},N.Predictor6=function(O,B,Z){return ge(O,B[Z-1])},N.Predictor7=function(O,B,Z){return ge(O,B[Z+0])},N.Predictor8=function(O,B,Z){return ge(B[Z-1],B[Z+0])},N.Predictor9=function(O,B,Z){return ge(B[Z+0],B[Z+1])},N.Predictor10=function(O,B,Z){return ge(ge(O,B[Z-1]),ge(B[Z+0],B[Z+1]))},N.Predictor11=function(O,B,Z){var ie=B[Z+0];return 0>=Qe(ie>>24&255,O>>24&255,(B=B[Z-1])>>24&255)+Qe(ie>>16&255,O>>16&255,B>>16&255)+Qe(ie>>8&255,O>>8&255,B>>8&255)+Qe(255&ie,255&O,255&B)?ie:O},N.Predictor12=function(O,B,Z){var ie=B[Z+0];return(Re((O>>24&255)+(ie>>24&255)-((B=B[Z-1])>>24&255))<<24|Re((O>>16&255)+(ie>>16&255)-(B>>16&255))<<16|Re((O>>8&255)+(ie>>8&255)-(B>>8&255))<<8|Re((255&O)+(255&ie)-(255&B)))>>>0},N.Predictor13=function(O,B,Z){var ie=B[Z-1];return(Be((O=ge(O,B[Z+0]))>>24&255,ie>>24&255)<<24|Be(O>>16&255,ie>>16&255)<<16|Be(O>>8&255,ie>>8&255)<<8|Be(O>>0&255,ie>>0&255))>>>0};var il=N.PredictorAdd0;N.PredictorAdd1=ct,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 go=N.PredictorAdd2;pt("ColorIndexInverseTransform","MapARGB","32b",function(O){return O>>8&255},function(O){return O}),pt("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(O){return O},function(O){return O>>8&255});var Hu,pi=N.ColorIndexInverseTransform,Di=N.MapARGB,Rs=N.VP8LColorIndexInverseTransformAlpha,To=N.MapAlpha,gi=N.VP8LPredictorsAdd=[];gi.length=16,(N.VP8LPredictors=[]).length=16,(N.VP8LPredictorsAdd_C=[]).length=16,(N.VP8LPredictors_C=[]).length=16;var is,ai,Bi,as,Mr,vo,al,Ro,_r,Mo,Hn,vr,yn,Vn,os,Io,jo,Wa,Pn,mo,Fo,Do,zi,Jr,Si,Yr,Ir,Rn,Kn=a(511),Bo=a(2041),Pl=a(225),ol=a(767),ou=0,zo=Bo,Al=Pl,vi=ol,Ya=Kn,Ol=0,qo=1,uf=2,Cl=3,su=4,en=5,Vu=6,kl=7,Ms=8,lu=9,uu=10,cu=[2,3,7],mc=[3,3,11],sl=[280,256,256,256,40],Vf=[0,1,1,1,0],Ih=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Gf=[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],cf=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Gu=8,Is=[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],$u=[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],Nl=null,ff=[[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]],Xa=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],yc=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Wu=[[[[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]]]],$f=[[[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]]],Wf=[[[[255,255,255,255,255,255,255,255,255,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]]]],bc=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],qi=[],Ui=[],na=[],yo=1,fu=2,Hi=[],va=[];at("UpsampleRgbLinePair",cr,3),at("UpsampleBgrLinePair",En,3),at("UpsampleRgbaLinePair",Va,4),at("UpsampleBgraLinePair",ii,4),at("UpsampleArgbLinePair",Xn,4),at("UpsampleRgba4444LinePair",Tn,2),at("UpsampleRgb565LinePair",mn,2);var Yf=N.UpsampleRgbLinePair,Xf=N.UpsampleBgrLinePair,js=N.UpsampleRgbaLinePair,hu=N.UpsampleBgraLinePair,oi=N.UpsampleArgbLinePair,mi=N.UpsampleRgba4444LinePair,wc=N.UpsampleRgb565LinePair,ss=16,bo=1<<ss-1,Ur=-227,Xr=482,ls=6,Ei=0,ia=a(256),ll=a(256),Ll=a(256),aa=a(256),du=a(Xr-Ur),hf=a(Xr-Ur);Ca("YuvToRgbRow",cr,3),Ca("YuvToBgrRow",En,3),Ca("YuvToRgbaRow",Va,4),Ca("YuvToBgraRow",ii,4),Ca("YuvToArgbRow",Xn,4),Ca("YuvToRgba4444Row",Tn,2),Ca("YuvToRgb565Row",mn,2);var Yu=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],us=[0,2,8],Kf=[8,7,6,4,4,2,2,2,1,1,1,1],cs=1;this.WebPDecodeRGBA=function(O,B,Z,ie,he){var ve=qo,be=new Un,we=new Ut;be.ba=we,we.S=ve,we.width=[we.width],we.height=[we.height];var _e=we.width,Oe=we.height,Fe=new kn;if(Fe==null||O==null)var Ye=2;else t(Fe!=null),Ye=Ga(O,B,Z,Fe.width,Fe.height,Fe.Pd,Fe.Qd,Fe.format,null);if(Ye!=0?_e=0:(_e!=null&&(_e[0]=Fe.width[0]),Oe!=null&&(Oe[0]=Fe.height[0]),_e=1),_e){we.width=we.width[0],we.height=we.height[0],ie!=null&&(ie[0]=we.width),he!=null&&(he[0]=we.height);e:{if(ie=new qr,(he=new di).data=O,he.w=B,he.ha=Z,he.kd=1,B=[0],t(he!=null),((O=Ga(he.data,he.w,he.ha,null,null,null,B,null,he))==0||O==7)&&B[0]&&(O=4),(B=O)==0){if(t(be!=null),ie.data=he.data,ie.w=he.w+he.offset,ie.ha=he.ha-he.offset,ie.put=pn,ie.ac=on,ie.bc=ca,ie.ma=be,he.xa){if((O=ha())==null){be=1;break e}if(function(Ve,He){var lt=[0],rt=[0],Ie=[0];t:for(;;){if(Ve==null)return 0;if(He==null)return Ve.a=2,0;if(Ve.l=He,Ve.a=0,V(Ve.m,He.data,He.w,He.ha),!qt(Ve.m,lt,rt,Ie)){Ve.a=3;break t}if(Ve.xb=fu,He.width=lt[0],He.height=rt[0],!Pa(lt[0],rt[0],1,Ve,null))break t;return 1}return t(Ve.a!=0),0}(O,ie)){if(ie=(B=ra(ie.width,ie.height,be.Oa,be.ba))==0){t:{ie=O;r:for(;;){if(ie==null){ie=0;break t}if(t(ie.s.yc!=null),t(ie.s.Ya!=null),t(0<ie.s.Wb),t((Z=ie.l)!=null),t((he=Z.ma)!=null),ie.xb!=0){if(ie.ca=he.ba,ie.tb=he.tb,t(ie.ca!=null),!rl(he.Oa,Z,Cl)){ie.a=2;break r}if(!da(ie,Z.width)||Z.da)break r;if((Z.da||Lt(ie.ca.S))&&Xe(),11>ie.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),ie.ca.f.kb.F!=null&&Xe()),ie.Pb&&0<ie.s.ua&&ie.s.vb.X==null&&!ke(ie.s.vb,ie.s.Wa.Xa)){ie.a=1;break r}ie.xb=0}if(!Yn(ie,ie.V,ie.Ba,ie.c,ie.i,Z.o,xa))break r;he.Dc=ie.Ma,ie=1;break t}t(ie.a!=0),ie=0}ie=!ie}ie&&(B=O.a)}else B=O.a}else{if((O=new dr)==null){be=1;break e}if(O.Fa=he.na,O.P=he.P,O.qc=he.Sa,Li(O,ie)){if((B=ra(ie.width,ie.height,be.Oa,be.ba))==0){if(O.Aa=0,Z=be.Oa,t((he=O)!=null),Z!=null){if(0<(_e=0>(_e=Z.Md)?0:100<_e?255:255*_e/100)){for(Oe=Fe=0;4>Oe;++Oe)12>(Ye=he.pb[Oe]).lc&&(Ye.ia=_e*Kf[0>Ye.lc?0:Ye.lc]>>3),Fe|=Ye.ia;Fe&&(alert("todo:VP8InitRandom"),he.ia=1)}he.Ga=Z.Id,100<he.Ga?he.Ga=100:0>he.Ga&&(he.Ga=0)}ti(O,ie)||(B=O.a)}}else B=O.a}B==0&&be.Oa!=null&&be.Oa.fd&&(B=Sl(be.ba))}be=B}ve=be!=0?null:11>ve?we.f.RGBA.eb:we.f.kb.y}else ve=null;return ve};var Tl=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function d(N,M){for(var T="",C=0;C<4;C++)T+=String.fromCharCode(N[M++]);return T}function h(N,M){return(N[M+0]<<0|N[M+1]<<8|N[M+2]<<16)>>>0}function v(N,M){return(N[M+0]<<0|N[M+1]<<8|N[M+2]<<16|N[M+3]<<24)>>>0}new u;var p=[0],f=[0],b=[],_=new u,S=e,x=function(N,M){var T={},C=0,L=!1,H=0,G=0;if(T.frames=[],!function(q,Q,re,Y){for(var ee=0;ee<Y;ee++)if(q[Q+ee]!=re.charCodeAt(ee))return!0;return!1}(N,M,"RIFF",4)){for(v(N,M+=4),M+=8;M<N.length;){var J=d(N,M),se=v(N,M+=4);M+=4;var U=se+(1&se);switch(J){case"VP8 ":case"VP8L":T.frames[C]===void 0&&(T.frames[C]={}),(z=T.frames[C]).src_off=L?G:M-8,z.src_size=H+se+8,C++,L&&(L=!1,H=0,G=0);break;case"VP8X":(z=T.header={}).feature_flags=N[M];var V=M+4;z.canvas_width=1+h(N,V),V+=3,z.canvas_height=1+h(N,V),V+=3;break;case"ALPH":L=!0,H=U+8,G=M-8;break;case"ANIM":(z=T.header).bgcolor=v(N,M),V=M+4,z.loop_count=(D=N)[(F=V)+0]<<0|D[F+1]<<8,V+=2;break;case"ANMF":var X,z;(z=T.frames[C]={}).offset_x=2*h(N,M),M+=3,z.offset_y=2*h(N,M),M+=3,z.width=1+h(N,M),M+=3,z.height=1+h(N,M),M+=3,z.duration=h(N,M),M+=3,X=N[M++],z.dispose=1&X,z.blend=X>>1&1}J!="ANMF"&&(M+=U)}var D,F;return T}}(S,0);x.response=S,x.rgbaoutput=!0,x.dataurl=!1;var m=x.header?x.header:null,w=x.frames?x.frames:null;if(m){m.loop_counter=m.loop_count,p=[m.canvas_height],f=[m.canvas_width];for(var E=0;E<w.length&&w[E].blend!=0;E++);}var P=w[0],R=_.WebPDecodeRGBA(S,P.src_off,P.src_size,f,p);P.rgba=R,P.imgwidth=f[0],P.imgheight=p[0];for(var k=0;k<f[0]*p[0]*4;k++)b[k]=R[k];return this.width=f,this.height=p,this.data=b,this}(function(e){var t=function(){return typeof gv=="function"},r=function(p,f,b,_){var S=4,x=o;switch(_){case e.image_compression.FAST:S=1,x=a;break;case e.image_compression.MEDIUM:S=6,x=l;break;case e.image_compression.SLOW:S=9,x=u}p=n(p,f,b,x);var m=gv(p,{level:S});return e.__addimage__.arrayBufferToBinaryString(m)},n=function(p,f,b,_){for(var S,x,m,w=p.length/f,E=new Uint8Array(p.length+w),P=h(),R=0;R<w;R+=1){if(m=R*f,S=p.subarray(m,m+f),_)E.set(_(S,b,x),m+R);else{for(var k,N=P.length,M=[];k<N;k+=1)M[k]=P[k](S,b,x);var T=v(M.concat());E.set(M[T],m+R)}x=S}return E},i=function(p){var f=Array.apply([],p);return f.unshift(0),f},a=function(p,f){var b,_=[],S=p.length;_[0]=1;for(var x=0;x<S;x+=1)b=p[x-f]||0,_[x+1]=p[x]-b+256&255;return _},o=function(p,f,b){var _,S=[],x=p.length;S[0]=2;for(var m=0;m<x;m+=1)_=b&&b[m]||0,S[m+1]=p[m]-_+256&255;return S},l=function(p,f,b){var _,S,x=[],m=p.length;x[0]=3;for(var w=0;w<m;w+=1)_=p[w-f]||0,S=b&&b[w]||0,x[w+1]=p[w]+256-(_+S>>>1)&255;return x},u=function(p,f,b){var _,S,x,m,w=[],E=p.length;w[0]=4;for(var P=0;P<E;P+=1)_=p[P-f]||0,S=b&&b[P]||0,x=b&&b[P-f]||0,m=d(_,S,x),w[P+1]=p[P]-m+256&255;return w},d=function(p,f,b){if(p===f&&f===b)return p;var _=Math.abs(f-b),S=Math.abs(p-b),x=Math.abs(p+f-b-b);return _<=S&&_<=x?p:S<=x?f:b},h=function(){return[i,a,o,l,u]},v=function(p){var f=p.map(function(b){return b.reduce(function(_,S){return _+Math.abs(S)},0)});return f.indexOf(Math.min.apply(null,f))};e.processPNG=function(p,f,b,_){var S,x,m,w,E,P,R,k,N,M,T,C,L,H,G,J=this.decode.FLATE_DECODE,se="";if(this.__addimage__.isArrayBuffer(p)&&(p=new Uint8Array(p)),this.__addimage__.isArrayBufferView(p)){if(p=(m=new Dk(p)).imgData,x=m.bits,S=m.colorSpace,E=m.colors,[4,6].indexOf(m.colorType)!==-1){if(m.bits===8){N=(k=m.pixelBitlength==32?new Uint32Array(m.decodePixels().buffer):m.pixelBitlength==16?new Uint16Array(m.decodePixels().buffer):new Uint8Array(m.decodePixels().buffer)).length,T=new Uint8Array(N*m.colors),M=new Uint8Array(N);var U,V=m.pixelBitlength-m.bits;for(H=0,G=0;H<N;H++){for(L=k[H],U=0;U<V;)T[G++]=L>>>U&255,U+=m.bits;M[H]=L>>>U&255}}if(m.bits===16){N=(k=new Uint32Array(m.decodePixels().buffer)).length,T=new Uint8Array(N*(32/m.pixelBitlength)*m.colors),M=new Uint8Array(N*(32/m.pixelBitlength)),C=m.colors>1,H=0,G=0;for(var X=0;H<N;)L=k[H++],T[G++]=L>>>0&255,C&&(T[G++]=L>>>16&255,L=k[H++],T[G++]=L>>>0&255),M[X++]=L>>>16&255;x=8}_!==e.image_compression.NONE&&t()?(p=r(T,m.width*m.colors,m.colors,_),R=r(M,m.width,1,_)):(p=T,R=M,J=void 0)}if(m.colorType===3&&(S=this.color_spaces.INDEXED,P=m.palette,m.transparency.indexed)){var z=m.transparency.indexed,D=0;for(H=0,N=z.length;H<N;++H)D+=z[H];if((D/=255)===N-1&&z.indexOf(0)!==-1)w=[z.indexOf(0)];else if(D!==N){for(k=m.decodePixels(),M=new Uint8Array(k.length),H=0,N=k.length;H<N;H++)M[H]=z[k[H]];R=r(M,m.width,1)}}var F=function(q){var Q;switch(q){case e.image_compression.FAST:Q=11;break;case e.image_compression.MEDIUM:Q=13;break;case e.image_compression.SLOW:Q=14;break;default:Q=12}return Q}(_);return J===this.decode.FLATE_DECODE&&(se="/Predictor "+F+" "),se+="/Colors "+E+" /BitsPerComponent "+x+" /Columns "+m.width,(this.__addimage__.isArrayBuffer(p)||this.__addimage__.isArrayBufferView(p))&&(p=this.__addimage__.arrayBufferToBinaryString(p)),(R&&this.__addimage__.isArrayBuffer(R)||this.__addimage__.isArrayBufferView(R))&&(R=this.__addimage__.arrayBufferToBinaryString(R)),{alias:b,data:p,index:f,filter:J,decodeParameters:se,transparency:w,palette:P,sMask:R,predictor:F,width:m.width,height:m.height,bitsPerComponent:x,colorSpace:S}}}})(Zt.API),function(e){e.processGIF89A=function(t,r,n,i){var a=new Bk(t),o=a.width,l=a.height,u=[];a.decodeAndBlitFrameRGBA(0,u);var d={data:u,width:o,height:l},h=new B2(100).encode(d,100);return e.processJPEG.call(this,h,r,n,i)},e.processGIF87A=e.processGIF89A}(Zt.API),ql.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){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[t]={red:i,green:n,blue:r,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},ql.prototype.parseBGR=function(){this.pos=this.offset;try{var e="bit"+this.bitPP,t=this.width*this.height*4;this.data=new Uint8Array(t),this[e]()}catch(r){qn.log("bit decode error:"+r)}},ql.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),r=t%4;for(e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,i=0;i<t;i++)for(var a=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+8*i*4,l=0;l<8&&8*i+l<this.width;l++){var u=this.palette[a>>7-l&1];this.data[o+4*l]=u.blue,this.data[o+4*l+1]=u.green,this.data[o+4*l+2]=u.red,this.data[o+4*l+3]=255}r!==0&&(this.pos+=4-r)}},ql.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i<e;i++){var a=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+2*i*4,l=a>>4,u=15&a,d=this.palette[l];if(this.data[o]=d.blue,this.data[o+1]=d.green,this.data[o+2]=d.red,this.data[o+3]=255,2*i+1>=this.width)break;d=this.palette[u],this.data[o+4]=d.blue,this.data[o+4+1]=d.green,this.data[o+4+2]=d.red,this.data[o+4+3]=255}t!==0&&(this.pos+=4-t)}},ql.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,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}e!==0&&(this.pos+=4-e)}},ql.prototype.bit15=function(){for(var e=this.width%3,t=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&t)/t*255|0,l=(a>>5&t)/t*255|0,u=(a>>10&t)/t*255|0,d=a>>15?255:0,h=n*this.width*4+4*i;this.data[h]=u,this.data[h+1]=l,this.data[h+2]=o,this.data[h+3]=d}this.pos+=e}},ql.prototype.bit16=function(){for(var e=this.width%3,t=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 l=(o&t)/t*255|0,u=(o>>5&r)/r*255|0,d=(o>>11)/t*255|0,h=i*this.width*4+4*a;this.data[h]=d,this.data[h+1]=u,this.data[h+2]=l,this.data[h+3]=255}this.pos+=e}},ql.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,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=t*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}},ql.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,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),l=t*this.width*4+4*r;this.data[l]=a,this.data[l+1]=i,this.data[l+2]=n,this.data[l+3]=o}},ql.prototype.getData=function(){return this.data},function(e){e.processBMP=function(t,r,n,i){var a=new ql(t,!1),o=a.width,l=a.height,u={data:a.getData(),width:o,height:l},d=new B2(100).encode(u,100);return e.processJPEG.call(this,d,r,n,i)}}(Zt.API),u4.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(t,r,n,i){var a=new u4(t),o=a.width,l=a.height,u={data:a.getData(),width:o,height:l},d=new B2(100).encode(u,100);return e.processJPEG.call(this,d,r,n,i)}}(Zt.API),Zt.API.processRGBA=function(e,t,r){for(var n=e.data,i=n.length,a=new Uint8Array(i/4*3),o=new Uint8Array(i/4),l=0,u=0,d=0;d<i;d+=4){var h=n[d],v=n[d+1],p=n[d+2],f=n[d+3];a[l++]=h,a[l++]=v,a[l++]=p,o[u++]=f}var b=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:b,index:t,alias:r,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},Zt.API.setLanguage=function(e){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]!==void 0&&(this.internal.languageSettings.languageCode=e,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},ch=Zt.API,n1=ch.getCharWidthsArray=function(e,t){var r,n,i=(t=t||{}).font||this.internal.getFont(),a=t.fontSize||this.internal.getFontSize(),o=t.charSpace||this.internal.getCharSpace(),l=t.widths?t.widths:i.metadata.Unicode.widths,u=l.fof?l.fof:1,d=t.kerning?t.kerning:i.metadata.Unicode.kerning,h=d.fof?d.fof:1,v=t.doKerning!==!1,p=0,f=e.length,b=0,_=l[0]||u,S=[];for(r=0;r<f;r++)n=e.charCodeAt(r),typeof i.metadata.widthOfString=="function"?S.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(n))+o*(1e3/a)||0)/1e3):(p=v&&Sn(d[n])==="object"&&!isNaN(parseInt(d[n][b],10))?d[n][b]/h:0,S.push((l[n]||_)/u+p)),b=n;return S},a4=ch.getStringUnitWidth=function(e,t){var r=(t=t||{}).fontSize||this.internal.getFontSize(),n=t.font||this.internal.getFont(),i=t.charSpace||this.internal.getCharSpace();return ch.processArabic&&(e=ch.processArabic(e)),typeof n.metadata.widthOfString=="function"?n.metadata.widthOfString(e,r,i)/r:n1.apply(this,arguments).reduce(function(a,o){return a+o},0)},o4=function(e,t,r,n){for(var i=[],a=0,o=e.length,l=0;a!==o&&l+t[a]<r;)l+=t[a],a++;i.push(e.slice(0,a));var u=a;for(l=0;a!==o;)l+t[a]>n&&(i.push(e.slice(u,a)),l=0,u=a),l+=t[a],a++;return u!==a&&i.push(e.slice(u,a)),i},s4=function(e,t,r){r||(r={});var n,i,a,o,l,u,d,h=[],v=[h],p=r.textIndent||0,f=0,b=0,_=e.split(" "),S=n1.apply(this,[" ",r])[0];if(u=r.lineIndent===-1?_[0].length+2:r.lineIndent||0){var x=Array(u).join(" "),m=[];_.map(function(E){(E=E.split(/\s*\n/)).length>1?m=m.concat(E.map(function(P,R){return(R&&P.length?`
579
- `:"")+P})):m.push(E[0])}),_=m,u=a4.apply(this,[x,r])}for(a=0,o=_.length;a<o;a++){var w=0;if(n=_[a],u&&n[0]==`
580
- `&&(n=n.substr(1),w=1),p+f+(b=(i=n1.apply(this,[n,r])).reduce(function(E,P){return E+P},0))>t||w){if(b>t){for(l=o4.apply(this,[n,i,t-(p+f),t]),h.push(l.shift()),h=[l.pop()];l.length;)v.push([l.shift()]);b=i.slice(n.length-(h[0]?h[0].length:0)).reduce(function(E,P){return E+P},0)}else h=[n];v.push(h),p=b+u,f=S}else h.push(n),p+=f+b,f=S}return d=u?function(E,P){return(P?x:"")+E.join(" ")}:function(E){return E.join(" ")},v.map(d)},ch.splitTextToSize=function(e,t,r){var n,i=(r=r||{}).fontSize||this.internal.getFontSize(),a=(function(h){if(h.widths&&h.kerning)return{widths:h.widths,kerning:h.kerning};var v=this.internal.getFont(h.fontName,h.fontStyle);return v.metadata.Unicode?{widths:v.metadata.Unicode.widths||{0:1},kerning:v.metadata.Unicode.kerning||{}}:{font:v.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,r);n=Array.isArray(e)?e:String(e).split(/\r?\n/);var o=1*this.internal.scaleFactor*t/i;a.textIndent=r.textIndent?1*r.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=r.lineIndent;var l,u,d=[];for(l=0,u=n.length;l<u;l++)d=d.concat(s4.apply(this,[n[l],o,a]));return d},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="klmnopqrstuvwxyz",r={},n={},i=0;i<t.length;i++)r[t[i]]="0123456789abcdef"[i],n["0123456789abcdef"[i]]=t[i];var a=function(v){return"0x"+parseInt(v,10).toString(16)},o=e.__fontmetrics__.compress=function(v){var p,f,b,_,S=["{"];for(var x in v){if(p=v[x],isNaN(parseInt(x,10))?f="'"+x+"'":(x=parseInt(x,10),f=(f=a(x).slice(2)).slice(0,-1)+n[f.slice(-1)]),typeof p=="number")p<0?(b=a(p).slice(3),_="-"):(b=a(p).slice(2),_=""),b=_+b.slice(0,-1)+n[b.slice(-1)];else{if(Sn(p)!=="object")throw new Error("Don't know what to do with value type "+Sn(p)+".");b=o(p)}S.push(f+b)}return S.push("}"),S.join("")},l=e.__fontmetrics__.uncompress=function(v){if(typeof v!="string")throw new Error("Invalid argument passed to uncompress.");for(var p,f,b,_,S={},x=1,m=S,w=[],E="",P="",R=v.length-1,k=1;k<R;k+=1)(_=v[k])=="'"?p?(b=p.join(""),p=void 0):p=[]:p?p.push(_):_=="{"?(w.push([m,b]),m={},b=void 0):_=="}"?((f=w.pop())[0][f[1]]=m,b=void 0,m=f[0]):_=="-"?x=-1:b===void 0?r.hasOwnProperty(_)?(E+=r[_],b=parseInt(E,16)*x,x=1,E=""):E+=_:r.hasOwnProperty(_)?(P+=r[_],m[b]=parseInt(P,16)*x,x=1,b=void 0,P=""):P+=_;return S},u={codePages:["WinAnsiEncoding"],WinAnsiEncoding:l("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},d={Unicode:{Courier:u,"Courier-Bold":u,"Courier-BoldOblique":u,"Courier-Oblique":u,Helvetica:u,"Helvetica-Bold":u,"Helvetica-BoldOblique":u,"Helvetica-Oblique":u,"Times-Roman":u,"Times-Bold":u,"Times-BoldItalic":u,"Times-Italic":u}},h={Unicode:{"Courier-Oblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":l("{'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":l("{'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:l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":l("{'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:l("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:l("{'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":l("{'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:l("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":l("{'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":l("{'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":l("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(v){var p=v.font,f=h.Unicode[p.postScriptName];f&&(p.metadata.Unicode={},p.metadata.Unicode.widths=f.widths,p.metadata.Unicode.kerning=f.kerning);var b=d.Unicode[p.postScriptName];b&&(p.metadata.Unicode.encoding=b,p.encoding=b.codePages[0])}])}(Zt.API),function(e){var t=function(r){for(var n=r.length,i=new Uint8Array(n),a=0;a<n;a++)i[a]=r.charCodeAt(a);return i};e.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,l){l=/^\x00\x01\x00\x00/.test(l)?t(l):t(Yd(l)),o.metadata=e.API.TTFFont.open(l),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(i,n)}}])}(Zt),function(e){function t(){return(er.canvg?Promise.resolve(er.canvg):cv(()=>import("./index.es-C4g1QahI.js"),[],import.meta.url)).catch(function(r){return Promise.reject(new Error("Could not load canvg: "+r))}).then(function(r){return r.default?r.default:r})}Zt.API.addSvgAsImage=function(r,n,i,a,o,l,u,d){if(isNaN(n)||isNaN(i))throw qn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(a)||isNaN(o))throw qn.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=a,h.height=o;var v=h.getContext("2d");v.fillStyle="#fff",v.fillRect(0,0,h.width,h.height);var p={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return t().then(function(b){return b.fromString(v,r,p)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(b){return b.render(p)}).then(function(){f.addImage(h.toDataURL("image/jpeg",1),n,i,a,o,u,d)})}}(),Zt.API.putTotalPages=function(e){var t,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),r=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,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(t,r);return this},Zt.API.viewerPreferences=function(e,t){var r;e=e||{},t=t||!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}},l=Object.keys(o),u=[],d=0,h=0,v=0;function p(b,_){var S,x=!1;for(S=0;S<b.length;S+=1)b[S]===_&&(x=!0);return x}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),r=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var f=l.length;for(v=0;v<f;v+=1)r[l[v]].value=r[l[v]].defaultValue,r[l[v]].explicitSet=!1}if(Sn(e)==="object"){for(i in e)if(a=e[i],p(l,i)&&a!==void 0){if(r[i].type==="boolean"&&typeof a=="boolean")r[i].value=a;else if(r[i].type==="name"&&p(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(d=0;d<a.length;d+=1)if(n=!0,a[d].length===1&&typeof a[d][0]=="number")u.push(String(a[d]-1));else if(a[d].length>1){for(h=0;h<a[d].length;h+=1)typeof a[d][h]!="number"&&(n=!1);n===!0&&u.push([a[d][0]-1,a[d][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 b,_=[];for(b in r)r[b].explicitSet===!0&&(r[b].type==="name"?_.push("/"+b+" /"+r[b].value):_.push("/"+b+" "+r[b].value));_.length!==0&&this.internal.write(`/ViewerPreferences
581
- <<
582
- `+_.join(`
583
- `)+`
584
- >>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=r,this},function(e){var t=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)),l=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),u=unescape(encodeURIComponent("</x:xmpmeta>")),d=a.length+o.length+l.length+i.length+u.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+d+" >>"),this.internal.write("stream"),this.internal.write(i+a+o+l+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")};e.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",t)),this}}(Zt.API),function(e){var t=e.API,r=t.pdfEscape16=function(a,o){for(var l,u=o.metadata.Unicode.widths,d=["","0","00","000","0000"],h=[""],v=0,p=a.length;v<p;++v){if(l=o.metadata.characterToGlyph(a.charCodeAt(v)),o.metadata.glyIdsUsed.push(l),o.metadata.toUnicode[l]=a.charCodeAt(v),u.indexOf(l)==-1&&(u.push(l),u.push([parseInt(o.metadata.widthOfGlyph(l),10)])),l=="0")return h.join("");l=l.toString(16),h.push(d[4-l.length],l)}return h.join("")},n=function(a){var o,l,u,d,h,v,p;for(h=`/CIDInit /ProcSet findresource begin
585
- 12 dict begin
586
- begincmap
587
- /CIDSystemInfo <<
588
- /Registry (Adobe)
589
- /Ordering (UCS)
590
- /Supplement 0
591
- >> def
592
- /CMapName /Adobe-Identity-UCS def
593
- /CMapType 2 def
594
- 1 begincodespacerange
595
- <0000><ffff>
596
- endcodespacerange`,u=[],v=0,p=(l=Object.keys(a).sort(function(f,b){return f-b})).length;v<p;v++)o=l[v],u.length>=100&&(h+=`
597
- `+u.length+` beginbfchar
598
- `+u.join(`
599
- `)+`
600
- endbfchar`,u=[]),a[o]!==void 0&&a[o]!==null&&typeof a[o].toString=="function"&&(d=("0000"+a[o].toString(16)).slice(-4),o=("0000"+(+o).toString(16)).slice(-4),u.push("<"+o+"><"+d+">"));return u.length&&(h+=`
601
- `+u.length+` beginbfchar
602
- `+u.join(`
603
- `)+`
604
- endbfchar
605
- `),h+=`endcmap
606
- CMapName currentdict /CMap defineresource pop
607
- end
608
- end`};t.events.push(["putFont",function(a){(function(o){var l=o.font,u=o.out,d=o.newObject,h=o.putStream;if(l.metadata instanceof e.API.TTFFont&&l.encoding==="Identity-H"){for(var v=l.metadata.Unicode.widths,p=l.metadata.subset.encode(l.metadata.glyIdsUsed,1),f="",b=0;b<p.length;b++)f+=String.fromCharCode(p[b]);var _=d();h({data:f,addLength1:!0,objectId:_}),u("endobj");var S=d();h({data:n(l.metadata.toUnicode),addLength1:!0,objectId:S}),u("endobj");var x=d();u("<<"),u("/Type /FontDescriptor"),u("/FontName /"+hh(l.fontName)),u("/FontFile2 "+_+" 0 R"),u("/FontBBox "+e.API.PDFObject.convert(l.metadata.bbox)),u("/Flags "+l.metadata.flags),u("/StemV "+l.metadata.stemV),u("/ItalicAngle "+l.metadata.italicAngle),u("/Ascent "+l.metadata.ascender),u("/Descent "+l.metadata.decender),u("/CapHeight "+l.metadata.capHeight),u(">>"),u("endobj");var m=d();u("<<"),u("/Type /Font"),u("/BaseFont /"+hh(l.fontName)),u("/FontDescriptor "+x+" 0 R"),u("/W "+e.API.PDFObject.convert(v)),u("/CIDToGIDMap /Identity"),u("/DW 1000"),u("/Subtype /CIDFontType2"),u("/CIDSystemInfo"),u("<<"),u("/Supplement 0"),u("/Registry (Adobe)"),u("/Ordering ("+l.encoding+")"),u(">>"),u(">>"),u("endobj"),l.objectNumber=d(),u("<<"),u("/Type /Font"),u("/Subtype /Type0"),u("/ToUnicode "+S+" 0 R"),u("/BaseFont /"+hh(l.fontName)),u("/Encoding /"+l.encoding),u("/DescendantFonts ["+m+" 0 R]"),u(">>"),u("endobj"),l.isAlreadyPutted=!0}})(a)}]),t.events.push(["putFont",function(a){(function(o){var l=o.font,u=o.out,d=o.newObject,h=o.putStream;if(l.metadata instanceof e.API.TTFFont&&l.encoding==="WinAnsiEncoding"){for(var v=l.metadata.rawData,p="",f=0;f<v.length;f++)p+=String.fromCharCode(v[f]);var b=d();h({data:p,addLength1:!0,objectId:b}),u("endobj");var _=d();h({data:n(l.metadata.toUnicode),addLength1:!0,objectId:_}),u("endobj");var S=d();u("<<"),u("/Descent "+l.metadata.decender),u("/CapHeight "+l.metadata.capHeight),u("/StemV "+l.metadata.stemV),u("/Type /FontDescriptor"),u("/FontFile2 "+b+" 0 R"),u("/Flags 96"),u("/FontBBox "+e.API.PDFObject.convert(l.metadata.bbox)),u("/FontName /"+hh(l.fontName)),u("/ItalicAngle "+l.metadata.italicAngle),u("/Ascent "+l.metadata.ascender),u(">>"),u("endobj"),l.objectNumber=d();for(var x=0;x<l.metadata.hmtx.widths.length;x++)l.metadata.hmtx.widths[x]=parseInt(l.metadata.hmtx.widths[x]*(1e3/l.metadata.head.unitsPerEm));u("<</Subtype/TrueType/Type/Font/ToUnicode "+_+" 0 R/BaseFont/"+hh(l.fontName)+"/FontDescriptor "+S+" 0 R/Encoding/"+l.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(l.metadata.hmtx.widths)+">>"),u("endobj"),l.isAlreadyPutted=!0}})(a)}]);var i=function(a){var o,l=a.text||"",u=a.x,d=a.y,h=a.options||{},v=a.mutex||{},p=v.pdfEscape,f=v.activeFontKey,b=v.fonts,_=f,S="",x=0,m="",w=b[_].encoding;if(b[_].encoding!=="Identity-H")return{text:l,x:u,y:d,options:h,mutex:v};for(m=l,_=f,Array.isArray(l)&&(m=l[0]),x=0;x<m.length;x+=1)b[_].metadata.hasOwnProperty("cmap")&&(o=b[_].metadata.cmap.unicode.codeMap[m[x].charCodeAt(0)]),o||m[x].charCodeAt(0)<256&&b[_].metadata.hasOwnProperty("Unicode")?S+=m[x]:S+="";var E="";return parseInt(_.slice(1))<14||w==="WinAnsiEncoding"?E=p(S,_).split("").map(function(P){return P.charCodeAt(0).toString(16)}).join(""):w==="Identity-H"&&(E=r(S,b[_])),v.isHex=!0,{text:E,x:u,y:d,options:h,mutex:v}};t.events.push(["postProcessText",function(a){var o=a.text||"",l=[],u={text:o,x:a.x,y:a.y,options:a.options,mutex:a.mutex};if(Array.isArray(o)){var d=0;for(d=0;d<o.length;d+=1)Array.isArray(o[d])&&o[d].length===3?l.push([i(Object.assign({},u,{text:o[d][0]})).text,o[d][1],o[d][2]]):l.push(i(Object.assign({},u,{text:o[d]})).text);a.text=l}else a.text=i(Object.assign({},u,{text:o})).text}])}(Zt),function(e){var t=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(r){return t.call(this),this.internal.vFS[r]!==void 0},e.addFileToVFS=function(r,n){return t.call(this),this.internal.vFS[r]=n,this},e.getFileFromVFS=function(r){return t.call(this),this.internal.vFS[r]!==void 0?this.internal.vFS[r]:null}}(Zt.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(n){var i,a,o,l,u,d,h,v=t,p=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],f=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],b={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},S=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],x=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),m=!1,w=0;this.__bidiEngine__={};var E=function(C){var L=C.charCodeAt(),H=L>>8,G=_[H];return G!==void 0?v[256*G+(255&L)]:H===252||H===253?"AL":x.test(H)?"L":H===8?"R":"N"},P=function(C){for(var L,H=0;H<C.length;H++){if((L=E(C.charAt(H)))==="L")return!1;if(L==="R")return!0}return!1},R=function(C,L,H,G){var J,se,U,V,X=L[G];switch(X){case"L":case"R":m=!1;break;case"N":case"AN":break;case"EN":m&&(X="AN");break;case"AL":m=!0,X="R";break;case"WS":X="N";break;case"CS":G<1||G+1>=L.length||(J=H[G-1])!=="EN"&&J!=="AN"||(se=L[G+1])!=="EN"&&se!=="AN"?X="N":m&&(se="AN"),X=se===J?se:"N";break;case"ES":X=(J=G>0?H[G-1]:"B")==="EN"&&G+1<L.length&&L[G+1]==="EN"?"EN":"N";break;case"ET":if(G>0&&H[G-1]==="EN"){X="EN";break}if(m){X="N";break}for(U=G+1,V=L.length;U<V&&L[U]==="ET";)U++;X=U<V&&L[U]==="EN"?"EN":"N";break;case"NSM":if(o&&!l){for(V=L.length,U=G+1;U<V&&L[U]==="NSM";)U++;if(U<V){var z=C[G],D=z>=1425&&z<=2303||z===64286;if(J=L[U],D&&(J==="R"||J==="AL")){X="R";break}}}X=G<1||(J=L[G-1])==="B"?"N":H[G-1];break;case"B":m=!1,i=!0,X=w;break;case"S":a=!0,X="N";break;case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":m=!1;break;case"BN":X="N"}return X},k=function(C,L,H){var G=C.split("");return H&&N(G,H,{hiLevel:w}),G.reverse(),L&&L.reverse(),G.join("")},N=function(C,L,H){var G,J,se,U,V,X=-1,z=C.length,D=0,F=[],q=w?f:p,Q=[];for(m=!1,i=!1,a=!1,J=0;J<z;J++)Q[J]=E(C[J]);for(se=0;se<z;se++){if(V=D,F[se]=R(C,Q,F,se),G=240&(D=q[V][b[F[se]]]),D&=15,L[se]=U=q[D][5],G>0)if(G===16){for(J=X;J<se;J++)L[J]=1;X=-1}else X=-1;if(q[D][6])X===-1&&(X=se);else if(X>-1){for(J=X;J<se;J++)L[J]=U;X=-1}Q[se]==="B"&&(L[se]=0),H.hiLevel|=U}a&&function(re,Y,ee){for(var ae=0;ae<ee;ae++)if(re[ae]==="S"){Y[ae]=w;for(var ue=ae-1;ue>=0&&re[ue]==="WS";ue--)Y[ue]=w}}(Q,L,z)},M=function(C,L,H,G,J){if(!(J.hiLevel<C)){if(C===1&&w===1&&!i)return L.reverse(),void(H&&H.reverse());for(var se,U,V,X,z=L.length,D=0;D<z;){if(G[D]>=C){for(V=D+1;V<z&&G[V]>=C;)V++;for(X=D,U=V-1;X<U;X++,U--)se=L[X],L[X]=L[U],L[U]=se,H&&(se=H[X],H[X]=H[U],H[U]=se);D=V}D++}}},T=function(C,L,H){var G=C.split(""),J={hiLevel:w};return H||(H=[]),N(G,H,J),function(se,U,V){if(V.hiLevel!==0&&h)for(var X,z=0;z<se.length;z++)U[z]===1&&(X=S.indexOf(se[z]))>=0&&(se[z]=S[X+1])}(G,H,J),M(2,G,L,H,J),M(1,G,L,H,J),G.join("")};return this.__bidiEngine__.doBidiReorder=function(C,L,H){if(function(J,se){if(se)for(var U=0;U<J.length;U++)se[U]=U;l===void 0&&(l=P(J)),d===void 0&&(d=P(J))}(C,L),o||!u||d)if(o&&u&&l^d)w=l?1:0,C=k(C,L,H);else if(!o&&u&&d)w=l?1:0,C=T(C,L,H),C=k(C,L);else if(!o||l||u||d){if(o&&!u&&l^d)C=k(C,L),l?(w=0,C=T(C,L,H)):(w=1,C=T(C,L,H),C=k(C,L));else if(o&&l&&!u&&d)w=1,C=T(C,L,H),C=k(C,L);else if(!o&&!u&&l^d){var G=h;l?(w=1,C=T(C,L,H),w=0,h=!1,C=T(C,L,H),h=G):(w=0,C=T(C,L,H),C=k(C,L),w=1,h=!1,C=T(C,L,H),h=G,C=k(C,L))}}else w=0,C=T(C,L,H);else w=l?1:0,C=T(C,L,H);return C},this.__bidiEngine__.setOptions=function(C){C&&(o=C.isInputVisual,u=C.isOutputVisual,l=C.isInputRtl,d=C.isOutputRtl,h=C.isSymmetricSwapping)},this.__bidiEngine__.setOptions(n),this.__bidiEngine__};var t=["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 e.__bidiEngine__({isInputVisual:!0});e.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 l=0;for(o=[],l=0;l<i.length;l+=1)Object.prototype.toString.call(i[l])==="[object Array]"?o.push([r.doBidiReorder(i[l][0]),i[l][1],i[l][2]]):o.push([r.doBidiReorder(i[l])]);n.text=o}else n.text=r.doBidiReorder(i);r.setOptions({isInputVisual:!0})}])}(Zt),Zt.API.TTFFont=function(){function e(t){var r;if(this.rawData=t,r=this.contents=new ef(t),this.contents.pos=4,r.readString(4)==="ttcf")throw new Error("TTCF not supported.");r.pos=0,this.parse(),this.subset=new eN(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new zk(this.contents),this.head=new Uk(this),this.name=new Wk(this),this.cmap=new C8(this),this.toUnicode={},this.hhea=new Hk(this),this.maxp=new Yk(this),this.hmtx=new Xk(this),this.post=new Gk(this),this.os2=new Vk(this),this.loca=new Jk(this),this.glyf=new Kk(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var t,r,n,i,a;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var o,l,u,d;for(d=[],o=0,l=(u=this.bbox).length;o<l;o++)t=u[o],d.push(Math.round(t*this.scaleFactor));return d}).call(this),this.stemV=0,this.post.exists?(n=255&(i=this.post.italic_angle),(32768&(r=i>>16))!=0&&(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")},e.prototype.characterToGlyph=function(t){var r;return((r=this.cmap.unicode)!=null?r.codeMap[t]:void 0)||0},e.prototype.widthOfGlyph=function(t){var r;return r=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*r},e.prototype.widthOfString=function(t,r,n){var i,a,o,l;for(o=0,a=0,l=(t=""+t).length;0<=l?a<l:a>l;a=0<=l?++a:--a)i=t.charCodeAt(a),o+=this.widthOfGlyph(this.characterToGlyph(i))+n*(1e3/r)||0;return o*(r/1e3)},e.prototype.lineHeight=function(t,r){var n;return r==null&&(r=!1),n=r?this.lineGap:0,(this.ascender+n-this.decender)/1e3*t},e}();var Kl,ef=function(){function e(t){this.data=t??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(t){return this.data[this.pos++]=t},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},e.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},e.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},e.prototype.readString=function(t){var r,n;for(n=[],r=0;0<=t?r<t:r>t;r=0<=t?++r:--r)n[r]=String.fromCharCode(this.readByte());return n.join("")},e.prototype.writeString=function(t){var r,n,i;for(i=[],r=0,n=t.length;0<=n?r<n:r>n;r=0<=n?++r:--r)i.push(this.writeByte(t.charCodeAt(r)));return i},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(t){return this.writeInt16(t)},e.prototype.readLongLong=function(){var t,r,n,i,a,o,l,u;return t=this.readByte(),r=this.readByte(),n=this.readByte(),i=this.readByte(),a=this.readByte(),o=this.readByte(),l=this.readByte(),u=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^r)+1099511627776*(255^n)+4294967296*(255^i)+16777216*(255^a)+65536*(255^o)+256*(255^l)+(255^u)+1):72057594037927940*t+281474976710656*r+1099511627776*n+4294967296*i+16777216*a+65536*o+256*l+u},e.prototype.writeLongLong=function(t){var r,n;return r=Math.floor(t/4294967296),n=4294967295&t,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)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(t){return this.writeInt32(t)},e.prototype.read=function(t){var r,n;for(r=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)r.push(this.readByte());return r},e.prototype.write=function(t){var r,n,i,a;for(a=[],n=0,i=t.length;n<i;n++)r=t[n],a.push(this.writeByte(r));return a},e}(),zk=function(){var e;function t(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 t.prototype.encode=function(r){var n,i,a,o,l,u,d,h,v,p,f,b,_;for(_ in f=Object.keys(r).length,u=Math.log(2),v=16*Math.floor(Math.log(f)/u),o=Math.floor(v/u),h=16*f-v,(i=new ef).writeInt(this.scalarType),i.writeShort(f),i.writeShort(v),i.writeShort(o),i.writeShort(h),a=16*f,d=i.pos+a,l=null,b=[],r)for(p=r[_],i.writeString(_),i.writeInt(e(p)),i.writeInt(d),i.writeInt(p.length),b=b.concat(p),_==="head"&&(l=d),d+=p.length;d%4;)b.push(0),d++;return i.write(b),n=2981146554-e(i.data),i.pos=l+8,i.writeUInt32(n),i.data},e=function(r){var n,i,a,o;for(r=k8.call(r);r.length%4;)r.push(0);for(a=new ef(r),i=0,n=0,o=r.length;n<o;n=n+=4)i+=a.readUInt32();return 4294967295&i},t}(),qk={}.hasOwnProperty,Du=function(e,t){for(var r in t)qk.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e};Kl=function(){function e(t){var r;this.file=t,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 e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var Uk=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Du(t,Kl),t.prototype.tag="head",t.prototype.parse=function(r){return r.pos=this.offset,this.version=r.readInt(),this.revision=r.readInt(),this.checkSumAdjustment=r.readInt(),this.magicNumber=r.readInt(),this.flags=r.readShort(),this.unitsPerEm=r.readShort(),this.created=r.readLongLong(),this.modified=r.readLongLong(),this.xMin=r.readShort(),this.yMin=r.readShort(),this.xMax=r.readShort(),this.yMax=r.readShort(),this.macStyle=r.readShort(),this.lowestRecPPEM=r.readShort(),this.fontDirectionHint=r.readShort(),this.indexToLocFormat=r.readShort(),this.glyphDataFormat=r.readShort()},t.prototype.encode=function(r){var n;return(n=new ef).writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(r),n.writeShort(this.glyphDataFormat),n.data},t}(),c4=function(){function e(t,r){var n,i,a,o,l,u,d,h,v,p,f,b,_,S,x,m,w;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=r+t.readInt(),v=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.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]=t.readByte();break;case 4:for(f=t.readUInt16(),p=f/2,t.pos+=6,a=function(){var E,P;for(P=[],u=E=0;0<=p?E<p:E>p;u=0<=p?++E:--E)P.push(t.readUInt16());return P}(),t.pos+=2,_=function(){var E,P;for(P=[],u=E=0;0<=p?E<p:E>p;u=0<=p?++E:--E)P.push(t.readUInt16());return P}(),d=function(){var E,P;for(P=[],u=E=0;0<=p?E<p:E>p;u=0<=p?++E:--E)P.push(t.readUInt16());return P}(),h=function(){var E,P;for(P=[],u=E=0;0<=p?E<p:E>p;u=0<=p?++E:--E)P.push(t.readUInt16());return P}(),i=(this.length-t.pos+this.offset)/2,l=function(){var E,P;for(P=[],u=E=0;0<=i?E<i:E>i;u=0<=i?++E:--E)P.push(t.readUInt16());return P}(),u=x=0,w=a.length;x<w;u=++x)for(S=a[u],n=m=b=_[u];b<=S?m<=S:m>=S;n=b<=S?++m:--m)h[u]===0?o=n+d[u]:(o=l[h[u]/2+(n-b)-(p-u)]||0)!==0&&(o+=d[u]),this.codeMap[n]=65535&o}t.pos=v}return e.encode=function(t,r){var n,i,a,o,l,u,d,h,v,p,f,b,_,S,x,m,w,E,P,R,k,N,M,T,C,L,H,G,J,se,U,V,X,z,D,F,q,Q,re,Y,ee,ae,ue,ce,pe,Ae;switch(G=new ef,o=Object.keys(t).sort(function(Ce,ke){return Ce-ke}),r){case"macroman":for(_=0,S=function(){var Ce=[];for(b=0;b<256;++b)Ce.push(0);return Ce}(),m={0:0},a={},J=0,X=o.length;J<X;J++)m[ue=t[i=o[J]]]==null&&(m[ue]=++_),a[i]={old:t[i],new:m[t[i]]},S[i]=m[t[i]];return G.writeUInt16(1),G.writeUInt16(0),G.writeUInt32(12),G.writeUInt16(0),G.writeUInt16(262),G.writeUInt16(0),G.write(S),{charMap:a,subtable:G.data,maxGlyphID:_+1};case"unicode":for(L=[],v=[],w=0,m={},n={},x=d=null,se=0,z=o.length;se<z;se++)m[P=t[i=o[se]]]==null&&(m[P]=++w),n[i]={old:P,new:m[P]},l=m[P]-i,x!=null&&l===d||(x&&v.push(x),L.push(i),d=l),x=i;for(x&&v.push(x),v.push(65535),L.push(65535),T=2*(M=L.length),N=2*Math.pow(Math.log(M)/Math.LN2,2),p=Math.log(N/2)/Math.LN2,k=2*M-N,u=[],R=[],f=[],b=U=0,D=L.length;U<D;b=++U){if(C=L[b],h=v[b],C===65535){u.push(0),R.push(0);break}if(C-(H=n[C].new)>=32768)for(u.push(0),R.push(2*(f.length+M-b)),i=V=C;C<=h?V<=h:V>=h;i=C<=h?++V:--V)f.push(n[i].new);else u.push(H-C),R.push(0)}for(G.writeUInt16(3),G.writeUInt16(1),G.writeUInt32(12),G.writeUInt16(4),G.writeUInt16(16+8*M+2*f.length),G.writeUInt16(0),G.writeUInt16(T),G.writeUInt16(N),G.writeUInt16(p),G.writeUInt16(k),ee=0,F=v.length;ee<F;ee++)i=v[ee],G.writeUInt16(i);for(G.writeUInt16(0),ae=0,q=L.length;ae<q;ae++)i=L[ae],G.writeUInt16(i);for(ce=0,Q=u.length;ce<Q;ce++)l=u[ce],G.writeUInt16(l);for(pe=0,re=R.length;pe<re;pe++)E=R[pe],G.writeUInt16(E);for(Ae=0,Y=f.length;Ae<Y;Ae++)_=f[Ae],G.writeUInt16(_);return{charMap:n,subtable:G.data,maxGlyphID:w+1}}},e}(),C8=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Du(t,Kl),t.prototype.tag="cmap",t.prototype.parse=function(r){var n,i,a;for(r.pos=this.offset,this.version=r.readUInt16(),a=r.readUInt16(),this.tables=[],this.unicode=null,i=0;0<=a?i<a:i>a;i=0<=a?++i:--i)n=new c4(r,this.offset),this.tables.push(n),n.isUnicode&&this.unicode==null&&(this.unicode=n);return!0},t.encode=function(r,n){var i,a;return n==null&&(n="macroman"),i=c4.encode(r,n),(a=new ef).writeUInt16(0),a.writeUInt16(1),i.table=a.data.concat(i.subtable),i},t}(),Hk=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Du(t,Kl),t.prototype.tag="hhea",t.prototype.parse=function(r){return r.pos=this.offset,this.version=r.readInt(),this.ascender=r.readShort(),this.decender=r.readShort(),this.lineGap=r.readShort(),this.advanceWidthMax=r.readShort(),this.minLeftSideBearing=r.readShort(),this.minRightSideBearing=r.readShort(),this.xMaxExtent=r.readShort(),this.caretSlopeRise=r.readShort(),this.caretSlopeRun=r.readShort(),this.caretOffset=r.readShort(),r.pos+=8,this.metricDataFormat=r.readShort(),this.numberOfMetrics=r.readUInt16()},t}(),Vk=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Du(t,Kl),t.prototype.tag="OS/2",t.prototype.parse=function(r){if(r.pos=this.offset,this.version=r.readUInt16(),this.averageCharWidth=r.readShort(),this.weightClass=r.readUInt16(),this.widthClass=r.readUInt16(),this.type=r.readShort(),this.ySubscriptXSize=r.readShort(),this.ySubscriptYSize=r.readShort(),this.ySubscriptXOffset=r.readShort(),this.ySubscriptYOffset=r.readShort(),this.ySuperscriptXSize=r.readShort(),this.ySuperscriptYSize=r.readShort(),this.ySuperscriptXOffset=r.readShort(),this.ySuperscriptYOffset=r.readShort(),this.yStrikeoutSize=r.readShort(),this.yStrikeoutPosition=r.readShort(),this.familyClass=r.readShort(),this.panose=function(){var n,i;for(i=[],n=0;n<10;++n)i.push(r.readByte());return i}(),this.charRange=function(){var n,i;for(i=[],n=0;n<4;++n)i.push(r.readInt());return i}(),this.vendorID=r.readString(4),this.selection=r.readShort(),this.firstCharIndex=r.readShort(),this.lastCharIndex=r.readShort(),this.version>0&&(this.ascent=r.readShort(),this.descent=r.readShort(),this.lineGap=r.readShort(),this.winAscent=r.readShort(),this.winDescent=r.readShort(),this.codePageRange=function(){var n,i;for(i=[],n=0;n<2;n=++n)i.push(r.readInt());return i}(),this.version>1))return this.xHeight=r.readShort(),this.capHeight=r.readShort(),this.defaultChar=r.readShort(),this.breakChar=r.readShort(),this.maxContext=r.readShort()},t}(),Gk=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Du(t,Kl),t.prototype.tag="post",t.prototype.parse=function(r){var n,i,a;switch(r.pos=this.offset,this.format=r.readInt(),this.italicAngle=r.readInt(),this.underlinePosition=r.readShort(),this.underlineThickness=r.readShort(),this.isFixedPitch=r.readInt(),this.minMemType42=r.readInt(),this.maxMemType42=r.readInt(),this.minMemType1=r.readInt(),this.maxMemType1=r.readInt(),this.format){case 65536:break;case 131072:var o;for(i=r.readUInt16(),this.glyphNameIndex=[],o=0;0<=i?o<i:o>i;o=0<=i?++o:--o)this.glyphNameIndex.push(r.readUInt16());for(this.names=[],a=[];r.pos<this.offset+this.length;)n=r.readByte(),a.push(this.names.push(r.readString(n)));return a;case 151552:return i=r.readUInt16(),this.offsets=r.read(i);case 196608:break;case 262144:return this.map=(function(){var l,u,d;for(d=[],o=l=0,u=this.file.maxp.numGlyphs;0<=u?l<u:l>u;o=0<=u?++l:--l)d.push(r.readUInt32());return d}).call(this)}},t}(),$k=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},Wk=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Du(t,Kl),t.prototype.tag="name",t.prototype.parse=function(r){var n,i,a,o,l,u,d,h,v,p,f;for(r.pos=this.offset,r.readShort(),n=r.readShort(),u=r.readShort(),i=[],o=0;0<=n?o<n:o>n;o=0<=n?++o:--o)i.push({platformID:r.readShort(),encodingID:r.readShort(),languageID:r.readShort(),nameID:r.readShort(),length:r.readShort(),offset:this.offset+u+r.readShort()});for(d={},o=v=0,p=i.length;v<p;o=++v)a=i[o],r.pos=a.offset,h=r.readString(a.length),l=new $k(h,a),d[f=a.nameID]==null&&(d[f]=[]),d[a.nameID].push(l);this.strings=d,this.copyright=d[0],this.fontFamily=d[1],this.fontSubfamily=d[2],this.uniqueSubfamily=d[3],this.fontName=d[4],this.version=d[5];try{this.postscriptName=d[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=d[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=d[7],this.manufacturer=d[8],this.designer=d[9],this.description=d[10],this.vendorUrl=d[11],this.designerUrl=d[12],this.license=d[13],this.licenseUrl=d[14],this.preferredFamily=d[15],this.preferredSubfamily=d[17],this.compatibleFull=d[18],this.sampleText=d[19]},t}(),Yk=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Du(t,Kl),t.prototype.tag="maxp",t.prototype.parse=function(r){return r.pos=this.offset,this.version=r.readInt(),this.numGlyphs=r.readUInt16(),this.maxPoints=r.readUInt16(),this.maxContours=r.readUInt16(),this.maxCompositePoints=r.readUInt16(),this.maxComponentContours=r.readUInt16(),this.maxZones=r.readUInt16(),this.maxTwilightPoints=r.readUInt16(),this.maxStorage=r.readUInt16(),this.maxFunctionDefs=r.readUInt16(),this.maxInstructionDefs=r.readUInt16(),this.maxStackElements=r.readUInt16(),this.maxSizeOfInstructions=r.readUInt16(),this.maxComponentElements=r.readUInt16(),this.maxComponentDepth=r.readUInt16()},t}(),Xk=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Du(t,Kl),t.prototype.tag="hmtx",t.prototype.parse=function(r){var n,i,a,o,l,u,d;for(r.pos=this.offset,this.metrics=[],n=0,u=this.file.hhea.numberOfMetrics;0<=u?n<u:n>u;n=0<=u?++n:--n)this.metrics.push({advance:r.readUInt16(),lsb:r.readInt16()});for(a=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var h,v;for(v=[],n=h=0;0<=a?h<a:h>a;n=0<=a?++h:--h)v.push(r.readInt16());return v}(),this.widths=(function(){var h,v,p,f;for(f=[],h=0,v=(p=this.metrics).length;h<v;h++)o=p[h],f.push(o.advance);return f}).call(this),i=this.widths[this.widths.length-1],d=[],n=l=0;0<=a?l<a:l>a;n=0<=a?++l:--l)d.push(this.widths.push(i));return d},t.prototype.forGlyph=function(r){return r in this.metrics?this.metrics[r]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[r-this.metrics.length]}},t}(),k8=[].slice,Kk=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Du(t,Kl),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(r){var n,i,a,o,l,u,d,h,v,p;return r in this.cache?this.cache[r]:(o=this.file.loca,n=this.file.contents,i=o.indexOf(r),(a=o.lengthOf(r))===0?this.cache[r]=null:(n.pos=this.offset+i,l=(u=new ef(n.read(a))).readShort(),h=u.readShort(),p=u.readShort(),d=u.readShort(),v=u.readShort(),this.cache[r]=l===-1?new Qk(u,h,p,d,v):new Zk(u,l,h,p,d,v),this.cache[r]))},t.prototype.encode=function(r,n,i){var a,o,l,u,d;for(l=[],o=[],u=0,d=n.length;u<d;u++)a=r[n[u]],o.push(l.length),a&&(l=l.concat(a.encode(i)));return o.push(l.length),{table:l,offsets:o}},t}(),Zk=function(){function e(t,r,n,i,a,o){this.raw=t,this.numberOfContours=r,this.xMin=n,this.yMin=i,this.xMax=a,this.yMax=o,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),Qk=function(){function e(t,r,n,i,a){var o,l;for(this.raw=t,this.xMin=r,this.yMin=n,this.xMax=i,this.yMax=a,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],o=this.raw;l=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readUInt16()),32&l;)o.pos+=1&l?4:2,128&l?o.pos+=8:64&l?o.pos+=4:8&l&&(o.pos+=2)}return e.prototype.encode=function(){var t,r,n;for(r=new ef(k8.call(this.raw.data)),t=0,n=this.glyphIDs.length;t<n;++t)r.pos=this.glyphOffsets[t];return r.data},e}(),Jk=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return Du(t,Kl),t.prototype.tag="loca",t.prototype.parse=function(r){var n,i;return r.pos=this.offset,n=this.file.head.indexToLocFormat,this.offsets=n===0?(function(){var a,o;for(o=[],i=0,a=this.length;i<a;i+=2)o.push(2*r.readUInt16());return o}).call(this):(function(){var a,o;for(o=[],i=0,a=this.length;i<a;i+=4)o.push(r.readUInt32());return o}).call(this)},t.prototype.indexOf=function(r){return this.offsets[r]},t.prototype.lengthOf=function(r){return this.offsets[r+1]-this.offsets[r]},t.prototype.encode=function(r,n){for(var i=new Uint32Array(this.offsets.length),a=0,o=0,l=0;l<i.length;++l)if(i[l]=a,o<n.length&&n[o]==l){++o,i[l]=a;var u=this.offsets[l],d=this.offsets[l+1]-u;d>0&&(a+=d)}for(var h=new Array(4*i.length),v=0;v<i.length;++v)h[4*v+3]=255&i[v],h[4*v+2]=(65280&i[v])>>8,h[4*v+1]=(16711680&i[v])>>16,h[4*v]=(4278190080&i[v])>>24;return h},t}(),eN=function(){function e(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var t,r,n,i,a;for(r in i=this.font.cmap.tables[0].codeMap,t={},a=this.subset)n=a[r],t[r]=i[n];return t},e.prototype.glyphsFor=function(t){var r,n,i,a,o,l,u;for(i={},o=0,l=t.length;o<l;o++)i[a=t[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},e.prototype.encode=function(t,r){var n,i,a,o,l,u,d,h,v,p,f,b,_,S,x;for(i in n=C8.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(t),f={0:0},x=n.charMap)f[(u=x[i]).old]=u.new;for(b in p=n.maxGlyphID,o)b in f||(f[b]=p++);return h=function(m){var w,E;for(w in E={},m)E[m[w]]=w;return E}(f),v=Object.keys(h).sort(function(m,w){return m-w}),_=function(){var m,w,E;for(E=[],m=0,w=v.length;m<w;m++)l=v[m],E.push(h[l]);return E}(),a=this.font.glyf.encode(o,_,f),d=this.font.loca.encode(a.offsets,_),S={cmap:this.font.cmap.raw(),glyf:a.table,loca:d,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&&(S["OS/2"]=this.font.os2.raw()),this.font.directory.encode(S)},e}();Zt.API.PDFObject=function(){var e;function t(){}return e=function(r,n){return(Array(n+1).join("0")+r).slice(-n)},t.convert=function(r){var n,i,a,o;if(Array.isArray(r))return"["+function(){var l,u,d;for(d=[],l=0,u=r.length;l<u;l++)n=r[l],d.push(t.convert(n));return d}().join(" ")+"]";if(typeof r=="string")return"/"+r;if(r?.isString)return"("+r+")";if(r instanceof Date)return"(D:"+e(r.getUTCFullYear(),4)+e(r.getUTCMonth(),2)+e(r.getUTCDate(),2)+e(r.getUTCHours(),2)+e(r.getUTCMinutes(),2)+e(r.getUTCSeconds(),2)+"Z)";if({}.toString.call(r)==="[object Object]"){for(i in a=["<<"],r)o=r[i],a.push("/"+i+" "+t.convert(o));return a.push(">>"),a.join(`
609
- `)}return""+r},t}();window.jspdf={jsPDF:Zt};NS(!1);Mw("change-font-size");const tN=new URLSearchParams(location.search).get("key"),N8=vC({key:tN});window.store=N8;window.config={addGlobalFont:FS,unstable_useHtmlTextRender:GS,unstable_setTextVerticalResizeEnabled:HS,unstable_setTextOverflow:Mw,onLoadError:jS,setAssetLoadTimeout:TS,setFontLoadTimeout:RS,unstable_setTextSplitAllowed:WS};const rN=h4.createRoot(document.getElementById("root"));rN.render(fe.createElement(tk,{visiblePagesOffset:0,renderOnlyActivePage:!0,store:N8,components:{PageControls:()=>null,Tooltip:()=>null}}));export{Sn as _,xh as c,dc as g};