polotno-node 2.12.26 → 2.12.27
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,603 +0,0 @@
|
|
|
1
|
-
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var i0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function jx(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Og={exports:{}},Fr={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var e5;function Dx(){if(e5)return Fr;e5=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),g=Symbol.iterator;function v(B){return B===null||typeof B!="object"?null:(B=g&&B[g]||B["@@iterator"],typeof B=="function"?B:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,_={};function x(B,D,U){this.props=B,this.context=D,this.refs=_,this.updater=U||p}x.prototype.isReactComponent={},x.prototype.setState=function(B,D){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,D,"setState")},x.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function b(){}b.prototype=x.prototype;function E(B,D,U){this.props=B,this.context=D,this.refs=_,this.updater=U||p}var A=E.prototype=new b;A.constructor=E,y(A,x.prototype),A.isPureReactComponent=!0;var S=Array.isArray,k=Object.prototype.hasOwnProperty,I={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function M(B,D,U){var X,ee={},K=null,oe=null;if(D!=null)for(X in D.ref!==void 0&&(oe=D.ref),D.key!==void 0&&(K=""+D.key),D)k.call(D,X)&&!O.hasOwnProperty(X)&&(ee[X]=D[X]);var me=arguments.length-2;if(me===1)ee.children=U;else if(1<me){for(var de=Array(me),ye=0;ye<me;ye++)de[ye]=arguments[ye+2];ee.children=de}if(B&&B.defaultProps)for(X in me=B.defaultProps,me)ee[X]===void 0&&(ee[X]=me[X]);return{$$typeof:t,type:B,key:K,ref:oe,props:ee,_owner:I.current}}function F(B,D){return{$$typeof:t,type:B.type,key:D,ref:B.ref,props:B.props,_owner:B._owner}}function j(B){return typeof B=="object"&&B!==null&&B.$$typeof===t}function T(B){var D={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(U){return D[U]})}var L=/\/+/g;function $(B,D){return typeof B=="object"&&B!==null&&B.key!=null?T(""+B.key):D.toString(36)}function q(B,D,U,X,ee){var K=typeof B;(K==="undefined"||K==="boolean")&&(B=null);var oe=!1;if(B===null)oe=!0;else switch(K){case"string":case"number":oe=!0;break;case"object":switch(B.$$typeof){case t:case e:oe=!0}}if(oe)return oe=B,ee=ee(oe),B=X===""?"."+$(oe,0):X,S(ee)?(U="",B!=null&&(U=B.replace(L,"$&/")+"/"),q(ee,D,U,"",function(ye){return ye})):ee!=null&&(j(ee)&&(ee=F(ee,U+(!ee.key||oe&&oe.key===ee.key?"":(""+ee.key).replace(L,"$&/")+"/")+B)),D.push(ee)),1;if(oe=0,X=X===""?".":X+":",S(B))for(var me=0;me<B.length;me++){K=B[me];var de=X+$(K,me);oe+=q(K,D,U,de,ee)}else if(de=v(B),typeof de=="function")for(B=de.call(B),me=0;!(K=B.next()).done;)K=K.value,de=X+$(K,me++),oe+=q(K,D,U,de,ee);else if(K==="object")throw D=String(B),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.");return oe}function J(B,D,U){if(B==null)return B;var X=[],ee=0;return q(B,X,"","",function(K){return D.call(U,K,ee++)}),X}function ae(B){if(B._status===-1){var D=B._result;D=D(),D.then(function(U){(B._status===0||B._status===-1)&&(B._status=1,B._result=U)},function(U){(B._status===0||B._status===-1)&&(B._status=2,B._result=U)}),B._status===-1&&(B._status=0,B._result=D)}if(B._status===1)return B._result.default;throw B._result}var ie={current:null},Z={transition:null},te={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:Z,ReactCurrentOwner:I};function V(){throw Error("act(...) is not supported in production builds of React.")}return Fr.Children={map:J,forEach:function(B,D,U){J(B,function(){D.apply(this,arguments)},U)},count:function(B){var D=0;return J(B,function(){D++}),D},toArray:function(B){return J(B,function(D){return D})||[]},only:function(B){if(!j(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},Fr.Component=x,Fr.Fragment=r,Fr.Profiler=i,Fr.PureComponent=E,Fr.StrictMode=n,Fr.Suspense=u,Fr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,Fr.act=V,Fr.cloneElement=function(B,D,U){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var X=y({},B.props),ee=B.key,K=B.ref,oe=B._owner;if(D!=null){if(D.ref!==void 0&&(K=D.ref,oe=I.current),D.key!==void 0&&(ee=""+D.key),B.type&&B.type.defaultProps)var me=B.type.defaultProps;for(de in D)k.call(D,de)&&!O.hasOwnProperty(de)&&(X[de]=D[de]===void 0&&me!==void 0?me[de]:D[de])}var de=arguments.length-2;if(de===1)X.children=U;else if(1<de){me=Array(de);for(var ye=0;ye<de;ye++)me[ye]=arguments[ye+2];X.children=me}return{$$typeof:t,type:B.type,key:ee,ref:K,props:X,_owner:oe}},Fr.createContext=function(B){return B={$$typeof:o,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:a,_context:B},B.Consumer=B},Fr.createElement=M,Fr.createFactory=function(B){var D=M.bind(null,B);return D.type=B,D},Fr.createRef=function(){return{current:null}},Fr.forwardRef=function(B){return{$$typeof:s,render:B}},Fr.isValidElement=j,Fr.lazy=function(B){return{$$typeof:f,_payload:{_status:-1,_result:B},_init:ae}},Fr.memo=function(B,D){return{$$typeof:h,type:B,compare:D===void 0?null:D}},Fr.startTransition=function(B){var D=Z.transition;Z.transition={};try{B()}finally{Z.transition=D}},Fr.unstable_act=V,Fr.useCallback=function(B,D){return ie.current.useCallback(B,D)},Fr.useContext=function(B){return ie.current.useContext(B)},Fr.useDebugValue=function(){},Fr.useDeferredValue=function(B){return ie.current.useDeferredValue(B)},Fr.useEffect=function(B,D){return ie.current.useEffect(B,D)},Fr.useId=function(){return ie.current.useId()},Fr.useImperativeHandle=function(B,D,U){return ie.current.useImperativeHandle(B,D,U)},Fr.useInsertionEffect=function(B,D){return ie.current.useInsertionEffect(B,D)},Fr.useLayoutEffect=function(B,D){return ie.current.useLayoutEffect(B,D)},Fr.useMemo=function(B,D){return ie.current.useMemo(B,D)},Fr.useReducer=function(B,D,U){return ie.current.useReducer(B,D,U)},Fr.useRef=function(B){return ie.current.useRef(B)},Fr.useState=function(B){return ie.current.useState(B)},Fr.useSyncExternalStore=function(B,D,U){return ie.current.useSyncExternalStore(B,D,U)},Fr.useTransition=function(){return ie.current.useTransition()},Fr.version="18.3.1",Fr}var t5;function Ap(){return t5||(t5=1,Og.exports=Dx()),Og.exports}var ji=Ap();const se=hh(ji);var h1={},Cg={exports:{}},Ls={},Lg={exports:{}},Ng={};/**
|
|
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 r5;function Fx(){return r5||(r5=1,function(t){function e(Z,te){var V=Z.length;Z.push(te);e:for(;0<V;){var B=V-1>>>1,D=Z[B];if(0<i(D,te))Z[B]=te,Z[V]=D,V=B;else break e}}function r(Z){return Z.length===0?null:Z[0]}function n(Z){if(Z.length===0)return null;var te=Z[0],V=Z.pop();if(V!==te){Z[0]=V;e:for(var B=0,D=Z.length,U=D>>>1;B<U;){var X=2*(B+1)-1,ee=Z[X],K=X+1,oe=Z[K];if(0>i(ee,V))K<D&&0>i(oe,ee)?(Z[B]=oe,Z[K]=V,B=K):(Z[B]=ee,Z[X]=V,B=X);else if(K<D&&0>i(oe,V))Z[B]=oe,Z[K]=V,B=K;else break e}}return te}function i(Z,te){var V=Z.sortIndex-te.sortIndex;return V!==0?V:Z.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();t.unstable_now=function(){return o.now()-s}}var u=[],h=[],f=1,g=null,v=3,p=!1,y=!1,_=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(Z){for(var te=r(h);te!==null;){if(te.callback===null)n(h);else if(te.startTime<=Z)n(h),te.sortIndex=te.expirationTime,e(u,te);else break;te=r(h)}}function S(Z){if(_=!1,A(Z),!y)if(r(u)!==null)y=!0,ae(k);else{var te=r(h);te!==null&&ie(S,te.startTime-Z)}}function k(Z,te){y=!1,_&&(_=!1,b(M),M=-1),p=!0;var V=v;try{for(A(te),g=r(u);g!==null&&(!(g.expirationTime>te)||Z&&!T());){var B=g.callback;if(typeof B=="function"){g.callback=null,v=g.priorityLevel;var D=B(g.expirationTime<=te);te=t.unstable_now(),typeof D=="function"?g.callback=D:g===r(u)&&n(u),A(te)}else n(u);g=r(u)}if(g!==null)var U=!0;else{var X=r(h);X!==null&&ie(S,X.startTime-te),U=!1}return U}finally{g=null,v=V,p=!1}}var I=!1,O=null,M=-1,F=5,j=-1;function T(){return!(t.unstable_now()-j<F)}function L(){if(O!==null){var Z=t.unstable_now();j=Z;var te=!0;try{te=O(!0,Z)}finally{te?$():(I=!1,O=null)}}else I=!1}var $;if(typeof E=="function")$=function(){E(L)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,J=q.port2;q.port1.onmessage=L,$=function(){J.postMessage(null)}}else $=function(){x(L,0)};function ae(Z){O=Z,I||(I=!0,$())}function ie(Z,te){M=x(function(){Z(t.unstable_now())},te)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(Z){Z.callback=null},t.unstable_continueExecution=function(){y||p||(y=!0,ae(k))},t.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<Z?Math.floor(1e3/Z):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(Z){switch(v){case 1:case 2:case 3:var te=3;break;default:te=v}var V=v;v=te;try{return Z()}finally{v=V}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(Z,te){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var V=v;v=Z;try{return te()}finally{v=V}},t.unstable_scheduleCallback=function(Z,te,V){var B=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?B+V:B):V=B,Z){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=V+D,Z={id:f++,callback:te,priorityLevel:Z,startTime:V,expirationTime:D,sortIndex:-1},V>B?(Z.sortIndex=V,e(h,Z),r(u)===null&&Z===r(h)&&(_?(b(M),M=-1):_=!0,ie(S,V-B))):(Z.sortIndex=D,e(u,Z),y||p||(y=!0,ae(k))),Z},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(Z){var te=v;return function(){var V=v;v=te;try{return Z.apply(this,arguments)}finally{v=V}}}}(Ng)),Ng}var n5;function Im(){return n5||(n5=1,Lg.exports=Fx()),Lg.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 i5;function Bx(){if(i5)return Ls;i5=1;var t=Ap(),e=Im();function r(l){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+l,w=1;w<arguments.length;w++)c+="&args[]="+encodeURIComponent(arguments[w]);return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function a(l,c){o(l,c),o(l+"Capture",c)}function o(l,c){for(i[l]=c,l=0;l<c.length;l++)n.add(c[l])}var s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},g={};function v(l){return u.call(g,l)?!0:u.call(f,l)?!1:h.test(l)?g[l]=!0:(f[l]=!0,!1)}function p(l,c,w,N){if(w!==null&&w.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return N?!1:w!==null?!w.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function y(l,c,w,N){if(c===null||typeof c>"u"||p(l,c,w,N))return!0;if(N)return!1;if(w!==null)switch(w.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function _(l,c,w,N,G,Q,he){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=N,this.attributeNamespace=G,this.mustUseProperty=w,this.propertyName=l,this.type=c,this.sanitizeURL=Q,this.removeEmptyString=he}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){x[l]=new _(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var c=l[0];x[c]=new _(c,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){x[l]=new _(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){x[l]=new _(l,2,!1,l,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(l){x[l]=new _(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){x[l]=new _(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){x[l]=new _(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){x[l]=new _(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){x[l]=new _(l,5,!1,l.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function E(l){return l[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(l){var c=l.replace(b,E);x[c]=new _(c,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var c=l.replace(b,E);x[c]=new _(c,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var c=l.replace(b,E);x[c]=new _(c,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){x[l]=new _(l,1,!1,l.toLowerCase(),null,!1,!1)}),x.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){x[l]=new _(l,1,!1,l.toLowerCase(),null,!0,!0)});function A(l,c,w,N){var G=x.hasOwnProperty(c)?x[c]:null;(G!==null?G.type!==0:N||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(y(c,w,G,N)&&(w=null),N||G===null?v(c)&&(w===null?l.removeAttribute(c):l.setAttribute(c,""+w)):G.mustUseProperty?l[G.propertyName]=w===null?G.type===3?!1:"":w:(c=G.attributeName,N=G.attributeNamespace,w===null?l.removeAttribute(c):(G=G.type,w=G===3||G===4&&w===!0?"":""+w,N?l.setAttributeNS(N,c,w):l.setAttribute(c,w))))}var S=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=Symbol.for("react.element"),I=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),T=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),Z=Symbol.iterator;function te(l){return l===null||typeof l!="object"?null:(l=Z&&l[Z]||l["@@iterator"],typeof l=="function"?l:null)}var V=Object.assign,B;function D(l){if(B===void 0)try{throw Error()}catch(w){var c=w.stack.trim().match(/\n( *(at )?)/);B=c&&c[1]||""}return`
|
|
26
|
-
`+B+l}var U=!1;function X(l,c){if(!l||U)return"";U=!0;var w=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(nt){var N=nt}Reflect.construct(l,[],c)}else{try{c.call()}catch(nt){N=nt}l.call(c.prototype)}else{try{throw Error()}catch(nt){N=nt}l()}}catch(nt){if(nt&&N&&typeof nt.stack=="string"){for(var G=nt.stack.split(`
|
|
27
|
-
`),Q=N.stack.split(`
|
|
28
|
-
`),he=G.length-1,Me=Q.length-1;1<=he&&0<=Me&&G[he]!==Q[Me];)Me--;for(;1<=he&&0<=Me;he--,Me--)if(G[he]!==Q[Me]){if(he!==1||Me!==1)do if(he--,Me--,0>Me||G[he]!==Q[Me]){var ze=`
|
|
29
|
-
`+G[he].replace(" at new "," at ");return l.displayName&&ze.includes("<anonymous>")&&(ze=ze.replace("<anonymous>",l.displayName)),ze}while(1<=he&&0<=Me);break}}}finally{U=!1,Error.prepareStackTrace=w}return(l=l?l.displayName||l.name:"")?D(l):""}function ee(l){switch(l.tag){case 5:return D(l.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return l=X(l.type,!1),l;case 11:return l=X(l.type.render,!1),l;case 1:return l=X(l.type,!0),l;default:return""}}function K(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case O:return"Fragment";case I:return"Portal";case F:return"Profiler";case M:return"StrictMode";case $:return"Suspense";case q:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case T:return(l.displayName||"Context")+".Consumer";case j:return(l._context.displayName||"Context")+".Provider";case L:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case J:return c=l.displayName||null,c!==null?c:K(l.type)||"Memo";case ae:c=l._payload,l=l._init;try{return K(l(c))}catch{}}return null}function oe(l){var c=l.type;switch(l.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=c.render,l=l.displayName||l.name||"",c.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K(c);case 8:return c===M?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function me(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function de(l){var c=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function ye(l){var c=de(l)?"checked":"value",w=Object.getOwnPropertyDescriptor(l.constructor.prototype,c),N=""+l[c];if(!l.hasOwnProperty(c)&&typeof w<"u"&&typeof w.get=="function"&&typeof w.set=="function"){var G=w.get,Q=w.set;return Object.defineProperty(l,c,{configurable:!0,get:function(){return G.call(this)},set:function(he){N=""+he,Q.call(this,he)}}),Object.defineProperty(l,c,{enumerable:w.enumerable}),{getValue:function(){return N},setValue:function(he){N=""+he},stopTracking:function(){l._valueTracker=null,delete l[c]}}}}function Te(l){l._valueTracker||(l._valueTracker=ye(l))}function Ce(l){if(!l)return!1;var c=l._valueTracker;if(!c)return!0;var w=c.getValue(),N="";return l&&(N=de(l)?l.checked?"true":"false":l.value),l=N,l!==w?(c.setValue(l),!0):!1}function Ie(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Ee(l,c){var w=c.checked;return V({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:w??l._wrapperState.initialChecked})}function ge(l,c){var w=c.defaultValue==null?"":c.defaultValue,N=c.checked!=null?c.checked:c.defaultChecked;w=me(c.value!=null?c.value:w),l._wrapperState={initialChecked:N,initialValue:w,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function Re(l,c){c=c.checked,c!=null&&A(l,"checked",c,!1)}function Be(l,c){Re(l,c);var w=me(c.value),N=c.type;if(w!=null)N==="number"?(w===0&&l.value===""||l.value!=w)&&(l.value=""+w):l.value!==""+w&&(l.value=""+w);else if(N==="submit"||N==="reset"){l.removeAttribute("value");return}c.hasOwnProperty("value")?fe(l,c.type,w):c.hasOwnProperty("defaultValue")&&fe(l,c.type,me(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(l.defaultChecked=!!c.defaultChecked)}function Oe(l,c,w){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var N=c.type;if(!(N!=="submit"&&N!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+l._wrapperState.initialValue,w||c===l.value||(l.value=c),l.defaultValue=c}w=l.name,w!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,w!==""&&(l.name=w)}function fe(l,c,w){(c!=="number"||Ie(l.ownerDocument)!==l)&&(w==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+w&&(l.defaultValue=""+w))}var Le=Array.isArray;function Ne(l,c,w,N){if(l=l.options,c){c={};for(var G=0;G<w.length;G++)c["$"+w[G]]=!0;for(w=0;w<l.length;w++)G=c.hasOwnProperty("$"+l[w].value),l[w].selected!==G&&(l[w].selected=G),G&&N&&(l[w].defaultSelected=!0)}else{for(w=""+me(w),c=null,G=0;G<l.length;G++){if(l[G].value===w){l[G].selected=!0,N&&(l[G].defaultSelected=!0);return}c!==null||l[G].disabled||(c=l[G])}c!==null&&(c.selected=!0)}}function ue(l,c){if(c.dangerouslySetInnerHTML!=null)throw Error(r(91));return V({},c,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function Ae(l,c){var w=c.value;if(w==null){if(w=c.children,c=c.defaultValue,w!=null){if(c!=null)throw Error(r(92));if(Le(w)){if(1<w.length)throw Error(r(93));w=w[0]}c=w}c==null&&(c=""),w=c}l._wrapperState={initialValue:me(w)}}function Pe(l,c){var w=me(c.value),N=me(c.defaultValue);w!=null&&(w=""+w,w!==l.value&&(l.value=w),c.defaultValue==null&&l.defaultValue!==w&&(l.defaultValue=w)),N!=null&&(l.defaultValue=""+N)}function Ue(l){var c=l.textContent;c===l._wrapperState.initialValue&&c!==""&&c!==null&&(l.value=c)}function st(l){switch(l){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function dt(l,c){return l==null||l==="http://www.w3.org/1999/xhtml"?st(c):l==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var pt,xt=function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,w,N,G){MSApp.execUnsafeLocalFunction(function(){return l(c,w,N,G)})}:l}(function(l,c){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=c;else{for(pt=pt||document.createElement("div"),pt.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=pt.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;c.firstChild;)l.appendChild(c.firstChild)}});function bt(l,c){if(c){var w=l.firstChild;if(w&&w===l.lastChild&&w.nodeType===3){w.nodeValue=c;return}}l.textContent=c}var kt={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},zr=["Webkit","ms","Moz","O"];Object.keys(kt).forEach(function(l){zr.forEach(function(c){c=c+l.charAt(0).toUpperCase()+l.substring(1),kt[c]=kt[l]})});function _r(l,c,w){return c==null||typeof c=="boolean"||c===""?"":w||typeof c!="number"||c===0||kt.hasOwnProperty(l)&&kt[l]?(""+c).trim():c+"px"}function It(l,c){l=l.style;for(var w in c)if(c.hasOwnProperty(w)){var N=w.indexOf("--")===0,G=_r(w,c[w],N);w==="float"&&(w="cssFloat"),N?l.setProperty(w,G):l[w]=G}}var Jt=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ve(l,c){if(c){if(Jt[l]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(r(137,l));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(r(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(r(61))}if(c.style!=null&&typeof c.style!="object")throw Error(r(62))}}function qe(l,c){if(l.indexOf("-")===-1)return typeof c.is=="string";switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Nt=null;function Ct(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var ir=null,Ut=null,xr=null;function er(l){if(l=wu(l)){if(typeof ir!="function")throw Error(r(280));var c=l.stateNode;c&&(c=Ni(c),ir(l.stateNode,l.type,c))}}function pr(l){Ut?xr?xr.push(l):xr=[l]:Ut=l}function Bi(){if(Ut){var l=Ut,c=xr;if(xr=Ut=null,er(l),c)for(l=0;l<c.length;l++)er(c[l])}}function oi(l,c){return l(c)}function Ei(){}var Sn=!1;function Qt(l,c,w){if(Sn)return l(c,w);Sn=!0;try{return oi(l,c,w)}finally{Sn=!1,(Ut!==null||xr!==null)&&(Ei(),Bi())}}function ca(l,c){var w=l.stateNode;if(w===null)return null;var N=Ni(w);if(N===null)return null;w=N[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(N=!N.disabled)||(l=l.type,N=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!N;break e;default:l=!1}if(l)return null;if(w&&typeof w!="function")throw Error(r(231,c,typeof w));return w}var Fa=!1;if(s)try{var Kn={};Object.defineProperty(Kn,"passive",{get:function(){Fa=!0}}),window.addEventListener("test",Kn,Kn),window.removeEventListener("test",Kn,Kn)}catch{Fa=!1}function Yi(l,c,w,N,G,Q,he,Me,ze){var nt=Array.prototype.slice.call(arguments,3);try{c.apply(w,nt)}catch(vt){this.onError(vt)}}var qr=!1,En=null,Rn=!1,Sa=null,Ho={onError:function(l){qr=!0,En=l}};function Ea(l,c,w,N,G,Q,he,Me,ze){qr=!1,En=null,Yi.apply(Ho,arguments)}function eo(l,c,w,N,G,Q,he,Me,ze){if(Ea.apply(this,arguments),qr){if(qr){var nt=En;qr=!1,En=null}else throw Error(r(198));Rn||(Rn=!0,Sa=nt)}}function si(l){var c=l,w=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,(c.flags&4098)!==0&&(w=c.return),l=c.return;while(l)}return c.tag===3?w:null}function ka(l){if(l.tag===13){var c=l.memoizedState;if(c===null&&(l=l.alternate,l!==null&&(c=l.memoizedState)),c!==null)return c.dehydrated}return null}function Aa(l){if(si(l)!==l)throw Error(r(188))}function $o(l){var c=l.alternate;if(!c){if(c=si(l),c===null)throw Error(r(188));return c!==l?null:l}for(var w=l,N=c;;){var G=w.return;if(G===null)break;var Q=G.alternate;if(Q===null){if(N=G.return,N!==null){w=N;continue}break}if(G.child===Q.child){for(Q=G.child;Q;){if(Q===w)return Aa(G),l;if(Q===N)return Aa(G),c;Q=Q.sibling}throw Error(r(188))}if(w.return!==N.return)w=G,N=Q;else{for(var he=!1,Me=G.child;Me;){if(Me===w){he=!0,w=G,N=Q;break}if(Me===N){he=!0,N=G,w=Q;break}Me=Me.sibling}if(!he){for(Me=Q.child;Me;){if(Me===w){he=!0,w=Q,N=G;break}if(Me===N){he=!0,N=Q,w=G;break}Me=Me.sibling}if(!he)throw Error(r(189))}}if(w.alternate!==N)throw Error(r(190))}if(w.tag!==3)throw Error(r(188));return w.stateNode.current===w?l:c}function zi(l){return l=$o(l),l!==null?to(l):null}function to(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var c=to(l);if(c!==null)return c;l=l.sibling}return null}var Bs=e.unstable_scheduleCallback,is=e.unstable_cancelCallback,lu=e.unstable_shouldYield,Nf=e.unstable_requestPaint,kn=e.unstable_now,uu=e.unstable_getCurrentPriorityLevel,as=e.unstable_ImmediatePriority,Pa=e.unstable_UserBlockingPriority,os=e.unstable_NormalPriority,Ec=e.unstable_LowPriority,ll=e.unstable_IdlePriority,_o=null,gi=null;function cn(l){if(gi&&typeof gi.onCommitFiberRoot=="function")try{gi.onCommitFiberRoot(_o,l,void 0,(l.current.flags&128)===128)}catch{}}var Sr=Math.clz32?Math.clz32:Xi,ss=Math.log,Tr=Math.LN2;function Xi(l){return l>>>=0,l===0?32:31-(ss(l)/Tr|0)|0}var ro=64,Ki=4194304;function Mn(l){switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Zi(l,c){var w=l.pendingLanes;if(w===0)return 0;var N=0,G=l.suspendedLanes,Q=l.pingedLanes,he=w&268435455;if(he!==0){var Me=he&~G;Me!==0?N=Mn(Me):(Q&=he,Q!==0&&(N=Mn(Q)))}else he=w&~G,he!==0?N=Mn(he):Q!==0&&(N=Mn(Q));if(N===0)return 0;if(c!==0&&c!==N&&(c&G)===0&&(G=N&-N,Q=c&-c,G>=Q||G===16&&(Q&4194240)!==0))return c;if((N&4)!==0&&(N|=w&16),c=l.entangledLanes,c!==0)for(l=l.entanglements,c&=N;0<c;)w=31-Sr(c),G=1<<w,N|=l[w],c&=~G;return N}function ul(l,c){switch(l){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zn(l,c){for(var w=l.suspendedLanes,N=l.pingedLanes,G=l.expirationTimes,Q=l.pendingLanes;0<Q;){var he=31-Sr(Q),Me=1<<he,ze=G[he];ze===-1?((Me&w)===0||(Me&N)!==0)&&(G[he]=ul(Me,c)):ze<=c&&(l.expiredLanes|=Me),Q&=~Me}}function ls(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function Vu(){var l=ro;return ro<<=1,(ro&4194240)===0&&(ro=64),l}function Oa(l){for(var c=[],w=0;31>w;w++)c.push(l);return c}function Tl(l,c,w){l.pendingLanes|=c,c!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,c=31-Sr(c),l[c]=w}function us(l,c){var w=l.pendingLanes&~c;l.pendingLanes=c,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=c,l.mutableReadLanes&=c,l.entangledLanes&=c,c=l.entanglements;var N=l.eventTimes;for(l=l.expirationTimes;0<w;){var G=31-Sr(w),Q=1<<G;c[G]=0,N[G]=-1,l[G]=-1,w&=~Q}}function cu(l,c){var w=l.entangledLanes|=c;for(l=l.entanglements;w;){var N=31-Sr(w),G=1<<N;G&c|l[N]&c&&(l[N]|=c),w&=~G}}var Rr=0;function xo(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var cs,cl,kc,Ac,fl,fs=!1,no=[],Ba=null,za=null,qa=null,Pt=new Map,hl=new Map,So=[],Pc="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 Oc(l,c){switch(l){case"focusin":case"focusout":Ba=null;break;case"dragenter":case"dragleave":za=null;break;case"mouseover":case"mouseout":qa=null;break;case"pointerover":case"pointerout":Pt.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":hl.delete(c.pointerId)}}function io(l,c,w,N,G,Q){return l===null||l.nativeEvent!==Q?(l={blockedOn:c,domEventName:w,eventSystemFlags:N,nativeEvent:Q,targetContainers:[G]},c!==null&&(c=wu(c),c!==null&&cl(c)),l):(l.eventSystemFlags|=N,c=l.targetContainers,G!==null&&c.indexOf(G)===-1&&c.push(G),l)}function wn(l,c,w,N,G){switch(c){case"focusin":return Ba=io(Ba,l,c,w,N,G),!0;case"dragenter":return za=io(za,l,c,w,N,G),!0;case"mouseover":return qa=io(qa,l,c,w,N,G),!0;case"pointerover":var Q=G.pointerId;return Pt.set(Q,io(Pt.get(Q)||null,l,c,w,N,G)),!0;case"gotpointercapture":return Q=G.pointerId,hl.set(Q,io(hl.get(Q)||null,l,c,w,N,G)),!0}return!1}function fu(l){var c=Ys(l.target);if(c!==null){var w=si(c);if(w!==null){if(c=w.tag,c===13){if(c=ka(w),c!==null){l.blockedOn=c,fl(l.priority,function(){kc(w)});return}}else if(c===3&&w.stateNode.current.memoizedState.isDehydrated){l.blockedOn=w.tag===3?w.stateNode.containerInfo:null;return}}}l.blockedOn=null}function hu(l){if(l.blockedOn!==null)return!1;for(var c=l.targetContainers;0<c.length;){var w=dl(l.domEventName,l.eventSystemFlags,c[0],l.nativeEvent);if(w===null){w=l.nativeEvent;var N=new w.constructor(w.type,w);Nt=N,w.target.dispatchEvent(N),Nt=null}else return c=wu(w),c!==null&&cl(c),l.blockedOn=w,!1;c.shift()}return!0}function zs(l,c,w){hu(l)&&w.delete(c)}function Yu(){fs=!1,Ba!==null&&hu(Ba)&&(Ba=null),za!==null&&hu(za)&&(za=null),qa!==null&&hu(qa)&&(qa=null),Pt.forEach(zs),hl.forEach(zs)}function Ua(l,c){l.blockedOn===c&&(l.blockedOn=null,fs||(fs=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Yu)))}function ki(l){function c(G){return Ua(G,l)}if(0<no.length){Ua(no[0],l);for(var w=1;w<no.length;w++){var N=no[w];N.blockedOn===l&&(N.blockedOn=null)}}for(Ba!==null&&Ua(Ba,l),za!==null&&Ua(za,l),qa!==null&&Ua(qa,l),Pt.forEach(c),hl.forEach(c),w=0;w<So.length;w++)N=So[w],N.blockedOn===l&&(N.blockedOn=null);for(;0<So.length&&(w=So[0],w.blockedOn===null);)fu(w),w.blockedOn===null&&So.shift()}var Go=S.ReactCurrentBatchConfig,du=!0;function Ca(l,c,w,N){var G=Rr,Q=Go.transition;Go.transition=null;try{Rr=1,Eo(l,c,w,N)}finally{Rr=G,Go.transition=Q}}function ao(l,c,w,N){var G=Rr,Q=Go.transition;Go.transition=null;try{Rr=4,Eo(l,c,w,N)}finally{Rr=G,Go.transition=Q}}function Eo(l,c,w,N){if(du){var G=dl(l,c,w,N);if(G===null)mu(l,c,N,ko,w),Oc(l,N);else if(wn(G,l,c,w,N))N.stopPropagation();else if(Oc(l,N),c&4&&-1<Pc.indexOf(l)){for(;G!==null;){var Q=wu(G);if(Q!==null&&cs(Q),Q=dl(l,c,w,N),Q===null&&mu(l,c,N,ko,w),Q===G)break;G=Q}G!==null&&N.stopPropagation()}else mu(l,c,N,null,w)}}var ko=null;function dl(l,c,w,N){if(ko=null,l=Ct(N),l=Ys(l),l!==null)if(c=si(l),c===null)l=null;else if(w=c.tag,w===13){if(l=ka(c),l!==null)return l;l=null}else if(w===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;l=null}else c!==l&&(l=null);return ko=l,null}function Rl(l){switch(l){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(uu()){case as:return 1;case Pa:return 4;case os:case Ec:return 16;case ll:return 536870912;default:return 16}default:return 16}}var li=null,Ha=null,Ao=null;function pl(){if(Ao)return Ao;var l,c=Ha,w=c.length,N,G="value"in li?li.value:li.textContent,Q=G.length;for(l=0;l<w&&c[l]===G[l];l++);var he=w-l;for(N=1;N<=he&&c[w-N]===G[Q-N];N++);return Ao=G.slice(l,1<N?1-N:void 0)}function La(l){var c=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&c===13&&(l=13)):l=c,l===10&&(l=13),32<=l||l===13?l:0}function Bn(){return!0}function fa(){return!1}function Qn(l){function c(w,N,G,Q,he){this._reactName=w,this._targetInst=G,this.type=N,this.nativeEvent=Q,this.target=he,this.currentTarget=null;for(var Me in l)l.hasOwnProperty(Me)&&(w=l[Me],this[Me]=w?w(Q):Q[Me]);return this.isDefaultPrevented=(Q.defaultPrevented!=null?Q.defaultPrevented:Q.returnValue===!1)?Bn:fa,this.isPropagationStopped=fa,this}return V(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var w=this.nativeEvent;w&&(w.preventDefault?w.preventDefault():typeof w.returnValue!="unknown"&&(w.returnValue=!1),this.isDefaultPrevented=Bn)},stopPropagation:function(){var w=this.nativeEvent;w&&(w.stopPropagation?w.stopPropagation():typeof w.cancelBubble!="unknown"&&(w.cancelBubble=!0),this.isPropagationStopped=Bn)},persist:function(){},isPersistent:Bn}),c}var vi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$a=Qn(vi),H=V({},vi,{view:0,detail:0}),ce=Qn(H),ke,De,Ge,at=V({},H,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Oo,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==Ge&&(Ge&&l.type==="mousemove"?(ke=l.screenX-Ge.screenX,De=l.screenY-Ge.screenY):De=ke=0,Ge=l),ke)},movementY:function(l){return"movementY"in l?l.movementY:De}}),ct=Qn(at),Dt=V({},at,{dataTransfer:0}),jt=Qn(Dt),cr=V({},H,{relatedTarget:0}),fr=Qn(cr),Ur=V({},vi,{animationName:0,elapsedTime:0,pseudoElement:0}),An=Qn(Ur),ui=V({},vi,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),on=Qn(ui),mi=V({},vi,{data:0}),_n=Qn(mi),Ai={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Po={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Qi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cc(l){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(l):(l=Qi[l])?!!c[l]:!1}function Oo(){return Cc}var hs=V({},H,{key:function(l){if(l.key){var c=Ai[l.key]||l.key;if(c!=="Unidentified")return c}return l.type==="keypress"?(l=La(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Po[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Oo,charCode:function(l){return l.type==="keypress"?La(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?La(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),qs=Qn(hs),gl=V({},at,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),oo=Qn(gl),vl=V({},H,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Oo}),Pi=Qn(vl),ds=V({},vi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Co=Qn(ds),Ml=V({},at,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),Il=Qn(Ml),zn=[9,13,27,32],so=s&&"CompositionEvent"in window,Lo=null;s&&"documentMode"in document&&(Lo=document.documentMode);var Us=s&&"TextEvent"in window&&!Lo,In=s&&(!so||Lo&&8<Lo&&11>=Lo),Ga=" ",ml=!1;function jl(l,c){switch(l){case"keyup":return zn.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qi(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Oi=!1;function Na(l,c){switch(l){case"compositionend":return qi(c);case"keypress":return c.which!==32?null:(ml=!0,Ga);case"textInput":return l=c.data,l===Ga&&ml?null:l;default:return null}}function Wa(l,c){if(Oi)return l==="compositionend"||!so&&jl(l,c)?(l=pl(),Ao=Ha=li=null,Oi=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return In&&c.locale!=="ko"?null:c.data;default:return null}}var ha={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ji(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c==="input"?!!ha[l.type]:c==="textarea"}function No(l,c,w,N){pr(N),c=jc(c,"onChange"),0<c.length&&(w=new $a("onChange","change",null,w,N),l.push({event:w,listeners:c}))}var ps=null,lo=null;function Jn(l){gu(l,0)}function Wo(l){var c=yi(l);if(Ce(c))return l}function ci(l,c){if(l==="change")return c}var Ta=!1;if(s){var To;if(s){var da="oninput"in document;if(!da){var yl=document.createElement("div");yl.setAttribute("oninput","return;"),da=typeof yl.oninput=="function"}To=da}else To=!1;Ta=To&&(!document.documentMode||9<document.documentMode)}function Vo(){ps&&(ps.detachEvent("onpropertychange",gs),lo=ps=null)}function gs(l){if(l.propertyName==="value"&&Wo(lo)){var c=[];No(c,lo,l,Ct(l)),Qt(Jn,c)}}function vs(l,c,w){l==="focusin"?(Vo(),ps=c,lo=w,ps.attachEvent("onpropertychange",gs)):l==="focusout"&&Vo()}function en(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Wo(lo)}function ms(l,c){if(l==="click")return Wo(c)}function ys(l,c){if(l==="input"||l==="change")return Wo(c)}function Hs(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var Pn=typeof Object.is=="function"?Object.is:Hs;function pa(l,c){if(Pn(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var w=Object.keys(l),N=Object.keys(c);if(w.length!==N.length)return!1;for(N=0;N<w.length;N++){var G=w[N];if(!u.call(c,G)||!Pn(l[G],c[G]))return!1}return!0}function Cr(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function ar(l,c){var w=Cr(l);l=0;for(var N;w;){if(w.nodeType===3){if(N=l+w.textContent.length,l<=c&&N>=c)return{node:w,offset:c-l};l=N}e:{for(;w;){if(w.nextSibling){w=w.nextSibling;break e}w=w.parentNode}w=void 0}w=Cr(w)}}function Er(l,c){return l&&c?l===c?!0:l&&l.nodeType===3?!1:c&&c.nodeType===3?Er(l,c.parentNode):"contains"in l?l.contains(c):l.compareDocumentPosition?!!(l.compareDocumentPosition(c)&16):!1:!1}function Lr(){for(var l=window,c=Ie();c instanceof l.HTMLIFrameElement;){try{var w=typeof c.contentWindow.location.href=="string"}catch{w=!1}if(w)l=c.contentWindow;else break;c=Ie(l.document)}return c}function Va(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c&&(c==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||c==="textarea"||l.contentEditable==="true")}function $s(l){var c=Lr(),w=l.focusedElem,N=l.selectionRange;if(c!==w&&w&&w.ownerDocument&&Er(w.ownerDocument.documentElement,w)){if(N!==null&&Va(w)){if(c=N.start,l=N.end,l===void 0&&(l=c),"selectionStart"in w)w.selectionStart=c,w.selectionEnd=Math.min(l,w.value.length);else if(l=(c=w.ownerDocument||document)&&c.defaultView||window,l.getSelection){l=l.getSelection();var G=w.textContent.length,Q=Math.min(N.start,G);N=N.end===void 0?Q:Math.min(N.end,G),!l.extend&&Q>N&&(G=N,N=Q,Q=G),G=ar(w,Q);var he=ar(w,N);G&&he&&(l.rangeCount!==1||l.anchorNode!==G.node||l.anchorOffset!==G.offset||l.focusNode!==he.node||l.focusOffset!==he.offset)&&(c=c.createRange(),c.setStart(G.node,G.offset),l.removeAllRanges(),Q>N?(l.addRange(c),l.extend(he.node,he.offset)):(c.setEnd(he.node,he.offset),l.addRange(c)))}}for(c=[],l=w;l=l.parentNode;)l.nodeType===1&&c.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<c.length;w++)l=c[w],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var bs=s&&"documentMode"in document&&11>=document.documentMode,Gs=null,Ci=null,bl=null,pu=!1;function Xu(l,c,w){var N=w.window===w?w.document:w.nodeType===9?w:w.ownerDocument;pu||Gs==null||Gs!==Ie(N)||(N=Gs,"selectionStart"in N&&Va(N)?N={start:N.selectionStart,end:N.selectionEnd}:(N=(N.ownerDocument&&N.ownerDocument.defaultView||window).getSelection(),N={anchorNode:N.anchorNode,anchorOffset:N.anchorOffset,focusNode:N.focusNode,focusOffset:N.focusOffset}),bl&&pa(bl,N)||(bl=N,N=jc(Ci,"onSelect"),0<N.length&&(c=new $a("onSelect","select",null,c,w),l.push({event:c,listeners:N}),c.target=Gs)))}function Ya(l,c){var w={};return w[l.toLowerCase()]=c.toLowerCase(),w["Webkit"+l]="webkit"+c,w["Moz"+l]="moz"+c,w}var Ui={animationend:Ya("Animation","AnimationEnd"),animationiteration:Ya("Animation","AnimationIteration"),animationstart:Ya("Animation","AnimationStart"),transitionend:Ya("Transition","TransitionEnd")},Yo={},Ku={};s&&(Ku=document.createElement("div").style,"AnimationEvent"in window||(delete Ui.animationend.animation,delete Ui.animationiteration.animation,delete Ui.animationstart.animation),"TransitionEvent"in window||delete Ui.transitionend.transition);function Dl(l){if(Yo[l])return Yo[l];if(!Ui[l])return l;var c=Ui[l],w;for(w in c)if(c.hasOwnProperty(w)&&w in Ku)return Yo[l]=c[w];return l}var Lc=Dl("animationend"),Nc=Dl("animationiteration"),Tc=Dl("animationstart"),Rc=Dl("transitionend"),Mc=new Map,Ic="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 Xo(l,c){Mc.set(l,c),a(c,[l])}for(var Fl=0;Fl<Ic.length;Fl++){var Li=Ic[Fl],uo=Li.toLowerCase(),Bl=Li[0].toUpperCase()+Li.slice(1);Xo(uo,"on"+Bl)}Xo(Lc,"onAnimationEnd"),Xo(Nc,"onAnimationIteration"),Xo(Tc,"onAnimationStart"),Xo("dblclick","onDoubleClick"),Xo("focusin","onFocus"),Xo("focusout","onBlur"),Xo(Rc,"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 Ko="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(" "),Tf=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ko));function zl(l,c,w){var N=l.type||"unknown-event";l.currentTarget=w,eo(N,c,void 0,l),l.currentTarget=null}function gu(l,c){c=(c&4)!==0;for(var w=0;w<l.length;w++){var N=l[w],G=N.event;N=N.listeners;e:{var Q=void 0;if(c)for(var he=N.length-1;0<=he;he--){var Me=N[he],ze=Me.instance,nt=Me.currentTarget;if(Me=Me.listener,ze!==Q&&G.isPropagationStopped())break e;zl(G,Me,nt),Q=ze}else for(he=0;he<N.length;he++){if(Me=N[he],ze=Me.instance,nt=Me.currentTarget,Me=Me.listener,ze!==Q&&G.isPropagationStopped())break e;zl(G,Me,nt),Q=ze}}}if(Rn)throw l=Sa,Rn=!1,Sa=null,l}function fn(l,c){var w=c[Ra];w===void 0&&(w=c[Ra]=new Set);var N=l+"__bubble";w.has(N)||(vu(c,l,2,!1),w.add(N))}function Zu(l,c,w){var N=0;c&&(N|=4),vu(w,l,N,c)}var ql="_reactListening"+Math.random().toString(36).slice(2);function Ws(l){if(!l[ql]){l[ql]=!0,n.forEach(function(w){w!=="selectionchange"&&(Tf.has(w)||Zu(w,!1,l),Zu(w,!0,l))});var c=l.nodeType===9?l:l.ownerDocument;c===null||c[ql]||(c[ql]=!0,Zu("selectionchange",!1,c))}}function vu(l,c,w,N){switch(Rl(c)){case 1:var G=Ca;break;case 4:G=ao;break;default:G=Eo}w=G.bind(null,c,w,l),G=void 0,!Fa||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(G=!0),N?G!==void 0?l.addEventListener(c,w,{capture:!0,passive:G}):l.addEventListener(c,w,!0):G!==void 0?l.addEventListener(c,w,{passive:G}):l.addEventListener(c,w,!1)}function mu(l,c,w,N,G){var Q=N;if((c&1)===0&&(c&2)===0&&N!==null)e:for(;;){if(N===null)return;var he=N.tag;if(he===3||he===4){var Me=N.stateNode.containerInfo;if(Me===G||Me.nodeType===8&&Me.parentNode===G)break;if(he===4)for(he=N.return;he!==null;){var ze=he.tag;if((ze===3||ze===4)&&(ze=he.stateNode.containerInfo,ze===G||ze.nodeType===8&&ze.parentNode===G))return;he=he.return}for(;Me!==null;){if(he=Ys(Me),he===null)return;if(ze=he.tag,ze===5||ze===6){N=Q=he;continue e}Me=Me.parentNode}}N=N.return}Qt(function(){var nt=Q,vt=Ct(w),yt=[];e:{var gt=Mc.get(l);if(gt!==void 0){var qt=$a,Vt=l;switch(l){case"keypress":if(La(w)===0)break e;case"keydown":case"keyup":qt=qs;break;case"focusin":Vt="focus",qt=fr;break;case"focusout":Vt="blur",qt=fr;break;case"beforeblur":case"afterblur":qt=fr;break;case"click":if(w.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":qt=ct;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":qt=jt;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":qt=Pi;break;case Lc:case Nc:case Tc:qt=An;break;case Rc:qt=Co;break;case"scroll":qt=ce;break;case"wheel":qt=Il;break;case"copy":case"cut":case"paste":qt=on;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":qt=oo}var Xt=(c&4)!==0,aa=!Xt&&l==="scroll",et=Xt?gt!==null?gt+"Capture":null:gt;Xt=[];for(var We=nt,tt;We!==null;){tt=We;var _t=tt.stateNode;if(tt.tag===5&&_t!==null&&(tt=_t,et!==null&&(_t=ca(We,et),_t!=null&&Xt.push(yu(We,_t,tt)))),aa)break;We=We.return}0<Xt.length&&(gt=new qt(gt,Vt,null,w,vt),yt.push({event:gt,listeners:Xt}))}}if((c&7)===0){e:{if(gt=l==="mouseover"||l==="pointerover",qt=l==="mouseout"||l==="pointerout",gt&&w!==Nt&&(Vt=w.relatedTarget||w.fromElement)&&(Ys(Vt)||Vt[ra]))break e;if((qt||gt)&&(gt=vt.window===vt?vt:(gt=vt.ownerDocument)?gt.defaultView||gt.parentWindow:window,qt?(Vt=w.relatedTarget||w.toElement,qt=nt,Vt=Vt?Ys(Vt):null,Vt!==null&&(aa=si(Vt),Vt!==aa||Vt.tag!==5&&Vt.tag!==6)&&(Vt=null)):(qt=null,Vt=nt),qt!==Vt)){if(Xt=ct,_t="onMouseLeave",et="onMouseEnter",We="mouse",(l==="pointerout"||l==="pointerover")&&(Xt=oo,_t="onPointerLeave",et="onPointerEnter",We="pointer"),aa=qt==null?gt:yi(qt),tt=Vt==null?gt:yi(Vt),gt=new Xt(_t,We+"leave",qt,w,vt),gt.target=aa,gt.relatedTarget=tt,_t=null,Ys(vt)===nt&&(Xt=new Xt(et,We+"enter",Vt,w,vt),Xt.target=tt,Xt.relatedTarget=aa,_t=Xt),aa=_t,qt&&Vt)t:{for(Xt=qt,et=Vt,We=0,tt=Xt;tt;tt=wl(tt))We++;for(tt=0,_t=et;_t;_t=wl(_t))tt++;for(;0<We-tt;)Xt=wl(Xt),We--;for(;0<tt-We;)et=wl(et),tt--;for(;We--;){if(Xt===et||et!==null&&Xt===et.alternate)break t;Xt=wl(Xt),et=wl(et)}Xt=null}else Xt=null;qt!==null&&Ah(yt,gt,qt,Xt,!1),Vt!==null&&aa!==null&&Ah(yt,aa,Vt,Xt,!0)}}e:{if(gt=nt?yi(nt):window,qt=gt.nodeName&>.nodeName.toLowerCase(),qt==="select"||qt==="input"&>.type==="file")var Kt=ci;else if(Ji(gt))if(Ta)Kt=ys;else{Kt=en;var lr=vs}else(qt=gt.nodeName)&&qt.toLowerCase()==="input"&&(gt.type==="checkbox"||gt.type==="radio")&&(Kt=ms);if(Kt&&(Kt=Kt(l,nt))){No(yt,Kt,w,vt);break e}lr&&lr(l,gt,nt),l==="focusout"&&(lr=gt._wrapperState)&&lr.controlled&>.type==="number"&&fe(gt,"number",gt.value)}switch(lr=nt?yi(nt):window,l){case"focusin":(Ji(lr)||lr.contentEditable==="true")&&(Gs=lr,Ci=nt,bl=null);break;case"focusout":bl=Ci=Gs=null;break;case"mousedown":pu=!0;break;case"contextmenu":case"mouseup":case"dragend":pu=!1,Xu(yt,w,vt);break;case"selectionchange":if(bs)break;case"keydown":case"keyup":Xu(yt,w,vt)}var ur;if(so)e:{switch(l){case"compositionstart":var mr="onCompositionStart";break e;case"compositionend":mr="onCompositionEnd";break e;case"compositionupdate":mr="onCompositionUpdate";break e}mr=void 0}else Oi?jl(l,w)&&(mr="onCompositionEnd"):l==="keydown"&&w.keyCode===229&&(mr="onCompositionStart");mr&&(In&&w.locale!=="ko"&&(Oi||mr!=="onCompositionStart"?mr==="onCompositionEnd"&&Oi&&(ur=pl()):(li=vt,Ha="value"in li?li.value:li.textContent,Oi=!0)),lr=jc(nt,mr),0<lr.length&&(mr=new _n(mr,l,null,w,vt),yt.push({event:mr,listeners:lr}),ur?mr.data=ur:(ur=qi(w),ur!==null&&(mr.data=ur)))),(ur=Us?Na(l,w):Wa(l,w))&&(nt=jc(nt,"onBeforeInput"),0<nt.length&&(vt=new _n("onBeforeInput","beforeinput",null,w,vt),yt.push({event:vt,listeners:nt}),vt.data=ur))}gu(yt,c)})}function yu(l,c,w){return{instance:l,listener:c,currentTarget:w}}function jc(l,c){for(var w=c+"Capture",N=[];l!==null;){var G=l,Q=G.stateNode;G.tag===5&&Q!==null&&(G=Q,Q=ca(l,w),Q!=null&&N.unshift(yu(l,Q,G)),Q=ca(l,c),Q!=null&&N.push(yu(l,Q,G))),l=l.return}return N}function wl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function Ah(l,c,w,N,G){for(var Q=c._reactName,he=[];w!==null&&w!==N;){var Me=w,ze=Me.alternate,nt=Me.stateNode;if(ze!==null&&ze===N)break;Me.tag===5&&nt!==null&&(Me=nt,G?(ze=ca(w,Q),ze!=null&&he.unshift(yu(w,ze,Me))):G||(ze=ca(w,Q),ze!=null&&he.push(yu(w,ze,Me)))),w=w.return}he.length!==0&&l.push({event:c,listeners:he})}var Pd=/\r\n?/g,Ph=/\u0000|\uFFFD/g;function Rf(l){return(typeof l=="string"?l:""+l).replace(Pd,`
|
|
30
|
-
`).replace(Ph,"")}function Qu(l,c,w){if(c=Rf(c),Rf(l)!==c&&w)throw Error(r(425))}function Vs(){}var Ju=null,Ul=null;function Mf(l,c){return l==="textarea"||l==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var co=typeof setTimeout=="function"?setTimeout:void 0,Dc=typeof clearTimeout=="function"?clearTimeout:void 0,ec=typeof Promise=="function"?Promise:void 0,Oh=typeof queueMicrotask=="function"?queueMicrotask:typeof ec<"u"?function(l){return ec.resolve(null).then(l).catch(Ch)}:co;function Ch(l){setTimeout(function(){throw l})}function Fc(l,c){var w=c,N=0;do{var G=w.nextSibling;if(l.removeChild(w),G&&G.nodeType===8)if(w=G.data,w==="/$"){if(N===0){l.removeChild(G),ki(c);return}N--}else w!=="$"&&w!=="$?"&&w!=="$!"||N++;w=G}while(w);ki(c)}function ea(l){for(;l!=null;l=l.nextSibling){var c=l.nodeType;if(c===1||c===3)break;if(c===8){if(c=l.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return l}function ta(l){l=l.previousSibling;for(var c=0;l;){if(l.nodeType===8){var w=l.data;if(w==="$"||w==="$!"||w==="$?"){if(c===0)return l;c--}else w==="/$"&&c++}l=l.previousSibling}return null}var ga=Math.random().toString(36).slice(2),Ro="__reactFiber$"+ga,bu="__reactProps$"+ga,ra="__reactContainer$"+ga,Ra="__reactEvents$"+ga,Lh="__reactListeners$"+ga,Nh="__reactHandles$"+ga;function Ys(l){var c=l[Ro];if(c)return c;for(var w=l.parentNode;w;){if(c=w[ra]||w[Ro]){if(w=c.alternate,c.child!==null||w!==null&&w.child!==null)for(l=ta(l);l!==null;){if(w=l[Ro])return w;l=ta(l)}return c}l=w,w=l.parentNode}return null}function wu(l){return l=l[Ro]||l[ra],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function yi(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(r(33))}function Ni(l){return l[bu]||null}var Bc=[],ws=-1;function Mo(l){return{current:l}}function tn(l){0>ws||(l.current=Bc[ws],Bc[ws]=null,ws--)}function sn(l,c){ws++,Bc[ws]=l.current,l.current=c}var _s={},Hi=Mo(_s),va=Mo(!1),_l=_s;function Hl(l,c){var w=l.type.contextTypes;if(!w)return _s;var N=l.stateNode;if(N&&N.__reactInternalMemoizedUnmaskedChildContext===c)return N.__reactInternalMemoizedMaskedChildContext;var G={},Q;for(Q in w)G[Q]=c[Q];return N&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=c,l.__reactInternalMemoizedMaskedChildContext=G),G}function ma(l){return l=l.childContextTypes,l!=null}function _u(){tn(va),tn(Hi)}function If(l,c,w){if(Hi.current!==_s)throw Error(r(168));sn(Hi,c),sn(va,w)}function tc(l,c,w){var N=l.stateNode;if(c=c.childContextTypes,typeof N.getChildContext!="function")return w;N=N.getChildContext();for(var G in N)if(!(G in c))throw Error(r(108,oe(l)||"Unknown",G));return V({},w,N)}function xs(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||_s,_l=Hi.current,sn(Hi,l),sn(va,va.current),!0}function Th(l,c,w){var N=l.stateNode;if(!N)throw Error(r(169));w?(l=tc(l,c,_l),N.__reactInternalMemoizedMergedChildContext=l,tn(va),tn(Hi),sn(Hi,l)):tn(va),sn(va,w)}var Ss=null,$l=!1,P=!1;function R(l){Ss===null?Ss=[l]:Ss.push(l)}function Y(l){$l=!0,R(l)}function re(){if(!P&&Ss!==null){P=!0;var l=0,c=Rr;try{var w=Ss;for(Rr=1;l<w.length;l++){var N=w[l];do N=N(!0);while(N!==null)}Ss=null,$l=!1}catch(G){throw Ss!==null&&(Ss=Ss.slice(l+1)),Bs(as,re),G}finally{Rr=c,P=!1}}return null}var le=[],pe=0,ve=null,be=0,we=[],Se=0,Fe=null,Je=1,xe="";function $e(l,c){le[pe++]=be,le[pe++]=ve,ve=l,be=c}function Qe(l,c,w){we[Se++]=Je,we[Se++]=xe,we[Se++]=Fe,Fe=l;var N=Je;l=xe;var G=32-Sr(N)-1;N&=~(1<<G),w+=1;var Q=32-Sr(c)+G;if(30<Q){var he=G-G%5;Q=(N&(1<<he)-1).toString(32),N>>=he,G-=he,Je=1<<32-Sr(c)+G|w<<G|N,xe=Q+l}else Je=1<<Q|w<<G|N,xe=l}function lt(l){l.return!==null&&($e(l,1),Qe(l,1,0))}function Xe(l){for(;l===ve;)ve=le[--pe],le[pe]=null,be=le[--pe],le[pe]=null;for(;l===Fe;)Fe=we[--Se],we[Se]=null,xe=we[--Se],we[Se]=null,Je=we[--Se],we[Se]=null}var ot=null,He=null,ft=!1,ht=null;function Wt(l,c){var w=kl(5,null,null,0);w.elementType="DELETED",w.stateNode=c,w.return=l,c=l.deletions,c===null?(l.deletions=[w],l.flags|=16):c.push(w)}function Bt(l,c){switch(l.tag){case 5:var w=l.type;return c=c.nodeType!==1||w.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(l.stateNode=c,ot=l,He=ea(c.firstChild),!0):!1;case 6:return c=l.pendingProps===""||c.nodeType!==3?null:c,c!==null?(l.stateNode=c,ot=l,He=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(w=Fe!==null?{id:Je,overflow:xe}:null,l.memoizedState={dehydrated:c,treeContext:w,retryLane:1073741824},w=kl(18,null,null,0),w.stateNode=c,w.return=l,l.child=w,ot=l,He=null,!0):!1;default:return!1}}function hr(l){return(l.mode&1)!==0&&(l.flags&128)===0}function zt(l){if(ft){var c=He;if(c){var w=c;if(!Bt(l,c)){if(hr(l))throw Error(r(418));c=ea(w.nextSibling);var N=ot;c&&Bt(l,c)?Wt(N,w):(l.flags=l.flags&-4097|2,ft=!1,ot=l)}}else{if(hr(l))throw Error(r(418));l.flags=l.flags&-4097|2,ft=!1,ot=l}}}function Pr(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;ot=l}function qn(l){if(l!==ot)return!1;if(!ft)return Pr(l),ft=!0,!1;var c;if((c=l.tag!==3)&&!(c=l.tag!==5)&&(c=l.type,c=c!=="head"&&c!=="body"&&!Mf(l.type,l.memoizedProps)),c&&(c=He)){if(hr(l))throw vr(),Error(r(418));for(;c;)Wt(l,c),c=ea(c.nextSibling)}if(Pr(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));e:{for(l=l.nextSibling,c=0;l;){if(l.nodeType===8){var w=l.data;if(w==="/$"){if(c===0){He=ea(l.nextSibling);break e}c--}else w!=="$"&&w!=="$!"&&w!=="$?"||c++}l=l.nextSibling}He=null}}else He=ot?ea(l.stateNode.nextSibling):null;return!0}function vr(){for(var l=He;l;)l=ea(l.nextSibling)}function Ft(){He=ot=null,ft=!1}function St(l){ht===null?ht=[l]:ht.push(l)}var Un=S.ReactCurrentBatchConfig;function Ht(l,c,w){if(l=w.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(w._owner){if(w=w._owner,w){if(w.tag!==1)throw Error(r(309));var N=w.stateNode}if(!N)throw Error(r(147,l));var G=N,Q=""+l;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===Q?c.ref:(c=function(he){var Me=G.refs;he===null?delete Me[Q]:Me[Q]=he},c._stringRef=Q,c)}if(typeof l!="string")throw Error(r(284));if(!w._owner)throw Error(r(290,l))}return l}function dr(l,c){throw l=Object.prototype.toString.call(c),Error(r(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l))}function Mr(l){var c=l._init;return c(l._payload)}function bi(l){function c(et,We){if(l){var tt=et.deletions;tt===null?(et.deletions=[We],et.flags|=16):tt.push(We)}}function w(et,We){if(!l)return null;for(;We!==null;)c(et,We),We=We.sibling;return null}function N(et,We){for(et=new Map;We!==null;)We.key!==null?et.set(We.key,We):et.set(We.index,We),We=We.sibling;return et}function G(et,We){return et=Jc(et,We),et.index=0,et.sibling=null,et}function Q(et,We,tt){return et.index=tt,l?(tt=et.alternate,tt!==null?(tt=tt.index,tt<We?(et.flags|=2,We):tt):(et.flags|=2,We)):(et.flags|=1048576,We)}function he(et){return l&&et.alternate===null&&(et.flags|=2),et}function Me(et,We,tt,_t){return We===null||We.tag!==6?(We=xg(tt,et.mode,_t),We.return=et,We):(We=G(We,tt),We.return=et,We)}function ze(et,We,tt,_t){var Kt=tt.type;return Kt===O?vt(et,We,tt.props.children,_t,tt.key):We!==null&&(We.elementType===Kt||typeof Kt=="object"&&Kt!==null&&Kt.$$typeof===ae&&Mr(Kt)===We.type)?(_t=G(We,tt.props),_t.ref=Ht(et,We,tt),_t.return=et,_t):(_t=i1(tt.type,tt.key,tt.props,null,et.mode,_t),_t.ref=Ht(et,We,tt),_t.return=et,_t)}function nt(et,We,tt,_t){return We===null||We.tag!==4||We.stateNode.containerInfo!==tt.containerInfo||We.stateNode.implementation!==tt.implementation?(We=Sg(tt,et.mode,_t),We.return=et,We):(We=G(We,tt.children||[]),We.return=et,We)}function vt(et,We,tt,_t,Kt){return We===null||We.tag!==7?(We=Uf(tt,et.mode,_t,Kt),We.return=et,We):(We=G(We,tt),We.return=et,We)}function yt(et,We,tt){if(typeof We=="string"&&We!==""||typeof We=="number")return We=xg(""+We,et.mode,tt),We.return=et,We;if(typeof We=="object"&&We!==null){switch(We.$$typeof){case k:return tt=i1(We.type,We.key,We.props,null,et.mode,tt),tt.ref=Ht(et,null,We),tt.return=et,tt;case I:return We=Sg(We,et.mode,tt),We.return=et,We;case ae:var _t=We._init;return yt(et,_t(We._payload),tt)}if(Le(We)||te(We))return We=Uf(We,et.mode,tt,null),We.return=et,We;dr(et,We)}return null}function gt(et,We,tt,_t){var Kt=We!==null?We.key:null;if(typeof tt=="string"&&tt!==""||typeof tt=="number")return Kt!==null?null:Me(et,We,""+tt,_t);if(typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case k:return tt.key===Kt?ze(et,We,tt,_t):null;case I:return tt.key===Kt?nt(et,We,tt,_t):null;case ae:return Kt=tt._init,gt(et,We,Kt(tt._payload),_t)}if(Le(tt)||te(tt))return Kt!==null?null:vt(et,We,tt,_t,null);dr(et,tt)}return null}function qt(et,We,tt,_t,Kt){if(typeof _t=="string"&&_t!==""||typeof _t=="number")return et=et.get(tt)||null,Me(We,et,""+_t,Kt);if(typeof _t=="object"&&_t!==null){switch(_t.$$typeof){case k:return et=et.get(_t.key===null?tt:_t.key)||null,ze(We,et,_t,Kt);case I:return et=et.get(_t.key===null?tt:_t.key)||null,nt(We,et,_t,Kt);case ae:var lr=_t._init;return qt(et,We,tt,lr(_t._payload),Kt)}if(Le(_t)||te(_t))return et=et.get(tt)||null,vt(We,et,_t,Kt,null);dr(We,_t)}return null}function Vt(et,We,tt,_t){for(var Kt=null,lr=null,ur=We,mr=We=0,Qa=null;ur!==null&&mr<tt.length;mr++){ur.index>mr?(Qa=ur,ur=null):Qa=ur.sibling;var pn=gt(et,ur,tt[mr],_t);if(pn===null){ur===null&&(ur=Qa);break}l&&ur&&pn.alternate===null&&c(et,ur),We=Q(pn,We,mr),lr===null?Kt=pn:lr.sibling=pn,lr=pn,ur=Qa}if(mr===tt.length)return w(et,ur),ft&&$e(et,mr),Kt;if(ur===null){for(;mr<tt.length;mr++)ur=yt(et,tt[mr],_t),ur!==null&&(We=Q(ur,We,mr),lr===null?Kt=ur:lr.sibling=ur,lr=ur);return ft&&$e(et,mr),Kt}for(ur=N(et,ur);mr<tt.length;mr++)Qa=qt(ur,et,mr,tt[mr],_t),Qa!==null&&(l&&Qa.alternate!==null&&ur.delete(Qa.key===null?mr:Qa.key),We=Q(Qa,We,mr),lr===null?Kt=Qa:lr.sibling=Qa,lr=Qa);return l&&ur.forEach(function(ef){return c(et,ef)}),ft&&$e(et,mr),Kt}function Xt(et,We,tt,_t){var Kt=te(tt);if(typeof Kt!="function")throw Error(r(150));if(tt=Kt.call(tt),tt==null)throw Error(r(151));for(var lr=Kt=null,ur=We,mr=We=0,Qa=null,pn=tt.next();ur!==null&&!pn.done;mr++,pn=tt.next()){ur.index>mr?(Qa=ur,ur=null):Qa=ur.sibling;var ef=gt(et,ur,pn.value,_t);if(ef===null){ur===null&&(ur=Qa);break}l&&ur&&ef.alternate===null&&c(et,ur),We=Q(ef,We,mr),lr===null?Kt=ef:lr.sibling=ef,lr=ef,ur=Qa}if(pn.done)return w(et,ur),ft&&$e(et,mr),Kt;if(ur===null){for(;!pn.done;mr++,pn=tt.next())pn=yt(et,pn.value,_t),pn!==null&&(We=Q(pn,We,mr),lr===null?Kt=pn:lr.sibling=pn,lr=pn);return ft&&$e(et,mr),Kt}for(ur=N(et,ur);!pn.done;mr++,pn=tt.next())pn=qt(ur,et,mr,pn.value,_t),pn!==null&&(l&&pn.alternate!==null&&ur.delete(pn.key===null?mr:pn.key),We=Q(pn,We,mr),lr===null?Kt=pn:lr.sibling=pn,lr=pn);return l&&ur.forEach(function(Ix){return c(et,Ix)}),ft&&$e(et,mr),Kt}function aa(et,We,tt,_t){if(typeof tt=="object"&&tt!==null&&tt.type===O&&tt.key===null&&(tt=tt.props.children),typeof tt=="object"&&tt!==null){switch(tt.$$typeof){case k:e:{for(var Kt=tt.key,lr=We;lr!==null;){if(lr.key===Kt){if(Kt=tt.type,Kt===O){if(lr.tag===7){w(et,lr.sibling),We=G(lr,tt.props.children),We.return=et,et=We;break e}}else if(lr.elementType===Kt||typeof Kt=="object"&&Kt!==null&&Kt.$$typeof===ae&&Mr(Kt)===lr.type){w(et,lr.sibling),We=G(lr,tt.props),We.ref=Ht(et,lr,tt),We.return=et,et=We;break e}w(et,lr);break}else c(et,lr);lr=lr.sibling}tt.type===O?(We=Uf(tt.props.children,et.mode,_t,tt.key),We.return=et,et=We):(_t=i1(tt.type,tt.key,tt.props,null,et.mode,_t),_t.ref=Ht(et,We,tt),_t.return=et,et=_t)}return he(et);case I:e:{for(lr=tt.key;We!==null;){if(We.key===lr)if(We.tag===4&&We.stateNode.containerInfo===tt.containerInfo&&We.stateNode.implementation===tt.implementation){w(et,We.sibling),We=G(We,tt.children||[]),We.return=et,et=We;break e}else{w(et,We);break}else c(et,We);We=We.sibling}We=Sg(tt,et.mode,_t),We.return=et,et=We}return he(et);case ae:return lr=tt._init,aa(et,We,lr(tt._payload),_t)}if(Le(tt))return Vt(et,We,tt,_t);if(te(tt))return Xt(et,We,tt,_t);dr(et,tt)}return typeof tt=="string"&&tt!==""||typeof tt=="number"?(tt=""+tt,We!==null&&We.tag===6?(w(et,We.sibling),We=G(We,tt),We.return=et,et=We):(w(et,We),We=xg(tt,et.mode,_t),We.return=et,et=We),he(et)):w(et,We)}return aa}var fi=bi(!0),Hr=bi(!1),wi=Mo(null),vn=null,jn=null,Nr=null;function Gr(){Nr=jn=vn=null}function On(l){var c=wi.current;tn(wi),l._currentValue=c}function Wr(l,c,w){for(;l!==null;){var N=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,N!==null&&(N.childLanes|=c)):N!==null&&(N.childLanes&c)!==c&&(N.childLanes|=c),l===w)break;l=l.return}}function Cn(l,c){vn=l,Nr=jn=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&c)!==0&&(ne=!0),l.firstContext=null)}function Ln(l){var c=l._currentValue;if(Nr!==l)if(l={context:l,memoizedValue:c,next:null},jn===null){if(vn===null)throw Error(r(308));jn=l,vn.dependencies={lanes:0,firstContext:l}}else jn=jn.next=l;return c}var rn=null;function Ti(l){rn===null?rn=[l]:rn.push(l)}function Kr(l,c,w,N){var G=c.interleaved;return G===null?(w.next=w,Ti(c)):(w.next=G.next,G.next=w),c.interleaved=w,Zr(l,N)}function Zr(l,c){l.lanes|=c;var w=l.alternate;for(w!==null&&(w.lanes|=c),w=l,l=l.return;l!==null;)l.childLanes|=c,w=l.alternate,w!==null&&(w.childLanes|=c),w=l,l=l.return;return w.tag===3?w.stateNode:null}var ei=!1;function Ri(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ya(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function ti(l,c){return{eventTime:l,lane:c,tag:0,payload:null,callback:null,next:null}}function Hn(l,c,w){var N=l.updateQueue;if(N===null)return null;if(N=N.shared,(un&2)!==0){var G=N.pending;return G===null?c.next=c:(c.next=G.next,G.next=c),N.pending=c,Zr(l,w)}return G=N.interleaved,G===null?(c.next=c,Ti(N)):(c.next=G.next,G.next=c),N.interleaved=c,Zr(l,w)}function ba(l,c,w){if(c=c.updateQueue,c!==null&&(c=c.shared,(w&4194240)!==0)){var N=c.lanes;N&=l.pendingLanes,w|=N,c.lanes=w,cu(l,w)}}function nn(l,c){var w=l.updateQueue,N=l.alternate;if(N!==null&&(N=N.updateQueue,w===N)){var G=null,Q=null;if(w=w.firstBaseUpdate,w!==null){do{var he={eventTime:w.eventTime,lane:w.lane,tag:w.tag,payload:w.payload,callback:w.callback,next:null};Q===null?G=Q=he:Q=Q.next=he,w=w.next}while(w!==null);Q===null?G=Q=c:Q=Q.next=c}else G=Q=c;w={baseState:N.baseState,firstBaseUpdate:G,lastBaseUpdate:Q,shared:N.shared,effects:N.effects},l.updateQueue=w;return}l=w.lastBaseUpdate,l===null?w.firstBaseUpdate=c:l.next=c,w.lastBaseUpdate=c}function $i(l,c,w,N){var G=l.updateQueue;ei=!1;var Q=G.firstBaseUpdate,he=G.lastBaseUpdate,Me=G.shared.pending;if(Me!==null){G.shared.pending=null;var ze=Me,nt=ze.next;ze.next=null,he===null?Q=nt:he.next=nt,he=ze;var vt=l.alternate;vt!==null&&(vt=vt.updateQueue,Me=vt.lastBaseUpdate,Me!==he&&(Me===null?vt.firstBaseUpdate=nt:Me.next=nt,vt.lastBaseUpdate=ze))}if(Q!==null){var yt=G.baseState;he=0,vt=nt=ze=null,Me=Q;do{var gt=Me.lane,qt=Me.eventTime;if((N>)===gt){vt!==null&&(vt=vt.next={eventTime:qt,lane:0,tag:Me.tag,payload:Me.payload,callback:Me.callback,next:null});e:{var Vt=l,Xt=Me;switch(gt=c,qt=w,Xt.tag){case 1:if(Vt=Xt.payload,typeof Vt=="function"){yt=Vt.call(qt,yt,gt);break e}yt=Vt;break e;case 3:Vt.flags=Vt.flags&-65537|128;case 0:if(Vt=Xt.payload,gt=typeof Vt=="function"?Vt.call(qt,yt,gt):Vt,gt==null)break e;yt=V({},yt,gt);break e;case 2:ei=!0}}Me.callback!==null&&Me.lane!==0&&(l.flags|=64,gt=G.effects,gt===null?G.effects=[Me]:gt.push(Me))}else qt={eventTime:qt,lane:gt,tag:Me.tag,payload:Me.payload,callback:Me.callback,next:null},vt===null?(nt=vt=qt,ze=yt):vt=vt.next=qt,he|=gt;if(Me=Me.next,Me===null){if(Me=G.shared.pending,Me===null)break;gt=Me,Me=gt.next,gt.next=null,G.lastBaseUpdate=gt,G.shared.pending=null}}while(!0);if(vt===null&&(ze=yt),G.baseState=ze,G.firstBaseUpdate=nt,G.lastBaseUpdate=vt,c=G.shared.interleaved,c!==null){G=c;do he|=G.lane,G=G.next;while(G!==c)}else Q===null&&(G.shared.lanes=0);Ff|=he,l.lanes=he,l.memoizedState=yt}}function Vr(l,c,w){if(l=c.effects,c.effects=null,l!==null)for(c=0;c<l.length;c++){var N=l[c],G=N.callback;if(G!==null){if(N.callback=null,N=w,typeof G!="function")throw Error(r(191,G));G.call(N)}}}var sr={},Ir=Mo(sr),kr=Mo(sr),Dn=Mo(sr);function hi(l){if(l===sr)throw Error(r(174));return l}function Zo(l,c){switch(sn(Dn,c),sn(kr,l),sn(Ir,sr),l=c.nodeType,l){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:dt(null,"");break;default:l=l===8?c.parentNode:c,c=l.namespaceURI||null,l=l.tagName,c=dt(c,l)}tn(Ir),sn(Ir,c)}function hn(){tn(Ir),tn(kr),tn(Dn)}function xu(l){hi(Dn.current);var c=hi(Ir.current),w=dt(c,l.type);c!==w&&(sn(kr,l),sn(Ir,w))}function Xs(l){kr.current===l&&(tn(Ir),tn(kr))}var dn=Mo(0);function fo(l){for(var c=l;c!==null;){if(c.tag===13){var w=c.memoizedState;if(w!==null&&(w=w.dehydrated,w===null||w.data==="$?"||w.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Gl=[];function wa(){for(var l=0;l<Gl.length;l++)Gl[l]._workInProgressVersionPrimary=null;Gl.length=0}var Su=S.ReactCurrentDispatcher,Eu=S.ReactCurrentBatchConfig,Gi=0,ln=null,$n=null,Gn=null,ho=!1,Io=!1,po=0,zc=0;function Wn(){throw Error(r(321))}function ku(l,c){if(c===null)return!1;for(var w=0;w<c.length&&w<l.length;w++)if(!Pn(l[w],c[w]))return!1;return!0}function xl(l,c,w,N,G,Q){if(Gi=Q,ln=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Su.current=l===null||l.memoizedState===null?ng:Pu,l=w(N,G),Io){Q=0;do{if(Io=!1,po=0,25<=Q)throw Error(r(301));Q+=1,Gn=$n=null,c.updateQueue=null,Su.current=Mh,l=w(N,G)}while(Io)}if(Su.current=$c,c=$n!==null&&$n.next!==null,Gi=0,Gn=$n=ln=null,ho=!1,c)throw Error(r(300));return l}function go(){var l=po!==0;return po=0,l}function xn(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gn===null?ln.memoizedState=Gn=l:Gn=Gn.next=l,Gn}function _i(){if($n===null){var l=ln.alternate;l=l!==null?l.memoizedState:null}else l=$n.next;var c=Gn===null?ln.memoizedState:Gn.next;if(c!==null)Gn=c,$n=l;else{if(l===null)throw Error(r(310));$n=l,l={memoizedState:$n.memoizedState,baseState:$n.baseState,baseQueue:$n.baseQueue,queue:$n.queue,next:null},Gn===null?ln.memoizedState=Gn=l:Gn=Gn.next=l}return Gn}function _a(l,c){return typeof c=="function"?c(l):c}function na(l){var c=_i(),w=c.queue;if(w===null)throw Error(r(311));w.lastRenderedReducer=l;var N=$n,G=N.baseQueue,Q=w.pending;if(Q!==null){if(G!==null){var he=G.next;G.next=Q.next,Q.next=he}N.baseQueue=G=Q,w.pending=null}if(G!==null){Q=G.next,N=N.baseState;var Me=he=null,ze=null,nt=Q;do{var vt=nt.lane;if((Gi&vt)===vt)ze!==null&&(ze=ze.next={lane:0,action:nt.action,hasEagerState:nt.hasEagerState,eagerState:nt.eagerState,next:null}),N=nt.hasEagerState?nt.eagerState:l(N,nt.action);else{var yt={lane:vt,action:nt.action,hasEagerState:nt.hasEagerState,eagerState:nt.eagerState,next:null};ze===null?(Me=ze=yt,he=N):ze=ze.next=yt,ln.lanes|=vt,Ff|=vt}nt=nt.next}while(nt!==null&&nt!==Q);ze===null?he=N:ze.next=Me,Pn(N,c.memoizedState)||(ne=!0),c.memoizedState=N,c.baseState=he,c.baseQueue=ze,w.lastRenderedState=N}if(l=w.interleaved,l!==null){G=l;do Q=G.lane,ln.lanes|=Q,Ff|=Q,G=G.next;while(G!==l)}else G===null&&(w.lanes=0);return[c.memoizedState,w.dispatch]}function Ks(l){var c=_i(),w=c.queue;if(w===null)throw Error(r(311));w.lastRenderedReducer=l;var N=w.dispatch,G=w.pending,Q=c.memoizedState;if(G!==null){w.pending=null;var he=G=G.next;do Q=l(Q,he.action),he=he.next;while(he!==G);Pn(Q,c.memoizedState)||(ne=!0),c.memoizedState=Q,c.baseQueue===null&&(c.baseState=Q),w.lastRenderedState=Q}return[Q,N]}function qc(){}function rc(l,c){var w=ln,N=_i(),G=c(),Q=!Pn(N.memoizedState,G);if(Q&&(N.memoizedState=G,ne=!0),N=N.queue,Hc(jf.bind(null,w,N,l),[l]),N.getSnapshot!==c||Q||Gn!==null&&Gn.memoizedState.tag&1){if(w.flags|=2048,Xa(9,Es.bind(null,w,N,G,c),void 0,null),Za===null)throw Error(r(349));(Gi&30)!==0||Rh(w,c,G)}return G}function Rh(l,c,w){l.flags|=16384,l={getSnapshot:c,value:w},c=ln.updateQueue,c===null?(c={lastEffect:null,stores:null},ln.updateQueue=c,c.stores=[l]):(w=c.stores,w===null?c.stores=[l]:w.push(l))}function Es(l,c,w,N){c.value=w,c.getSnapshot=N,Wl(c)&&Au(l)}function jf(l,c,w){return w(function(){Wl(c)&&Au(l)})}function Wl(l){var c=l.getSnapshot;l=l.value;try{var w=c();return!Pn(l,w)}catch{return!0}}function Au(l){var c=Zr(l,1);c!==null&&Kl(c,l,1,-1)}function Qo(l){var c=xn();return typeof l=="function"&&(l=l()),c.memoizedState=c.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_a,lastRenderedState:l},c.queue=l,l=l.dispatch=$p.bind(null,ln,l),[c.memoizedState,l]}function Xa(l,c,w,N){return l={tag:l,create:c,destroy:w,deps:N,next:null},c=ln.updateQueue,c===null?(c={lastEffect:null,stores:null},ln.updateQueue=c,c.lastEffect=l.next=l):(w=c.lastEffect,w===null?c.lastEffect=l.next=l:(N=w.next,w.next=l,l.next=N,c.lastEffect=l)),l}function ks(){return _i().memoizedState}function vo(l,c,w,N){var G=xn();ln.flags|=l,G.memoizedState=Xa(1|c,w,void 0,N===void 0?null:N)}function As(l,c,w,N){var G=_i();N=N===void 0?null:N;var Q=void 0;if($n!==null){var he=$n.memoizedState;if(Q=he.destroy,N!==null&&ku(N,he.deps)){G.memoizedState=Xa(c,w,Q,N);return}}ln.flags|=l,G.memoizedState=Xa(1|c,w,Q,N)}function Uc(l,c){return vo(8390656,8,l,c)}function Hc(l,c){return As(2048,8,l,c)}function Df(l,c){return As(4,2,l,c)}function nc(l,c){return As(4,4,l,c)}function Ps(l,c){if(typeof c=="function")return l=l(),c(l),function(){c(null)};if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function zp(l,c,w){return w=w!=null?w.concat([l]):null,As(4,4,Ps.bind(null,c,l),w)}function Vl(){}function Od(l,c){var w=_i();c=c===void 0?null:c;var N=w.memoizedState;return N!==null&&c!==null&&ku(c,N[1])?N[0]:(w.memoizedState=[l,c],l)}function Vn(l,c){var w=_i();c=c===void 0?null:c;var N=w.memoizedState;return N!==null&&c!==null&&ku(c,N[1])?N[0]:(l=l(),w.memoizedState=[l,c],l)}function qp(l,c,w){return(Gi&21)===0?(l.baseState&&(l.baseState=!1,ne=!0),l.memoizedState=w):(Pn(w,c)||(w=Vu(),ln.lanes|=w,Ff|=w,l.baseState=!0),c)}function Up(l,c){var w=Rr;Rr=w!==0&&4>w?w:4,l(!0);var N=Eu.transition;Eu.transition={};try{l(!1),c()}finally{Rr=w,Eu.transition=N}}function Hp(){return _i().memoizedState}function rg(l,c,w){var N=Zc(l);if(w={lane:N,action:w,hasEagerState:!1,eagerState:null,next:null},Cd(l))Gp(c,w);else if(w=Kr(l,c,w,N),w!==null){var G=es();Kl(w,l,N,G),Jo(w,c,N)}}function $p(l,c,w){var N=Zc(l),G={lane:N,action:w,hasEagerState:!1,eagerState:null,next:null};if(Cd(l))Gp(c,G);else{var Q=l.alternate;if(l.lanes===0&&(Q===null||Q.lanes===0)&&(Q=c.lastRenderedReducer,Q!==null))try{var he=c.lastRenderedState,Me=Q(he,w);if(G.hasEagerState=!0,G.eagerState=Me,Pn(Me,he)){var ze=c.interleaved;ze===null?(G.next=G,Ti(c)):(G.next=ze.next,ze.next=G),c.interleaved=G;return}}catch{}finally{}w=Kr(l,c,G,N),w!==null&&(G=es(),Kl(w,l,N,G),Jo(w,c,N))}}function Cd(l){var c=l.alternate;return l===ln||c!==null&&c===ln}function Gp(l,c){Io=ho=!0;var w=l.pending;w===null?c.next=c:(c.next=w.next,w.next=c),l.pending=c}function Jo(l,c,w){if((w&4194240)!==0){var N=c.lanes;N&=l.pendingLanes,w|=N,c.lanes=w,cu(l,w)}}var $c={readContext:Ln,useCallback:Wn,useContext:Wn,useEffect:Wn,useImperativeHandle:Wn,useInsertionEffect:Wn,useLayoutEffect:Wn,useMemo:Wn,useReducer:Wn,useRef:Wn,useState:Wn,useDebugValue:Wn,useDeferredValue:Wn,useTransition:Wn,useMutableSource:Wn,useSyncExternalStore:Wn,useId:Wn,unstable_isNewReconciler:!1},ng={readContext:Ln,useCallback:function(l,c){return xn().memoizedState=[l,c===void 0?null:c],l},useContext:Ln,useEffect:Uc,useImperativeHandle:function(l,c,w){return w=w!=null?w.concat([l]):null,vo(4194308,4,Ps.bind(null,c,l),w)},useLayoutEffect:function(l,c){return vo(4194308,4,l,c)},useInsertionEffect:function(l,c){return vo(4,2,l,c)},useMemo:function(l,c){var w=xn();return c=c===void 0?null:c,l=l(),w.memoizedState=[l,c],l},useReducer:function(l,c,w){var N=xn();return c=w!==void 0?w(c):c,N.memoizedState=N.baseState=c,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:c},N.queue=l,l=l.dispatch=rg.bind(null,ln,l),[N.memoizedState,l]},useRef:function(l){var c=xn();return l={current:l},c.memoizedState=l},useState:Qo,useDebugValue:Vl,useDeferredValue:function(l){return xn().memoizedState=l},useTransition:function(){var l=Qo(!1),c=l[0];return l=Up.bind(null,l[1]),xn().memoizedState=l,[c,l]},useMutableSource:function(){},useSyncExternalStore:function(l,c,w){var N=ln,G=xn();if(ft){if(w===void 0)throw Error(r(407));w=w()}else{if(w=c(),Za===null)throw Error(r(349));(Gi&30)!==0||Rh(N,c,w)}G.memoizedState=w;var Q={value:w,getSnapshot:c};return G.queue=Q,Uc(jf.bind(null,N,Q,l),[l]),N.flags|=2048,Xa(9,Es.bind(null,N,Q,w,c),void 0,null),w},useId:function(){var l=xn(),c=Za.identifierPrefix;if(ft){var w=xe,N=Je;w=(N&~(1<<32-Sr(N)-1)).toString(32)+w,c=":"+c+"R"+w,w=po++,0<w&&(c+="H"+w.toString(32)),c+=":"}else w=zc++,c=":"+c+"r"+w.toString(32)+":";return l.memoizedState=c},unstable_isNewReconciler:!1},Pu={readContext:Ln,useCallback:Od,useContext:Ln,useEffect:Hc,useImperativeHandle:zp,useInsertionEffect:Df,useLayoutEffect:nc,useMemo:Vn,useReducer:na,useRef:ks,useState:function(){return na(_a)},useDebugValue:Vl,useDeferredValue:function(l){var c=_i();return qp(c,$n.memoizedState,l)},useTransition:function(){var l=na(_a)[0],c=_i().memoizedState;return[l,c]},useMutableSource:qc,useSyncExternalStore:rc,useId:Hp,unstable_isNewReconciler:!1},Mh={readContext:Ln,useCallback:Od,useContext:Ln,useEffect:Hc,useImperativeHandle:zp,useInsertionEffect:Df,useLayoutEffect:nc,useMemo:Vn,useReducer:Ks,useRef:ks,useState:function(){return Ks(_a)},useDebugValue:Vl,useDeferredValue:function(l){var c=_i();return $n===null?c.memoizedState=l:qp(c,$n.memoizedState,l)},useTransition:function(){var l=Ks(_a)[0],c=_i().memoizedState;return[l,c]},useMutableSource:qc,useSyncExternalStore:rc,useId:Hp,unstable_isNewReconciler:!1};function Ma(l,c){if(l&&l.defaultProps){c=V({},c),l=l.defaultProps;for(var w in l)c[w]===void 0&&(c[w]=l[w]);return c}return c}function Gc(l,c,w,N){c=l.memoizedState,w=w(N,c),w=w==null?c:V({},c,w),l.memoizedState=w,l.lanes===0&&(l.updateQueue.baseState=w)}var Wc={isMounted:function(l){return(l=l._reactInternals)?si(l)===l:!1},enqueueSetState:function(l,c,w){l=l._reactInternals;var N=es(),G=Zc(l),Q=ti(N,G);Q.payload=c,w!=null&&(Q.callback=w),c=Hn(l,Q,G),c!==null&&(Kl(c,l,G,N),ba(c,l,G))},enqueueReplaceState:function(l,c,w){l=l._reactInternals;var N=es(),G=Zc(l),Q=ti(N,G);Q.tag=1,Q.payload=c,w!=null&&(Q.callback=w),c=Hn(l,Q,G),c!==null&&(Kl(c,l,G,N),ba(c,l,G))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var w=es(),N=Zc(l),G=ti(w,N);G.tag=2,c!=null&&(G.callback=c),c=Hn(l,G,N),c!==null&&(Kl(c,l,N,w),ba(c,l,N))}};function Ih(l,c,w,N,G,Q,he){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(N,Q,he):c.prototype&&c.prototype.isPureReactComponent?!pa(w,N)||!pa(G,Q):!0}function Wp(l,c,w){var N=!1,G=_s,Q=c.contextType;return typeof Q=="object"&&Q!==null?Q=Ln(Q):(G=ma(c)?_l:Hi.current,N=c.contextTypes,Q=(N=N!=null)?Hl(l,G):_s),c=new c(w,Q),l.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Wc,l.stateNode=c,c._reactInternals=l,N&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=G,l.__reactInternalMemoizedMaskedChildContext=Q),c}function Ld(l,c,w,N){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(w,N),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(w,N),c.state!==l&&Wc.enqueueReplaceState(c,c.state,null)}function jh(l,c,w,N){var G=l.stateNode;G.props=w,G.state=l.memoizedState,G.refs={},Ri(l);var Q=c.contextType;typeof Q=="object"&&Q!==null?G.context=Ln(Q):(Q=ma(c)?_l:Hi.current,G.context=Hl(l,Q)),G.state=l.memoizedState,Q=c.getDerivedStateFromProps,typeof Q=="function"&&(Gc(l,c,Q,w),G.state=l.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof G.getSnapshotBeforeUpdate=="function"||typeof G.UNSAFE_componentWillMount!="function"&&typeof G.componentWillMount!="function"||(c=G.state,typeof G.componentWillMount=="function"&&G.componentWillMount(),typeof G.UNSAFE_componentWillMount=="function"&&G.UNSAFE_componentWillMount(),c!==G.state&&Wc.enqueueReplaceState(G,G.state,null),$i(l,w,G,N),G.state=l.memoizedState),typeof G.componentDidMount=="function"&&(l.flags|=4194308)}function ic(l,c){try{var w="",N=c;do w+=ee(N),N=N.return;while(N);var G=w}catch(Q){G=`
|
|
31
|
-
Error generating stack: `+Q.message+`
|
|
32
|
-
`+Q.stack}return{value:l,source:c,stack:G,digest:null}}function Dh(l,c,w){return{value:l,source:null,stack:w??null,digest:c??null}}function Vc(l,c){try{console.error(c.value)}catch(w){setTimeout(function(){throw w})}}var ig=typeof WeakMap=="function"?WeakMap:Map;function Vp(l,c,w){w=ti(-1,w),w.tag=3,w.payload={element:null};var N=c.value;return w.callback=function(){Qp||(Qp=!0,pg=N),Vc(l,c)},w}function d(l,c,w){w=ti(-1,w),w.tag=3;var N=l.type.getDerivedStateFromError;if(typeof N=="function"){var G=c.value;w.payload=function(){return N(G)},w.callback=function(){Vc(l,c)}}var Q=l.stateNode;return Q!==null&&typeof Q.componentDidCatch=="function"&&(w.callback=function(){Vc(l,c),typeof N!="function"&&(Xc===null?Xc=new Set([this]):Xc.add(this));var he=c.stack;this.componentDidCatch(c.value,{componentStack:he!==null?he:""})}),w}function m(l,c,w){var N=l.pingCache;if(N===null){N=l.pingCache=new ig;var G=new Set;N.set(c,G)}else G=N.get(c),G===void 0&&(G=new Set,N.set(c,G));G.has(w)||(G.add(w),l=Ex.bind(null,l,c,w),c.then(l,l))}function C(l){do{var c;if((c=l.tag===13)&&(c=l.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return l;l=l.return}while(l!==null);return null}function z(l,c,w,N,G){return(l.mode&1)===0?(l===c?l.flags|=65536:(l.flags|=128,w.flags|=131072,w.flags&=-52805,w.tag===1&&(w.alternate===null?w.tag=17:(c=ti(-1,1),c.tag=2,Hn(w,c,1))),w.lanes|=1),l):(l.flags|=65536,l.lanes=G,l)}var W=S.ReactCurrentOwner,ne=!1;function _e(l,c,w,N){c.child=l===null?Hr(c,null,w,N):fi(c,l.child,w,N)}function Ye(l,c,w,N,G){w=w.render;var Q=c.ref;return Cn(c,G),N=xl(l,c,w,N,Q,G),w=go(),l!==null&&!ne?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~G,Ka(l,c,G)):(ft&&w&<(c),c.flags|=1,_e(l,c,N,G),c.child)}function it(l,c,w,N,G){if(l===null){var Q=w.type;return typeof Q=="function"&&!_g(Q)&&Q.defaultProps===void 0&&w.compare===null&&w.defaultProps===void 0?(c.tag=15,c.type=Q,wt(l,c,Q,N,G)):(l=i1(w.type,null,N,c,c.mode,G),l.ref=c.ref,l.return=c,c.child=l)}if(Q=l.child,(l.lanes&G)===0){var he=Q.memoizedProps;if(w=w.compare,w=w!==null?w:pa,w(he,N)&&l.ref===c.ref)return Ka(l,c,G)}return c.flags|=1,l=Jc(Q,N),l.ref=c.ref,l.return=c,c.child=l}function wt(l,c,w,N,G){if(l!==null){var Q=l.memoizedProps;if(pa(Q,N)&&l.ref===c.ref)if(ne=!1,c.pendingProps=N=Q,(l.lanes&G)!==0)(l.flags&131072)!==0&&(ne=!0);else return c.lanes=l.lanes,Ka(l,c,G)}return Tt(l,c,w,N,G)}function $t(l,c,w){var N=c.pendingProps,G=N.children,Q=l!==null?l.memoizedState:null;if(N.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},sn(Bh,Zs),Zs|=w;else{if((w&1073741824)===0)return l=Q!==null?Q.baseLanes|w:w,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:l,cachePool:null,transitions:null},c.updateQueue=null,sn(Bh,Zs),Zs|=l,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},N=Q!==null?Q.baseLanes:w,sn(Bh,Zs),Zs|=N}else Q!==null?(N=Q.baseLanes|w,c.memoizedState=null):N=w,sn(Bh,Zs),Zs|=N;return _e(l,c,G,w),c.child}function br(l,c){var w=c.ref;(l===null&&w!==null||l!==null&&l.ref!==w)&&(c.flags|=512,c.flags|=2097152)}function Tt(l,c,w,N,G){var Q=ma(w)?_l:Hi.current;return Q=Hl(c,Q),Cn(c,G),w=xl(l,c,w,N,Q,G),N=go(),l!==null&&!ne?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~G,Ka(l,c,G)):(ft&&N&<(c),c.flags|=1,_e(l,c,w,G),c.child)}function Fn(l,c,w,N,G){if(ma(w)){var Q=!0;xs(c)}else Q=!1;if(Cn(c,G),c.stateNode===null)$r(l,c),Wp(c,w,N),jh(c,w,N,G),N=!0;else if(l===null){var he=c.stateNode,Me=c.memoizedProps;he.props=Me;var ze=he.context,nt=w.contextType;typeof nt=="object"&&nt!==null?nt=Ln(nt):(nt=ma(w)?_l:Hi.current,nt=Hl(c,nt));var vt=w.getDerivedStateFromProps,yt=typeof vt=="function"||typeof he.getSnapshotBeforeUpdate=="function";yt||typeof he.UNSAFE_componentWillReceiveProps!="function"&&typeof he.componentWillReceiveProps!="function"||(Me!==N||ze!==nt)&&Ld(c,he,N,nt),ei=!1;var gt=c.memoizedState;he.state=gt,$i(c,N,he,G),ze=c.memoizedState,Me!==N||gt!==ze||va.current||ei?(typeof vt=="function"&&(Gc(c,w,vt,N),ze=c.memoizedState),(Me=ei||Ih(c,w,Me,N,gt,ze,nt))?(yt||typeof he.UNSAFE_componentWillMount!="function"&&typeof he.componentWillMount!="function"||(typeof he.componentWillMount=="function"&&he.componentWillMount(),typeof he.UNSAFE_componentWillMount=="function"&&he.UNSAFE_componentWillMount()),typeof he.componentDidMount=="function"&&(c.flags|=4194308)):(typeof he.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=N,c.memoizedState=ze),he.props=N,he.state=ze,he.context=nt,N=Me):(typeof he.componentDidMount=="function"&&(c.flags|=4194308),N=!1)}else{he=c.stateNode,ya(l,c),Me=c.memoizedProps,nt=c.type===c.elementType?Me:Ma(c.type,Me),he.props=nt,yt=c.pendingProps,gt=he.context,ze=w.contextType,typeof ze=="object"&&ze!==null?ze=Ln(ze):(ze=ma(w)?_l:Hi.current,ze=Hl(c,ze));var qt=w.getDerivedStateFromProps;(vt=typeof qt=="function"||typeof he.getSnapshotBeforeUpdate=="function")||typeof he.UNSAFE_componentWillReceiveProps!="function"&&typeof he.componentWillReceiveProps!="function"||(Me!==yt||gt!==ze)&&Ld(c,he,N,ze),ei=!1,gt=c.memoizedState,he.state=gt,$i(c,N,he,G);var Vt=c.memoizedState;Me!==yt||gt!==Vt||va.current||ei?(typeof qt=="function"&&(Gc(c,w,qt,N),Vt=c.memoizedState),(nt=ei||Ih(c,w,nt,N,gt,Vt,ze)||!1)?(vt||typeof he.UNSAFE_componentWillUpdate!="function"&&typeof he.componentWillUpdate!="function"||(typeof he.componentWillUpdate=="function"&&he.componentWillUpdate(N,Vt,ze),typeof he.UNSAFE_componentWillUpdate=="function"&&he.UNSAFE_componentWillUpdate(N,Vt,ze)),typeof he.componentDidUpdate=="function"&&(c.flags|=4),typeof he.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof he.componentDidUpdate!="function"||Me===l.memoizedProps&>===l.memoizedState||(c.flags|=4),typeof he.getSnapshotBeforeUpdate!="function"||Me===l.memoizedProps&>===l.memoizedState||(c.flags|=1024),c.memoizedProps=N,c.memoizedState=Vt),he.props=N,he.state=Vt,he.context=ze,N=nt):(typeof he.componentDidUpdate!="function"||Me===l.memoizedProps&>===l.memoizedState||(c.flags|=4),typeof he.getSnapshotBeforeUpdate!="function"||Me===l.memoizedProps&>===l.memoizedState||(c.flags|=1024),N=!1)}return mn(l,c,w,N,Q,G)}function mn(l,c,w,N,G,Q){br(l,c);var he=(c.flags&128)!==0;if(!N&&!he)return G&&Th(c,w,!1),Ka(l,c,Q);N=c.stateNode,W.current=c;var Me=he&&typeof w.getDerivedStateFromError!="function"?null:N.render();return c.flags|=1,l!==null&&he?(c.child=fi(c,l.child,null,Q),c.child=fi(c,null,Me,Q)):_e(l,c,Me,Q),c.memoizedState=N.state,G&&Th(c,w,!0),c.child}function mo(l){var c=l.stateNode;c.pendingContext?If(l,c.pendingContext,c.pendingContext!==c.context):c.context&&If(l,c.context,!1),Zo(l,c.containerInfo)}function Sl(l,c,w,N,G){return Ft(),St(G),c.flags|=256,_e(l,c,w,N),c.child}var rt={dehydrated:null,treeContext:null,retryLane:0};function Ke(l){return{baseLanes:l,cachePool:null,transitions:null}}function ut(l,c,w){var N=c.pendingProps,G=dn.current,Q=!1,he=(c.flags&128)!==0,Me;if((Me=he)||(Me=l!==null&&l.memoizedState===null?!1:(G&2)!==0),Me?(Q=!0,c.flags&=-129):(l===null||l.memoizedState!==null)&&(G|=1),sn(dn,G&1),l===null)return zt(c),l=c.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((c.mode&1)===0?c.lanes=1:l.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(he=N.children,l=N.fallback,Q?(N=c.mode,Q=c.child,he={mode:"hidden",children:he},(N&1)===0&&Q!==null?(Q.childLanes=0,Q.pendingProps=he):Q=a1(he,N,0,null),l=Uf(l,N,w,null),Q.return=c,l.return=c,Q.sibling=l,c.child=Q,c.child.memoizedState=Ke(w),c.memoizedState=rt,l):Rt(c,he));if(G=l.memoizedState,G!==null&&(Me=G.dehydrated,Me!==null))return Or(l,c,he,N,Me,G,w);if(Q){Q=N.fallback,he=c.mode,G=l.child,Me=G.sibling;var ze={mode:"hidden",children:N.children};return(he&1)===0&&c.child!==G?(N=c.child,N.childLanes=0,N.pendingProps=ze,c.deletions=null):(N=Jc(G,ze),N.subtreeFlags=G.subtreeFlags&14680064),Me!==null?Q=Jc(Me,Q):(Q=Uf(Q,he,w,null),Q.flags|=2),Q.return=c,N.return=c,N.sibling=Q,c.child=N,N=Q,Q=c.child,he=l.child.memoizedState,he=he===null?Ke(w):{baseLanes:he.baseLanes|w,cachePool:null,transitions:he.transitions},Q.memoizedState=he,Q.childLanes=l.childLanes&~w,c.memoizedState=rt,N}return Q=l.child,l=Q.sibling,N=Jc(Q,{mode:"visible",children:N.children}),(c.mode&1)===0&&(N.lanes=w),N.return=c,N.sibling=null,l!==null&&(w=c.deletions,w===null?(c.deletions=[l],c.flags|=16):w.push(l)),c.child=N,c.memoizedState=null,N}function Rt(l,c){return c=a1({mode:"visible",children:c},l.mode,0,null),c.return=l,l.child=c}function nr(l,c,w,N){return N!==null&&St(N),fi(c,l.child,null,w),l=Rt(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function Or(l,c,w,N,G,Q,he){if(w)return c.flags&256?(c.flags&=-257,N=Dh(Error(r(422))),nr(l,c,he,N)):c.memoizedState!==null?(c.child=l.child,c.flags|=128,null):(Q=N.fallback,G=c.mode,N=a1({mode:"visible",children:N.children},G,0,null),Q=Uf(Q,G,he,null),Q.flags|=2,N.return=c,Q.return=c,N.sibling=Q,c.child=N,(c.mode&1)!==0&&fi(c,l.child,null,he),c.child.memoizedState=Ke(he),c.memoizedState=rt,Q);if((c.mode&1)===0)return nr(l,c,he,null);if(G.data==="$!"){if(N=G.nextSibling&&G.nextSibling.dataset,N)var Me=N.dgst;return N=Me,Q=Error(r(419)),N=Dh(Q,N,void 0),nr(l,c,he,N)}if(Me=(he&l.childLanes)!==0,ne||Me){if(N=Za,N!==null){switch(he&-he){case 4:G=2;break;case 16:G=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:G=32;break;case 536870912:G=268435456;break;default:G=0}G=(G&(N.suspendedLanes|he))!==0?0:G,G!==0&&G!==Q.retryLane&&(Q.retryLane=G,Zr(l,G),Kl(N,l,G,-1))}return wg(),N=Dh(Error(r(421))),nr(l,c,he,N)}return G.data==="$?"?(c.flags|=128,c.child=l.child,c=kx.bind(null,l),G._reactRetry=c,null):(l=Q.treeContext,He=ea(G.nextSibling),ot=c,ft=!0,ht=null,l!==null&&(we[Se++]=Je,we[Se++]=xe,we[Se++]=Fe,Je=l.id,xe=l.overflow,Fe=c),c=Rt(c,N.children),c.flags|=4096,c)}function wr(l,c,w){l.lanes|=c;var N=l.alternate;N!==null&&(N.lanes|=c),Wr(l.return,c,w)}function Yr(l,c,w,N,G){var Q=l.memoizedState;Q===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:N,tail:w,tailMode:G}:(Q.isBackwards=c,Q.rendering=null,Q.renderingStartTime=0,Q.last=N,Q.tail=w,Q.tailMode=G)}function ia(l,c,w){var N=c.pendingProps,G=N.revealOrder,Q=N.tail;if(_e(l,c,N.children,w),N=dn.current,(N&2)!==0)N=N&1|2,c.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&wr(l,w,c);else if(l.tag===19)wr(l,w,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}N&=1}if(sn(dn,N),(c.mode&1)===0)c.memoizedState=null;else switch(G){case"forwards":for(w=c.child,G=null;w!==null;)l=w.alternate,l!==null&&fo(l)===null&&(G=w),w=w.sibling;w=G,w===null?(G=c.child,c.child=null):(G=w.sibling,w.sibling=null),Yr(c,!1,G,w,Q);break;case"backwards":for(w=null,G=c.child,c.child=null;G!==null;){if(l=G.alternate,l!==null&&fo(l)===null){c.child=G;break}l=G.sibling,G.sibling=w,w=G,G=l}Yr(c,!0,w,null,Q);break;case"together":Yr(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function $r(l,c){(c.mode&1)===0&&l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2)}function Ka(l,c,w){if(l!==null&&(c.dependencies=l.dependencies),Ff|=c.lanes,(w&c.childLanes)===0)return null;if(l!==null&&c.child!==l.child)throw Error(r(153));if(c.child!==null){for(l=c.child,w=Jc(l,l.pendingProps),c.child=w,w.return=c;l.sibling!==null;)l=l.sibling,w=w.sibling=Jc(l,l.pendingProps),w.return=c;w.sibling=null}return c.child}function ag(l,c,w){switch(c.tag){case 3:mo(c),Ft();break;case 5:xu(c);break;case 1:ma(c.type)&&xs(c);break;case 4:Zo(c,c.stateNode.containerInfo);break;case 10:var N=c.type._context,G=c.memoizedProps.value;sn(wi,N._currentValue),N._currentValue=G;break;case 13:if(N=c.memoizedState,N!==null)return N.dehydrated!==null?(sn(dn,dn.current&1),c.flags|=128,null):(w&c.child.childLanes)!==0?ut(l,c,w):(sn(dn,dn.current&1),l=Ka(l,c,w),l!==null?l.sibling:null);sn(dn,dn.current&1);break;case 19:if(N=(w&c.childLanes)!==0,(l.flags&128)!==0){if(N)return ia(l,c,w);c.flags|=128}if(G=c.memoizedState,G!==null&&(G.rendering=null,G.tail=null,G.lastEffect=null),sn(dn,dn.current),N)break;return null;case 22:case 23:return c.lanes=0,$t(l,c,w)}return Ka(l,c,w)}var ky,og,Ay,Py;ky=function(l,c){for(var w=c.child;w!==null;){if(w.tag===5||w.tag===6)l.appendChild(w.stateNode);else if(w.tag!==4&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===c)break;for(;w.sibling===null;){if(w.return===null||w.return===c)return;w=w.return}w.sibling.return=w.return,w=w.sibling}},og=function(){},Ay=function(l,c,w,N){var G=l.memoizedProps;if(G!==N){l=c.stateNode,hi(Ir.current);var Q=null;switch(w){case"input":G=Ee(l,G),N=Ee(l,N),Q=[];break;case"select":G=V({},G,{value:void 0}),N=V({},N,{value:void 0}),Q=[];break;case"textarea":G=ue(l,G),N=ue(l,N),Q=[];break;default:typeof G.onClick!="function"&&typeof N.onClick=="function"&&(l.onclick=Vs)}Ve(w,N);var he;w=null;for(nt in G)if(!N.hasOwnProperty(nt)&&G.hasOwnProperty(nt)&&G[nt]!=null)if(nt==="style"){var Me=G[nt];for(he in Me)Me.hasOwnProperty(he)&&(w||(w={}),w[he]="")}else nt!=="dangerouslySetInnerHTML"&&nt!=="children"&&nt!=="suppressContentEditableWarning"&&nt!=="suppressHydrationWarning"&&nt!=="autoFocus"&&(i.hasOwnProperty(nt)?Q||(Q=[]):(Q=Q||[]).push(nt,null));for(nt in N){var ze=N[nt];if(Me=G?.[nt],N.hasOwnProperty(nt)&&ze!==Me&&(ze!=null||Me!=null))if(nt==="style")if(Me){for(he in Me)!Me.hasOwnProperty(he)||ze&&ze.hasOwnProperty(he)||(w||(w={}),w[he]="");for(he in ze)ze.hasOwnProperty(he)&&Me[he]!==ze[he]&&(w||(w={}),w[he]=ze[he])}else w||(Q||(Q=[]),Q.push(nt,w)),w=ze;else nt==="dangerouslySetInnerHTML"?(ze=ze?ze.__html:void 0,Me=Me?Me.__html:void 0,ze!=null&&Me!==ze&&(Q=Q||[]).push(nt,ze)):nt==="children"?typeof ze!="string"&&typeof ze!="number"||(Q=Q||[]).push(nt,""+ze):nt!=="suppressContentEditableWarning"&&nt!=="suppressHydrationWarning"&&(i.hasOwnProperty(nt)?(ze!=null&&nt==="onScroll"&&fn("scroll",l),Q||Me===ze||(Q=[])):(Q=Q||[]).push(nt,ze))}w&&(Q=Q||[]).push("style",w);var nt=Q;(c.updateQueue=nt)&&(c.flags|=4)}},Py=function(l,c,w,N){w!==N&&(c.flags|=4)};function Nd(l,c){if(!ft)switch(l.tailMode){case"hidden":c=l.tail;for(var w=null;c!==null;)c.alternate!==null&&(w=c),c=c.sibling;w===null?l.tail=null:w.sibling=null;break;case"collapsed":w=l.tail;for(var N=null;w!==null;)w.alternate!==null&&(N=w),w=w.sibling;N===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:N.sibling=null}}function jo(l){var c=l.alternate!==null&&l.alternate.child===l.child,w=0,N=0;if(c)for(var G=l.child;G!==null;)w|=G.lanes|G.childLanes,N|=G.subtreeFlags&14680064,N|=G.flags&14680064,G.return=l,G=G.sibling;else for(G=l.child;G!==null;)w|=G.lanes|G.childLanes,N|=G.subtreeFlags,N|=G.flags,G.return=l,G=G.sibling;return l.subtreeFlags|=N,l.childLanes=w,c}function px(l,c,w){var N=c.pendingProps;switch(Xe(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jo(c),null;case 1:return ma(c.type)&&_u(),jo(c),null;case 3:return N=c.stateNode,hn(),tn(va),tn(Hi),wa(),N.pendingContext&&(N.context=N.pendingContext,N.pendingContext=null),(l===null||l.child===null)&&(qn(c)?c.flags|=4:l===null||l.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,ht!==null&&(mg(ht),ht=null))),og(l,c),jo(c),null;case 5:Xs(c);var G=hi(Dn.current);if(w=c.type,l!==null&&c.stateNode!=null)Ay(l,c,w,N,G),l.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!N){if(c.stateNode===null)throw Error(r(166));return jo(c),null}if(l=hi(Ir.current),qn(c)){N=c.stateNode,w=c.type;var Q=c.memoizedProps;switch(N[Ro]=c,N[bu]=Q,l=(c.mode&1)!==0,w){case"dialog":fn("cancel",N),fn("close",N);break;case"iframe":case"object":case"embed":fn("load",N);break;case"video":case"audio":for(G=0;G<Ko.length;G++)fn(Ko[G],N);break;case"source":fn("error",N);break;case"img":case"image":case"link":fn("error",N),fn("load",N);break;case"details":fn("toggle",N);break;case"input":ge(N,Q),fn("invalid",N);break;case"select":N._wrapperState={wasMultiple:!!Q.multiple},fn("invalid",N);break;case"textarea":Ae(N,Q),fn("invalid",N)}Ve(w,Q),G=null;for(var he in Q)if(Q.hasOwnProperty(he)){var Me=Q[he];he==="children"?typeof Me=="string"?N.textContent!==Me&&(Q.suppressHydrationWarning!==!0&&Qu(N.textContent,Me,l),G=["children",Me]):typeof Me=="number"&&N.textContent!==""+Me&&(Q.suppressHydrationWarning!==!0&&Qu(N.textContent,Me,l),G=["children",""+Me]):i.hasOwnProperty(he)&&Me!=null&&he==="onScroll"&&fn("scroll",N)}switch(w){case"input":Te(N),Oe(N,Q,!0);break;case"textarea":Te(N),Ue(N);break;case"select":case"option":break;default:typeof Q.onClick=="function"&&(N.onclick=Vs)}N=G,c.updateQueue=N,N!==null&&(c.flags|=4)}else{he=G.nodeType===9?G:G.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=st(w)),l==="http://www.w3.org/1999/xhtml"?w==="script"?(l=he.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof N.is=="string"?l=he.createElement(w,{is:N.is}):(l=he.createElement(w),w==="select"&&(he=l,N.multiple?he.multiple=!0:N.size&&(he.size=N.size))):l=he.createElementNS(l,w),l[Ro]=c,l[bu]=N,ky(l,c,!1,!1),c.stateNode=l;e:{switch(he=qe(w,N),w){case"dialog":fn("cancel",l),fn("close",l),G=N;break;case"iframe":case"object":case"embed":fn("load",l),G=N;break;case"video":case"audio":for(G=0;G<Ko.length;G++)fn(Ko[G],l);G=N;break;case"source":fn("error",l),G=N;break;case"img":case"image":case"link":fn("error",l),fn("load",l),G=N;break;case"details":fn("toggle",l),G=N;break;case"input":ge(l,N),G=Ee(l,N),fn("invalid",l);break;case"option":G=N;break;case"select":l._wrapperState={wasMultiple:!!N.multiple},G=V({},N,{value:void 0}),fn("invalid",l);break;case"textarea":Ae(l,N),G=ue(l,N),fn("invalid",l);break;default:G=N}Ve(w,G),Me=G;for(Q in Me)if(Me.hasOwnProperty(Q)){var ze=Me[Q];Q==="style"?It(l,ze):Q==="dangerouslySetInnerHTML"?(ze=ze?ze.__html:void 0,ze!=null&&xt(l,ze)):Q==="children"?typeof ze=="string"?(w!=="textarea"||ze!=="")&&bt(l,ze):typeof ze=="number"&&bt(l,""+ze):Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&Q!=="autoFocus"&&(i.hasOwnProperty(Q)?ze!=null&&Q==="onScroll"&&fn("scroll",l):ze!=null&&A(l,Q,ze,he))}switch(w){case"input":Te(l),Oe(l,N,!1);break;case"textarea":Te(l),Ue(l);break;case"option":N.value!=null&&l.setAttribute("value",""+me(N.value));break;case"select":l.multiple=!!N.multiple,Q=N.value,Q!=null?Ne(l,!!N.multiple,Q,!1):N.defaultValue!=null&&Ne(l,!!N.multiple,N.defaultValue,!0);break;default:typeof G.onClick=="function"&&(l.onclick=Vs)}switch(w){case"button":case"input":case"select":case"textarea":N=!!N.autoFocus;break e;case"img":N=!0;break e;default:N=!1}}N&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return jo(c),null;case 6:if(l&&c.stateNode!=null)Py(l,c,l.memoizedProps,N);else{if(typeof N!="string"&&c.stateNode===null)throw Error(r(166));if(w=hi(Dn.current),hi(Ir.current),qn(c)){if(N=c.stateNode,w=c.memoizedProps,N[Ro]=c,(Q=N.nodeValue!==w)&&(l=ot,l!==null))switch(l.tag){case 3:Qu(N.nodeValue,w,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Qu(N.nodeValue,w,(l.mode&1)!==0)}Q&&(c.flags|=4)}else N=(w.nodeType===9?w:w.ownerDocument).createTextNode(N),N[Ro]=c,c.stateNode=N}return jo(c),null;case 13:if(tn(dn),N=c.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(ft&&He!==null&&(c.mode&1)!==0&&(c.flags&128)===0)vr(),Ft(),c.flags|=98560,Q=!1;else if(Q=qn(c),N!==null&&N.dehydrated!==null){if(l===null){if(!Q)throw Error(r(318));if(Q=c.memoizedState,Q=Q!==null?Q.dehydrated:null,!Q)throw Error(r(317));Q[Ro]=c}else Ft(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;jo(c),Q=!1}else ht!==null&&(mg(ht),ht=null),Q=!0;if(!Q)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=w,c):(N=N!==null,N!==(l!==null&&l.memoizedState!==null)&&N&&(c.child.flags|=8192,(c.mode&1)!==0&&(l===null||(dn.current&1)!==0?Ia===0&&(Ia=3):wg())),c.updateQueue!==null&&(c.flags|=4),jo(c),null);case 4:return hn(),og(l,c),l===null&&Ws(c.stateNode.containerInfo),jo(c),null;case 10:return On(c.type._context),jo(c),null;case 17:return ma(c.type)&&_u(),jo(c),null;case 19:if(tn(dn),Q=c.memoizedState,Q===null)return jo(c),null;if(N=(c.flags&128)!==0,he=Q.rendering,he===null)if(N)Nd(Q,!1);else{if(Ia!==0||l!==null&&(l.flags&128)!==0)for(l=c.child;l!==null;){if(he=fo(l),he!==null){for(c.flags|=128,Nd(Q,!1),N=he.updateQueue,N!==null&&(c.updateQueue=N,c.flags|=4),c.subtreeFlags=0,N=w,w=c.child;w!==null;)Q=w,l=N,Q.flags&=14680066,he=Q.alternate,he===null?(Q.childLanes=0,Q.lanes=l,Q.child=null,Q.subtreeFlags=0,Q.memoizedProps=null,Q.memoizedState=null,Q.updateQueue=null,Q.dependencies=null,Q.stateNode=null):(Q.childLanes=he.childLanes,Q.lanes=he.lanes,Q.child=he.child,Q.subtreeFlags=0,Q.deletions=null,Q.memoizedProps=he.memoizedProps,Q.memoizedState=he.memoizedState,Q.updateQueue=he.updateQueue,Q.type=he.type,l=he.dependencies,Q.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),w=w.sibling;return sn(dn,dn.current&1|2),c.child}l=l.sibling}Q.tail!==null&&kn()>zh&&(c.flags|=128,N=!0,Nd(Q,!1),c.lanes=4194304)}else{if(!N)if(l=fo(he),l!==null){if(c.flags|=128,N=!0,w=l.updateQueue,w!==null&&(c.updateQueue=w,c.flags|=4),Nd(Q,!0),Q.tail===null&&Q.tailMode==="hidden"&&!he.alternate&&!ft)return jo(c),null}else 2*kn()-Q.renderingStartTime>zh&&w!==1073741824&&(c.flags|=128,N=!0,Nd(Q,!1),c.lanes=4194304);Q.isBackwards?(he.sibling=c.child,c.child=he):(w=Q.last,w!==null?w.sibling=he:c.child=he,Q.last=he)}return Q.tail!==null?(c=Q.tail,Q.rendering=c,Q.tail=c.sibling,Q.renderingStartTime=kn(),c.sibling=null,w=dn.current,sn(dn,N?w&1|2:w&1),c):(jo(c),null);case 22:case 23:return bg(),N=c.memoizedState!==null,l!==null&&l.memoizedState!==null!==N&&(c.flags|=8192),N&&(c.mode&1)!==0?(Zs&1073741824)!==0&&(jo(c),c.subtreeFlags&6&&(c.flags|=8192)):jo(c),null;case 24:return null;case 25:return null}throw Error(r(156,c.tag))}function gx(l,c){switch(Xe(c),c.tag){case 1:return ma(c.type)&&_u(),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return hn(),tn(va),tn(Hi),wa(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 5:return Xs(c),null;case 13:if(tn(dn),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Ft()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return tn(dn),null;case 4:return hn(),null;case 10:return On(c.type._context),null;case 22:case 23:return bg(),null;case 24:return null;default:return null}}var Yp=!1,Do=!1,vx=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function Fh(l,c){var w=l.ref;if(w!==null)if(typeof w=="function")try{w(null)}catch(N){Wi(l,c,N)}else w.current=null}function sg(l,c,w){try{w()}catch(N){Wi(l,c,N)}}var Oy=!1;function mx(l,c){if(Ju=du,l=Lr(),Va(l)){if("selectionStart"in l)var w={start:l.selectionStart,end:l.selectionEnd};else e:{w=(w=l.ownerDocument)&&w.defaultView||window;var N=w.getSelection&&w.getSelection();if(N&&N.rangeCount!==0){w=N.anchorNode;var G=N.anchorOffset,Q=N.focusNode;N=N.focusOffset;try{w.nodeType,Q.nodeType}catch{w=null;break e}var he=0,Me=-1,ze=-1,nt=0,vt=0,yt=l,gt=null;t:for(;;){for(var qt;yt!==w||G!==0&&yt.nodeType!==3||(Me=he+G),yt!==Q||N!==0&&yt.nodeType!==3||(ze=he+N),yt.nodeType===3&&(he+=yt.nodeValue.length),(qt=yt.firstChild)!==null;)gt=yt,yt=qt;for(;;){if(yt===l)break t;if(gt===w&&++nt===G&&(Me=he),gt===Q&&++vt===N&&(ze=he),(qt=yt.nextSibling)!==null)break;yt=gt,gt=yt.parentNode}yt=qt}w=Me===-1||ze===-1?null:{start:Me,end:ze}}else w=null}w=w||{start:0,end:0}}else w=null;for(Ul={focusedElem:l,selectionRange:w},du=!1,Gt=c;Gt!==null;)if(c=Gt,l=c.child,(c.subtreeFlags&1028)!==0&&l!==null)l.return=c,Gt=l;else for(;Gt!==null;){c=Gt;try{var Vt=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Vt!==null){var Xt=Vt.memoizedProps,aa=Vt.memoizedState,et=c.stateNode,We=et.getSnapshotBeforeUpdate(c.elementType===c.type?Xt:Ma(c.type,Xt),aa);et.__reactInternalSnapshotBeforeUpdate=We}break;case 3:var tt=c.stateNode.containerInfo;tt.nodeType===1?tt.textContent="":tt.nodeType===9&&tt.documentElement&&tt.removeChild(tt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(_t){Wi(c,c.return,_t)}if(l=c.sibling,l!==null){l.return=c.return,Gt=l;break}Gt=c.return}return Vt=Oy,Oy=!1,Vt}function Td(l,c,w){var N=c.updateQueue;if(N=N!==null?N.lastEffect:null,N!==null){var G=N=N.next;do{if((G.tag&l)===l){var Q=G.destroy;G.destroy=void 0,Q!==void 0&&sg(c,w,Q)}G=G.next}while(G!==N)}}function Xp(l,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var w=c=c.next;do{if((w.tag&l)===l){var N=w.create;w.destroy=N()}w=w.next}while(w!==c)}}function lg(l){var c=l.ref;if(c!==null){var w=l.stateNode;switch(l.tag){case 5:l=w;break;default:l=w}typeof c=="function"?c(l):c.current=l}}function Cy(l){var c=l.alternate;c!==null&&(l.alternate=null,Cy(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&(delete c[Ro],delete c[bu],delete c[Ra],delete c[Lh],delete c[Nh])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Ly(l){return l.tag===5||l.tag===3||l.tag===4}function Ny(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Ly(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function ug(l,c,w){var N=l.tag;if(N===5||N===6)l=l.stateNode,c?w.nodeType===8?w.parentNode.insertBefore(l,c):w.insertBefore(l,c):(w.nodeType===8?(c=w.parentNode,c.insertBefore(l,w)):(c=w,c.appendChild(l)),w=w._reactRootContainer,w!=null||c.onclick!==null||(c.onclick=Vs));else if(N!==4&&(l=l.child,l!==null))for(ug(l,c,w),l=l.sibling;l!==null;)ug(l,c,w),l=l.sibling}function cg(l,c,w){var N=l.tag;if(N===5||N===6)l=l.stateNode,c?w.insertBefore(l,c):w.appendChild(l);else if(N!==4&&(l=l.child,l!==null))for(cg(l,c,w),l=l.sibling;l!==null;)cg(l,c,w),l=l.sibling}var yo=null,Yl=!1;function Yc(l,c,w){for(w=w.child;w!==null;)Ty(l,c,w),w=w.sibling}function Ty(l,c,w){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(_o,w)}catch{}switch(w.tag){case 5:Do||Fh(w,c);case 6:var N=yo,G=Yl;yo=null,Yc(l,c,w),yo=N,Yl=G,yo!==null&&(Yl?(l=yo,w=w.stateNode,l.nodeType===8?l.parentNode.removeChild(w):l.removeChild(w)):yo.removeChild(w.stateNode));break;case 18:yo!==null&&(Yl?(l=yo,w=w.stateNode,l.nodeType===8?Fc(l.parentNode,w):l.nodeType===1&&Fc(l,w),ki(l)):Fc(yo,w.stateNode));break;case 4:N=yo,G=Yl,yo=w.stateNode.containerInfo,Yl=!0,Yc(l,c,w),yo=N,Yl=G;break;case 0:case 11:case 14:case 15:if(!Do&&(N=w.updateQueue,N!==null&&(N=N.lastEffect,N!==null))){G=N=N.next;do{var Q=G,he=Q.destroy;Q=Q.tag,he!==void 0&&((Q&2)!==0||(Q&4)!==0)&&sg(w,c,he),G=G.next}while(G!==N)}Yc(l,c,w);break;case 1:if(!Do&&(Fh(w,c),N=w.stateNode,typeof N.componentWillUnmount=="function"))try{N.props=w.memoizedProps,N.state=w.memoizedState,N.componentWillUnmount()}catch(Me){Wi(w,c,Me)}Yc(l,c,w);break;case 21:Yc(l,c,w);break;case 22:w.mode&1?(Do=(N=Do)||w.memoizedState!==null,Yc(l,c,w),Do=N):Yc(l,c,w);break;default:Yc(l,c,w)}}function Ry(l){var c=l.updateQueue;if(c!==null){l.updateQueue=null;var w=l.stateNode;w===null&&(w=l.stateNode=new vx),c.forEach(function(N){var G=Ax.bind(null,l,N);w.has(N)||(w.add(N),N.then(G,G))})}}function Xl(l,c){var w=c.deletions;if(w!==null)for(var N=0;N<w.length;N++){var G=w[N];try{var Q=l,he=c,Me=he;e:for(;Me!==null;){switch(Me.tag){case 5:yo=Me.stateNode,Yl=!1;break e;case 3:yo=Me.stateNode.containerInfo,Yl=!0;break e;case 4:yo=Me.stateNode.containerInfo,Yl=!0;break e}Me=Me.return}if(yo===null)throw Error(r(160));Ty(Q,he,G),yo=null,Yl=!1;var ze=G.alternate;ze!==null&&(ze.return=null),G.return=null}catch(nt){Wi(G,c,nt)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)My(c,l),c=c.sibling}function My(l,c){var w=l.alternate,N=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Xl(c,l),Ou(l),N&4){try{Td(3,l,l.return),Xp(3,l)}catch(Xt){Wi(l,l.return,Xt)}try{Td(5,l,l.return)}catch(Xt){Wi(l,l.return,Xt)}}break;case 1:Xl(c,l),Ou(l),N&512&&w!==null&&Fh(w,w.return);break;case 5:if(Xl(c,l),Ou(l),N&512&&w!==null&&Fh(w,w.return),l.flags&32){var G=l.stateNode;try{bt(G,"")}catch(Xt){Wi(l,l.return,Xt)}}if(N&4&&(G=l.stateNode,G!=null)){var Q=l.memoizedProps,he=w!==null?w.memoizedProps:Q,Me=l.type,ze=l.updateQueue;if(l.updateQueue=null,ze!==null)try{Me==="input"&&Q.type==="radio"&&Q.name!=null&&Re(G,Q),qe(Me,he);var nt=qe(Me,Q);for(he=0;he<ze.length;he+=2){var vt=ze[he],yt=ze[he+1];vt==="style"?It(G,yt):vt==="dangerouslySetInnerHTML"?xt(G,yt):vt==="children"?bt(G,yt):A(G,vt,yt,nt)}switch(Me){case"input":Be(G,Q);break;case"textarea":Pe(G,Q);break;case"select":var gt=G._wrapperState.wasMultiple;G._wrapperState.wasMultiple=!!Q.multiple;var qt=Q.value;qt!=null?Ne(G,!!Q.multiple,qt,!1):gt!==!!Q.multiple&&(Q.defaultValue!=null?Ne(G,!!Q.multiple,Q.defaultValue,!0):Ne(G,!!Q.multiple,Q.multiple?[]:"",!1))}G[bu]=Q}catch(Xt){Wi(l,l.return,Xt)}}break;case 6:if(Xl(c,l),Ou(l),N&4){if(l.stateNode===null)throw Error(r(162));G=l.stateNode,Q=l.memoizedProps;try{G.nodeValue=Q}catch(Xt){Wi(l,l.return,Xt)}}break;case 3:if(Xl(c,l),Ou(l),N&4&&w!==null&&w.memoizedState.isDehydrated)try{ki(c.containerInfo)}catch(Xt){Wi(l,l.return,Xt)}break;case 4:Xl(c,l),Ou(l);break;case 13:Xl(c,l),Ou(l),G=l.child,G.flags&8192&&(Q=G.memoizedState!==null,G.stateNode.isHidden=Q,!Q||G.alternate!==null&&G.alternate.memoizedState!==null||(dg=kn())),N&4&&Ry(l);break;case 22:if(vt=w!==null&&w.memoizedState!==null,l.mode&1?(Do=(nt=Do)||vt,Xl(c,l),Do=nt):Xl(c,l),Ou(l),N&8192){if(nt=l.memoizedState!==null,(l.stateNode.isHidden=nt)&&!vt&&(l.mode&1)!==0)for(Gt=l,vt=l.child;vt!==null;){for(yt=Gt=vt;Gt!==null;){switch(gt=Gt,qt=gt.child,gt.tag){case 0:case 11:case 14:case 15:Td(4,gt,gt.return);break;case 1:Fh(gt,gt.return);var Vt=gt.stateNode;if(typeof Vt.componentWillUnmount=="function"){N=gt,w=gt.return;try{c=N,Vt.props=c.memoizedProps,Vt.state=c.memoizedState,Vt.componentWillUnmount()}catch(Xt){Wi(N,w,Xt)}}break;case 5:Fh(gt,gt.return);break;case 22:if(gt.memoizedState!==null){Dy(yt);continue}}qt!==null?(qt.return=gt,Gt=qt):Dy(yt)}vt=vt.sibling}e:for(vt=null,yt=l;;){if(yt.tag===5){if(vt===null){vt=yt;try{G=yt.stateNode,nt?(Q=G.style,typeof Q.setProperty=="function"?Q.setProperty("display","none","important"):Q.display="none"):(Me=yt.stateNode,ze=yt.memoizedProps.style,he=ze!=null&&ze.hasOwnProperty("display")?ze.display:null,Me.style.display=_r("display",he))}catch(Xt){Wi(l,l.return,Xt)}}}else if(yt.tag===6){if(vt===null)try{yt.stateNode.nodeValue=nt?"":yt.memoizedProps}catch(Xt){Wi(l,l.return,Xt)}}else if((yt.tag!==22&&yt.tag!==23||yt.memoizedState===null||yt===l)&&yt.child!==null){yt.child.return=yt,yt=yt.child;continue}if(yt===l)break e;for(;yt.sibling===null;){if(yt.return===null||yt.return===l)break e;vt===yt&&(vt=null),yt=yt.return}vt===yt&&(vt=null),yt.sibling.return=yt.return,yt=yt.sibling}}break;case 19:Xl(c,l),Ou(l),N&4&&Ry(l);break;case 21:break;default:Xl(c,l),Ou(l)}}function Ou(l){var c=l.flags;if(c&2){try{e:{for(var w=l.return;w!==null;){if(Ly(w)){var N=w;break e}w=w.return}throw Error(r(160))}switch(N.tag){case 5:var G=N.stateNode;N.flags&32&&(bt(G,""),N.flags&=-33);var Q=Ny(l);cg(l,Q,G);break;case 3:case 4:var he=N.stateNode.containerInfo,Me=Ny(l);ug(l,Me,he);break;default:throw Error(r(161))}}catch(ze){Wi(l,l.return,ze)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function yx(l,c,w){Gt=l,Iy(l)}function Iy(l,c,w){for(var N=(l.mode&1)!==0;Gt!==null;){var G=Gt,Q=G.child;if(G.tag===22&&N){var he=G.memoizedState!==null||Yp;if(!he){var Me=G.alternate,ze=Me!==null&&Me.memoizedState!==null||Do;Me=Yp;var nt=Do;if(Yp=he,(Do=ze)&&!nt)for(Gt=G;Gt!==null;)he=Gt,ze=he.child,he.tag===22&&he.memoizedState!==null?Fy(G):ze!==null?(ze.return=he,Gt=ze):Fy(G);for(;Q!==null;)Gt=Q,Iy(Q),Q=Q.sibling;Gt=G,Yp=Me,Do=nt}jy(l)}else(G.subtreeFlags&8772)!==0&&Q!==null?(Q.return=G,Gt=Q):jy(l)}}function jy(l){for(;Gt!==null;){var c=Gt;if((c.flags&8772)!==0){var w=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Do||Xp(5,c);break;case 1:var N=c.stateNode;if(c.flags&4&&!Do)if(w===null)N.componentDidMount();else{var G=c.elementType===c.type?w.memoizedProps:Ma(c.type,w.memoizedProps);N.componentDidUpdate(G,w.memoizedState,N.__reactInternalSnapshotBeforeUpdate)}var Q=c.updateQueue;Q!==null&&Vr(c,Q,N);break;case 3:var he=c.updateQueue;if(he!==null){if(w=null,c.child!==null)switch(c.child.tag){case 5:w=c.child.stateNode;break;case 1:w=c.child.stateNode}Vr(c,he,w)}break;case 5:var Me=c.stateNode;if(w===null&&c.flags&4){w=Me;var ze=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":ze.autoFocus&&w.focus();break;case"img":ze.src&&(w.src=ze.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var nt=c.alternate;if(nt!==null){var vt=nt.memoizedState;if(vt!==null){var yt=vt.dehydrated;yt!==null&&ki(yt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Do||c.flags&512&&lg(c)}catch(gt){Wi(c,c.return,gt)}}if(c===l){Gt=null;break}if(w=c.sibling,w!==null){w.return=c.return,Gt=w;break}Gt=c.return}}function Dy(l){for(;Gt!==null;){var c=Gt;if(c===l){Gt=null;break}var w=c.sibling;if(w!==null){w.return=c.return,Gt=w;break}Gt=c.return}}function Fy(l){for(;Gt!==null;){var c=Gt;try{switch(c.tag){case 0:case 11:case 15:var w=c.return;try{Xp(4,c)}catch(ze){Wi(c,w,ze)}break;case 1:var N=c.stateNode;if(typeof N.componentDidMount=="function"){var G=c.return;try{N.componentDidMount()}catch(ze){Wi(c,G,ze)}}var Q=c.return;try{lg(c)}catch(ze){Wi(c,Q,ze)}break;case 5:var he=c.return;try{lg(c)}catch(ze){Wi(c,he,ze)}}}catch(ze){Wi(c,c.return,ze)}if(c===l){Gt=null;break}var Me=c.sibling;if(Me!==null){Me.return=c.return,Gt=Me;break}Gt=c.return}}var bx=Math.ceil,Kp=S.ReactCurrentDispatcher,fg=S.ReactCurrentOwner,El=S.ReactCurrentBatchConfig,un=0,Za=null,xa=null,bo=0,Zs=0,Bh=Mo(0),Ia=0,Rd=null,Ff=0,Zp=0,hg=0,Md=null,Os=null,dg=0,zh=1/0,ac=null,Qp=!1,pg=null,Xc=null,Jp=!1,Kc=null,e1=0,Id=0,gg=null,t1=-1,r1=0;function es(){return(un&6)!==0?kn():t1!==-1?t1:t1=kn()}function Zc(l){return(l.mode&1)===0?1:(un&2)!==0&&bo!==0?bo&-bo:Un.transition!==null?(r1===0&&(r1=Vu()),r1):(l=Rr,l!==0||(l=window.event,l=l===void 0?16:Rl(l.type)),l)}function Kl(l,c,w,N){if(50<Id)throw Id=0,gg=null,Error(r(185));Tl(l,w,N),((un&2)===0||l!==Za)&&(l===Za&&((un&2)===0&&(Zp|=w),Ia===4&&Qc(l,bo)),Cs(l,N),w===1&&un===0&&(c.mode&1)===0&&(zh=kn()+500,$l&&re()))}function Cs(l,c){var w=l.callbackNode;Zn(l,c);var N=Zi(l,l===Za?bo:0);if(N===0)w!==null&&is(w),l.callbackNode=null,l.callbackPriority=0;else if(c=N&-N,l.callbackPriority!==c){if(w!=null&&is(w),c===1)l.tag===0?Y(zy.bind(null,l)):R(zy.bind(null,l)),Oh(function(){(un&6)===0&&re()}),w=null;else{switch(xo(N)){case 1:w=as;break;case 4:w=Pa;break;case 16:w=os;break;case 536870912:w=ll;break;default:w=os}w=Yy(w,By.bind(null,l))}l.callbackPriority=c,l.callbackNode=w}}function By(l,c){if(t1=-1,r1=0,(un&6)!==0)throw Error(r(327));var w=l.callbackNode;if(qh()&&l.callbackNode!==w)return null;var N=Zi(l,l===Za?bo:0);if(N===0)return null;if((N&30)!==0||(N&l.expiredLanes)!==0||c)c=n1(l,N);else{c=N;var G=un;un|=2;var Q=Uy();(Za!==l||bo!==c)&&(ac=null,zh=kn()+500,zf(l,c));do try{xx();break}catch(Me){qy(l,Me)}while(!0);Gr(),Kp.current=Q,un=G,xa!==null?c=0:(Za=null,bo=0,c=Ia)}if(c!==0){if(c===2&&(G=ls(l),G!==0&&(N=G,c=vg(l,G))),c===1)throw w=Rd,zf(l,0),Qc(l,N),Cs(l,kn()),w;if(c===6)Qc(l,N);else{if(G=l.current.alternate,(N&30)===0&&!wx(G)&&(c=n1(l,N),c===2&&(Q=ls(l),Q!==0&&(N=Q,c=vg(l,Q))),c===1))throw w=Rd,zf(l,0),Qc(l,N),Cs(l,kn()),w;switch(l.finishedWork=G,l.finishedLanes=N,c){case 0:case 1:throw Error(r(345));case 2:qf(l,Os,ac);break;case 3:if(Qc(l,N),(N&130023424)===N&&(c=dg+500-kn(),10<c)){if(Zi(l,0)!==0)break;if(G=l.suspendedLanes,(G&N)!==N){es(),l.pingedLanes|=l.suspendedLanes&G;break}l.timeoutHandle=co(qf.bind(null,l,Os,ac),c);break}qf(l,Os,ac);break;case 4:if(Qc(l,N),(N&4194240)===N)break;for(c=l.eventTimes,G=-1;0<N;){var he=31-Sr(N);Q=1<<he,he=c[he],he>G&&(G=he),N&=~Q}if(N=G,N=kn()-N,N=(120>N?120:480>N?480:1080>N?1080:1920>N?1920:3e3>N?3e3:4320>N?4320:1960*bx(N/1960))-N,10<N){l.timeoutHandle=co(qf.bind(null,l,Os,ac),N);break}qf(l,Os,ac);break;case 5:qf(l,Os,ac);break;default:throw Error(r(329))}}}return Cs(l,kn()),l.callbackNode===w?By.bind(null,l):null}function vg(l,c){var w=Md;return l.current.memoizedState.isDehydrated&&(zf(l,c).flags|=256),l=n1(l,c),l!==2&&(c=Os,Os=w,c!==null&&mg(c)),l}function mg(l){Os===null?Os=l:Os.push.apply(Os,l)}function wx(l){for(var c=l;;){if(c.flags&16384){var w=c.updateQueue;if(w!==null&&(w=w.stores,w!==null))for(var N=0;N<w.length;N++){var G=w[N],Q=G.getSnapshot;G=G.value;try{if(!Pn(Q(),G))return!1}catch{return!1}}}if(w=c.child,c.subtreeFlags&16384&&w!==null)w.return=c,c=w;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Qc(l,c){for(c&=~hg,c&=~Zp,l.suspendedLanes|=c,l.pingedLanes&=~c,l=l.expirationTimes;0<c;){var w=31-Sr(c),N=1<<w;l[w]=-1,c&=~N}}function zy(l){if((un&6)!==0)throw Error(r(327));qh();var c=Zi(l,0);if((c&1)===0)return Cs(l,kn()),null;var w=n1(l,c);if(l.tag!==0&&w===2){var N=ls(l);N!==0&&(c=N,w=vg(l,N))}if(w===1)throw w=Rd,zf(l,0),Qc(l,c),Cs(l,kn()),w;if(w===6)throw Error(r(345));return l.finishedWork=l.current.alternate,l.finishedLanes=c,qf(l,Os,ac),Cs(l,kn()),null}function yg(l,c){var w=un;un|=1;try{return l(c)}finally{un=w,un===0&&(zh=kn()+500,$l&&re())}}function Bf(l){Kc!==null&&Kc.tag===0&&(un&6)===0&&qh();var c=un;un|=1;var w=El.transition,N=Rr;try{if(El.transition=null,Rr=1,l)return l()}finally{Rr=N,El.transition=w,un=c,(un&6)===0&&re()}}function bg(){Zs=Bh.current,tn(Bh)}function zf(l,c){l.finishedWork=null,l.finishedLanes=0;var w=l.timeoutHandle;if(w!==-1&&(l.timeoutHandle=-1,Dc(w)),xa!==null)for(w=xa.return;w!==null;){var N=w;switch(Xe(N),N.tag){case 1:N=N.type.childContextTypes,N!=null&&_u();break;case 3:hn(),tn(va),tn(Hi),wa();break;case 5:Xs(N);break;case 4:hn();break;case 13:tn(dn);break;case 19:tn(dn);break;case 10:On(N.type._context);break;case 22:case 23:bg()}w=w.return}if(Za=l,xa=l=Jc(l.current,null),bo=Zs=c,Ia=0,Rd=null,hg=Zp=Ff=0,Os=Md=null,rn!==null){for(c=0;c<rn.length;c++)if(w=rn[c],N=w.interleaved,N!==null){w.interleaved=null;var G=N.next,Q=w.pending;if(Q!==null){var he=Q.next;Q.next=G,N.next=he}w.pending=N}rn=null}return l}function qy(l,c){do{var w=xa;try{if(Gr(),Su.current=$c,ho){for(var N=ln.memoizedState;N!==null;){var G=N.queue;G!==null&&(G.pending=null),N=N.next}ho=!1}if(Gi=0,Gn=$n=ln=null,Io=!1,po=0,fg.current=null,w===null||w.return===null){Ia=1,Rd=c,xa=null;break}e:{var Q=l,he=w.return,Me=w,ze=c;if(c=bo,Me.flags|=32768,ze!==null&&typeof ze=="object"&&typeof ze.then=="function"){var nt=ze,vt=Me,yt=vt.tag;if((vt.mode&1)===0&&(yt===0||yt===11||yt===15)){var gt=vt.alternate;gt?(vt.updateQueue=gt.updateQueue,vt.memoizedState=gt.memoizedState,vt.lanes=gt.lanes):(vt.updateQueue=null,vt.memoizedState=null)}var qt=C(he);if(qt!==null){qt.flags&=-257,z(qt,he,Me,Q,c),qt.mode&1&&m(Q,nt,c),c=qt,ze=nt;var Vt=c.updateQueue;if(Vt===null){var Xt=new Set;Xt.add(ze),c.updateQueue=Xt}else Vt.add(ze);break e}else{if((c&1)===0){m(Q,nt,c),wg();break e}ze=Error(r(426))}}else if(ft&&Me.mode&1){var aa=C(he);if(aa!==null){(aa.flags&65536)===0&&(aa.flags|=256),z(aa,he,Me,Q,c),St(ic(ze,Me));break e}}Q=ze=ic(ze,Me),Ia!==4&&(Ia=2),Md===null?Md=[Q]:Md.push(Q),Q=he;do{switch(Q.tag){case 3:Q.flags|=65536,c&=-c,Q.lanes|=c;var et=Vp(Q,ze,c);nn(Q,et);break e;case 1:Me=ze;var We=Q.type,tt=Q.stateNode;if((Q.flags&128)===0&&(typeof We.getDerivedStateFromError=="function"||tt!==null&&typeof tt.componentDidCatch=="function"&&(Xc===null||!Xc.has(tt)))){Q.flags|=65536,c&=-c,Q.lanes|=c;var _t=d(Q,Me,c);nn(Q,_t);break e}}Q=Q.return}while(Q!==null)}$y(w)}catch(Kt){c=Kt,xa===w&&w!==null&&(xa=w=w.return);continue}break}while(!0)}function Uy(){var l=Kp.current;return Kp.current=$c,l===null?$c:l}function wg(){(Ia===0||Ia===3||Ia===2)&&(Ia=4),Za===null||(Ff&268435455)===0&&(Zp&268435455)===0||Qc(Za,bo)}function n1(l,c){var w=un;un|=2;var N=Uy();(Za!==l||bo!==c)&&(ac=null,zf(l,c));do try{_x();break}catch(G){qy(l,G)}while(!0);if(Gr(),un=w,Kp.current=N,xa!==null)throw Error(r(261));return Za=null,bo=0,Ia}function _x(){for(;xa!==null;)Hy(xa)}function xx(){for(;xa!==null&&!lu();)Hy(xa)}function Hy(l){var c=Vy(l.alternate,l,Zs);l.memoizedProps=l.pendingProps,c===null?$y(l):xa=c,fg.current=null}function $y(l){var c=l;do{var w=c.alternate;if(l=c.return,(c.flags&32768)===0){if(w=px(w,c,Zs),w!==null){xa=w;return}}else{if(w=gx(w,c),w!==null){w.flags&=32767,xa=w;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Ia=6,xa=null;return}}if(c=c.sibling,c!==null){xa=c;return}xa=c=l}while(c!==null);Ia===0&&(Ia=5)}function qf(l,c,w){var N=Rr,G=El.transition;try{El.transition=null,Rr=1,Sx(l,c,w,N)}finally{El.transition=G,Rr=N}return null}function Sx(l,c,w,N){do qh();while(Kc!==null);if((un&6)!==0)throw Error(r(327));w=l.finishedWork;var G=l.finishedLanes;if(w===null)return null;if(l.finishedWork=null,l.finishedLanes=0,w===l.current)throw Error(r(177));l.callbackNode=null,l.callbackPriority=0;var Q=w.lanes|w.childLanes;if(us(l,Q),l===Za&&(xa=Za=null,bo=0),(w.subtreeFlags&2064)===0&&(w.flags&2064)===0||Jp||(Jp=!0,Yy(os,function(){return qh(),null})),Q=(w.flags&15990)!==0,(w.subtreeFlags&15990)!==0||Q){Q=El.transition,El.transition=null;var he=Rr;Rr=1;var Me=un;un|=4,fg.current=null,mx(l,w),My(w,l),$s(Ul),du=!!Ju,Ul=Ju=null,l.current=w,yx(w),Nf(),un=Me,Rr=he,El.transition=Q}else l.current=w;if(Jp&&(Jp=!1,Kc=l,e1=G),Q=l.pendingLanes,Q===0&&(Xc=null),cn(w.stateNode),Cs(l,kn()),c!==null)for(N=l.onRecoverableError,w=0;w<c.length;w++)G=c[w],N(G.value,{componentStack:G.stack,digest:G.digest});if(Qp)throw Qp=!1,l=pg,pg=null,l;return(e1&1)!==0&&l.tag!==0&&qh(),Q=l.pendingLanes,(Q&1)!==0?l===gg?Id++:(Id=0,gg=l):Id=0,re(),null}function qh(){if(Kc!==null){var l=xo(e1),c=El.transition,w=Rr;try{if(El.transition=null,Rr=16>l?16:l,Kc===null)var N=!1;else{if(l=Kc,Kc=null,e1=0,(un&6)!==0)throw Error(r(331));var G=un;for(un|=4,Gt=l.current;Gt!==null;){var Q=Gt,he=Q.child;if((Gt.flags&16)!==0){var Me=Q.deletions;if(Me!==null){for(var ze=0;ze<Me.length;ze++){var nt=Me[ze];for(Gt=nt;Gt!==null;){var vt=Gt;switch(vt.tag){case 0:case 11:case 15:Td(8,vt,Q)}var yt=vt.child;if(yt!==null)yt.return=vt,Gt=yt;else for(;Gt!==null;){vt=Gt;var gt=vt.sibling,qt=vt.return;if(Cy(vt),vt===nt){Gt=null;break}if(gt!==null){gt.return=qt,Gt=gt;break}Gt=qt}}}var Vt=Q.alternate;if(Vt!==null){var Xt=Vt.child;if(Xt!==null){Vt.child=null;do{var aa=Xt.sibling;Xt.sibling=null,Xt=aa}while(Xt!==null)}}Gt=Q}}if((Q.subtreeFlags&2064)!==0&&he!==null)he.return=Q,Gt=he;else e:for(;Gt!==null;){if(Q=Gt,(Q.flags&2048)!==0)switch(Q.tag){case 0:case 11:case 15:Td(9,Q,Q.return)}var et=Q.sibling;if(et!==null){et.return=Q.return,Gt=et;break e}Gt=Q.return}}var We=l.current;for(Gt=We;Gt!==null;){he=Gt;var tt=he.child;if((he.subtreeFlags&2064)!==0&&tt!==null)tt.return=he,Gt=tt;else e:for(he=We;Gt!==null;){if(Me=Gt,(Me.flags&2048)!==0)try{switch(Me.tag){case 0:case 11:case 15:Xp(9,Me)}}catch(Kt){Wi(Me,Me.return,Kt)}if(Me===he){Gt=null;break e}var _t=Me.sibling;if(_t!==null){_t.return=Me.return,Gt=_t;break e}Gt=Me.return}}if(un=G,re(),gi&&typeof gi.onPostCommitFiberRoot=="function")try{gi.onPostCommitFiberRoot(_o,l)}catch{}N=!0}return N}finally{Rr=w,El.transition=c}}return!1}function Gy(l,c,w){c=ic(w,c),c=Vp(l,c,1),l=Hn(l,c,1),c=es(),l!==null&&(Tl(l,1,c),Cs(l,c))}function Wi(l,c,w){if(l.tag===3)Gy(l,l,w);else for(;c!==null;){if(c.tag===3){Gy(c,l,w);break}else if(c.tag===1){var N=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof N.componentDidCatch=="function"&&(Xc===null||!Xc.has(N))){l=ic(w,l),l=d(c,l,1),c=Hn(c,l,1),l=es(),c!==null&&(Tl(c,1,l),Cs(c,l));break}}c=c.return}}function Ex(l,c,w){var N=l.pingCache;N!==null&&N.delete(c),c=es(),l.pingedLanes|=l.suspendedLanes&w,Za===l&&(bo&w)===w&&(Ia===4||Ia===3&&(bo&130023424)===bo&&500>kn()-dg?zf(l,0):hg|=w),Cs(l,c)}function Wy(l,c){c===0&&((l.mode&1)===0?c=1:(c=Ki,Ki<<=1,(Ki&130023424)===0&&(Ki=4194304)));var w=es();l=Zr(l,c),l!==null&&(Tl(l,c,w),Cs(l,w))}function kx(l){var c=l.memoizedState,w=0;c!==null&&(w=c.retryLane),Wy(l,w)}function Ax(l,c){var w=0;switch(l.tag){case 13:var N=l.stateNode,G=l.memoizedState;G!==null&&(w=G.retryLane);break;case 19:N=l.stateNode;break;default:throw Error(r(314))}N!==null&&N.delete(c),Wy(l,w)}var Vy;Vy=function(l,c,w){if(l!==null)if(l.memoizedProps!==c.pendingProps||va.current)ne=!0;else{if((l.lanes&w)===0&&(c.flags&128)===0)return ne=!1,ag(l,c,w);ne=(l.flags&131072)!==0}else ne=!1,ft&&(c.flags&1048576)!==0&&Qe(c,be,c.index);switch(c.lanes=0,c.tag){case 2:var N=c.type;$r(l,c),l=c.pendingProps;var G=Hl(c,Hi.current);Cn(c,w),G=xl(null,c,N,l,G,w);var Q=go();return c.flags|=1,typeof G=="object"&&G!==null&&typeof G.render=="function"&&G.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,ma(N)?(Q=!0,xs(c)):Q=!1,c.memoizedState=G.state!==null&&G.state!==void 0?G.state:null,Ri(c),G.updater=Wc,c.stateNode=G,G._reactInternals=c,jh(c,N,l,w),c=mn(null,c,N,!0,Q,w)):(c.tag=0,ft&&Q&<(c),_e(null,c,G,w),c=c.child),c;case 16:N=c.elementType;e:{switch($r(l,c),l=c.pendingProps,G=N._init,N=G(N._payload),c.type=N,G=c.tag=Ox(N),l=Ma(N,l),G){case 0:c=Tt(null,c,N,l,w);break e;case 1:c=Fn(null,c,N,l,w);break e;case 11:c=Ye(null,c,N,l,w);break e;case 14:c=it(null,c,N,Ma(N.type,l),w);break e}throw Error(r(306,N,""))}return c;case 0:return N=c.type,G=c.pendingProps,G=c.elementType===N?G:Ma(N,G),Tt(l,c,N,G,w);case 1:return N=c.type,G=c.pendingProps,G=c.elementType===N?G:Ma(N,G),Fn(l,c,N,G,w);case 3:e:{if(mo(c),l===null)throw Error(r(387));N=c.pendingProps,Q=c.memoizedState,G=Q.element,ya(l,c),$i(c,N,null,w);var he=c.memoizedState;if(N=he.element,Q.isDehydrated)if(Q={element:N,isDehydrated:!1,cache:he.cache,pendingSuspenseBoundaries:he.pendingSuspenseBoundaries,transitions:he.transitions},c.updateQueue.baseState=Q,c.memoizedState=Q,c.flags&256){G=ic(Error(r(423)),c),c=Sl(l,c,N,w,G);break e}else if(N!==G){G=ic(Error(r(424)),c),c=Sl(l,c,N,w,G);break e}else for(He=ea(c.stateNode.containerInfo.firstChild),ot=c,ft=!0,ht=null,w=Hr(c,null,N,w),c.child=w;w;)w.flags=w.flags&-3|4096,w=w.sibling;else{if(Ft(),N===G){c=Ka(l,c,w);break e}_e(l,c,N,w)}c=c.child}return c;case 5:return xu(c),l===null&&zt(c),N=c.type,G=c.pendingProps,Q=l!==null?l.memoizedProps:null,he=G.children,Mf(N,G)?he=null:Q!==null&&Mf(N,Q)&&(c.flags|=32),br(l,c),_e(l,c,he,w),c.child;case 6:return l===null&&zt(c),null;case 13:return ut(l,c,w);case 4:return Zo(c,c.stateNode.containerInfo),N=c.pendingProps,l===null?c.child=fi(c,null,N,w):_e(l,c,N,w),c.child;case 11:return N=c.type,G=c.pendingProps,G=c.elementType===N?G:Ma(N,G),Ye(l,c,N,G,w);case 7:return _e(l,c,c.pendingProps,w),c.child;case 8:return _e(l,c,c.pendingProps.children,w),c.child;case 12:return _e(l,c,c.pendingProps.children,w),c.child;case 10:e:{if(N=c.type._context,G=c.pendingProps,Q=c.memoizedProps,he=G.value,sn(wi,N._currentValue),N._currentValue=he,Q!==null)if(Pn(Q.value,he)){if(Q.children===G.children&&!va.current){c=Ka(l,c,w);break e}}else for(Q=c.child,Q!==null&&(Q.return=c);Q!==null;){var Me=Q.dependencies;if(Me!==null){he=Q.child;for(var ze=Me.firstContext;ze!==null;){if(ze.context===N){if(Q.tag===1){ze=ti(-1,w&-w),ze.tag=2;var nt=Q.updateQueue;if(nt!==null){nt=nt.shared;var vt=nt.pending;vt===null?ze.next=ze:(ze.next=vt.next,vt.next=ze),nt.pending=ze}}Q.lanes|=w,ze=Q.alternate,ze!==null&&(ze.lanes|=w),Wr(Q.return,w,c),Me.lanes|=w;break}ze=ze.next}}else if(Q.tag===10)he=Q.type===c.type?null:Q.child;else if(Q.tag===18){if(he=Q.return,he===null)throw Error(r(341));he.lanes|=w,Me=he.alternate,Me!==null&&(Me.lanes|=w),Wr(he,w,c),he=Q.sibling}else he=Q.child;if(he!==null)he.return=Q;else for(he=Q;he!==null;){if(he===c){he=null;break}if(Q=he.sibling,Q!==null){Q.return=he.return,he=Q;break}he=he.return}Q=he}_e(l,c,G.children,w),c=c.child}return c;case 9:return G=c.type,N=c.pendingProps.children,Cn(c,w),G=Ln(G),N=N(G),c.flags|=1,_e(l,c,N,w),c.child;case 14:return N=c.type,G=Ma(N,c.pendingProps),G=Ma(N.type,G),it(l,c,N,G,w);case 15:return wt(l,c,c.type,c.pendingProps,w);case 17:return N=c.type,G=c.pendingProps,G=c.elementType===N?G:Ma(N,G),$r(l,c),c.tag=1,ma(N)?(l=!0,xs(c)):l=!1,Cn(c,w),Wp(c,N,G),jh(c,N,G,w),mn(null,c,N,!0,l,w);case 19:return ia(l,c,w);case 22:return $t(l,c,w)}throw Error(r(156,c.tag))};function Yy(l,c){return Bs(l,c)}function Px(l,c,w,N){this.tag=l,this.key=w,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=N,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kl(l,c,w,N){return new Px(l,c,w,N)}function _g(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Ox(l){if(typeof l=="function")return _g(l)?1:0;if(l!=null){if(l=l.$$typeof,l===L)return 11;if(l===J)return 14}return 2}function Jc(l,c){var w=l.alternate;return w===null?(w=kl(l.tag,c,l.key,l.mode),w.elementType=l.elementType,w.type=l.type,w.stateNode=l.stateNode,w.alternate=l,l.alternate=w):(w.pendingProps=c,w.type=l.type,w.flags=0,w.subtreeFlags=0,w.deletions=null),w.flags=l.flags&14680064,w.childLanes=l.childLanes,w.lanes=l.lanes,w.child=l.child,w.memoizedProps=l.memoizedProps,w.memoizedState=l.memoizedState,w.updateQueue=l.updateQueue,c=l.dependencies,w.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},w.sibling=l.sibling,w.index=l.index,w.ref=l.ref,w}function i1(l,c,w,N,G,Q){var he=2;if(N=l,typeof l=="function")_g(l)&&(he=1);else if(typeof l=="string")he=5;else e:switch(l){case O:return Uf(w.children,G,Q,c);case M:he=8,G|=8;break;case F:return l=kl(12,w,c,G|2),l.elementType=F,l.lanes=Q,l;case $:return l=kl(13,w,c,G),l.elementType=$,l.lanes=Q,l;case q:return l=kl(19,w,c,G),l.elementType=q,l.lanes=Q,l;case ie:return a1(w,G,Q,c);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case j:he=10;break e;case T:he=9;break e;case L:he=11;break e;case J:he=14;break e;case ae:he=16,N=null;break e}throw Error(r(130,l==null?l:typeof l,""))}return c=kl(he,w,c,G),c.elementType=l,c.type=N,c.lanes=Q,c}function Uf(l,c,w,N){return l=kl(7,l,N,c),l.lanes=w,l}function a1(l,c,w,N){return l=kl(22,l,N,c),l.elementType=ie,l.lanes=w,l.stateNode={isHidden:!1},l}function xg(l,c,w){return l=kl(6,l,null,c),l.lanes=w,l}function Sg(l,c,w){return c=kl(4,l.children!==null?l.children:[],l.key,c),c.lanes=w,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}function Cx(l,c,w,N,G){this.tag=c,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Oa(0),this.expirationTimes=Oa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oa(0),this.identifierPrefix=N,this.onRecoverableError=G,this.mutableSourceEagerHydrationData=null}function Eg(l,c,w,N,G,Q,he,Me,ze){return l=new Cx(l,c,w,Me,ze),c===1?(c=1,Q===!0&&(c|=8)):c=0,Q=kl(3,null,null,c),l.current=Q,Q.stateNode=l,Q.memoizedState={element:N,isDehydrated:w,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ri(Q),l}function Lx(l,c,w){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I,key:N==null?null:""+N,children:l,containerInfo:c,implementation:w}}function Xy(l){if(!l)return _s;l=l._reactInternals;e:{if(si(l)!==l||l.tag!==1)throw Error(r(170));var c=l;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(ma(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(r(171))}if(l.tag===1){var w=l.type;if(ma(w))return tc(l,w,c)}return c}function Ky(l,c,w,N,G,Q,he,Me,ze){return l=Eg(w,N,!0,l,G,Q,he,Me,ze),l.context=Xy(null),w=l.current,N=es(),G=Zc(w),Q=ti(N,G),Q.callback=c??null,Hn(w,Q,G),l.current.lanes=G,Tl(l,G,N),Cs(l,N),l}function o1(l,c,w,N){var G=c.current,Q=es(),he=Zc(G);return w=Xy(w),c.context===null?c.context=w:c.pendingContext=w,c=ti(Q,he),c.payload={element:l},N=N===void 0?null:N,N!==null&&(c.callback=N),l=Hn(G,c,he),l!==null&&(Kl(l,G,he,Q),ba(l,G,he)),he}function s1(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function Zy(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var w=l.retryLane;l.retryLane=w!==0&&w<c?w:c}}function kg(l,c){Zy(l,c),(l=l.alternate)&&Zy(l,c)}function Nx(){return null}var Qy=typeof reportError=="function"?reportError:function(l){console.error(l)};function Ag(l){this._internalRoot=l}l1.prototype.render=Ag.prototype.render=function(l){var c=this._internalRoot;if(c===null)throw Error(r(409));o1(l,c,null,null)},l1.prototype.unmount=Ag.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var c=l.containerInfo;Bf(function(){o1(null,l,null,null)}),c[ra]=null}};function l1(l){this._internalRoot=l}l1.prototype.unstable_scheduleHydration=function(l){if(l){var c=Ac();l={blockedOn:null,target:l,priority:c};for(var w=0;w<So.length&&c!==0&&c<So[w].priority;w++);So.splice(w,0,l),w===0&&fu(l)}};function Pg(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function u1(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function Jy(){}function Tx(l,c,w,N,G){if(G){if(typeof N=="function"){var Q=N;N=function(){var nt=s1(he);Q.call(nt)}}var he=Ky(c,N,l,0,null,!1,!1,"",Jy);return l._reactRootContainer=he,l[ra]=he.current,Ws(l.nodeType===8?l.parentNode:l),Bf(),he}for(;G=l.lastChild;)l.removeChild(G);if(typeof N=="function"){var Me=N;N=function(){var nt=s1(ze);Me.call(nt)}}var ze=Eg(l,0,!1,null,null,!1,!1,"",Jy);return l._reactRootContainer=ze,l[ra]=ze.current,Ws(l.nodeType===8?l.parentNode:l),Bf(function(){o1(c,ze,w,N)}),ze}function c1(l,c,w,N,G){var Q=w._reactRootContainer;if(Q){var he=Q;if(typeof G=="function"){var Me=G;G=function(){var ze=s1(he);Me.call(ze)}}o1(c,he,l,G)}else he=Tx(w,c,l,G,N);return s1(he)}cs=function(l){switch(l.tag){case 3:var c=l.stateNode;if(c.current.memoizedState.isDehydrated){var w=Mn(c.pendingLanes);w!==0&&(cu(c,w|1),Cs(c,kn()),(un&6)===0&&(zh=kn()+500,re()))}break;case 13:Bf(function(){var N=Zr(l,1);if(N!==null){var G=es();Kl(N,l,1,G)}}),kg(l,1)}},cl=function(l){if(l.tag===13){var c=Zr(l,134217728);if(c!==null){var w=es();Kl(c,l,134217728,w)}kg(l,134217728)}},kc=function(l){if(l.tag===13){var c=Zc(l),w=Zr(l,c);if(w!==null){var N=es();Kl(w,l,c,N)}kg(l,c)}},Ac=function(){return Rr},fl=function(l,c){var w=Rr;try{return Rr=l,c()}finally{Rr=w}},ir=function(l,c,w){switch(c){case"input":if(Be(l,w),c=w.name,w.type==="radio"&&c!=null){for(w=l;w.parentNode;)w=w.parentNode;for(w=w.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<w.length;c++){var N=w[c];if(N!==l&&N.form===l.form){var G=Ni(N);if(!G)throw Error(r(90));Ce(N),Be(N,G)}}}break;case"textarea":Pe(l,w);break;case"select":c=w.value,c!=null&&Ne(l,!!w.multiple,c,!1)}},oi=yg,Ei=Bf;var Rx={usingClientEntryPoint:!1,Events:[wu,yi,Ni,pr,Bi,yg]},jd={findFiberByHostInstance:Ys,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Mx={bundleType:jd.bundleType,version:jd.version,rendererPackageName:jd.rendererPackageName,rendererConfig:jd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:S.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=zi(l),l===null?null:l.stateNode},findFiberByHostInstance:jd.findFiberByHostInstance||Nx,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 f1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!f1.isDisabled&&f1.supportsFiber)try{_o=f1.inject(Mx),gi=f1}catch{}}return Ls.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Rx,Ls.createPortal=function(l,c){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Pg(c))throw Error(r(200));return Lx(l,c,null,w)},Ls.createRoot=function(l,c){if(!Pg(l))throw Error(r(299));var w=!1,N="",G=Qy;return c!=null&&(c.unstable_strictMode===!0&&(w=!0),c.identifierPrefix!==void 0&&(N=c.identifierPrefix),c.onRecoverableError!==void 0&&(G=c.onRecoverableError)),c=Eg(l,1,!1,null,null,w,!1,N,G),l[ra]=c.current,Ws(l.nodeType===8?l.parentNode:l),new Ag(c)},Ls.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(r(188)):(l=Object.keys(l).join(","),Error(r(268,l)));return l=zi(c),l=l===null?null:l.stateNode,l},Ls.flushSync=function(l){return Bf(l)},Ls.hydrate=function(l,c,w){if(!u1(c))throw Error(r(200));return c1(null,l,c,!0,w)},Ls.hydrateRoot=function(l,c,w){if(!Pg(l))throw Error(r(405));var N=w!=null&&w.hydratedSources||null,G=!1,Q="",he=Qy;if(w!=null&&(w.unstable_strictMode===!0&&(G=!0),w.identifierPrefix!==void 0&&(Q=w.identifierPrefix),w.onRecoverableError!==void 0&&(he=w.onRecoverableError)),c=Ky(c,null,l,1,w??null,G,!1,Q,he),l[ra]=c.current,Ws(l),N)for(l=0;l<N.length;l++)w=N[l],G=w._getVersion,G=G(w._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[w,G]:c.mutableSourceEagerHydrationData.push(w,G);return new l1(c)},Ls.render=function(l,c,w){if(!u1(c))throw Error(r(200));return c1(null,l,c,!1,w)},Ls.unmountComponentAtNode=function(l){if(!u1(l))throw Error(r(40));return l._reactRootContainer?(Bf(function(){c1(null,null,l,!1,function(){l._reactRootContainer=null,l[ra]=null})}),!0):!1},Ls.unstable_batchedUpdates=yg,Ls.unstable_renderSubtreeIntoContainer=function(l,c,w,N){if(!u1(w))throw Error(r(200));if(l==null||l._reactInternals===void 0)throw Error(r(38));return c1(l,c,w,!1,N)},Ls.version="18.3.1-next-f1338f8080-20240426",Ls}var a5;function Xw(){if(a5)return Cg.exports;a5=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Cg.exports=Bx(),Cg.exports}var o5;function zx(){if(o5)return h1;o5=1;var t=Xw();return h1.createRoot=t.createRoot,h1.hydrateRoot=t.hydrateRoot,h1}var qx=zx();const Kw=hh(qx);function Dr(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];throw new Error(typeof t=="number"?"[MobX] minified error nr: "+t+(r.length?" "+r.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+t)}var Ux={};function O0(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Ux}var Zw=Object.assign,a0=Object.getOwnPropertyDescriptor,Iu=Object.defineProperty,C0=Object.prototype,$v=[];Object.freeze($v);var jm={};Object.freeze(jm);var Hx=typeof Proxy<"u",$x=Object.toString();function Qw(){Hx||Dr("Proxy not available")}function Jw(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var ed=function(){};function ol(t){return typeof t=="function"}function ah(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function L0(t){return t!==null&&typeof t=="object"}function vf(t){if(!L0(t))return!1;var e=Object.getPrototypeOf(t);if(e==null)return!0;var r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r.toString()===$x}function e6(t){var e=t?.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function N0(t,e,r){Iu(t,e,{enumerable:!1,writable:!0,configurable:!0,value:r})}function t6(t,e,r){Iu(t,e,{enumerable:!1,writable:!1,configurable:!0,value:r})}function xf(t,e){var r="isMobX"+t;return e.prototype[r]=!0,function(n){return L0(n)&&n[r]===!0}}function yd(t){return t!=null&&Object.prototype.toString.call(t)==="[object Map]"}function Gx(t){var e=Object.getPrototypeOf(t),r=Object.getPrototypeOf(e),n=Object.getPrototypeOf(r);return n===null}function hc(t){return t!=null&&Object.prototype.toString.call(t)==="[object Set]"}var r6=typeof Object.getOwnPropertySymbols<"u";function Wx(t){var e=Object.keys(t);if(!r6)return e;var r=Object.getOwnPropertySymbols(t);return r.length?[].concat(e,r.filter(function(n){return C0.propertyIsEnumerable.call(t,n)})):e}var T0=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:r6?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function n6(t){return t===null?null:typeof t=="object"?""+t:t}function gc(t,e){return C0.hasOwnProperty.call(t,e)}var Vx=Object.getOwnPropertyDescriptors||function(e){var r={};return T0(e).forEach(function(n){r[n]=a0(e,n)}),r};function tl(t,e){return!!(t&e)}function rl(t,e,r){return r?t|=e:t&=~e,t}function s5(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Yx(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Kx(n.key),n)}}function bd(t,e,r){return e&&Yx(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function td(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=Zx(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
33
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mf(){return mf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},mf.apply(null,arguments)}function i6(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Gv(t,e)}function Gv(t,e){return Gv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Gv(t,e)}function Xx(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Kx(t){var e=Xx(t,"string");return typeof e=="symbol"?e:e+""}function Zx(t,e){if(t){if(typeof t=="string")return s5(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s5(t,e):void 0}}var Nu=Symbol("mobx-stored-annotations");function ju(t){function e(r,n){if(Op(n))return t.decorate_20223_(r,n);Pp(r,n,t)}return Object.assign(e,t)}function Pp(t,e,r){gc(t,Nu)||N0(t,Nu,mf({},t[Nu])),i9(r)||(t[Nu][e]=r)}function Qx(t){return gc(t,Nu)||N0(t,Nu,mf({},t[Nu])),t[Nu]}function Op(t){return typeof t=="object"&&typeof t.kind=="string"}var gr=Symbol("mobx administration"),Sf=function(){function t(r){r===void 0&&(r="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=gn.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var e=t.prototype;return e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},e.reportObserved=function(){return _6(this)},e.reportChanged=function(){Ts(),x6(this),Rs()},e.toString=function(){return this.name_},bd(t,[{key:"isBeingObserved",get:function(){return tl(this.flags_,t.isBeingObservedMask_)},set:function(n){this.flags_=rl(this.flags_,t.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return tl(this.flags_,t.isPendingUnobservationMask_)},set:function(n){this.flags_=rl(this.flags_,t.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return tl(this.flags_,t.diffValueMask_)?1:0},set:function(n){this.flags_=rl(this.flags_,t.diffValueMask_,n===1)}}])}();Sf.isBeingObservedMask_=1;Sf.isPendingUnobservationMask_=2;Sf.diffValueMask_=4;var Dm=xf("Atom",Sf);function o0(t,e,r){e===void 0&&(e=ed),r===void 0&&(r=ed);var n=new Sf(t);return e!==ed&&sS(n,e),r!==ed&&L6(n,r),n}function Jx(t,e){return V6(t,e)}function e9(t,e){return Object.is?Object.is(t,e):t===e?t!==0||1/t===1/e:t!==t&&e!==e}var cd={structural:Jx,default:e9};function oh(t,e,r){return I6(t)?t:Array.isArray(t)?Xr.array(t,{name:r}):vf(t)?Xr.object(t,void 0,{name:r}):yd(t)?Xr.map(t,{name:r}):hc(t)?Xr.set(t,{name:r}):typeof t=="function"&&!pp(t)&&!gp(t)?e6(t)?fd(t):dp(r,t):t}function t9(t,e,r){if(t==null||iu(t)||Hu(t)||Nl(t)||rs(t))return t;if(Array.isArray(t))return Xr.array(t,{name:r,deep:!1});if(vf(t))return Xr.object(t,void 0,{name:r,deep:!1});if(yd(t))return Xr.map(t,{name:r,deep:!1});if(hc(t))return Xr.set(t,{name:r,deep:!1})}function R0(t){return t}function r9(t,e){return V6(t,e)?e:t}var n9="override";function i9(t){return t.annotationType_===n9}function Cp(t,e){return{annotationType_:t,options_:e,make_:a9,extend_:o9,decorate_20223_:s9}}function a9(t,e,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(t,e,r,!1)===null?0:1;if(n===t.target_)return this.extend_(t,e,r,!1)===null?0:2;if(pp(r.value))return 1;var a=a6(t,this,e,r,!1);return Iu(n,e,a),2}function o9(t,e,r,n){var i=a6(t,this,e,r);return t.defineProperty_(e,i,n)}function s9(t,e){var r=e.kind,n=e.name,i=e.addInitializer,a=this,o=function(h){var f,g,v,p;return yf((f=(g=a.options_)==null?void 0:g.name)!=null?f:n.toString(),h,(v=(p=a.options_)==null?void 0:p.autoAction)!=null?v:!1)};if(r=="field")return function(u){var h,f=u;return pp(f)||(f=o(f)),(h=a.options_)!=null&&h.bound&&(f=f.bind(this),f.isMobxAction=!0),f};if(r=="method"){var s;return pp(t)||(t=o(t)),(s=this.options_)!=null&&s.bound&&i(function(){var u=this,h=u[n].bind(u);h.isMobxAction=!0,u[n]=h}),t}Dr("Cannot apply '"+a.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
|
|
34
|
-
'`+a.annotationType_+"' can only be used on properties with a function value."))}function l9(t,e,r,n){e.annotationType_,n.value}function a6(t,e,r,n,i){var a,o,s,u,h,f,g;i===void 0&&(i=Lt.safeDescriptors),l9(t,e,r,n);var v=n.value;if((a=e.options_)!=null&&a.bound){var p;v=v.bind((p=t.proxy_)!=null?p:t.target_)}return{value:yf((o=(s=e.options_)==null?void 0:s.name)!=null?o:r.toString(),v,(u=(h=e.options_)==null?void 0:h.autoAction)!=null?u:!1,(f=e.options_)!=null&&f.bound?(g=t.proxy_)!=null?g:t.target_:void 0),configurable:i?t.isPlainObject_:!0,enumerable:!1,writable:!i}}function o6(t,e){return{annotationType_:t,options_:e,make_:u9,extend_:c9,decorate_20223_:f9}}function u9(t,e,r,n){var i;if(n===t.target_)return this.extend_(t,e,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!gc(t.target_,e)||!gp(t.target_[e]))&&this.extend_(t,e,r,!1)===null)return 0;if(gp(r.value))return 1;var a=s6(t,this,e,r,!1,!1);return Iu(n,e,a),2}function c9(t,e,r,n){var i,a=s6(t,this,e,r,(i=this.options_)==null?void 0:i.bound);return t.defineProperty_(e,a,n)}function f9(t,e){var r,n=e.name,i=e.addInitializer;return gp(t)||(t=fd(t)),(r=this.options_)!=null&&r.bound&&i(function(){var a=this,o=a[n].bind(a);o.isMobXFlow=!0,a[n]=o}),t}function h9(t,e,r,n){e.annotationType_,n.value}function s6(t,e,r,n,i,a){a===void 0&&(a=Lt.safeDescriptors),h9(t,e,r,n);var o=n.value;if(gp(o)||(o=fd(o)),i){var s;o=o.bind((s=t.proxy_)!=null?s:t.target_),o.isMobXFlow=!0}return{value:o,configurable:a?t.isPlainObject_:!0,enumerable:!1,writable:!a}}function Fm(t,e){return{annotationType_:t,options_:e,make_:d9,extend_:p9,decorate_20223_:g9}}function d9(t,e,r){return this.extend_(t,e,r,!1)===null?0:1}function p9(t,e,r,n){return v9(t,this,e,r),t.defineComputedProperty_(e,mf({},this.options_,{get:r.get,set:r.set}),n)}function g9(t,e){var r=this,n=e.name,i=e.addInitializer;return i(function(){var a=wd(this)[gr],o=mf({},r.options_,{get:t,context:this});o.name||(o.name="ObservableObject."+n.toString()),a.values_.set(n,new tu(o))}),function(){return this[gr].getObservablePropValue_(n)}}function v9(t,e,r,n){e.annotationType_,n.get}function M0(t,e){return{annotationType_:t,options_:e,make_:m9,extend_:y9,decorate_20223_:b9}}function m9(t,e,r){return this.extend_(t,e,r,!1)===null?0:1}function y9(t,e,r,n){var i,a;return w9(t,this),t.defineObservableProperty_(e,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:oh,n)}function b9(t,e){var r=this,n=e.kind,i=e.name,a=new WeakSet;function o(s,u){var h,f,g=wd(s)[gr],v=new gf(u,(h=(f=r.options_)==null?void 0:f.enhancer)!=null?h:oh,"ObservableObject."+i.toString(),!1);g.values_.set(i,v),a.add(s)}if(n=="accessor")return{get:function(){return a.has(this)||o(this,t.get.call(this)),this[gr].getObservablePropValue_(i)},set:function(u){return a.has(this)||o(this,u),this[gr].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||o(this,u),u}}}function w9(t,e,r,n){e.annotationType_}var _9="true",x9=l6();function l6(t){return{annotationType_:_9,options_:t,make_:S9,extend_:E9,decorate_20223_:k9}}function S9(t,e,r,n){var i,a;if(r.get)return dh.make_(t,e,r,n);if(r.set){var o=yf(e.toString(),r.set);return n===t.target_?t.defineProperty_(e,{configurable:Lt.safeDescriptors?t.isPlainObject_:!0,set:o})===null?0:2:(Iu(n,e,{configurable:!0,set:o}),2)}if(n!==t.target_&&typeof r.value=="function"){var s;if(e6(r.value)){var u,h=(u=this.options_)!=null&&u.autoBind?fd.bound:fd;return h.make_(t,e,r,n)}var f=(s=this.options_)!=null&&s.autoBind?dp.bound:dp;return f.make_(t,e,r,n)}var g=((i=this.options_)==null?void 0:i.deep)===!1?Xr.ref:Xr;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var v;r.value=r.value.bind((v=t.proxy_)!=null?v:t.target_)}return g.make_(t,e,r,n)}function E9(t,e,r,n){var i,a;if(r.get)return dh.extend_(t,e,r,n);if(r.set)return t.defineProperty_(e,{configurable:Lt.safeDescriptors?t.isPlainObject_:!0,set:yf(e.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;r.value=r.value.bind((o=t.proxy_)!=null?o:t.target_)}var s=((a=this.options_)==null?void 0:a.deep)===!1?Xr.ref:Xr;return s.extend_(t,e,r,n)}function k9(t,e){Dr("'"+this.annotationType_+"' cannot be used as a decorator")}var A9="observable",P9="observable.ref",O9="observable.shallow",C9="observable.struct",u6={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(u6);function d1(t){return t||u6}var Wv=M0(A9),L9=M0(P9,{enhancer:R0}),N9=M0(O9,{enhancer:t9}),T9=M0(C9,{enhancer:r9}),c6=ju(Wv);function p1(t){return t.deep===!0?oh:t.deep===!1?R0:M9(t.defaultDecorator)}function R9(t){var e;return t?(e=t.defaultDecorator)!=null?e:l6(t):void 0}function M9(t){var e,r;return t&&(e=(r=t.options_)==null?void 0:r.enhancer)!=null?e:oh}function f6(t,e,r){if(Op(e))return Wv.decorate_20223_(t,e);if(ah(e)){Pp(t,e,Wv);return}return I6(t)?t:vf(t)?Xr.object(t,e,r):Array.isArray(t)?Xr.array(t,e):yd(t)?Xr.map(t,e):hc(t)?Xr.set(t,e):typeof t=="object"&&t!==null?t:Xr.box(t,e)}Zw(f6,c6);var I9={box:function(e,r){var n=d1(r);return new gf(e,p1(n),n.name,!0,n.equals)},array:function(e,r){var n=d1(r);return(Lt.useProxies===!1||n.proxy===!1?DS:PS)(e,p1(n),n.name)},map:function(e,r){var n=d1(r);return new Hm(e,p1(n),n.name)},set:function(e,r){var n=d1(r);return new U6(e,p1(n),n.name)},object:function(e,r,n){return gh(function(){return fS(Lt.useProxies===!1||n?.proxy===!1?wd({},n):ES({},n),e,r)})},ref:ju(L9),shallow:ju(N9),deep:c6,struct:ju(T9)},Xr=Zw(f6,I9),h6="computed",j9="computed.struct",Vv=Fm(h6),D9=Fm(j9,{equals:cd.structural}),dh=function(e,r){if(Op(r))return Vv.decorate_20223_(e,r);if(ah(r))return Pp(e,r,Vv);if(vf(e))return ju(Fm(h6,e));var n=vf(r)?r:{};return n.get=e,n.name||(n.name=e.name||""),new tu(n)};Object.assign(dh,Vv);dh.struct=ju(D9);var l5,u5,s0=0,F9=1,B9=(l5=(u5=a0(function(){},"name"))==null?void 0:u5.configurable)!=null?l5:!1,c5={value:"action",configurable:!0,writable:!1,enumerable:!1};function yf(t,e,r,n){r===void 0&&(r=!1);function i(){return d6(t,r,e,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return e.toString()},B9&&(c5.value=t,Iu(i,"name",c5)),i}function d6(t,e,r,n,i){var a=z9(t,e);try{return r.apply(n,i)}catch(o){throw a.error_=o,o}finally{q9(a)}}function z9(t,e,r,n){var i=!1,a=0,o=Lt.trackingDerivation,s=!e||!o;Ts();var u=Lt.allowStateChanges;s&&(ph(),u=I0(!0));var h=Bm(!0),f={runAsAction_:s,prevDerivation_:o,prevAllowStateChanges_:u,prevAllowStateReads_:h,notifySpy_:i,startTime_:a,actionId_:F9++,parentActionId_:s0};return s0=f.actionId_,f}function q9(t){s0!==t.actionId_&&Dr(30),s0=t.parentActionId_,t.error_!==void 0&&(Lt.suppressReactionErrors=!0),j0(t.prevAllowStateChanges_),ep(t.prevAllowStateReads_),Rs(),t.runAsAction_&&vc(t.prevDerivation_),Lt.suppressReactionErrors=!1}function p6(t,e){var r=I0(t);try{return e()}finally{j0(r)}}function I0(t){var e=Lt.allowStateChanges;return Lt.allowStateChanges=t,e}function j0(t){Lt.allowStateChanges=t}var gf=function(t){function e(n,i,a,o,s){var u;return a===void 0&&(a="ObservableValue"),s===void 0&&(s=cd.default),u=t.call(this,a)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=i,u.name_=a,u.equals=s,u.value_=i(n,void 0,a),u}i6(e,t);var r=e.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==Lt.UNCHANGED&&this.setNewValue_(i)},r.prepareNewValue_=function(i){if(Al(this)){var a=Pl(this,{object:this,type:Du,newValue:i});if(!a)return Lt.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Lt.UNCHANGED:i},r.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),Jl(this)&&eu(this,{type:Du,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return Lp(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Du,newValue:this.value_,oldValue:void 0}),Np(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 n6(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},e}(Sf),U9=xf("ObservableValue",gf),tu=function(){function t(r){this.dependenciesState_=gn.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=gn.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new u0(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=l0.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||Dr(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=yf("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?cd.structural:cd.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){Y9(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},e.get=function(){if(this.isComputing&&Dr(32,this.name_,this.derivation),Lt.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Yv(this)&&(this.warnAboutUntrackedRead_(),Ts(),this.value_=this.computeValue_(!1),Rs());else if(_6(this),Yv(this)){var n=Lt.trackingContext;this.keepAlive_&&!n&&(Lt.trackingContext=this),this.trackAndCompute()&&V9(this),Lt.trackingContext=n}var i=this.value_;if(U1(i))throw i.cause;return i},e.set=function(n){if(this.setter_){this.isRunningSetter&&Dr(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else Dr(34,this.name_)},e.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===gn.NOT_TRACKING_,a=this.computeValue_(!0),o=i||U1(n)||U1(a)||!this.equals_(n,a);return o&&(this.value_=a),o},e.computeValue_=function(n){this.isComputing=!0;var i=I0(!1),a;if(n)a=g6(this,this.derivation,this.scope_);else if(Lt.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new u0(o)}return j0(i),this.isComputing=!1,a},e.suspend_=function(){this.keepAlive_||(Xv(this),this.value_=void 0)},e.observe_=function(n,i){var a=this,o=!0,s=void 0;return zu(function(){var u=a.get();if(!o||i){var h=ph();n({observableKind:"computed",debugObjectName:a.name_,type:Du,object:a,newValue:u,oldValue:s}),vc(h)}o=!1,s=u})},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return n6(this.get())},e[Symbol.toPrimitive]=function(){return this.valueOf()},bd(t,[{key:"isComputing",get:function(){return tl(this.flags_,t.isComputingMask_)},set:function(n){this.flags_=rl(this.flags_,t.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return tl(this.flags_,t.isRunningSetterMask_)},set:function(n){this.flags_=rl(this.flags_,t.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return tl(this.flags_,t.isBeingObservedMask_)},set:function(n){this.flags_=rl(this.flags_,t.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return tl(this.flags_,t.isPendingUnobservationMask_)},set:function(n){this.flags_=rl(this.flags_,t.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return tl(this.flags_,t.diffValueMask_)?1:0},set:function(n){this.flags_=rl(this.flags_,t.diffValueMask_,n===1)}}])}();tu.isComputingMask_=1;tu.isRunningSetterMask_=2;tu.isBeingObservedMask_=4;tu.isPendingUnobservationMask_=8;tu.diffValueMask_=16;var D0=xf("ComputedValue",tu),gn;(function(t){t[t.NOT_TRACKING_=-1]="NOT_TRACKING_",t[t.UP_TO_DATE_=0]="UP_TO_DATE_",t[t.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",t[t.STALE_=2]="STALE_"})(gn||(gn={}));var l0;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(l0||(l0={}));var u0=function(e){this.cause=void 0,this.cause=e};function U1(t){return t instanceof u0}function Yv(t){switch(t.dependenciesState_){case gn.UP_TO_DATE_:return!1;case gn.NOT_TRACKING_:case gn.STALE_:return!0;case gn.POSSIBLY_STALE_:{for(var e=Bm(!0),r=ph(),n=t.observing_,i=n.length,a=0;a<i;a++){var o=n[a];if(D0(o)){if(Lt.disableErrorBoundaries)o.get();else try{o.get()}catch{return vc(r),ep(e),!0}if(t.dependenciesState_===gn.STALE_)return vc(r),ep(e),!0}}return m6(t),vc(r),ep(e),!1}}}function g6(t,e,r){var n=Bm(!0);m6(t),t.newObserving_=new Array(t.runId_===0?100:t.observing_.length),t.unboundDepsCount_=0,t.runId_=++Lt.runId;var i=Lt.trackingDerivation;Lt.trackingDerivation=t,Lt.inBatch++;var a;if(Lt.disableErrorBoundaries===!0)a=e.call(r);else try{a=e.call(r)}catch(o){a=new u0(o)}return Lt.inBatch--,Lt.trackingDerivation=i,H9(t),ep(n),a}function H9(t){for(var e=t.observing_,r=t.observing_=t.newObserving_,n=gn.UP_TO_DATE_,i=0,a=t.unboundDepsCount_,o=0;o<a;o++){var s=r[o];s.diffValue===0&&(s.diffValue=1,i!==o&&(r[i]=s),i++),s.dependenciesState_>n&&(n=s.dependenciesState_)}for(r.length=i,t.newObserving_=null,a=e.length;a--;){var u=e[a];u.diffValue===0&&b6(u,t),u.diffValue=0}for(;i--;){var h=r[i];h.diffValue===1&&(h.diffValue=0,W9(h,t))}n!==gn.UP_TO_DATE_&&(t.dependenciesState_=n,t.onBecomeStale_())}function Xv(t){var e=t.observing_;t.observing_=[];for(var r=e.length;r--;)b6(e[r],t);t.dependenciesState_=gn.NOT_TRACKING_}function v6(t){var e=ph();try{return t()}finally{vc(e)}}function ph(){var t=Lt.trackingDerivation;return Lt.trackingDerivation=null,t}function vc(t){Lt.trackingDerivation=t}function Bm(t){var e=Lt.allowStateReads;return Lt.allowStateReads=t,e}function ep(t){Lt.allowStateReads=t}function m6(t){if(t.dependenciesState_!==gn.UP_TO_DATE_){t.dependenciesState_=gn.UP_TO_DATE_;for(var e=t.observing_,r=e.length;r--;)e[r].lowestObserverState_=gn.UP_TO_DATE_}}var H1=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},$1=!0,y6=!1,Lt=function(){var t=O0();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&($1=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new H1().version&&($1=!1),$1?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new H1):(setTimeout(function(){y6||Dr(35)},1),new H1)}();function $9(){if((Lt.pendingReactions.length||Lt.inBatch||Lt.isRunningReactions)&&Dr(36),y6=!0,$1){var t=O0();--t.__mobxInstanceCount===0&&(t.__mobxGlobals=void 0),Lt=new H1}}function G9(){return Lt}function W9(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function b6(t,e){t.observers_.delete(e),t.observers_.size===0&&w6(t)}function w6(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,Lt.pendingUnobservations.push(t))}function Ts(){Lt.inBatch++}function Rs(){if(--Lt.inBatch===0){S6();for(var t=Lt.pendingUnobservations,e=0;e<t.length;e++){var r=t[e];r.isPendingUnobservation=!1,r.observers_.size===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBUO()),r instanceof tu&&r.suspend_())}Lt.pendingUnobservations=[]}}function _6(t){var e=Lt.trackingDerivation;return e!==null?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved&&Lt.trackingContext&&(t.isBeingObserved=!0,t.onBO())),t.isBeingObserved):(t.observers_.size===0&&Lt.inBatch>0&&w6(t),!1)}function x6(t){t.lowestObserverState_!==gn.STALE_&&(t.lowestObserverState_=gn.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===gn.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=gn.STALE_}))}function V9(t){t.lowestObserverState_!==gn.STALE_&&(t.lowestObserverState_=gn.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===gn.POSSIBLY_STALE_?e.dependenciesState_=gn.STALE_:e.dependenciesState_===gn.UP_TO_DATE_&&(t.lowestObserverState_=gn.UP_TO_DATE_)}))}function Y9(t){t.lowestObserverState_===gn.UP_TO_DATE_&&(t.lowestObserverState_=gn.POSSIBLY_STALE_,t.observers_.forEach(function(e){e.dependenciesState_===gn.UP_TO_DATE_&&(e.dependenciesState_=gn.POSSIBLY_STALE_,e.onBecomeStale_())}))}var Bu=function(){function t(r,n,i,a){r===void 0&&(r="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=gn.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=l0.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=a}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Lt.pendingReactions.push(this),S6())},e.runReaction_=function(){if(!this.isDisposed){Ts(),this.isScheduled=!1;var n=Lt.trackingContext;if(Lt.trackingContext=this,Yv(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Lt.trackingContext=n,Rs()}},e.track=function(n){if(!this.isDisposed){Ts(),this.isRunning=!0;var i=Lt.trackingContext;Lt.trackingContext=this;var a=g6(this,n,void 0);Lt.trackingContext=i,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Xv(this),U1(a)&&this.reportExceptionInDerivation_(a.cause),Rs()}},e.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(Lt.disableErrorBoundaries)throw n;var a="[mobx] uncaught error in '"+this+"'";Lt.suppressReactionErrors||console.error(a,n),Lt.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},e.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Ts(),Xv(this),Rs()))},e.getDisposer_=function(n){var i=this,a=function o(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",a),a[gr]=this,a},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(n){},bd(t,[{key:"isDisposed",get:function(){return tl(this.flags_,t.isDisposedMask_)},set:function(n){this.flags_=rl(this.flags_,t.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return tl(this.flags_,t.isScheduledMask_)},set:function(n){this.flags_=rl(this.flags_,t.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return tl(this.flags_,t.isTrackPendingMask_)},set:function(n){this.flags_=rl(this.flags_,t.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return tl(this.flags_,t.isRunningMask_)},set:function(n){this.flags_=rl(this.flags_,t.isRunningMask_,n)}},{key:"diffValue",get:function(){return tl(this.flags_,t.diffValueMask_)?1:0},set:function(n){this.flags_=rl(this.flags_,t.diffValueMask_,n===1)}}])}();Bu.isDisposedMask_=1;Bu.isScheduledMask_=2;Bu.isTrackPendingMask_=4;Bu.isRunningMask_=8;Bu.diffValueMask_=16;var X9=100,Kv=function(e){return e()};function S6(){Lt.inBatch>0||Lt.isRunningReactions||Kv(K9)}function K9(){Lt.isRunningReactions=!0;for(var t=Lt.pendingReactions,e=0;t.length>0;){++e===X9&&(console.error("[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var r=t.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}Lt.isRunningReactions=!1}var c0=xf("Reaction",Bu);function Z9(t){var e=Kv;Kv=function(n){return t(function(){return e(n)})}}function tp(){return!1}function Q9(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var E6="action",J9="action.bound",k6="autoAction",eS="autoAction.bound",A6="<unnamed action>",Zv=Cp(E6),tS=Cp(J9,{bound:!0}),Qv=Cp(k6,{autoAction:!0}),rS=Cp(eS,{autoAction:!0,bound:!0});function P6(t){var e=function(n,i){if(ol(n))return yf(n.name||A6,n,t);if(ol(i))return yf(n,i,t);if(Op(i))return(t?Qv:Zv).decorate_20223_(n,i);if(ah(i))return Pp(n,i,t?Qv:Zv);if(ah(n))return ju(Cp(t?k6:E6,{name:n,autoAction:t}))};return e}var Qr=P6(!1);Object.assign(Qr,Zv);var dp=P6(!0);Object.assign(dp,Qv);Qr.bound=ju(tS);dp.bound=ju(rS);function dc(t){return d6(t.name||A6,!1,t,this,void 0)}function pp(t){return ol(t)&&t.isMobxAction===!0}function zu(t,e){var r,n,i,a;e===void 0&&(e=jm);var o=(r=(n=e)==null?void 0:n.name)!=null?r:"Autorun",s=!e.scheduler&&!e.delay,u;if(s)u=new Bu(o,function(){this.track(g)},e.onError,e.requiresObservable);else{var h=O6(e),f=!1;u=new Bu(o,function(){f||(f=!0,h(function(){f=!1,u.isDisposed||u.track(g)}))},e.onError,e.requiresObservable)}function g(){t(u)}return(i=e)!=null&&(i=i.signal)!=null&&i.aborted||u.schedule_(),u.getDisposer_((a=e)==null?void 0:a.signal)}var nS=function(e){return e()};function O6(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:nS}function C6(t,e,r){var n,i,a;r===void 0&&(r=jm);var o=(n=r.name)!=null?n:"Reaction",s=Qr(o,r.onError?iS(r.onError,e):e),u=!r.scheduler&&!r.delay,h=O6(r),f=!0,g=!1,v,p=r.compareStructural?cd.structural:r.equals||cd.default,y=new Bu(o,function(){f||u?_():g||(g=!0,h(_))},r.onError,r.requiresObservable);function _(){if(g=!1,!y.isDisposed){var x=!1,b=v;y.track(function(){var E=p6(!1,function(){return t(y)});x=f||!p(v,E),v=E}),(f&&r.fireImmediately||!f&&x)&&s(v,b,y),f=!1}}return(i=r)!=null&&(i=i.signal)!=null&&i.aborted||y.schedule_(),y.getDisposer_((a=r)==null?void 0:a.signal)}function iS(t,e){return function(){try{return e.apply(this,arguments)}catch(r){t.call(this,r)}}}var aS="onBO",oS="onBUO";function sS(t,e,r){return N6(aS,t,e,r)}function L6(t,e,r){return N6(oS,t,e,r)}function N6(t,e,r,n){var i=hd(e),a=ol(n)?n:r,o=t+"L";return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var s=i[o];s&&(s.delete(a),s.size===0&&delete i[o])}}var lS="never",g1="always",uS="observed";function cS(t){t.isolateGlobalState===!0&&$9();var e=t.useProxies,r=t.enforceActions;if(e!==void 0&&(Lt.useProxies=e===g1?!0:e===lS?!1:typeof Proxy<"u"),e==="ifavailable"&&(Lt.verifyProxies=!0),r!==void 0){var n=r===g1?g1:r===uS;Lt.enforceActions=n,Lt.allowStateChanges=!(n===!0||n===g1)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in t&&(Lt[i]=!!t[i])}),Lt.allowStateReads=!Lt.observableRequiresReaction,t.reactionScheduler&&Z9(t.reactionScheduler)}function fS(t,e,r,n){var i=Vx(e);return gh(function(){var a=wd(t,n)[gr];T0(i).forEach(function(o){a.extend_(o,i[o],r&&o in r?r[o]:!0)})}),t}function hS(t,e){return T6(hd(t,e))}function T6(t){var e={name:t.name_};return t.observing_&&t.observing_.length>0&&(e.dependencies=dS(t.observing_).map(T6)),e}function dS(t){return Array.from(new Set(t))}var pS=0;function R6(){this.message="FLOW_CANCELLED"}R6.prototype=Object.create(Error.prototype);var Tg=o6("flow"),gS=o6("flow.bound",{bound:!0}),fd=Object.assign(function(e,r){if(Op(r))return Tg.decorate_20223_(e,r);if(ah(r))return Pp(e,r,Tg);var n=e,i=n.name||"<unnamed flow>",a=function(){var s=this,u=arguments,h=++pS,f=Qr(i+" - runid: "+h+" - init",n).apply(s,u),g,v=void 0,p=new Promise(function(y,_){var x=0;g=_;function b(S){v=void 0;var k;try{k=Qr(i+" - runid: "+h+" - yield "+x++,f.next).call(f,S)}catch(I){return _(I)}A(k)}function E(S){v=void 0;var k;try{k=Qr(i+" - runid: "+h+" - yield "+x++,f.throw).call(f,S)}catch(I){return _(I)}A(k)}function A(S){if(ol(S?.then)){S.then(A,_);return}return S.done?y(S.value):(v=Promise.resolve(S.value),v.then(b,E))}b(void 0)});return p.cancel=Qr(i+" - runid: "+h+" - cancel",function(){try{v&&f5(v);var y=f.return(void 0),_=Promise.resolve(y.value);_.then(ed,ed),f5(_),g(new R6)}catch(x){g(x)}}),p};return a.isMobXFlow=!0,a},Tg);fd.bound=ju(gS);function f5(t){ol(t.cancel)&&t.cancel()}function gp(t){return t?.isMobXFlow===!0}function M6(t,e,r){var n;return Nl(t)||Hu(t)||U9(t)?n=qu(t):iu(t)&&(n=qu(t,e)),n.dehancer=typeof e=="function"?e:r,function(){n.dehancer=void 0}}function zm(t,e,r){return ol(r)?mS(t,e,r):vS(t,e)}function vS(t,e){return qu(t).intercept_(e)}function mS(t,e,r){return qu(t,e).intercept_(r)}function yS(t,e){return t?iu(t)||!!t[gr]||Dm(t)||c0(t)||D0(t):!1}function I6(t){return yS(t)}function f0(t){if(iu(t))return t[gr].keys_();if(Nl(t)||rs(t))return Array.from(t.keys());if(Hu(t))return t.map(function(e,r){return r});Dr(5)}function j6(t){if(iu(t))return f0(t).map(function(e){return t[e]});if(Nl(t))return f0(t).map(function(e){return t.get(e)});if(rs(t))return Array.from(t.values());if(Hu(t))return t.slice();Dr(6)}function bS(t){if(iu(t))return f0(t).map(function(e){return[e,t[e]]});if(Nl(t))return f0(t).map(function(e){return[e,t.get(e)]});if(rs(t))return Array.from(t.entries());if(Hu(t))return t.map(function(e,r){return[r,e]});Dr(7)}function D6(t,e,r){if(arguments.length===2&&!rs(t)){Ts();var n=e;try{for(var i in n)D6(t,i,n[i])}finally{Rs()}return}iu(t)?t[gr].set_(e,r):Nl(t)?t.set(e,r):rs(t)?t.add(e):Hu(t)?(typeof e!="number"&&(e=parseInt(e,10)),e<0&&Dr("Invalid index: '"+e+"'"),Ts(),e>=t.length&&(t.length=e+1),t[e]=r,Rs()):Dr(8)}function F6(t,e,r){if(iu(t))return t[gr].defineProperty_(e,r);Dr(39)}function qm(t,e,r,n){return ol(r)?_S(t,e,r,n):wS(t,e,r)}function wS(t,e,r){return qu(t).observe_(e,r)}function _S(t,e,r,n){return qu(t,e).observe_(r,n)}function pc(t,e){e===void 0&&(e=void 0),Ts();try{return t.apply(e)}finally{Rs()}}function h5(t,e,r){return arguments.length===1||e&&typeof e=="object"?xS(t,e):B6(t,e,{})}function B6(t,e,r){var n;if(typeof r.timeout=="number"){var i=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!o[gr].isDisposed)if(o(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=yf("When-effect",e),o=zu(function(s){var u=p6(!1,t);u&&(s.dispose(),n&&clearTimeout(n),a())},r);return o}function xS(t,e){var r;if(e!=null&&(r=e.signal)!=null&&r.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,i,a=new Promise(function(o,s){var u,h=B6(t,o,mf({},e,{onError:s}));n=function(){h(),s(new Error("WHEN_CANCELLED"))},i=function(){h(),s(new Error("WHEN_ABORTED"))},e==null||(u=e.signal)==null||u.addEventListener==null||u.addEventListener("abort",i)}).finally(function(){var o;return e==null||(o=e.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",i)});return a.cancel=n,a}function Uh(t){return t[gr]}var SS={has:function(e,r){return Uh(e).has_(r)},get:function(e,r){return Uh(e).get_(r)},set:function(e,r,n){var i;return ah(r)?(i=Uh(e).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(e,r){var n;return ah(r)?(n=Uh(e).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(e,r,n){var i;return(i=Uh(e).defineProperty_(r,n))!=null?i:!0},ownKeys:function(e){return Uh(e).ownKeys_()},preventExtensions:function(e){Dr(13)}};function ES(t,e){var r,n;return Qw(),t=wd(t,e),(n=(r=t[gr]).proxy_)!=null?n:r.proxy_=new Proxy(t,SS)}function Al(t){return t.interceptors_!==void 0&&t.interceptors_.length>0}function Lp(t,e){var r=t.interceptors_||(t.interceptors_=[]);return r.push(e),Jw(function(){var n=r.indexOf(e);n!==-1&&r.splice(n,1)})}function Pl(t,e){var r=ph();try{for(var n=[].concat(t.interceptors_||[]),i=0,a=n.length;i<a&&(e=n[i](e),e&&!e.type&&Dr(14),!!e);i++);return e}finally{vc(r)}}function Jl(t){return t.changeListeners_!==void 0&&t.changeListeners_.length>0}function Np(t,e){var r=t.changeListeners_||(t.changeListeners_=[]);return r.push(e),Jw(function(){var n=r.indexOf(e);n!==-1&&r.splice(n,1)})}function eu(t,e){var r=ph(),n=t.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](e);vc(r)}}function z6(t,e,r){return gh(function(){var n,i=wd(t,r)[gr];(n=e)!=null||(e=Qx(t)),T0(e).forEach(function(a){return i.make_(a,e[a])})}),t}var d5="splice",Du="update",kS=1e4,AS={get:function(e,r){var n=e[gr];return r===gr?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):gc(h0,r)?h0[r]:e[r]},set:function(e,r,n){var i=e[gr];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?e[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){Dr(15)}},Um=function(){function t(r,n,i,a){r===void 0&&(r="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=a,this.atom_=new Sf(r),this.enhancer_=function(o,s){return n(o,s,"ObservableArray[..]")}}var e=t.prototype;return e.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},e.intercept_=function(n){return Lp(this,n)},e.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Np(this,n)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&Dr("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var a=new Array(n-i),o=0;o<n-i;o++)a[o]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(n,i-n)},e.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&Dr(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&W6(n+i+1)},e.spliceWithArray_=function(n,i,a){var o=this;this.atom_;var s=this.values_.length;if(n===void 0?n=0:n>s?n=s:n<0&&(n=Math.max(0,s+n)),arguments.length===1?i=s-n:i==null?i=0:i=Math.max(0,Math.min(i,s-n)),a===void 0&&(a=$v),Al(this)){var u=Pl(this,{object:this.proxy_,type:d5,index:n,removedCount:i,added:a});if(!u)return $v;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(g){return o.enhancer_(g,void 0)}),this.legacyMode_){var h=a.length-i;this.updateArrayLength_(s,h)}var f=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,f),this.dehanceValues_(f)},e.spliceItemsIntoValues_=function(n,i,a){if(a.length<kS){var o;return(o=this.values_).splice.apply(o,[n,i].concat(a))}else{var s=this.values_.slice(n,n+i),u=this.values_.slice(n+i);this.values_.length+=a.length-i;for(var h=0;h<a.length;h++)this.values_[n+h]=a[h];for(var f=0;f<u.length;f++)this.values_[n+a.length+f]=u[f];return s}},e.notifyArrayChildUpdate_=function(n,i,a){var o=!this.owned_&&tp(),s=Jl(this),u=s||o?{observableKind:"array",object:this.proxy_,type:Du,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),s&&eu(this,u)},e.notifyArraySplice_=function(n,i,a){var o=!this.owned_&&tp(),s=Jl(this),u=s||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:d5,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),s&&eu(this,u)},e.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx] Out of bounds read: "+n);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},e.set_=function(n,i){var a=this.values_;if(this.legacyMode_&&n>a.length&&Dr(17,n,a.length),n<a.length){this.atom_;var o=a[n];if(Al(this)){var s=Pl(this,{type:Du,object:this.proxy_,index:n,newValue:i});if(!s)return;i=s.newValue}i=this.enhancer_(i,o);var u=i!==o;u&&(a[n]=i,this.notifyArrayChildUpdate_(n,i,o))}else{for(var h=new Array(n+1-a.length),f=0;f<h.length-1;f++)h[f]=void 0;h[h.length-1]=i,this.spliceWithArray_(a.length,0,h)}},t}();function PS(t,e,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),Qw(),gh(function(){var i=new Um(r,e,n,!1);t6(i.values_,gr,i);var a=new Proxy(i.values_,AS);return i.proxy_=a,t&&t.length&&i.spliceWithArray_(0,0,t),a})}var h0={clear:function(){return this.splice(0)},replace:function(e){var r=this[gr];return r.spliceWithArray_(0,r.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];var o=this[gr];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(e);case 2:return o.spliceWithArray_(e,r)}return o.spliceWithArray_(e,r,i)},spliceWithArray:function(e,r,n){return this[gr].spliceWithArray_(e,r,n)},push:function(){for(var e=this[gr],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.spliceWithArray_(e.values_.length,0,n),e.values_.length},pop:function(){return this.splice(Math.max(this[gr].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[gr],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.spliceWithArray_(0,0,n),e.values_.length},reverse:function(){return Lt.trackingDerivation&&Dr(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Lt.trackingDerivation&&Dr(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var r=this[gr],n=r.dehanceValues_(r.values_).indexOf(e);return n>-1?(this.splice(n,1),!0):!1}};ii("at",sl);ii("concat",sl);ii("flat",sl);ii("includes",sl);ii("indexOf",sl);ii("join",sl);ii("lastIndexOf",sl);ii("slice",sl);ii("toString",sl);ii("toLocaleString",sl);ii("toSorted",sl);ii("toSpliced",sl);ii("with",sl);ii("every",nu);ii("filter",nu);ii("find",nu);ii("findIndex",nu);ii("findLast",nu);ii("findLastIndex",nu);ii("flatMap",nu);ii("forEach",nu);ii("map",nu);ii("some",nu);ii("toReversed",nu);ii("reduce",q6);ii("reduceRight",q6);function ii(t,e){typeof Array.prototype[t]=="function"&&(h0[t]=e(t))}function sl(t){return function(){var e=this[gr];e.atom_.reportObserved();var r=e.dehanceValues_(e.values_);return r[t].apply(r,arguments)}}function nu(t){return function(e,r){var n=this,i=this[gr];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[t](function(o,s){return e.call(r,o,s,n)})}}function q6(t){return function(){var e=this,r=this[gr];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(a,o,s){return i(a,o,s,e)},n[t].apply(n,arguments)}}var OS=xf("ObservableArrayAdministration",Um);function Hu(t){return L0(t)&&OS(t[gr])}var CS={},ff="add",d0="delete",Hm=function(){function t(r,n,i){var a=this;n===void 0&&(n=oh),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[gr]=CS,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,ol(Map)||Dr(18),gh(function(){a.keysAtom_=o0("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,r&&a.merge(r)})}var e=t.prototype;return e.has_=function(n){return this.data_.has(n)},e.has=function(n){var i=this;if(!Lt.trackingDerivation)return this.has_(n);var a=this.hasMap_.get(n);if(!a){var o=a=new gf(this.has_(n),R0,"ObservableMap.key?",!1);this.hasMap_.set(n,o),L6(o,function(){return i.hasMap_.delete(n)})}return a.get()},e.set=function(n,i){var a=this.has_(n);if(Al(this)){var o=Pl(this,{type:a?Du:ff,object:this,newValue:i,name:n});if(!o)return this;i=o.newValue}return a?this.updateValue_(n,i):this.addValue_(n,i),this},e.delete=function(n){var i=this;if(this.keysAtom_,Al(this)){var a=Pl(this,{type:d0,object:this,name:n});if(!a)return!1}if(this.has_(n)){var o=tp(),s=Jl(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:d0,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return pc(function(){var h;i.keysAtom_.reportChanged(),(h=i.hasMap_.get(n))==null||h.setNewValue_(!1);var f=i.data_.get(n);f.setNewValue_(void 0),i.data_.delete(n)}),s&&eu(this,u),!0}return!1},e.updateValue_=function(n,i){var a=this.data_.get(n);if(i=a.prepareNewValue_(i),i!==Lt.UNCHANGED){var o=tp(),s=Jl(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:Du,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),s&&eu(this,u)}},e.addValue_=function(n,i){var a=this;this.keysAtom_,pc(function(){var h,f=new gf(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,f),i=f.value_,(h=a.hasMap_.get(n))==null||h.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=tp(),s=Jl(this),u=s||o?{observableKind:"map",debugObjectName:this.name_,type:ff,object:this,name:n,newValue:i}:null;s&&eu(this,u)},e.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var n=this,i=this.keys();return p5({next:function(){var o=i.next(),s=o.done,u=o.value;return{done:s,value:s?void 0:n.get(u)}}})},e.entries=function(){var n=this,i=this.keys();return p5({next:function(){var o=i.next(),s=o.done,u=o.value;return{done:s,value:s?void 0:[u,n.get(u)]}}})},e[Symbol.iterator]=function(){return this.entries()},e.forEach=function(n,i){for(var a=td(this),o;!(o=a()).done;){var s=o.value,u=s[0],h=s[1];n.call(i,h,u,this)}},e.merge=function(n){var i=this;return Nl(n)&&(n=new Map(n)),pc(function(){vf(n)?Wx(n).forEach(function(a){return i.set(a,n[a])}):Array.isArray(n)?n.forEach(function(a){var o=a[0],s=a[1];return i.set(o,s)}):yd(n)?(Gx(n)||Dr(19,n),n.forEach(function(a,o){return i.set(o,a)})):n!=null&&Dr(20,n)}),this},e.clear=function(){var n=this;pc(function(){v6(function(){for(var i=td(n.keys()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},e.replace=function(n){var i=this;return pc(function(){for(var a=LS(n),o=new Map,s=!1,u=td(i.data_.keys()),h;!(h=u()).done;){var f=h.value;if(!a.has(f)){var g=i.delete(f);if(g)s=!0;else{var v=i.data_.get(f);o.set(f,v)}}}for(var p=td(a.entries()),y;!(y=p()).done;){var _=y.value,x=_[0],b=_[1],E=i.data_.has(x);if(i.set(x,b),i.data_.has(x)){var A=i.data_.get(x);o.set(x,A),E||(s=!0)}}if(!s)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var S=i.data_.keys(),k=o.keys(),I=S.next(),O=k.next();!I.done;){if(I.value!==O.value){i.keysAtom_.reportChanged();break}I=S.next(),O=k.next()}i.data_=o}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(n,i){return Np(this,n)},e.intercept_=function(n){return Lp(this,n)},bd(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Nl=xf("ObservableMap",Hm);function p5(t){return t[Symbol.toStringTag]="MapIterator",Gm(t)}function LS(t){if(yd(t)||Nl(t))return t;if(Array.isArray(t))return new Map(t);if(vf(t)){var e=new Map;for(var r in t)e.set(r,t[r]);return e}else return Dr(21,t)}var NS={},U6=function(){function t(r,n,i){var a=this;n===void 0&&(n=oh),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[gr]=NS,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,ol(Set)||Dr(22),this.enhancer_=function(o,s){return n(o,s,i)},gh(function(){a.atom_=o0(a.name_),r&&a.replace(r)})}var e=t.prototype;return e.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},e.clear=function(){var n=this;pc(function(){v6(function(){for(var i=td(n.data_.values()),a;!(a=i()).done;){var o=a.value;n.delete(o)}})})},e.forEach=function(n,i){for(var a=td(this),o;!(o=a()).done;){var s=o.value;n.call(i,s,s,this)}},e.add=function(n){var i=this;if(this.atom_,Al(this)){var a=Pl(this,{type:ff,object:this,newValue:n});if(!a)return this;n=a.newValue}if(!this.has(n)){pc(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=!1,s=Jl(this),u=s||o?{observableKind:"set",debugObjectName:this.name_,type:ff,object:this,newValue:n}:null;s&&eu(this,u)}return this},e.delete=function(n){var i=this;if(Al(this)){var a=Pl(this,{type:d0,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var o=!1,s=Jl(this),u=s||o?{observableKind:"set",debugObjectName:this.name_,type:d0,object:this,oldValue:n}:null;return pc(function(){i.atom_.reportChanged(),i.data_.delete(n)}),s&&eu(this,u),!0}return!1},e.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},e.entries=function(){var n=this.values();return g5({next:function(){var a=n.next(),o=a.value,s=a.done;return s?{value:void 0,done:s}:{value:[o,o],done:s}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var n=this,i=this.data_.values();return g5({next:function(){var o=i.next(),s=o.value,u=o.done;return u?{value:void 0,done:u}:{value:n.dehanceValue_(s),done:u}}})},e.intersection=function(n){if(hc(n)&&!rs(n))return n.intersection(this);var i=new Set(this);return i.intersection(n)},e.union=function(n){if(hc(n)&&!rs(n))return n.union(this);var i=new Set(this);return i.union(n)},e.difference=function(n){return new Set(this).difference(n)},e.symmetricDifference=function(n){if(hc(n)&&!rs(n))return n.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(n)},e.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},e.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},e.isDisjointFrom=function(n){if(hc(n)&&!rs(n))return n.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(n)},e.replace=function(n){var i=this;return rs(n)&&(n=new Set(n)),pc(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):hc(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&Dr("Cannot initialize set from "+n)}),this},e.observe_=function(n,i){return Np(this,n)},e.intercept_=function(n){return Lp(this,n)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[Symbol.iterator]=function(){return this.values()},bd(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),rs=xf("ObservableSet",U6);function g5(t){return t[Symbol.toStringTag]="SetIterator",Gm(t)}var v5=Object.create(null),m5="remove",H6=function(){function t(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=x9),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 Sf("ObservableObject.keys"),this.isPlainObject_=vf(this.target_)}var e=t.prototype;return e.getObservablePropValue_=function(n){return this.values_.get(n).get()},e.setObservablePropValue_=function(n,i){var a=this.values_.get(n);if(a instanceof tu)return a.set(i),!0;if(Al(this)){var o=Pl(this,{type:Du,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Lt.UNCHANGED){var s=Jl(this),u=!1,h=s||u?{type:Du,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),s&&eu(this,h)}return!0},e.get_=function(n){return Lt.trackingDerivation&&!gc(this.target_,n)&&this.has_(n),this.target_[n]},e.set_=function(n,i,a){return a===void 0&&(a=!1),gc(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):a?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},e.has_=function(n){if(!Lt.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new gf(n in this.target_,R0,"ObservableObject.key?",!1),this.pendingKeys_.set(n,i)),i.get()},e.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(n in this.target_)){var a;if((a=this.target_[Nu])!=null&&a[n])return;Dr(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==C0;){var s=a0(o,n);if(s){var u=i.make_(this,n,s,o);if(u===0)return;if(u===1)break}o=Object.getPrototypeOf(o)}b5(this,i,n)}},e.extend_=function(n,i,a,o){if(o===void 0&&(o=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(n,i,o);var s=a.extend_(this,n,i,o);return s&&b5(this,a,n),s},e.defineProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{Ts();var o=this.delete_(n);if(!o)return o;if(Al(this)){var s=Pl(this,{object:this.proxy_||this.target_,name:n,type:ff,newValue:i.value});if(!s)return null;var u=s.newValue;i.value!==u&&(i=mf({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Iu(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{Rs()}return!0},e.defineObservableProperty_=function(n,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{Ts();var s=this.delete_(n);if(!s)return s;if(Al(this)){var u=Pl(this,{object:this.proxy_||this.target_,name:n,type:ff,newValue:i});if(!u)return null;i=u.newValue}var h=y5(n),f={configurable:Lt.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:h.get,set:h.set};if(o){if(!Reflect.defineProperty(this.target_,n,f))return!1}else Iu(this.target_,n,f);var g=new gf(i,a,"ObservableObject.key",!1);this.values_.set(n,g),this.notifyPropertyAddition_(n,g.value_)}finally{Rs()}return!0},e.defineComputedProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{Ts();var o=this.delete_(n);if(!o)return o;if(Al(this)){var s=Pl(this,{object:this.proxy_||this.target_,name:n,type:ff,newValue:void 0});if(!s)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=y5(n),h={configurable:Lt.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,n,h))return!1}else Iu(this.target_,n,h);this.values_.set(n,new tu(i)),this.notifyPropertyAddition_(n,void 0)}finally{Rs()}return!0},e.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!gc(this.target_,n))return!0;if(Al(this)){var a=Pl(this,{object:this.proxy_||this.target_,name:n,type:m5});if(!a)return null}try{var o;Ts();var s=Jl(this),u=!1,h=this.values_.get(n),f=void 0;if(!h&&(s||u)){var g;f=(g=a0(this.target_,n))==null?void 0:g.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(h&&(this.values_.delete(n),h instanceof gf&&(f=h.value_),x6(h)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(n in this.target_),s||u){var v={type:m5,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:f,name:n};s&&eu(this,v)}}finally{Rs()}return!0},e.observe_=function(n,i){return Np(this,n)},e.intercept_=function(n){return Lp(this,n)},e.notifyPropertyAddition_=function(n,i){var a,o=Jl(this),s=!1;if(o||s){var u=o||s?{type:ff,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;o&&eu(this,u)}(a=this.pendingKeys_)==null||(a=a.get(n))==null||a.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),T0(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t}();function wd(t,e){var r;if(gc(t,gr))return t;var n=(r=e?.name)!=null?r:"ObservableObject",i=new H6(t,new Map,String(n),R9(e));return N0(t,gr,i),t}var TS=xf("ObservableObjectAdministration",H6);function y5(t){return v5[t]||(v5[t]={get:function(){return this[gr].getObservablePropValue_(t)},set:function(r){return this[gr].setObservablePropValue_(t,r)}})}function iu(t){return L0(t)?TS(t[gr]):!1}function b5(t,e,r){var n;(n=t.target_[Nu])==null||delete n[r]}var RS=G6(0),MS=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,t===!1}(),Rg=0,$6=function(){};function IS(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t.prototype,e):t.prototype.__proto__!==void 0?t.prototype.__proto__=e:t.prototype=e}IS($6,Array.prototype);var $m=function(t){function e(n,i,a,o){var s;return a===void 0&&(a="ObservableArray"),o===void 0&&(o=!1),s=t.call(this)||this,gh(function(){var u=new Um(a,i,o,!0);u.proxy_=s,t6(s,gr,u),n&&n.length&&s.spliceWithArray(0,0,n),MS&&Object.defineProperty(s,"0",RS)}),s}i6(e,t);var r=e.prototype;return r.concat=function(){this[gr].atom_.reportObserved();for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),a.map(function(s){return Hu(s)?s.slice():s}))},r[Symbol.iterator]=function(){var n=this,i=0;return Gm({next:function(){return i<n.length?{value:n[i++],done:!1}:{done:!0,value:void 0}}})},bd(e,[{key:"length",get:function(){return this[gr].getArrayLength_()},set:function(i){this[gr].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}($6);Object.entries(h0).forEach(function(t){var e=t[0],r=t[1];e!=="concat"&&N0($m.prototype,e,r)});function G6(t){return{enumerable:!1,configurable:!0,get:function(){return this[gr].get_(t)},set:function(r){this[gr].set_(t,r)}}}function jS(t){Iu($m.prototype,""+t,G6(t))}function W6(t){if(t>Rg){for(var e=Rg;e<t+100;e++)jS(e);Rg=t}}W6(1e3);function DS(t,e,r){return new $m(t,e,r)}function hd(t,e){if(typeof t=="object"&&t!==null){if(Hu(t))return e!==void 0&&Dr(23),t[gr].atom_;if(rs(t))return t.atom_;if(Nl(t)){if(e===void 0)return t.keysAtom_;var r=t.data_.get(e)||t.hasMap_.get(e);return r||Dr(25,e,Jv(t)),r}if(iu(t)){if(!e)return Dr(26);var n=t[gr].values_.get(e);return n||Dr(27,e,Jv(t)),n}if(Dm(t)||D0(t)||c0(t))return t}else if(ol(t)&&c0(t[gr]))return t[gr];Dr(28)}function qu(t,e){if(t||Dr(29),e!==void 0)return qu(hd(t,e));if(Dm(t)||D0(t)||c0(t)||Nl(t)||rs(t))return t;if(t[gr])return t[gr];Dr(24,t)}function Jv(t,e){var r;if(e!==void 0)r=hd(t,e);else{if(pp(t))return t.name;iu(t)||Nl(t)||rs(t)?r=qu(t):r=hd(t)}return r.name_}function gh(t){var e=ph(),r=I0(!0);Ts();try{return t()}finally{Rs(),j0(r),vc(e)}}var w5=C0.toString;function V6(t,e,r){return r===void 0&&(r=-1),em(t,e,r)}function em(t,e,r,n,i){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var a=typeof t;if(a!=="function"&&a!=="object"&&typeof e!="object")return!1;var o=w5.call(t);if(o!==w5.call(e))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":r>=0&&r++;break}t=_5(t),e=_5(e);var s=o==="[object Array]";if(!s){if(typeof t!="object"||typeof e!="object")return!1;var u=t.constructor,h=e.constructor;if(u!==h&&!(ol(u)&&u instanceof u&&ol(h)&&h instanceof h)&&"constructor"in t&&"constructor"in e)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var f=n.length;f--;)if(n[f]===t)return i[f]===e;if(n.push(t),i.push(e),s){if(f=t.length,f!==e.length)return!1;for(;f--;)if(!em(t[f],e[f],r-1,n,i))return!1}else{var g=Object.keys(t),v=g.length;if(Object.keys(e).length!==v)return!1;for(var p=0;p<v;p++){var y=g[p];if(!(gc(e,y)&&em(t[y],e[y],r-1,n,i)))return!1}}return n.pop(),i.pop(),!0}function _5(t){return Hu(t)?t.slice():yd(t)||Nl(t)||hc(t)||rs(t)?Array.from(t.entries()):t}var x5,FS=((x5=O0().Iterator)==null?void 0:x5.prototype)||{};function Gm(t){return t[Symbol.iterator]=BS,Object.assign(Object.create(FS),t)}function BS(){return this}["Symbol","Map","Set"].forEach(function(t){var e=O0();typeof e[t]>"u"&&Dr("MobX requires global '"+t+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Q9,extras:{getDebugName:Jv},$mobx:gr});if(!ji.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!z6)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var Y6=Xw();function zS(t){t()}function qS(t){t||(t=zS),cS({reactionScheduler:t})}function US(t){return hS(t)}var HS=1e4,$S=1e4,GS=function(){function t(e){var r=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=HS),clearTimeout(r.sweepTimeout),r.sweepTimeout=void 0;var i=Date.now();r.registrations.forEach(function(a,o){i-a.registeredAt>=n&&(r.finalize(a.value),r.registrations.delete(o))}),r.registrations.size>0&&r.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){r.sweep(0)}})}return Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,n){this.registrations.set(n,{value:r,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(t.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,$S))}}),t}(),WS=typeof FinalizationRegistry<"u"?FinalizationRegistry:GS,tm=new WS(function(t){var e;(e=t.reaction)===null||e===void 0||e.dispose(),t.reaction=null}),Mg={exports:{}},Ig={};/**
|
|
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 S5;function VS(){if(S5)return Ig;S5=1;var t=Ap();function e(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var r=typeof Object.is=="function"?Object.is:e,n=t.useState,i=t.useEffect,a=t.useLayoutEffect,o=t.useDebugValue;function s(g,v){var p=v(),y=n({inst:{value:p,getSnapshot:v}}),_=y[0].inst,x=y[1];return a(function(){_.value=p,_.getSnapshot=v,u(_)&&x({inst:_})},[g,p,v]),i(function(){return u(_)&&x({inst:_}),g(function(){u(_)&&x({inst:_})})},[g]),o(p),p}function u(g){var v=g.getSnapshot;g=g.value;try{var p=v();return!r(g,p)}catch{return!0}}function h(g,v){return v()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:s;return Ig.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:f,Ig}var E5;function YS(){return E5||(E5=1,Mg.exports=VS()),Mg.exports}var XS=YS();function k5(t){t.reaction=new Bu("observer".concat(t.name),function(){var e;t.stateVersion=Symbol(),(e=t.onStoreChange)===null||e===void 0||e.call(t)})}function KS(t,e){e===void 0&&(e="observed");var r=se.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:e,subscribe:function(s){return tm.unregister(n),n.onStoreChange=s,n.reaction||(k5(n),n.stateVersion=Symbol()),function(){var u;n.onStoreChange=null,(u=n.reaction)===null||u===void 0||u.dispose(),n.reaction=null}},getSnapshot:function(){return n.stateVersion}};r.current=n}var i=r.current;i.reaction||(k5(i),tm.register(r,i,i)),se.useDebugValue(i.reaction,US),XS.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var a,o;if(i.reaction.track(function(){try{a=t()}catch(s){o=s}}),o)throw o;return a}var jg,Dg,X6=typeof Symbol=="function"&&Symbol.for,ZS=(Dg=(jg=Object.getOwnPropertyDescriptor(function(){},"name"))===null||jg===void 0?void 0:jg.configurable)!==null&&Dg!==void 0?Dg:!1,A5=X6?Symbol.for("react.forward_ref"):typeof ji.forwardRef=="function"&&ji.forwardRef(function(t){return null}).$$typeof,P5=X6?Symbol.for("react.memo"):typeof ji.memo=="function"&&ji.memo(function(t){return null}).$$typeof;function ni(t,e){var r;if(P5&&t.$$typeof===P5)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");var n=(r=void 0)!==null&&r!==void 0?r:!1,i=t,a=t.displayName||t.name;if(A5&&t.$$typeof===A5&&(n=!0,i=t.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var o=function(s,u){return KS(function(){return i(s,u)},a)};return o.displayName=t.displayName,ZS&&Object.defineProperty(o,"name",{value:t.name,writable:!0,configurable:!0}),t.contextTypes&&(o.contextTypes=t.contextTypes),n&&(o=ji.forwardRef(o)),o=ji.memo(o),JS(t,o),o}var QS={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function JS(t,e){Object.keys(t).forEach(function(r){QS[r]||Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}function eE(t,e){return ji.useState(function(){return Xr(t(),e,{autoBind:!0})})[0]}var Fg;qS(Y6.unstable_batchedUpdates);Fg=tm.finalizeAllImmediately;const tE=Math.PI/180;function rE(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Zf=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},Ot={_global:Zf,version:"10.0.2",isBrowser:rE(),isUnminified:/param/.test((function(t){}).toString()),dblClickWindow:400,getAngle(t){return Ot.angleDeg?t*tE:t},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return Ot.DD.isDragging},isTransforming(){var t,e;return(e=(t=Ot.Transformer)===null||t===void 0?void 0:t.isTransforming())!==null&&e!==void 0?e:!1},isDragReady(){return!!Ot.DD.node},releaseCanvasOnDestroy:!0,document:Zf.document,_injectGlobal(t){typeof Zf.Konva<"u"&&console.error("Severa Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),Zf.Konva=t}},Fi=t=>{Ot[t.prototype.getClassName()]=t};Ot._injectGlobal(Ot);const nE=`Konva.js unsupported environment.
|
|
43
|
-
|
|
44
|
-
Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
|
|
45
|
-
|
|
46
|
-
To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
|
|
47
|
-
|
|
48
|
-
bash: npm install canvas
|
|
49
|
-
js: import "konva/canvas-backend";
|
|
50
|
-
|
|
51
|
-
or
|
|
52
|
-
|
|
53
|
-
bash: npm install skia-canvas
|
|
54
|
-
js: import "konva/skia-backend";
|
|
55
|
-
`,O5=()=>{if(typeof document>"u")throw new Error(nE)};class nl{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 nl(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){const r=this.m;return{x:r[0]*e.x+r[2]*e.y+r[4],y:r[1]*e.x+r[3]*e.y+r[5]}}translate(e,r){return this.m[4]+=this.m[0]*e+this.m[2]*r,this.m[5]+=this.m[1]*e+this.m[3]*r,this}scale(e,r){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=r,this.m[3]*=r,this}rotate(e){const r=Math.cos(e),n=Math.sin(e),i=this.m[0]*r+this.m[2]*n,a=this.m[1]*r+this.m[3]*n,o=this.m[0]*-n+this.m[2]*r,s=this.m[1]*-n+this.m[3]*r;return this.m[0]=i,this.m[1]=a,this.m[2]=o,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,r){const n=this.m[0]+this.m[2]*r,i=this.m[1]+this.m[3]*r,a=this.m[2]+this.m[0]*e,o=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=i,this.m[2]=a,this.m[3]=o,this}multiply(e){const r=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],i=this.m[0]*e.m[2]+this.m[2]*e.m[3],a=this.m[1]*e.m[2]+this.m[3]*e.m[3],o=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],s=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=r,this.m[1]=n,this.m[2]=i,this.m[3]=a,this.m[4]=o,this.m[5]=s,this}invert(){const e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),r=this.m[3]*e,n=-this.m[1]*e,i=-this.m[2]*e,a=this.m[0]*e,o=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=r,this.m[1]=n,this.m[2]=i,this.m[3]=a,this.m[4]=o,this.m[5]=s,this}getMatrix(){return this.m}decompose(){const e=this.m[0],r=this.m[1],n=this.m[2],i=this.m[3],a=this.m[4],o=this.m[5],s=e*i-r*n,u={x:a,y:o,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||r!=0){const h=Math.sqrt(e*e+r*r);u.rotation=r>0?Math.acos(e/h):-Math.acos(e/h),u.scaleX=h,u.scaleY=s/h,u.skewX=(e*n+r*i)/s,u.skewY=0}else if(n!=0||i!=0){const h=Math.sqrt(n*n+i*i);u.rotation=Math.PI/2-(i>0?Math.acos(-n/h):-Math.acos(n/h)),u.scaleX=s/h,u.scaleY=h,u.skewX=0,u.skewY=(e*n+r*i)/s}return u.rotation=Ze._getRotation(u.rotation),u}}const iE="[object Array]",aE="[object Number]",oE="[object String]",sE="[object Boolean]",lE=Math.PI/180,uE=180/Math.PI,Bg="#",cE="",fE="0",hE="Konva warning: ",C5="Konva error: ",dE="rgb(",zg={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]},pE=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let v1=[];const gE=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(t){setTimeout(t,60)},Ze={_isElement(t){return!!(t&&t.nodeType==1)},_isFunction(t){return!!(t&&t.constructor&&t.call&&t.apply)},_isPlainObject(t){return!!t&&t.constructor===Object},_isArray(t){return Object.prototype.toString.call(t)===iE},_isNumber(t){return Object.prototype.toString.call(t)===aE&&!isNaN(t)&&isFinite(t)},_isString(t){return Object.prototype.toString.call(t)===oE},_isBoolean(t){return Object.prototype.toString.call(t)===sE},isObject(t){return t instanceof Object},isValidSelector(t){if(typeof t!="string")return!1;const e=t[0];return e==="#"||e==="."||e===e.toUpperCase()},_sign(t){return t===0||t>0?1:-1},requestAnimFrame(t){v1.push(t),v1.length===1&&gE(function(){const e=v1;v1=[],e.forEach(function(r){r()})})},createCanvasElement(){O5();const t=document.createElement("canvas");try{t.style=t.style||{}}catch{}return t},createImageElement(){return O5(),document.createElement("img")},_isInDocument(t){for(;t=t.parentNode;)if(t==document)return!0;return!1},_urlToImage(t,e){const r=Ze.createImageElement();r.onload=function(){e(r)},r.src=t},_rgbToHex(t,e,r){return((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1)},_hexToRgb(t){t=t.replace(Bg,cE);const e=parseInt(t,16);return{r:e>>16&255,g:e>>8&255,b:e&255}},getRandomColor(){let t=(Math.random()*16777215<<0).toString(16);for(;t.length<6;)t=fE+t;return Bg+t},getRGB(t){let e;return t in zg?(e=zg[t],{r:e[0],g:e[1],b:e[2]}):t[0]===Bg?this._hexToRgb(t.substring(1)):t.substr(0,4)===dE?(e=pE.exec(t.replace(/ /g,"")),{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}):{r:0,g:0,b:0}},colorToRGBA(t){return t=t||"black",Ze._namedColorToRBA(t)||Ze._hex3ColorToRGBA(t)||Ze._hex4ColorToRGBA(t)||Ze._hex6ColorToRGBA(t)||Ze._hex8ColorToRGBA(t)||Ze._rgbColorToRGBA(t)||Ze._rgbaColorToRGBA(t)||Ze._hslColorToRGBA(t)},_namedColorToRBA(t){const e=zg[t.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA(t){if(t.indexOf("rgb(")===0){t=t.match(/rgb\(([^)]+)\)/)[1];const e=t.split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA(t){if(t.indexOf("rgba(")===0){t=t.match(/rgba\(([^)]+)\)/)[1];const e=t.split(/ *, */).map((r,n)=>r.slice(-1)==="%"?n===3?parseInt(r)/100:parseInt(r)/100*255:Number(r));return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex8ColorToRGBA(t){if(t[0]==="#"&&t.length===9)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:parseInt(t.slice(7,9),16)/255}},_hex6ColorToRGBA(t){if(t[0]==="#"&&t.length===7)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:1}},_hex4ColorToRGBA(t){if(t[0]==="#"&&t.length===5)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:parseInt(t[4]+t[4],16)/255}},_hex3ColorToRGBA(t){if(t[0]==="#"&&t.length===4)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:1}},_hslColorToRGBA(t){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(t)){const[e,...r]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t),n=Number(r[0])/360,i=Number(r[1])/100,a=Number(r[2])/100;let o,s,u;if(i===0)return u=a*255,{r:Math.round(u),g:Math.round(u),b:Math.round(u),a:1};a<.5?o=a*(1+i):o=a+i-a*i;const h=2*a-o,f=[0,0,0];for(let g=0;g<3;g++)s=n+1/3*-(g-1),s<0&&s++,s>1&&s--,6*s<1?u=h+(o-h)*6*s:2*s<1?u=o:3*s<2?u=h+(o-h)*(2/3-s)*6:u=h,f[g]=u*255;return{r:Math.round(f[0]),g:Math.round(f[1]),b:Math.round(f[2]),a:1}}},haveIntersection(t,e){return!(e.x>t.x+t.width||e.x+e.width<t.x||e.y>t.y+t.height||e.y+e.height<t.y)},cloneObject(t){const e={};for(const r in t)this._isPlainObject(t[r])?e[r]=this.cloneObject(t[r]):this._isArray(t[r])?e[r]=this.cloneArray(t[r]):e[r]=t[r];return e},cloneArray(t){return t.slice(0)},degToRad(t){return t*lE},radToDeg(t){return t*uE},_degToRad(t){return Ze.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),Ze.degToRad(t)},_radToDeg(t){return Ze.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),Ze.radToDeg(t)},_getRotation(t){return Ot.angleDeg?Ze.radToDeg(t):t},_capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)},throw(t){throw new Error(C5+t)},error(t){console.error(C5+t)},warn(t){Ot.showWarnings&&console.warn(hE+t)},each(t,e){for(const r in t)e(r,t[r])},_inRange(t,e,r){return e<=t&&t<r},_getProjectionToSegment(t,e,r,n,i,a){let o,s,u;const h=(t-r)*(t-r)+(e-n)*(e-n);if(h==0)o=t,s=e,u=(i-r)*(i-r)+(a-n)*(a-n);else{const f=((i-t)*(r-t)+(a-e)*(n-e))/h;f<0?(o=t,s=e,u=(t-i)*(t-i)+(e-a)*(e-a)):f>1?(o=r,s=n,u=(r-i)*(r-i)+(n-a)*(n-a)):(o=t+f*(r-t),s=e+f*(n-e),u=(o-i)*(o-i)+(s-a)*(s-a))}return[o,s,u]},_getProjectionToLine(t,e,r){const n=Ze.cloneObject(t);let i=Number.MAX_VALUE;return e.forEach(function(a,o){if(!r&&o===e.length-1)return;const s=e[(o+1)%e.length],u=Ze._getProjectionToSegment(a.x,a.y,s.x,s.y,t.x,t.y),h=u[0],f=u[1],g=u[2];g<i&&(n.x=h,n.y=f,i=g)}),n},_prepareArrayForTween(t,e,r){const n=[],i=[];if(t.length>e.length){const o=e;e=t,t=o}for(let o=0;o<t.length;o+=2)n.push({x:t[o],y:t[o+1]});for(let o=0;o<e.length;o+=2)i.push({x:e[o],y:e[o+1]});const a=[];return i.forEach(function(o){const s=Ze._getProjectionToLine(o,n,r);a.push(s.x),a.push(s.y)}),a},_prepareToStringify(t){let e;t.visitedByCircularReferenceRemoval=!0;for(const r in t)if(t.hasOwnProperty(r)&&t[r]&&typeof t[r]=="object"){if(e=Object.getOwnPropertyDescriptor(t,r),t[r].visitedByCircularReferenceRemoval||Ze._isElement(t[r]))if(e.configurable)delete t[r];else return null;else if(Ze._prepareToStringify(t[r])===null)if(e.configurable)delete t[r];else return null}return delete t.visitedByCircularReferenceRemoval,t},_assign(t,e){for(const r in e)t[r]=e[r];return t},_getFirstPointerId(t){return t.touches?t.changedTouches[0].identifier:t.pointerId||999},releaseCanvas(...t){Ot.releaseCanvasOnDestroy&&t.forEach(e=>{e.width=0,e.height=0})},drawRoundedRectPath(t,e,r,n){let i=e<0?e:0,a=r<0?r:0;e=Math.abs(e),r=Math.abs(r);let o=0,s=0,u=0,h=0;typeof n=="number"?o=s=u=h=Math.min(n,e/2,r/2):(o=Math.min(n[0]||0,e/2,r/2),s=Math.min(n[1]||0,e/2,r/2),h=Math.min(n[2]||0,e/2,r/2),u=Math.min(n[3]||0,e/2,r/2)),t.moveTo(i+o,a),t.lineTo(i+e-s,a),t.arc(i+e-s,a+s,s,Math.PI*3/2,0,!1),t.lineTo(i+e,a+r-h),t.arc(i+e-h,a+r-h,h,0,Math.PI/2,!1),t.lineTo(i+u,a+r),t.arc(i+u,a+r-u,u,Math.PI/2,Math.PI,!1),t.lineTo(i,a+o),t.arc(i+o,a+o,o,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(t,e,r,n,i){n=Math.abs(n);for(let a=0;a<r;a++){const o=e[(a-1+r)%r],s=e[a],u=e[(a+1)%r],h={x:s.x-o.x,y:s.y-o.y},f={x:u.x-s.x,y:u.y-s.y},g=Math.hypot(h.x,h.y),v=Math.hypot(f.x,f.y);let p;typeof i=="number"?p=i:p=a<i.length?i[a]:0,p=n*Math.cos(Math.PI/r)*Math.min(1,p/n*2);const _={x:h.x/g,y:h.y/g},x={x:f.x/v,y:f.y/v},b={x:s.x-_.x*p,y:s.y-_.y*p},E={x:s.x+x.x*p,y:s.y+x.y*p};a===0?t.moveTo(b.x,b.y):t.lineTo(b.x,b.y),t.arcTo(s.x,s.y,E.x,E.y,p)}}};function vE(t){const e=[],r=t.length,n=Ze;for(let i=0;i<r;i++){let a=t[i];n._isNumber(a)?a=Math.round(a*1e3)/1e3:n._isString(a)||(a=a+""),e.push(a)}return e}const L5=",",mE="(",yE=")",bE="([",wE="])",_E=";",xE="()",SE="=",N5=["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"],EE=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],kE=100;let m1=null;function T5(){if(m1!==null)return m1;try{const e=Ze.createCanvasElement().getContext("2d");return e?!!e&&"filter"in e:(m1=!1,!1)}catch{return m1=!1,!1}}class F0{constructor(e){this.canvas=e,Ot.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,r){let n=this.traceArr,i=n.length,a="",o,s,u,h;for(o=0;o<i;o++)s=n[o],u=s.method,u?(h=s.args,a+=u,e?a+=xE:Ze._isArray(h[0])?a+=bE+h.join(L5)+wE:(r&&(h=h.map(f=>typeof f=="number"?Math.floor(f):f)),a+=mE+h.join(L5)+yE)):(a+=s.property,e||(a+=SE+s.val)),a+=_E;return a}clearTrace(){this.traceArr=[]}_trace(e){let r=this.traceArr,n;r.push(e),n=r.length,n>=kE&&r.shift()}reset(){const e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){const r=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,r.getWidth()/r.pixelRatio,r.getHeight()/r.pixelRatio)}_applyLineCap(e){const r=e.attrs.lineCap;r&&this.setAttr("lineCap",r)}_applyOpacity(e){const r=e.getAbsoluteOpacity();r!==1&&this.setAttr("globalAlpha",r)}_applyLineJoin(e){const r=e.attrs.lineJoin;r&&this.setAttr("lineJoin",r)}_applyMiterLimit(e){const r=e.attrs.miterLimit;r!=null&&this.setAttr("miterLimit",r)}setAttr(e,r){this._context[e]=r}arc(e,r,n,i,a,o){this._context.arc(e,r,n,i,a,o)}arcTo(e,r,n,i,a){this._context.arcTo(e,r,n,i,a)}beginPath(){this._context.beginPath()}bezierCurveTo(e,r,n,i,a,o){this._context.bezierCurveTo(e,r,n,i,a,o)}clearRect(e,r,n,i){this._context.clearRect(e,r,n,i)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,r){const n=arguments;if(n.length===2)return this._context.createImageData(e,r);if(n.length===1)return this._context.createImageData(e)}createLinearGradient(e,r,n,i){return this._context.createLinearGradient(e,r,n,i)}createPattern(e,r){return this._context.createPattern(e,r)}createRadialGradient(e,r,n,i,a,o){return this._context.createRadialGradient(e,r,n,i,a,o)}drawImage(e,r,n,i,a,o,s,u,h){const f=arguments,g=this._context;f.length===3?g.drawImage(e,r,n):f.length===5?g.drawImage(e,r,n,i,a):f.length===9&&g.drawImage(e,r,n,i,a,o,s,u,h)}ellipse(e,r,n,i,a,o,s,u){this._context.ellipse(e,r,n,i,a,o,s,u)}isPointInPath(e,r,n,i){return n?this._context.isPointInPath(n,e,r,i):this._context.isPointInPath(e,r,i)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,r,n,i){this._context.fillRect(e,r,n,i)}strokeRect(e,r,n,i){this._context.strokeRect(e,r,n,i)}fillText(e,r,n,i){i?this._context.fillText(e,r,n,i):this._context.fillText(e,r,n)}measureText(e){return this._context.measureText(e)}getImageData(e,r,n,i){return this._context.getImageData(e,r,n,i)}lineTo(e,r){this._context.lineTo(e,r)}moveTo(e,r){this._context.moveTo(e,r)}rect(e,r,n,i){this._context.rect(e,r,n,i)}roundRect(e,r,n,i,a){this._context.roundRect(e,r,n,i,a)}putImageData(e,r,n){this._context.putImageData(e,r,n)}quadraticCurveTo(e,r,n,i){this._context.quadraticCurveTo(e,r,n,i)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,r){this._context.scale(e,r)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,r,n,i,a,o){this._context.setTransform(e,r,n,i,a,o)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,r,n,i){this._context.strokeText(e,r,n,i)}transform(e,r,n,i,a,o){this._context.transform(e,r,n,i,a,o)}translate(e,r){this._context.translate(e,r)}_enableTrace(){let e=this,r=N5.length,n=this.setAttr,i,a;const o=function(s){let u=e[s],h;e[s]=function(){return a=vE(Array.prototype.slice.call(arguments,0)),h=u.apply(e,arguments),e._trace({method:s,args:a}),h}};for(i=0;i<r;i++)o(N5[i]);e.setAttr=function(){n.apply(e,arguments);const s=arguments[0];let u=arguments[1];(s==="shadowOffsetX"||s==="shadowOffsetY"||s==="shadowBlur")&&(u=u/this.canvas.getPixelRatio()),e._trace({property:s,val:u})}}_applyGlobalCompositeOperation(e){const r=e.attrs.globalCompositeOperation;!r||r==="source-over"||this.setAttr("globalCompositeOperation",r)}}EE.forEach(function(t){Object.defineProperty(F0.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class AE extends F0{constructor(e,{willReadFrequently:r=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:r})}_fillColor(e){const r=e.fill();this.setAttr("fillStyle",r),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){const r=e._getLinearGradient();r&&(this.setAttr("fillStyle",r),e._fillFunc(this))}_fillRadialGradient(e){const r=e._getRadialGradient();r&&(this.setAttr("fillStyle",r),e._fillFunc(this))}_fill(e){const r=e.fill(),n=e.getFillPriority();if(r&&n==="color"){this._fillColor(e);return}const i=e.getFillPatternImage();if(i&&n==="pattern"){this._fillPattern(e);return}const a=e.getFillLinearGradientColorStops();if(a&&n==="linear-gradient"){this._fillLinearGradient(e);return}const o=e.getFillRadialGradientColorStops();if(o&&n==="radial-gradient"){this._fillRadialGradient(e);return}r?this._fillColor(e):i?this._fillPattern(e):a?this._fillLinearGradient(e):o&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const r=e.getStrokeLinearGradientStartPoint(),n=e.getStrokeLinearGradientEndPoint(),i=e.getStrokeLinearGradientColorStops(),a=this.createLinearGradient(r.x,r.y,n.x,n.y);if(i){for(let o=0;o<i.length;o+=2)a.addColorStop(i[o],i[o+1]);this.setAttr("strokeStyle",a)}}_stroke(e){const r=e.dash(),n=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!n){this.save();const a=this.getCanvas().getPixelRatio();this.setTransform(a,0,0,a,0,0)}this._applyLineCap(e),r&&e.dashEnabled()&&(this.setLineDash(r),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),n||this.restore()}}_applyShadow(e){var r,n,i;const a=(r=e.getShadowRGBA())!==null&&r!==void 0?r:"black",o=(n=e.getShadowBlur())!==null&&n!==void 0?n:5,s=(i=e.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},u=e.getAbsoluteScale(),h=this.canvas.getPixelRatio(),f=u.x*h,g=u.y*h;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",o*Math.min(Math.abs(f),Math.abs(g))),this.setAttr("shadowOffsetX",s.x*f),this.setAttr("shadowOffsetY",s.y*g)}}class PE extends F0{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const r=e.getStrokeScaleEnabled();if(!r){this.save();const a=this.getCanvas().getPixelRatio();this.setTransform(a,0,0,a,0,0)}this._applyLineCap(e);const n=e.hitStrokeWidth(),i=n==="auto"?e.strokeWidth():n;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),r||this.restore()}}}let y1;function OE(){if(y1)return y1;const t=Ze.createCanvasElement(),e=t.getContext("2d");return y1=function(){const r=Ot._global.devicePixelRatio||1,n=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return r/n}(),Ze.releaseCanvas(t),y1}class Wm{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const n=(e||{}).pixelRatio||Ot.pixelRatio||OE();this.pixelRatio=n,this._canvas=Ze.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){const r=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/r,this.getHeight()/r)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";const r=this.pixelRatio;this.getContext()._context.scale(r,r)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";const r=this.pixelRatio;this.getContext()._context.scale(r,r)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,r){this.setWidth(e||0),this.setHeight(r||0)}toDataURL(e,r){try{return this._canvas.toDataURL(e,r)}catch{try{return this._canvas.toDataURL()}catch(i){return Ze.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class lf extends Wm{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new AE(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}function R5(){const t=Ze.createCanvasElement();t.width=1,t.height=1;const e=t.getContext("2d",{willReadFrequently:!0});e.clearRect(0,0,1,1),e.fillStyle="rgba(255,0,255,1)",e.fillRect(0,0,1,1);const r=e.getImageData(0,0,1,1).data;return!(r[0]===255&&r[1]===0&&r[2]===255&&r[3]===255)}function M5(){var t,e;return typeof navigator>"u"?!1:(e=(t=navigator.brave)===null||t===void 0?void 0:t.isBrave())!==null&&e!==void 0?e:!1}let I5=!1;function CE(){return M5()&&R5()&&!I5&&(I5=!0,Ze.error('Looks like you have "Brave shield" enabled in your browser. It breaks KonvaJS internals. Please disable it. You may need to ask your users to do the same.')),M5()&&R5()}class Vm extends Wm{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new PE(this),this.setSize(e.width,e.height),CE()}}const yn={get isDragging(){let t=!1;return yn._dragElements.forEach(e=>{e.dragStatus==="dragging"&&(t=!0)}),t},justDragged:!1,get node(){let t;return yn._dragElements.forEach(e=>{t=e.node}),t},_dragElements:new Map,_drag(t){const e=[];yn._dragElements.forEach((r,n)=>{const{node:i}=r,a=i.getStage();a.setPointersPositions(t),r.pointerId===void 0&&(r.pointerId=Ze._getFirstPointerId(t));const o=a._changedPointerPositions.find(s=>s.id===r.pointerId);if(o){if(r.dragStatus!=="dragging"){const s=i.dragDistance();if(Math.max(Math.abs(o.x-r.startPointerPos.x),Math.abs(o.y-r.startPointerPos.y))<s||(i.startDrag({evt:t}),!i.isDragging()))return}i._setDragPosition(t,r),e.push(i)}}),e.forEach(r=>{r.fire("dragmove",{type:"dragmove",target:r,evt:t},!0)})},_endDragBefore(t){const e=[];yn._dragElements.forEach(r=>{const{node:n}=r,i=n.getStage();if(t&&i.setPointersPositions(t),!i._changedPointerPositions.find(s=>s.id===r.pointerId))return;(r.dragStatus==="dragging"||r.dragStatus==="stopped")&&(yn.justDragged=!0,Ot._mouseListenClick=!1,Ot._touchListenClick=!1,Ot._pointerListenClick=!1,r.dragStatus="stopped");const o=r.node.getLayer()||r.node instanceof Ot.Stage&&r.node;o&&e.indexOf(o)===-1&&e.push(o)}),e.forEach(r=>{r.draw()})},_endDragAfter(t){yn._dragElements.forEach((e,r)=>{e.dragStatus==="stopped"&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:t},!0),e.dragStatus!=="dragging"&&yn._dragElements.delete(r)})}};Ot.isBrowser&&(window.addEventListener("mouseup",yn._endDragBefore,!0),window.addEventListener("touchend",yn._endDragBefore,!0),window.addEventListener("touchcancel",yn._endDragBefore,!0),window.addEventListener("mousemove",yn._drag),window.addEventListener("touchmove",yn._drag),window.addEventListener("mouseup",yn._endDragAfter,!1),window.addEventListener("touchend",yn._endDragAfter,!1),window.addEventListener("touchcancel",yn._endDragAfter,!1));function Ef(t){return Ze._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||Ze._isBoolean(t)?t:Object.prototype.toString.call(t)}function K6(t){return t>255?255:t<0?0:Math.round(t)}function Et(){if(Ot.isUnminified)return function(t,e){return Ze._isNumber(t)||Ze.warn(Ef(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function B0(t){if(Ot.isUnminified)return function(e,r){let n=Ze._isNumber(e),i=Ze._isArray(e)&&e.length==t;return!n&&!i&&Ze.warn(Ef(e)+' is a not valid value for "'+r+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function Ym(){if(Ot.isUnminified)return function(t,e){return Ze._isNumber(t)||t==="auto"||Ze.warn(Ef(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function vh(){if(Ot.isUnminified)return function(t,e){return Ze._isString(t)||Ze.warn(Ef(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function Z6(){if(Ot.isUnminified)return function(t,e){const r=Ze._isString(t),n=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return r||n||Ze.warn(Ef(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function LE(){if(Ot.isUnminified)return function(t,e){const r=Int8Array?Object.getPrototypeOf(Int8Array):null;return r&&t instanceof r||(Ze._isArray(t)?t.forEach(function(n){Ze._isNumber(n)||Ze.warn('"'+e+'" attribute has non numeric element '+n+". Make sure that all elements are numbers.")}):Ze.warn(Ef(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}function au(){if(Ot.isUnminified)return function(t,e){return t===!0||t===!1||Ze.warn(Ef(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function NE(t){if(Ot.isUnminified)return function(e,r){return e==null||Ze.isObject(e)||Ze.warn(Ef(e)+' is a not valid value for "'+r+'" attribute. The value should be an object with properties '+t),e}}const Dd="get",Fd="set",je={addGetterSetter(t,e,r,n,i){je.addGetter(t,e,r),je.addSetter(t,e,n,i),je.addOverloadedGetterSetter(t,e)},addGetter(t,e,r){const n=Dd+Ze._capitalize(e);t.prototype[n]=t.prototype[n]||function(){const i=this.attrs[e];return i===void 0?r:i}},addSetter(t,e,r,n){const i=Fd+Ze._capitalize(e);t.prototype[i]||je.overWriteSetter(t,e,r,n)},overWriteSetter(t,e,r,n){const i=Fd+Ze._capitalize(e);t.prototype[i]=function(a){return r&&a!==void 0&&a!==null&&(a=r.call(this,a,e)),this._setAttr(e,a),n&&n.call(this),this}},addComponentsGetterSetter(t,e,r,n,i){const a=r.length,o=Ze._capitalize,s=Dd+o(e),u=Fd+o(e);t.prototype[s]=function(){const f={};for(let g=0;g<a;g++){const v=r[g];f[v]=this.getAttr(e+o(v))}return f};const h=NE(r);t.prototype[u]=function(f){const g=this.attrs[e];n&&(f=n.call(this,f,e)),h&&h.call(this,f,e);for(const v in f)f.hasOwnProperty(v)&&this._setAttr(e+o(v),f[v]);return f||r.forEach(v=>{this._setAttr(e+o(v),void 0)}),this._fireChangeEvent(e,g,f),i&&i.call(this),this},je.addOverloadedGetterSetter(t,e)},addOverloadedGetterSetter(t,e){const r=Ze._capitalize(e),n=Fd+r,i=Dd+r;t.prototype[e]=function(){return arguments.length?(this[n](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(t,e,r,n){Ze.error("Adding deprecated "+e);const i=Dd+Ze._capitalize(e),a=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";t.prototype[i]=function(){Ze.error(a);const o=this.attrs[e];return o===void 0?r:o},je.addSetter(t,e,n,function(){Ze.error(a)}),je.addOverloadedGetterSetter(t,e)},backCompat(t,e){Ze.each(e,function(r,n){const i=t.prototype[n],a=Dd+Ze._capitalize(r),o=Fd+Ze._capitalize(r);function s(){i.apply(this,arguments),Ze.error('"'+r+'" method is deprecated and will be removed soon. Use ""'+n+'" instead.')}t.prototype[r]=s,t.prototype[a]=s,t.prototype[o]=s})},afterSetFilter(){this._filterUpToDate=!1}};function TE(t){const e=/(\w+)\(([^)]+)\)/g;let r;for(;(r=e.exec(t))!==null;){const[,n,i]=r;switch(n){case"blur":{const a=parseFloat(i.replace("px",""));return function(o){this.blurRadius(a*.5);const s=Ot.Filters;s&&s.Blur&&s.Blur.call(this,o)}}case"brightness":{const a=i.includes("%")?parseFloat(i)/100:parseFloat(i);return function(o){this.brightness(a);const s=Ot.Filters;s&&s.Brightness&&s.Brightness.call(this,o)}}case"contrast":{const a=parseFloat(i);return function(o){const s=100*(Math.sqrt(a)-1);this.contrast(s);const u=Ot.Filters;u&&u.Contrast&&u.Contrast.call(this,o)}}case"grayscale":return function(a){const o=Ot.Filters;o&&o.Grayscale&&o.Grayscale.call(this,a)};case"sepia":return function(a){const o=Ot.Filters;o&&o.Sepia&&o.Sepia.call(this,a)};case"invert":return function(a){const o=Ot.Filters;o&&o.Invert&&o.Invert.call(this,a)};default:Ze.warn(`CSS filter "${n}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const G1="absoluteOpacity",b1="allEventListeners",cc="absoluteTransform",j5="absoluteScale",Hf="canvas",RE="Change",ME="children",IE="konva",rm="listening",jE="mouseenter",DE="mouseleave",FE="pointerenter",BE="pointerleave",zE="touchenter",qE="touchleave",D5="set",F5="Shape",W1=" ",B5="stage",of="transform",UE="Stage",nm="visible",HE=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(W1);let $E=1,At=class im{constructor(e){this._id=$E++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===of||e===cc)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,r){let n=this._cache.get(e);return(n===void 0||(e===of||e===cc)&&n.dirty===!0)&&(n=r.call(this),this._cache.set(e,n)),n}_calculate(e,r,n){if(!this._attachedDepsListeners.get(e)){const i=r.map(a=>a+"Change.konva").join(W1);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,n)}_getCanvasCache(){return this._cache.get(Hf)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===cc&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Hf)){const{scene:e,filter:r,hit:n,buffer:i}=this._cache.get(Hf);Ze.releaseCanvas(e,r,n,i),this._cache.delete(Hf)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){const r=e||{};let n={};(r.x===void 0||r.y===void 0||r.width===void 0||r.height===void 0)&&(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(r.width||n.width),a=Math.ceil(r.height||n.height),o=r.pixelRatio,s=r.x===void 0?Math.floor(n.x):r.x,u=r.y===void 0?Math.floor(n.y):r.y,h=r.offset||0,f=r.drawBorder||!1,g=r.hitCanvasPixelRatio||1;if(!i||!a){Ze.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const v=Math.abs(Math.round(n.x)-s)>.5?1:0,p=Math.abs(Math.round(n.y)-u)>.5?1:0;i+=h*2+v,a+=h*2+p,s-=h,u-=h;const y=new lf({pixelRatio:o,width:i,height:a}),_=new lf({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),x=new Vm({pixelRatio:g,width:i,height:a}),b=y.getContext(),E=x.getContext(),A=new lf({width:y.width/y.pixelRatio+Math.abs(s),height:y.height/y.pixelRatio+Math.abs(u),pixelRatio:y.pixelRatio}),S=A.getContext();return x.isCache=!0,y.isCache=!0,this._cache.delete(Hf),this._filterUpToDate=!1,r.imageSmoothingEnabled===!1&&(y.getContext()._context.imageSmoothingEnabled=!1,_.getContext()._context.imageSmoothingEnabled=!1),b.save(),E.save(),S.save(),b.translate(-s,-u),E.translate(-s,-u),S.translate(-s,-u),A.x=s,A.y=u,this._isUnderCache=!0,this._clearSelfAndDescendantCache(G1),this._clearSelfAndDescendantCache(j5),this.drawScene(y,this,A),this.drawHit(x,this),this._isUnderCache=!1,b.restore(),E.restore(),f&&(b.save(),b.beginPath(),b.rect(0,0,i,a),b.closePath(),b.setAttr("strokeStyle","red"),b.setAttr("lineWidth",5),b.stroke(),b.restore()),this._cache.set(Hf,{scene:y,filter:_,hit:x,buffer:A,x:s,y:u}),this._requestDraw(),this}isCached(){return this._cache.has(Hf)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,r){const n=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];let i=1/0,a=1/0,o=-1/0,s=-1/0;const u=this.getAbsoluteTransform(r);return n.forEach(function(h){const f=u.point(h);i===void 0&&(i=o=f.x,a=s=f.y),i=Math.min(i,f.x),a=Math.min(a,f.y),o=Math.max(o,f.x),s=Math.max(s,f.y)}),{x:i,y:a,width:o-i,height:s-a}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const r=this._getCanvasCache();e.translate(r.x,r.y);const n=this._getCachedSceneCanvas(),i=n.pixelRatio;e.drawImage(n._canvas,0,0,n.width/i,n.height/i),e.restore()}_drawCachedHitCanvas(e){const r=this._getCanvasCache(),n=r.hit;e.save(),e.translate(r.x,r.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),r=this._getCanvasCache(),n=r.scene,i=r.filter,a=i.getContext(),o,s,u,h;if(!e||e.length===0)return n;if(this._filterUpToDate)return i;let f=!0;for(let v=0;v<e.length;v++)if(typeof e[v]=="string"&&T5(),typeof e[v]!="string"||!T5()){f=!1;break}const g=n.pixelRatio;if(i.setSize(n.width/n.pixelRatio,n.height/n.pixelRatio),f){const v=e.join(" ");return a.save(),a.setAttr("filter",v),a.drawImage(n._canvas,0,0,n.getWidth()/g,n.getHeight()/g),a.restore(),this._filterUpToDate=!0,i}try{for(o=e.length,a.clear(),a.drawImage(n._canvas,0,0,n.getWidth()/g,n.getHeight()/g),s=a.getImageData(0,0,i.getWidth(),i.getHeight()),u=0;u<o;u++)h=e[u],typeof h=="string"&&(h=TE(h)),h.call(this,s),a.putImageData(s,0,0)}catch(v){Ze.error("Unable to apply filter. "+v.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,i}on(e,r){if(this._cache&&this._cache.delete(b1),arguments.length===3)return this._delegate.apply(this,arguments);const n=e.split(W1);for(let i=0;i<n.length;i++){const o=n[i].split("."),s=o[0],u=o[1]||"";this.eventListeners[s]||(this.eventListeners[s]=[]),this.eventListeners[s].push({name:u,handler:r})}return this}off(e,r){let n=(e||"").split(W1),i=n.length,a,o,s,u,h,f;if(this._cache&&this._cache.delete(b1),!e)for(o in this.eventListeners)this._off(o);for(a=0;a<i;a++)if(s=n[a],u=s.split("."),h=u[0],f=u[1],h)this.eventListeners[h]&&this._off(h,f,r);else for(o in this.eventListeners)this._off(o,f,r);return this}dispatchEvent(e){const r={target:this,type:e.type,evt:e};return this.fire(e.type,r),this}addEventListener(e,r){return this.on(e,function(n){r.call(this,n.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,r,n){const i=this;this.on(e,function(a){const o=a.target.findAncestors(r,!0,i);for(let s=0;s<o.length;s++)a=Ze.cloneObject(a),a.currentTarget=o[s],n.call(o[s],a)})}remove(){return this.isDragging()&&this.stopDrag(),yn._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(cc),this._clearSelfAndDescendantCache(G1),this._clearSelfAndDescendantCache(j5),this._clearSelfAndDescendantCache(B5),this._clearSelfAndDescendantCache(nm),this._clearSelfAndDescendantCache(rm)}_remove(){this._clearCaches();const e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){const r="get"+Ze._capitalize(e);return Ze._isFunction(this[r])?this[r]():this.attrs[e]}getAncestors(){let e=this.getParent(),r=[];for(;e;)r.push(e),e=e.getParent();return r}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let r,n;if(!e)return this;for(r in e)r!==ME&&(n=D5+Ze._capitalize(r),Ze._isFunction(this[n])?this[n](e[r]):this._setAttr(r,e[r]))}),this}isListening(){return this._getCache(rm,this._isListening)}_isListening(e){if(!this.listening())return!1;const n=this.getParent();return n&&n!==e&&this!==e?n._isListening(e):!0}isVisible(){return this._getCache(nm,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const n=this.getParent();return n&&n!==e&&this!==e?n._isVisible(e):!0}shouldDrawHit(e,r=!1){if(e)return this._isVisible(e)&&this._isListening(e);const n=this.getLayer();let i=!1;yn._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===n)&&(i=!0)});const a=!r&&!Ot.hitOnDragEnabled&&(i||Ot.isTransforming());return this.isListening()&&this.isVisible()&&!a}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),r=this,n=0,i,a,o,s;function u(f){for(i=[],a=f.length,o=0;o<a;o++)s=f[o],n++,s.nodeType!==F5&&(i=i.concat(s.getChildren().slice())),s._id===r._id&&(o=a);i.length>0&&i[0].getDepth()<=e&&u(i)}const h=this.getStage();return r.nodeType!==UE&&h&&u(h.getChildren()),n}getDepth(){let e=0,r=this.parent;for(;r;)e++,r=r.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(of),this._clearSelfAndDescendantCache(cc)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;const r=e.getPointerPosition();if(!r)return null;const n=this.getAbsoluteTransform().copy();return n.invert(),n.point(r)}getAbsolutePosition(e){let r=!1,n=this.parent;for(;n;){if(n.isCached()){r=!0;break}n=n.parent}r&&!e&&(e=!0);const i=this.getAbsoluteTransform(e).getMatrix(),a=new nl,o=this.offset();return a.m=i.slice(),a.translate(o.x,o.y),a.getTranslation()}setAbsolutePosition(e){const{x:r,y:n,...i}=this._clearTransform();this.attrs.x=r,this.attrs.y=n,this._clearCache(of);const a=this._getAbsoluteTransform().copy();return a.invert(),a.translate(e.x,e.y),e={x:this.attrs.x+a.getTranslation().x,y:this.attrs.y+a.getTranslation().y},this._setTransform(i),this.setPosition({x:e.x,y:e.y}),this._clearCache(of),this._clearSelfAndDescendantCache(cc),this}_setTransform(e){let r;for(r in e)this.attrs[r]=e[r]}_clearTransform(){const e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let r=e.x,n=e.y,i=this.x(),a=this.y();return r!==void 0&&(i+=r),n!==void 0&&(a+=n),this.setPosition({x:i,y:a}),this}_eachAncestorReverse(e,r){let n=[],i=this.getParent(),a,o;if(!(r&&r._id===this._id)){for(n.unshift(this);i&&(!r||i._id!==r._id);)n.unshift(i),i=i.parent;for(a=n.length,o=0;o<a;o++)e(n[o])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return Ze.warn("Node has no parent. moveToTop function is ignored."),!1;const e=this.index,r=this.parent.getChildren().length;return e<r-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return Ze.warn("Node has no parent. moveUp function is ignored."),!1;const e=this.index,r=this.parent.getChildren().length;return e<r-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return Ze.warn("Node has no parent. moveDown function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return Ze.warn("Node has no parent. moveToBottom function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return Ze.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&Ze.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const r=this.index;return this.parent.children.splice(r,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(G1,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity();const r=this.getParent();return r&&!r._isUnderCache&&(e*=r.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),r,n,i,a,o;const s={attrs:{},className:this.getClassName()};for(r in e)n=e[r],o=Ze.isObject(n)&&!Ze._isPlainObject(n)&&!Ze._isArray(n),!o&&(i=typeof this[r]=="function"&&this[r],delete e[r],a=i?i.call(this):null,e[r]=n,a!==n&&(s.attrs[r]=n));return Ze._prepareToStringify(s)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,r,n){const i=[];r&&this._isMatch(e)&&i.push(this);let a=this.parent;for(;a;){if(a===n)return i;a._isMatch(e)&&i.push(a),a=a.parent}return i}isAncestorOf(e){return!1}findAncestor(e,r,n){return this.findAncestors(e,r,n)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);let r=e.replace(/ /g,"").split(","),n=r.length,i,a;for(i=0;i<n;i++)if(a=r[i],Ze.isValidSelector(a)||(Ze.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),Ze.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),Ze.warn("Konva is awesome, right?")),a.charAt(0)==="#"){if(this.id()===a.slice(1))return!0}else if(a.charAt(0)==="."){if(this.hasName(a.slice(1)))return!0}else if(this.className===a||this.nodeType===a)return!0;return!1}getLayer(){const e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(B5,this._getStage)}_getStage(){const e=this.getParent();return e?e.getStage():null}fire(e,r={},n){return r.target=r.target||this,n?this._fireAndBubble(e,r):this._fire(e,r),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(cc,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let r;if(e)return r=new nl,this._eachAncestorReverse(function(n){const i=n.transformsEnabled();i==="all"?r.multiply(n.getTransform()):i==="position"&&r.translate(n.x()-n.offsetX(),n.y()-n.offsetY())},e),r;{r=this._cache.get(cc)||new nl,this.parent?this.parent.getAbsoluteTransform().copyInto(r):r.reset();const n=this.transformsEnabled();if(n==="all")r.multiply(this.getTransform());else if(n==="position"){const i=this.attrs.x||0,a=this.attrs.y||0,o=this.attrs.offsetX||0,s=this.attrs.offsetY||0;r.translate(i-o,a-s)}return r.dirty=!1,r}}getAbsoluteScale(e){let r=this;for(;r;)r._isUnderCache&&(e=r),r=r.getParent();const i=this.getAbsoluteTransform(e).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(of,this._getTransform)}_getTransform(){var e,r;const n=this._cache.get(of)||new nl;n.reset();const i=this.x(),a=this.y(),o=Ot.getAngle(this.rotation()),s=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,u=(r=this.attrs.scaleY)!==null&&r!==void 0?r:1,h=this.attrs.skewX||0,f=this.attrs.skewY||0,g=this.attrs.offsetX||0,v=this.attrs.offsetY||0;return(i!==0||a!==0)&&n.translate(i,a),o!==0&&n.rotate(o),(h!==0||f!==0)&&n.skew(h,f),(s!==1||u!==1)&&n.scale(s,u),(g!==0||v!==0)&&n.translate(-1*g,-1*v),n.dirty=!1,n}clone(e){let r=Ze.cloneObject(this.attrs),n,i,a,o,s;for(n in e)r[n]=e[n];const u=new this.constructor(r);for(n in this.eventListeners)for(i=this.eventListeners[n],a=i.length,o=0;o<a;o++)s=i[o],s.name.indexOf(IE)<0&&(u.eventListeners[n]||(u.eventListeners[n]=[]),u.eventListeners[n].push(s));return u}_toKonvaCanvas(e){e=e||{};const r=this.getClientRect(),n=this.getStage(),i=e.x!==void 0?e.x:Math.floor(r.x),a=e.y!==void 0?e.y:Math.floor(r.y),o=e.pixelRatio||1,s=new lf({width:e.width||Math.ceil(r.width)||(n?n.width():0),height:e.height||Math.ceil(r.height)||(n?n.height():0),pixelRatio:o}),u=s.getContext(),h=new lf({width:s.width/s.pixelRatio+Math.abs(i),height:s.height/s.pixelRatio+Math.abs(a),pixelRatio:s.pixelRatio});return e.imageSmoothingEnabled===!1&&(u._context.imageSmoothingEnabled=!1),u.save(),(i||a)&&u.translate(-1*i,-1*a),this.drawScene(s,void 0,h),u.restore(),s}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};const r=e.mimeType||null,n=e.quality||null,i=this._toKonvaCanvas(e).toDataURL(r,n);return e.callback&&e.callback(i),i}toImage(e){return new Promise((r,n)=>{try{const i=e?.callback;i&&delete e.callback,Ze._urlToImage(this.toDataURL(e),function(a){r(a),i?.(a)})}catch(i){n(i)}})}toBlob(e){return new Promise((r,n)=>{try{const i=e?.callback;i&&delete e.callback,this.toCanvas(e).toBlob(a=>{r(a),i?.(a)},e?.mimeType,e?.quality)}catch(i){n(i)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Ot.dragDistance}_off(e,r,n){let i=this.eventListeners[e],a,o,s;for(a=0;a<i.length;a++)if(o=i[a].name,s=i[a].handler,(o!=="konva"||r==="konva")&&(!r||o===r)&&(!n||n===s)){if(i.splice(a,1),i.length===0){delete this.eventListeners[e];break}a--}}_fireChangeEvent(e,r,n){this._fire(e+RE,{oldVal:r,newVal:n})}addName(e){if(!this.hasName(e)){const r=this.name(),n=r?r+" "+e:e;this.name(n)}return this}hasName(e){if(!e)return!1;const r=this.name();return r?(r||"").split(/\s/g).indexOf(e)!==-1:!1}removeName(e){const r=(this.name()||"").split(/\s/g),n=r.indexOf(e);return n!==-1&&(r.splice(n,1),this.name(r.join(" "))),this}setAttr(e,r){const n=this[D5+Ze._capitalize(e)];return Ze._isFunction(n)?n.call(this,r):this._setAttr(e,r),this}_requestDraw(){if(Ot.autoDrawEnabled){const e=this.getLayer()||this.getStage();e?.batchDraw()}}_setAttr(e,r){const n=this.attrs[e];n===r&&!Ze.isObject(r)||(r==null?delete this.attrs[e]:this.attrs[e]=r,this._shouldFireChangeEvents&&this._fireChangeEvent(e,n,r),this._requestDraw())}_setComponentAttr(e,r,n){let i;n!==void 0&&(i=this.attrs[e],i||(this.attrs[e]=this.getAttr(e)),this.attrs[e][r]=n,this._fireChangeEvent(e,i,n))}_fireAndBubble(e,r,n){r&&this.nodeType===F5&&(r.target=this);const i=[jE,DE,FE,BE,zE,qE];if(!(i.indexOf(e)!==-1&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||this.nodeType==="Stage"&&!n))){this._fire(e,r);const o=i.indexOf(e)!==-1&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(r&&!r.cancelBubble||!r)&&this.parent&&this.parent.isListening()&&!o&&(n&&n.parent?this._fireAndBubble.call(this.parent,e,r,n):this._fireAndBubble.call(this.parent,e,r))}}_getProtoListeners(e){var r,n,i;const a=(r=this._cache.get(b1))!==null&&r!==void 0?r:{};let o=a?.[e];if(o===void 0){o=[];let s=Object.getPrototypeOf(this);for(;s;){const u=(i=(n=s.eventListeners)===null||n===void 0?void 0:n[e])!==null&&i!==void 0?i:[];o.push(...u),s=Object.getPrototypeOf(s)}a[e]=o,this._cache.set(b1,a)}return o}_fire(e,r){r=r||{},r.currentTarget=this,r.type=e;const n=this._getProtoListeners(e);if(n)for(let a=0;a<n.length;a++)n[a].handler.call(this,r);const i=this.eventListeners[e];if(i)for(let a=0;a<i.length;a++)i[a].handler.call(this,r)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){const r=e?e.pointerId:void 0,n=this.getStage(),i=this.getAbsolutePosition();if(!n)return;const a=n._getPointerById(r)||n._changedPointerPositions[0]||i;yn._dragElements.set(this._id,{node:this,startPointerPos:a,offset:{x:a.x-i.x,y:a.y-i.y},dragStatus:"ready",pointerId:r})}startDrag(e,r=!0){yn._dragElements.has(this._id)||this._createDragElement(e);const n=yn._dragElements.get(this._id);n.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},r)}_setDragPosition(e,r){const n=this.getStage()._getPointerById(r.pointerId);if(!n)return;let i={x:n.x-r.offset.x,y:n.y-r.offset.y};const a=this.dragBoundFunc();if(a!==void 0){const o=a.call(this,i,e);o?i=o:Ze.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}stopDrag(e){const r=yn._dragElements.get(this._id);r&&(r.dragStatus="stopped"),yn._endDragBefore(e),yn._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=yn._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if(!(!(e.evt.button!==void 0)||Ot.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let i=!1;yn._dragElements.forEach(a=>{this.isAncestorOf(a.node)&&(i=!0)}),i||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const r=yn._dragElements.get(this._id),n=r&&r.dragStatus==="dragging",i=r&&r.dragStatus==="ready";n?this.stopDrag():i&&yn._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const r=this.getStage();if(!r)return!1;const n={x:-e.x,y:-e.y,width:r.width()+2*e.x,height:r.height()+2*e.y};return Ze.haveIntersection(n,this.getClientRect())}static create(e,r){return Ze._isString(e)&&(e=JSON.parse(e)),this._createNode(e,r)}static _createNode(e,r){let n=im.prototype.getClassName.call(e),i=e.children,a,o,s;r&&(e.attrs.container=r),Ot[n]||(Ze.warn('Can not find a node with class name "'+n+'". Fallback to "Shape".'),n="Shape");const u=Ot[n];if(a=new u(e.attrs),i)for(o=i.length,s=0;s<o;s++)a.add(im._createNode(i[s]));return a}};At.prototype.nodeType="Node";At.prototype._attrsAffectingSize=[];At.prototype.eventListeners={};At.prototype.on.call(At.prototype,HE,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(of),this._clearSelfAndDescendantCache(cc)});At.prototype.on.call(At.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(nm)});At.prototype.on.call(At.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(rm)});At.prototype.on.call(At.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(G1)});const Xn=je.addGetterSetter;Xn(At,"zIndex");Xn(At,"absolutePosition");Xn(At,"position");Xn(At,"x",0,Et());Xn(At,"y",0,Et());Xn(At,"globalCompositeOperation","source-over",vh());Xn(At,"opacity",1,Et());Xn(At,"name","",vh());Xn(At,"id","",vh());Xn(At,"rotation",0,Et());je.addComponentsGetterSetter(At,"scale",["x","y"]);Xn(At,"scaleX",1,Et());Xn(At,"scaleY",1,Et());je.addComponentsGetterSetter(At,"skew",["x","y"]);Xn(At,"skewX",0,Et());Xn(At,"skewY",0,Et());je.addComponentsGetterSetter(At,"offset",["x","y"]);Xn(At,"offsetX",0,Et());Xn(At,"offsetY",0,Et());Xn(At,"dragDistance",void 0,Et());Xn(At,"width",0,Et());Xn(At,"height",0,Et());Xn(At,"listening",!0,au());Xn(At,"preventDefault",!0,au());Xn(At,"filters",void 0,function(t){return this._filterUpToDate=!1,t});Xn(At,"visible",!0,au());Xn(At,"transformsEnabled","all",vh());Xn(At,"size");Xn(At,"dragBoundFunc");Xn(At,"draggable",!1,au());je.backCompat(At,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class al extends At{constructor(){super(...arguments),this.children=[]}getChildren(e){const r=this.children||[];return e?r.filter(e):r}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let n=0;n<e.length;n++)this.add(e[n]);return this}const r=e[0];return r.getParent()?(r.moveTo(this),this):(this._validateAdd(r),r.index=this.getChildren().length,r.parent=this,r._clearCaches(),this.getChildren().push(r),this._fire("add",{child:r}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){const r=this._generalFind(e,!0);return r.length>0?r[0]:void 0}_generalFind(e,r){const n=[];return this._descendants(i=>{const a=i._isMatch(e);return a&&n.push(i),!!(a&&r)}),n}_descendants(e){let r=!1;const n=this.getChildren();for(const i of n){if(r=e(i),r)return!0;if(i.hasChildren()&&(r=i._descendants(e),r))return!0}return!1}toObject(){const e=At.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(r=>{e.children.push(r.toObject())}),e}isAncestorOf(e){let r=e.getParent();for(;r;){if(r._id===this._id)return!0;r=r.getParent()}return!1}clone(e){const r=At.prototype.clone.call(this,e);return this.getChildren().forEach(function(n){r.add(n.clone())}),r}getAllIntersections(e){const r=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(e)&&r.push(n)}),r}_clearSelfAndDescendantCache(e){var r;super._clearSelfAndDescendantCache(e),!this.isCached()&&((r=this.children)===null||r===void 0||r.forEach(function(n){n._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(r,n){r.index=n}),this._requestDraw()}drawScene(e,r,n){const i=this.getLayer(),a=e||i&&i.getCanvas(),o=a&&a.getContext(),s=this._getCanvasCache(),u=s&&s.scene,h=a&&a.isCache;if(!this.isVisible()&&!h)return this;if(u){o.save();const f=this.getAbsoluteTransform(r).getMatrix();o.transform(f[0],f[1],f[2],f[3],f[4],f[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",a,r,n);return this}drawHit(e,r){if(!this.shouldDrawHit(r))return this;const n=this.getLayer(),i=e||n&&n.hitCanvas,a=i&&i.getContext(),o=this._getCanvasCache();if(o&&o.hit){a.save();const u=this.getAbsoluteTransform(r).getMatrix();a.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedHitCanvas(a),a.restore()}else this._drawChildren("drawHit",i,r);return this}_drawChildren(e,r,n,i){var a;const o=r&&r.getContext(),s=this.clipWidth(),u=this.clipHeight(),h=this.clipFunc(),f=typeof s=="number"&&typeof u=="number"||h,g=n===this;if(f){o.save();const p=this.getAbsoluteTransform(n);let y=p.getMatrix();o.transform(y[0],y[1],y[2],y[3],y[4],y[5]),o.beginPath();let _;if(h)_=h.call(this,o,this);else{const x=this.clipX(),b=this.clipY();o.rect(x||0,b||0,s,u)}o.clip.apply(o,_),y=p.copy().invert().getMatrix(),o.transform(y[0],y[1],y[2],y[3],y[4],y[5])}const v=!g&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";v&&(o.save(),o._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(p){p[e](r,n,i)}),v&&o.restore(),f&&o.restore()}getClientRect(e={}){var r;const n=e.skipTransform,i=e.relativeTo;let a,o,s,u,h={x:1/0,y:1/0,width:0,height:0};const f=this;(r=this.children)===null||r===void 0||r.forEach(function(p){if(!p.visible())return;const y=p.getClientRect({relativeTo:f,skipShadow:e.skipShadow,skipStroke:e.skipStroke});y.width===0&&y.height===0||(a===void 0?(a=y.x,o=y.y,s=y.x+y.width,u=y.y+y.height):(a=Math.min(a,y.x),o=Math.min(o,y.y),s=Math.max(s,y.x+y.width),u=Math.max(u,y.y+y.height)))});const g=this.find("Shape");let v=!1;for(let p=0;p<g.length;p++)if(g[p]._isVisible(this)){v=!0;break}return v&&a!==void 0?h={x:a,y:o,width:s-a,height:u-o}:h={x:0,y:0,width:0,height:0},n?h:this._transformedRect(h,i)}}je.addComponentsGetterSetter(al,"clip",["x","y","width","height"]);je.addGetterSetter(al,"clipX",void 0,Et());je.addGetterSetter(al,"clipY",void 0,Et());je.addGetterSetter(al,"clipWidth",void 0,Et());je.addGetterSetter(al,"clipHeight",void 0,Et());je.addGetterSetter(al,"clipFunc");const vp=new Map,Q6=Ot._global.PointerEvent!==void 0;function qg(t){return vp.get(t)}function Xm(t){return{evt:t,pointerId:t.pointerId}}function J6(t,e){return vp.get(t)===e}function e8(t,e){rp(t),e.getStage()&&(vp.set(t,e),Q6&&e._fire("gotpointercapture",Xm(new PointerEvent("gotpointercapture"))))}function rp(t,e){const r=vp.get(t);if(!r)return;const n=r.getStage();n&&n.content,vp.delete(t),Q6&&r._fire("lostpointercapture",Xm(new PointerEvent("lostpointercapture")))}const GE="Stage",WE="string",z5="px",VE="mouseout",t8="mouseleave",r8="mouseover",n8="mouseenter",i8="mousemove",a8="mousedown",o8="mouseup",Wd="pointermove",Vd="pointerdown",rd="pointerup",Yd="pointercancel",YE="lostpointercapture",w1="pointerout",Xd="pointerleave",_1="pointerover",x1="pointerenter",am="contextmenu",s8="touchstart",l8="touchend",u8="touchmove",c8="touchcancel",om="wheel",XE=5,KE=[[n8,"_pointerenter"],[a8,"_pointerdown"],[i8,"_pointermove"],[o8,"_pointerup"],[t8,"_pointerleave"],[s8,"_pointerdown"],[u8,"_pointermove"],[l8,"_pointerup"],[c8,"_pointercancel"],[r8,"_pointerover"],[om,"_wheel"],[am,"_contextmenu"],[Vd,"_pointerdown"],[Wd,"_pointermove"],[rd,"_pointerup"],[Yd,"_pointercancel"],[Xd,"_pointerleave"],[YE,"_lostpointercapture"]],Ug={mouse:{[w1]:VE,[Xd]:t8,[_1]:r8,[x1]:n8,[Wd]:i8,[Vd]:a8,[rd]:o8,[Yd]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[w1]:"touchout",[Xd]:"touchleave",[_1]:"touchover",[x1]:"touchenter",[Wd]:u8,[Vd]:s8,[rd]:l8,[Yd]:c8,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[w1]:w1,[Xd]:Xd,[_1]:_1,[x1]:x1,[Wd]:Wd,[Vd]:Vd,[rd]:rd,[Yd]:Yd,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},Kd=t=>t.indexOf("pointer")>=0?"pointer":t.indexOf("touch")>=0?"touch":"mouse",Hh=t=>{const e=Kd(t);if(e==="pointer")return Ot.pointerEventsEnabled&&Ug.pointer;if(e==="touch")return Ug.touch;if(e==="mouse")return Ug.mouse};function q5(t={}){return(t.clipFunc||t.clipWidth||t.clipHeight)&&Ze.warn("Stage does not support clipping. Please use clip for Layers or Groups."),t}const ZE="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);",np=[];let z0=class extends al{constructor(e){super(q5(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),np.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{q5(this.attrs)}),this._checkVisibility()}_validateAdd(e){const r=e.getType()==="Layer",n=e.getType()==="FastLayer";r||n||Ze.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if(typeof e===WE){let r;if(e.charAt(0)==="."){const n=e.slice(1);e=document.getElementsByClassName(n)[0]}else e.charAt(0)!=="#"?r=e:r=e.slice(1),e=document.getElementById(r);if(!e)throw"Can not find container in document with id "+r}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const e=this.children,r=e.length;for(let n=0;n<r;n++)e[n].clear();return this}clone(e){return e||(e={}),e.container=typeof document<"u"&&document.createElement("div"),al.prototype.clone.call(this,e)}destroy(){super.destroy();const e=this.content;e&&Ze._isInDocument(e)&&this.container().removeChild(e);const r=np.indexOf(this);return r>-1&&np.splice(r,1),Ze.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(Ze.warn(ZE),null)}_getPointerById(e){return this._pointerPositions.find(r=>r.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e={...e},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();const r=new lf({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=r.getContext()._context,i=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),i.forEach(function(a){if(!a.isVisible())return;const o=a._toKonvaCanvas(e);n.drawImage(o._canvas,e.x,e.y,o.getWidth()/o.getPixelRatio(),o.getHeight()/o.getPixelRatio())}),r}getIntersection(e){if(!e)return null;const r=this.children,n=r.length,i=n-1;for(let a=i;a>=0;a--){const o=r[a].getIntersection(e);if(o)return o}return null}_resizeDOM(){const e=this.width(),r=this.height();this.content&&(this.content.style.width=e+z5,this.content.style.height=r+z5),this.bufferCanvas.setSize(e,r),this.bufferHitCanvas.setSize(e,r),this.children.forEach(n=>{n.setSize({width:e,height:r}),n.draw()})}add(e,...r){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}super.add(e);const n=this.children.length;return n>XE&&Ze.warn("The stage has "+n+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),Ot.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return J6(e,this)}setPointerCapture(e){e8(e,this)}releaseCapture(e){rp(e)}getLayers(){return this.children}_bindContentEvents(){Ot.isBrowser&&KE.forEach(([e,r])=>{this.content.addEventListener(e,n=>{this[r](n)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);const r=Hh(e.type);r&&this._fire(r.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const r=Hh(e.type);r&&this._fire(r.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let r=this[e+"targetShape"];return r&&!r.getStage()&&(r=null),r}_pointerleave(e){const r=Hh(e.type),n=Kd(e.type);if(!r)return;this.setPointersPositions(e);const i=this._getTargetShape(n),a=!(Ot.isDragging()||Ot.isTransforming())||Ot.hitOnDragEnabled;i&&a?(i._fireAndBubble(r.pointerout,{evt:e}),i._fireAndBubble(r.pointerleave,{evt:e}),this._fire(r.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+"targetShape"]=null):a&&(this._fire(r.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(r.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(e){const r=Hh(e.type),n=Kd(e.type);if(!r)return;this.setPointersPositions(e);let i=!1;this._changedPointerPositions.forEach(a=>{const o=this.getIntersection(a);if(yn.justDragged=!1,Ot["_"+n+"ListenClick"]=!0,!o||!o.isListening()){this[n+"ClickStartShape"]=void 0;return}Ot.capturePointerEventsEnabled&&o.setPointerCapture(a.id),this[n+"ClickStartShape"]=o,o._fireAndBubble(r.pointerdown,{evt:e,pointerId:a.id}),i=!0;const s=e.type.indexOf("touch")>=0;o.preventDefault()&&e.cancelable&&s&&e.preventDefault()}),i||this._fire(r.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(e){const r=Hh(e.type),n=Kd(e.type);if(!r)return;const i=e.type.indexOf("touch")>=0||e.pointerType==="touch";if(Ot.isDragging()&&yn.node.preventDefault()&&e.cancelable&&i&&e.preventDefault(),this.setPointersPositions(e),!(!(Ot.isDragging()||Ot.isTransforming())||Ot.hitOnDragEnabled))return;const o={};let s=!1;const u=this._getTargetShape(n);this._changedPointerPositions.forEach(h=>{const f=qg(h.id)||this.getIntersection(h),g=h.id,v={evt:e,pointerId:g},p=u!==f;if(p&&u&&(u._fireAndBubble(r.pointerout,{...v},f),u._fireAndBubble(r.pointerleave,{...v},f)),f){if(o[f._id])return;o[f._id]=!0}f&&f.isListening()?(s=!0,p&&(f._fireAndBubble(r.pointerover,{...v},u),f._fireAndBubble(r.pointerenter,{...v},u),this[n+"targetShape"]=f),f._fireAndBubble(r.pointermove,{...v})):u&&(this._fire(r.pointerover,{evt:e,target:this,currentTarget:this,pointerId:g}),this[n+"targetShape"]=null)}),s||this._fire(r.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const r=Hh(e.type),n=Kd(e.type);if(!r)return;this.setPointersPositions(e);const i=this[n+"ClickStartShape"],a=this[n+"ClickEndShape"],o={};let s=!1;this._changedPointerPositions.forEach(u=>{const h=qg(u.id)||this.getIntersection(u);if(h){if(h.releaseCapture(u.id),o[h._id])return;o[h._id]=!0}const f=u.id,g={evt:e,pointerId:f};let v=!1;Ot["_"+n+"InDblClickWindow"]?(v=!0,clearTimeout(this[n+"DblTimeout"])):yn.justDragged||(Ot["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout(function(){Ot["_"+n+"InDblClickWindow"]=!1},Ot.dblClickWindow),h&&h.isListening()?(s=!0,this[n+"ClickEndShape"]=h,h._fireAndBubble(r.pointerup,{...g}),Ot["_"+n+"ListenClick"]&&i&&i===h&&(h._fireAndBubble(r.pointerclick,{...g}),v&&a&&a===h&&h._fireAndBubble(r.pointerdblclick,{...g}))):(this[n+"ClickEndShape"]=null,s||(this._fire(r.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),s=!0),Ot["_"+n+"ListenClick"]&&this._fire(r.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:f}),v&&this._fire(r.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:f}))}),s||this._fire(r.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),Ot["_"+n+"ListenClick"]=!1,e.cancelable&&n!=="touch"&&n!=="pointer"&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);const r=this.getIntersection(this.getPointerPosition());r&&r.isListening()?r._fireAndBubble(am,{evt:e}):this._fire(am,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);const r=this.getIntersection(this.getPointerPosition());r&&r.isListening()?r._fireAndBubble(om,{evt:e}):this._fire(om,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const r=qg(e.pointerId)||this.getIntersection(this.getPointerPosition());r&&r._fireAndBubble(rd,Xm(e)),rp(e.pointerId)}_lostpointercapture(e){rp(e.pointerId)}setPointersPositions(e){const r=this._getContentPosition();let n=null,i=null;e=e||window.event,e.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,a=>{this._pointerPositions.push({id:a.identifier,x:(a.clientX-r.left)/r.scaleX,y:(a.clientY-r.top)/r.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,a=>{this._changedPointerPositions.push({id:a.identifier,x:(a.clientX-r.left)/r.scaleX,y:(a.clientY-r.top)/r.scaleY})})):(n=(e.clientX-r.left)/r.scaleX,i=(e.clientY-r.top)/r.scaleY,this.pointerPos={x:n,y:i},this._pointerPositions=[{x:n,y:i,id:Ze._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:i,id:Ze._getFirstPointerId(e)}])}_setPointerPosition(e){Ze.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new lf({width:this.width(),height:this.height()}),this.bufferHitCanvas=new Vm({pixelRatio:1,width:this.width(),height:this.height()}),!Ot.isBrowser)return;const e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}cache(){return Ze.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(e){e.batchDraw()}),this}};z0.prototype.nodeType=GE;Fi(z0);je.addGetterSetter(z0,"container");Ot.isBrowser&&document.addEventListener("visibilitychange",()=>{np.forEach(t=>{t.batchDraw()})});const f8="hasShadow",h8="shadowRGBA",d8="patternImage",p8="linearGradient",g8="radialGradient";let S1;function Hg(){return S1||(S1=Ze.createCanvasElement().getContext("2d"),S1)}const ip={};function QE(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function JE(t){t.stroke()}function ek(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function tk(t){t.stroke()}function rk(){this._clearCache(f8)}function nk(){this._clearCache(h8)}function ik(){this._clearCache(d8)}function ak(){this._clearCache(p8)}function ok(){this._clearCache(g8)}let mt=class extends At{constructor(e){super(e);let r;for(;r=Ze.getRandomColor(),!(r&&!(r in ip)););this.colorKey=r,ip[r]=this}getContext(){return Ze.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return Ze.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(f8,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(d8,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const r=Hg().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(r&&r.setTransform){const n=new nl;n.translate(this.fillPatternX(),this.fillPatternY()),n.rotate(Ot.getAngle(this.fillPatternRotation())),n.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),n.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=n.getMatrix(),a=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);r.setTransform(a)}return r}}_getLinearGradient(){return this._getCache(p8,this.__getLinearGradient)}__getLinearGradient(){const e=this.fillLinearGradientColorStops();if(e){const r=Hg(),n=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),a=r.createLinearGradient(n.x,n.y,i.x,i.y);for(let o=0;o<e.length;o+=2)a.addColorStop(e[o],e[o+1]);return a}}_getRadialGradient(){return this._getCache(g8,this.__getRadialGradient)}__getRadialGradient(){const e=this.fillRadialGradientColorStops();if(e){const r=Hg(),n=this.fillRadialGradientStartPoint(),i=this.fillRadialGradientEndPoint(),a=r.createRadialGradient(n.x,n.y,this.fillRadialGradientStartRadius(),i.x,i.y,this.fillRadialGradientEndRadius());for(let o=0;o<e.length;o+=2)a.addColorStop(e[o],e[o+1]);return a}}getShadowRGBA(){return this._getCache(h8,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const e=Ze.colorToRGBA(this.shadowColor());if(e)return"rgba("+e.r+","+e.g+","+e.b+","+e.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const e=this.hitStrokeWidth();return e==="auto"?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){const r=this.getStage();if(!r)return!1;const n=r.bufferHitCanvas;return n.getContext().clear(),this.drawHit(n,void 0,!0),n.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return At.prototype.destroy.call(this),delete ip[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var r;if(!((r=this.attrs.perfectDrawEnabled)!==null&&r!==void 0?r:!0))return!1;const i=e||this.hasFill(),a=this.hasStroke(),o=this.getAbsoluteOpacity()!==1;if(i&&a&&o)return!0;const s=this.hasShadow(),u=this.shadowForStrokeEnabled();return!!(i&&a&&s&&u)}setStrokeHitEnabled(e){Ze.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){let r=!1,n=this.getParent();for(;n;){if(n.isCached()){r=!0;break}n=n.getParent()}const i=e.skipTransform,a=e.relativeTo||r&&this.getStage()||void 0,o=this.getSelfRect(),u=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,h=o.width+u,f=o.height+u,g=!e.skipShadow&&this.hasShadow(),v=g?this.shadowOffsetX():0,p=g?this.shadowOffsetY():0,y=h+Math.abs(v),_=f+Math.abs(p),x=g&&this.shadowBlur()||0,b=y+x*2,E=_+x*2,A={width:b,height:E,x:-(u/2+x)+Math.min(v,0)+o.x,y:-(u/2+x)+Math.min(p,0)+o.y};return i?A:this._transformedRect(A,a)}drawScene(e,r,n){const i=this.getLayer(),a=e||i.getCanvas(),o=a.getContext(),s=this._getCanvasCache(),u=this.getSceneFunc(),h=this.hasShadow();let f;const g=r===this;if(!this.isVisible()&&!g)return this;if(s){o.save();const v=this.getAbsoluteTransform(r).getMatrix();return o.transform(v[0],v[1],v[2],v[3],v[4],v[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!u)return this;if(o.save(),this._useBufferCanvas()){f=this.getStage();const v=n||f.bufferCanvas,p=v.getContext();p.clear(),p.save(),p._applyLineJoin(this),p._applyMiterLimit(this);const y=this.getAbsoluteTransform(r).getMatrix();p.transform(y[0],y[1],y[2],y[3],y[4],y[5]),u.call(this,p,this),p.restore();const _=v.pixelRatio;h&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(v._canvas,v.x||0,v.y||0,v.width/_,v.height/_)}else{if(o._applyLineJoin(this),o._applyMiterLimit(this),!g){const v=this.getAbsoluteTransform(r).getMatrix();o.transform(v[0],v[1],v[2],v[3],v[4],v[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}h&&o._applyShadow(this),u.call(this,o,this)}return o.restore(),this}drawHit(e,r,n=!1){if(!this.shouldDrawHit(r,n))return this;const i=this.getLayer(),a=e||i.hitCanvas,o=a&&a.getContext(),s=this.hitFunc()||this.sceneFunc(),u=this._getCanvasCache(),h=u&&u.hit;if(this.colorKey||Ze.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),h){o.save();const g=this.getAbsoluteTransform(r).getMatrix();return o.transform(g[0],g[1],g[2],g[3],g[4],g[5]),this._drawCachedHitCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),o._applyLineJoin(this),o._applyMiterLimit(this),!(this===r)){const g=this.getAbsoluteTransform(r).getMatrix();o.transform(g[0],g[1],g[2],g[3],g[4],g[5])}return s.call(this,o,this),o.restore(),this}drawHitFromCache(e=0){const r=this._getCanvasCache(),n=this._getCachedSceneCanvas(),i=r.hit,a=i.getContext(),o=i.getWidth(),s=i.getHeight();a.clear(),a.drawImage(n._canvas,0,0,o,s);try{const u=a.getImageData(0,0,o,s),h=u.data,f=h.length,g=Ze._hexToRgb(this.colorKey);for(let v=0;v<f;v+=4)h[v+3]>e?(h[v]=g.r,h[v+1]=g.g,h[v+2]=g.b,h[v+3]=255):h[v+3]=0;a.putImageData(u,0,0)}catch(u){Ze.error("Unable to draw hit graph from cached scene canvas. "+u.message)}return this}hasPointerCapture(e){return J6(e,this)}setPointerCapture(e){e8(e,this)}releaseCapture(e){rp(e)}};mt.prototype._fillFunc=QE;mt.prototype._strokeFunc=JE;mt.prototype._fillFuncHit=ek;mt.prototype._strokeFuncHit=tk;mt.prototype._centroid=!1;mt.prototype.nodeType="Shape";Fi(mt);mt.prototype.eventListeners={};mt.prototype.on.call(mt.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",rk);mt.prototype.on.call(mt.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",nk);mt.prototype.on.call(mt.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",ik);mt.prototype.on.call(mt.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",ak);mt.prototype.on.call(mt.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",ok);je.addGetterSetter(mt,"stroke",void 0,Z6());je.addGetterSetter(mt,"strokeWidth",2,Et());je.addGetterSetter(mt,"fillAfterStrokeEnabled",!1);je.addGetterSetter(mt,"hitStrokeWidth","auto",Ym());je.addGetterSetter(mt,"strokeHitEnabled",!0,au());je.addGetterSetter(mt,"perfectDrawEnabled",!0,au());je.addGetterSetter(mt,"shadowForStrokeEnabled",!0,au());je.addGetterSetter(mt,"lineJoin");je.addGetterSetter(mt,"lineCap");je.addGetterSetter(mt,"miterLimit");je.addGetterSetter(mt,"sceneFunc");je.addGetterSetter(mt,"hitFunc");je.addGetterSetter(mt,"dash");je.addGetterSetter(mt,"dashOffset",0,Et());je.addGetterSetter(mt,"shadowColor",void 0,vh());je.addGetterSetter(mt,"shadowBlur",0,Et());je.addGetterSetter(mt,"shadowOpacity",1,Et());je.addComponentsGetterSetter(mt,"shadowOffset",["x","y"]);je.addGetterSetter(mt,"shadowOffsetX",0,Et());je.addGetterSetter(mt,"shadowOffsetY",0,Et());je.addGetterSetter(mt,"fillPatternImage");je.addGetterSetter(mt,"fill",void 0,Z6());je.addGetterSetter(mt,"fillPatternX",0,Et());je.addGetterSetter(mt,"fillPatternY",0,Et());je.addGetterSetter(mt,"fillLinearGradientColorStops");je.addGetterSetter(mt,"strokeLinearGradientColorStops");je.addGetterSetter(mt,"fillRadialGradientStartRadius",0);je.addGetterSetter(mt,"fillRadialGradientEndRadius",0);je.addGetterSetter(mt,"fillRadialGradientColorStops");je.addGetterSetter(mt,"fillPatternRepeat","repeat");je.addGetterSetter(mt,"fillEnabled",!0);je.addGetterSetter(mt,"strokeEnabled",!0);je.addGetterSetter(mt,"shadowEnabled",!0);je.addGetterSetter(mt,"dashEnabled",!0);je.addGetterSetter(mt,"strokeScaleEnabled",!0);je.addGetterSetter(mt,"fillPriority","color");je.addComponentsGetterSetter(mt,"fillPatternOffset",["x","y"]);je.addGetterSetter(mt,"fillPatternOffsetX",0,Et());je.addGetterSetter(mt,"fillPatternOffsetY",0,Et());je.addComponentsGetterSetter(mt,"fillPatternScale",["x","y"]);je.addGetterSetter(mt,"fillPatternScaleX",1,Et());je.addGetterSetter(mt,"fillPatternScaleY",1,Et());je.addComponentsGetterSetter(mt,"fillLinearGradientStartPoint",["x","y"]);je.addComponentsGetterSetter(mt,"strokeLinearGradientStartPoint",["x","y"]);je.addGetterSetter(mt,"fillLinearGradientStartPointX",0);je.addGetterSetter(mt,"strokeLinearGradientStartPointX",0);je.addGetterSetter(mt,"fillLinearGradientStartPointY",0);je.addGetterSetter(mt,"strokeLinearGradientStartPointY",0);je.addComponentsGetterSetter(mt,"fillLinearGradientEndPoint",["x","y"]);je.addComponentsGetterSetter(mt,"strokeLinearGradientEndPoint",["x","y"]);je.addGetterSetter(mt,"fillLinearGradientEndPointX",0);je.addGetterSetter(mt,"strokeLinearGradientEndPointX",0);je.addGetterSetter(mt,"fillLinearGradientEndPointY",0);je.addGetterSetter(mt,"strokeLinearGradientEndPointY",0);je.addComponentsGetterSetter(mt,"fillRadialGradientStartPoint",["x","y"]);je.addGetterSetter(mt,"fillRadialGradientStartPointX",0);je.addGetterSetter(mt,"fillRadialGradientStartPointY",0);je.addComponentsGetterSetter(mt,"fillRadialGradientEndPoint",["x","y"]);je.addGetterSetter(mt,"fillRadialGradientEndPointX",0);je.addGetterSetter(mt,"fillRadialGradientEndPointY",0);je.addGetterSetter(mt,"fillPatternRotation",0);je.addGetterSetter(mt,"fillRule",void 0,vh());je.backCompat(mt,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const sk="#",lk="beforeDraw",uk="draw",v8=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],ck=v8.length;let mh=class extends al{constructor(e){super(e),this.canvas=new lf,this.hitCanvas=new Vm({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);const r=this.getStage();return r&&r.content&&(r.content.removeChild(this.getNativeCanvasElement()),e<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[e+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){At.prototype.moveToTop.call(this);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!At.prototype.moveUp.call(this))return!1;const r=this.getStage();return!r||!r.content?!1:(r.content.removeChild(this.getNativeCanvasElement()),this.index<r.children.length-1?r.content.insertBefore(this.getNativeCanvasElement(),r.children[this.index+1].getCanvas()._canvas):r.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(At.prototype.moveDown.call(this)){const e=this.getStage();if(e){const r=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),r[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(At.prototype.moveToBottom.call(this)){const e=this.getStage();if(e){const r=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),r[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const e=this.getNativeCanvasElement();return At.prototype.remove.call(this),e&&e.parentNode&&Ze._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:r}){return this.canvas.setSize(e,r),this.hitCanvas.setSize(e,r),this._setSmoothEnabled(),this}_validateAdd(e){const r=e.getType();r!=="Group"&&r!=="Shape"&&Ze.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e={...e},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),At.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){Ze.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Ze.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Ze.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let r=1,n=!1;for(;;){for(let i=0;i<ck;i++){const a=v8[i],o=this._getIntersection({x:e.x+a.x*r,y:e.y+a.y*r}),s=o.shape;if(s)return s;if(n=!!o.antialiased,!o.antialiased)break}if(n)r+=1;else return null}}_getIntersection(e){const r=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(e.x*r),Math.round(e.y*r),1,1).data,i=n[3];if(i===255){const a=Ze._rgbToHex(n[0],n[1],n[2]),o=ip[sk+a];return o?{shape:o}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(e,r,n){const i=this.getLayer(),a=e||i&&i.getCanvas();return this._fire(lk,{node:this}),this.clearBeforeDraw()&&a.getContext().clear(),al.prototype.drawScene.call(this,a,r,n),this._fire(uk,{node:this}),this}drawHit(e,r){const n=this.getLayer(),i=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),al.prototype.drawHit.call(this,i,r),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){Ze.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return Ze.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return Ze.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};mh.prototype.nodeType="Layer";Fi(mh);je.addGetterSetter(mh,"imageSmoothingEnabled",!0);je.addGetterSetter(mh,"clearBeforeDraw",!0);je.addGetterSetter(mh,"hitGraphEnabled",!0,au());class Km extends mh{constructor(e){super(e),this.listening(!1),Ze.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Km.prototype.nodeType="FastLayer";Fi(Km);let dd=class extends al{_validateAdd(e){const r=e.getType();r!=="Group"&&r!=="Shape"&&Ze.throw("You may only add groups and shapes to groups.")}};dd.prototype.nodeType="Group";Fi(dd);const $g=function(){return Zf.performance&&Zf.performance.now?function(){return Zf.performance.now()}:function(){return new Date().getTime()}}();let _d=class Kh{constructor(e,r){this.id=Kh.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:$g(),frameRate:0},this.func=e,this.setLayers(r)}setLayers(e){let r=[];return e&&(r=Array.isArray(e)?e:[e]),this.layers=r,this}getLayers(){return this.layers}addLayer(e){const r=this.layers,n=r.length;for(let i=0;i<n;i++)if(r[i]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const r=Kh.animations,n=r.length;for(let i=0;i<n;i++)if(r[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=$g(),Kh._addAnimation(this),this}stop(){return Kh._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const r=e.id,n=this.animations,i=n.length;for(let a=0;a<i;a++)if(n[a].id===r){this.animations.splice(a,1);break}}static _runFrames(){const e={},r=this.animations;for(let n=0;n<r.length;n++){const i=r[n],a=i.layers,o=i.func;i._updateFrameObject($g());const s=a.length;let u;if(o?u=o.call(i,i.frame)!==!1:u=!0,!!u)for(let h=0;h<s;h++){const f=a[h];f._id!==void 0&&(e[f._id]=f)}}for(const n in e)e.hasOwnProperty(n)&&e[n].batchDraw()}static _animationLoop(){const e=Kh;e.animations.length?(e._runFrames(),Ze.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,Ze.requestAnimFrame(this._animationLoop))}};_d.animations=[];_d.animIdCounter=0;_d.animRunning=!1;const fk={node:1,duration:1,easing:1,onFinish:1,yoyo:1},hk=1,U5=2,H5=3,$5=["fill","stroke","shadowColor"];let dk=0;class pk{constructor(e,r,n,i,a,o,s){this.prop=e,this.propFunc=r,this.begin=i,this._pos=i,this.duration=o,this._change=0,this.prevPos=0,this.yoyo=s,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=n,this._change=a-this.begin,this.pause()}fire(e){const r=this[e];r&&r()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=U5,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=H5,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const e=this.getTimer()-this._startTime;this.state===U5?this.setTime(e):this.state===H5&&this.setTime(this.duration-e)}pause(){this.state=hk,this.fire("onPause")}getTimer(){return new Date().getTime()}}class ri{constructor(e){const r=this,n=e.node,i=n._id,a=e.easing||ap.Linear,o=!!e.yoyo;let s,u;typeof e.duration>"u"?s=.3:e.duration===0?s=.001:s=e.duration,this.node=n,this._id=dk++;const h=n.getLayer()||(n instanceof Ot.Stage?n.getLayers():null);h||Ze.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new _d(function(){r.tween.onEnterFrame()},h),this.tween=new pk(u,function(f){r._tweenFunc(f)},a,0,1,s*1e3,o),this._addListeners(),ri.attrs[i]||(ri.attrs[i]={}),ri.attrs[i][this._id]||(ri.attrs[i][this._id]={}),ri.tweens[i]||(ri.tweens[i]={});for(u in e)fk[u]===void 0&&this._addAttr(u,e[u]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,r){const n=this.node,i=n._id;let a,o,s,u,h;const f=ri.tweens[i][e];f&&delete ri.attrs[i][f][e];let g=n.getAttr(e);if(Ze._isArray(r))if(a=[],o=Math.max(r.length,g.length),e==="points"&&r.length!==g.length&&(r.length>g.length?(u=g,g=Ze._prepareArrayForTween(g,r,n.closed())):(s=r,r=Ze._prepareArrayForTween(r,g,n.closed()))),e.indexOf("fill")===0)for(let v=0;v<o;v++)if(v%2===0)a.push(r[v]-g[v]);else{const p=Ze.colorToRGBA(g[v]);h=Ze.colorToRGBA(r[v]),g[v]=p,a.push({r:h.r-p.r,g:h.g-p.g,b:h.b-p.b,a:h.a-p.a})}else for(let v=0;v<o;v++)a.push(r[v]-g[v]);else $5.indexOf(e)!==-1?(g=Ze.colorToRGBA(g),h=Ze.colorToRGBA(r),a={r:h.r-g.r,g:h.g-g.g,b:h.b-g.b,a:h.a-g.a}):a=r-g;ri.attrs[i][this._id][e]={start:g,diff:a,end:r,trueEnd:s,trueStart:u},ri.tweens[i][e]=this._id}_tweenFunc(e){const r=this.node,n=ri.attrs[r._id][this._id];let i,a,o,s,u,h,f,g;for(i in n){if(a=n[i],o=a.start,s=a.diff,g=a.end,Ze._isArray(o))if(u=[],f=Math.max(o.length,g.length),i.indexOf("fill")===0)for(h=0;h<f;h++)h%2===0?u.push((o[h]||0)+s[h]*e):u.push("rgba("+Math.round(o[h].r+s[h].r*e)+","+Math.round(o[h].g+s[h].g*e)+","+Math.round(o[h].b+s[h].b*e)+","+(o[h].a+s[h].a*e)+")");else for(h=0;h<f;h++)u.push((o[h]||0)+s[h]*e);else $5.indexOf(i)!==-1?u="rgba("+Math.round(o.r+s.r*e)+","+Math.round(o.g+s.g*e)+","+Math.round(o.b+s.b*e)+","+(o.a+s.a*e)+")":u=o+s*e;r.setAttr(i,u)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const e=this.node,r=ri.attrs[e._id][this._id];r.points&&r.points.trueEnd&&e.setAttr("points",r.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const e=this.node,r=ri.attrs[e._id][this._id];r.points&&r.points.trueStart&&e.points(r.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const e=this.node._id,r=this._id,n=ri.tweens[e];this.pause(),this.anim&&this.anim.stop();for(const i in n)delete ri.tweens[e][i];delete ri.attrs[e][r],ri.tweens[e]&&(Object.keys(ri.tweens[e]).length===0&&delete ri.tweens[e],Object.keys(ri.attrs[e]).length===0&&delete ri.attrs[e])}}ri.attrs={};ri.tweens={};At.prototype.to=function(t){const e=t.onFinish;t.node=this,t.onFinish=function(){this.destroy(),e&&e()},new ri(t).play()};const ap={BackEaseIn(t,e,r,n){return r*(t/=n)*t*((1.70158+1)*t-1.70158)+e},BackEaseOut(t,e,r,n){return r*((t=t/n-1)*t*((1.70158+1)*t+1.70158)+1)+e},BackEaseInOut(t,e,r,n){let i=1.70158;return(t/=n/2)<1?r/2*(t*t*(((i*=1.525)+1)*t-i))+e:r/2*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)+e},ElasticEaseIn(t,e,r,n,i,a){let o=0;return t===0?e:(t/=n)===1?e+r:(a||(a=n*.3),!i||i<Math.abs(r)?(i=r,o=a/4):o=a/(2*Math.PI)*Math.asin(r/i),-(i*Math.pow(2,10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/a))+e)},ElasticEaseOut(t,e,r,n,i,a){let o=0;return t===0?e:(t/=n)===1?e+r:(a||(a=n*.3),!i||i<Math.abs(r)?(i=r,o=a/4):o=a/(2*Math.PI)*Math.asin(r/i),i*Math.pow(2,-10*t)*Math.sin((t*n-o)*(2*Math.PI)/a)+r+e)},ElasticEaseInOut(t,e,r,n,i,a){let o=0;return t===0?e:(t/=n/2)===2?e+r:(a||(a=n*(.3*1.5)),!i||i<Math.abs(r)?(i=r,o=a/4):o=a/(2*Math.PI)*Math.asin(r/i),t<1?-.5*(i*Math.pow(2,10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/a))+e:i*Math.pow(2,-10*(t-=1))*Math.sin((t*n-o)*(2*Math.PI)/a)*.5+r+e)},BounceEaseOut(t,e,r,n){return(t/=n)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e},BounceEaseIn(t,e,r,n){return r-ap.BounceEaseOut(n-t,0,r,n)+e},BounceEaseInOut(t,e,r,n){return t<n/2?ap.BounceEaseIn(t*2,0,r,n)*.5+e:ap.BounceEaseOut(t*2-n,0,r,n)*.5+r*.5+e},EaseIn(t,e,r,n){return r*(t/=n)*t+e},EaseOut(t,e,r,n){return-r*(t/=n)*(t-2)+e},EaseInOut(t,e,r,n){return(t/=n/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e},StrongEaseIn(t,e,r,n){return r*(t/=n)*t*t*t*t+e},StrongEaseOut(t,e,r,n){return r*((t=t/n-1)*t*t*t*t+1)+e},StrongEaseInOut(t,e,r,n){return(t/=n/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e},Linear(t,e,r,n){return r*t/n+e}},sh=Ze._assign(Ot,{Util:Ze,Transform:nl,Node:At,Container:al,Stage:z0,stages:np,Layer:mh,FastLayer:Km,Group:dd,DD:yn,Shape:mt,shapes:ip,Animation:_d,Tween:ri,Easings:ap,Context:F0,Canvas:Wm});let wc=class extends mt{_sceneFunc(e){const r=Ot.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,r,n),e.arc(0,0,this.innerRadius(),r,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),r=this.outerRadius(),n=this.clockwise(),i=Ot.getAngle(n?360-this.angle():this.angle()),a=Math.cos(Math.min(i,Math.PI)),o=1,s=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),u=Math.sin(Math.min(i,Math.PI/2)),h=a*(a>0?e:r),f=o*r,g=s*(s>0?e:r),v=u*(u>0?r:e);return{x:h,y:n?-1*v:g,width:f-h,height:v-g}}};wc.prototype._centroid=!0;wc.prototype.className="Arc";wc.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];Fi(wc);je.addGetterSetter(wc,"innerRadius",0,Et());je.addGetterSetter(wc,"outerRadius",0,Et());je.addGetterSetter(wc,"angle",0,Et());je.addGetterSetter(wc,"clockwise",!1,au());function sm(t,e,r,n,i,a,o){const s=Math.sqrt(Math.pow(r-t,2)+Math.pow(n-e,2)),u=Math.sqrt(Math.pow(i-r,2)+Math.pow(a-n,2)),h=o*s/(s+u),f=o*u/(s+u),g=r-h*(i-t),v=n-h*(a-e),p=r+f*(i-t),y=n+f*(a-e);return[g,v,p,y]}function G5(t,e){const r=t.length,n=[];for(let i=2;i<r-2;i+=2){const a=sm(t[i-2],t[i-1],t[i],t[i+1],t[i+2],t[i+3],e);isNaN(a[0])||(n.push(a[0]),n.push(a[1]),n.push(t[i]),n.push(t[i+1]),n.push(a[2]),n.push(a[3]))}return n}let _c=class extends mt{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){const r=this.points(),n=r.length,i=this.tension(),a=this.closed(),o=this.bezier();if(!n)return;let s=0;if(e.beginPath(),e.moveTo(r[0],r[1]),i!==0&&n>4){const u=this.getTensionPoints(),h=u.length;for(s=a?0:4,a||e.quadraticCurveTo(u[0],u[1],u[2],u[3]);s<h-2;)e.bezierCurveTo(u[s++],u[s++],u[s++],u[s++],u[s++],u[s++]);a||e.quadraticCurveTo(u[h-2],u[h-1],r[n-2],r[n-1])}else if(o)for(s=2;s<n;)e.bezierCurveTo(r[s++],r[s++],r[s++],r[s++],r[s++],r[s++]);else for(s=2;s<n;s+=2)e.lineTo(r[s],r[s+1]);a?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():G5(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),r=e.length,n=this.tension(),i=sm(e[r-2],e[r-1],e[0],e[1],e[2],e[3],n),a=sm(e[r-4],e[r-3],e[r-2],e[r-1],e[0],e[1],n),o=G5(e,n);return[i[2],i[3]].concat(o).concat([a[0],a[1],e[r-2],e[r-1],a[2],a[3],i[0],i[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:e=this.points();let r=e[0],n=e[0],i=e[1],a=e[1],o,s;for(let u=0;u<e.length/2;u++)o=e[u*2],s=e[u*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,s),a=Math.max(a,s);return{x:r,y:i,width:n-r,height:a-i}}};_c.prototype.className="Line";_c.prototype._attrsAffectingSize=["points","bezier","tension"];Fi(_c);je.addGetterSetter(_c,"closed",!1);je.addGetterSetter(_c,"bezier",!1);je.addGetterSetter(_c,"tension",0,Et());je.addGetterSetter(_c,"points",[],LE());const gk=[[],[],[-.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]],vk=[[],[],[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]],mk=[[1],[1,1],[1,2,1],[1,3,3,1]],W5=(t,e,r)=>{let n,i;const o=r/2;n=0;for(let s=0;s<20;s++)i=o*gk[20][s]+o,n+=vk[20][s]*yk(t,e,i);return o*n},V5=(t,e,r)=>{r===void 0&&(r=1);const n=t[0]-2*t[1]+t[2],i=e[0]-2*e[1]+e[2],a=2*t[1]-2*t[0],o=2*e[1]-2*e[0],s=4*(n*n+i*i),u=4*(n*a+i*o),h=a*a+o*o;if(s===0)return r*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(e[2]-e[0],2));const f=u/(2*s),g=h/s,v=r+f,p=g-f*f,y=v*v+p>0?Math.sqrt(v*v+p):0,_=f*f+p>0?Math.sqrt(f*f+p):0,x=f+Math.sqrt(f*f+p)!==0?p*Math.log(Math.abs((v+y)/(f+_))):0;return Math.sqrt(s)/2*(v*y-f*_+x)};function yk(t,e,r){const n=lm(1,r,t),i=lm(1,r,e),a=n*n+i*i;return Math.sqrt(a)}const lm=(t,e,r)=>{const n=r.length-1;let i,a;if(n===0)return 0;if(t===0){a=0;for(let o=0;o<=n;o++)a+=mk[n][o]*Math.pow(1-e,n-o)*Math.pow(e,o)*r[o];return a}else{i=new Array(n);for(let o=0;o<n;o++)i[o]=n*(r[o+1]-r[o]);return lm(t-1,e,i)}},Y5=(t,e,r)=>{let n=1,i=t/e,a=(t-r(i))/e,o=0;for(;n>.001;){const s=r(i+a),u=Math.abs(t-s)/e;if(u<n)n=u,i+=a;else{const h=r(i-a),f=Math.abs(t-h)/e;f<n?(n=f,i-=a):a/=2}if(o++,o>500)break}return i};let Ol=class Ns extends mt{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Ns.parsePathData(this.data()),this.pathLength=Ns.getPathLength(this.dataArray)}_sceneFunc(e){const r=this.dataArray;e.beginPath();let n=!1;for(let i=0;i<r.length;i++){const a=r[i].command,o=r[i].points;switch(a){case"L":e.lineTo(o[0],o[1]);break;case"M":e.moveTo(o[0],o[1]);break;case"C":e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":e.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":const s=o[0],u=o[1],h=o[2],f=o[3],g=o[4],v=o[5],p=o[6],y=o[7],_=h>f?h:f,x=h>f?1:h/f,b=h>f?f/h:1;e.translate(s,u),e.rotate(p),e.scale(x,b),e.arc(0,0,_,g,g+v,1-y),e.scale(1/x,1/b),e.rotate(-p),e.translate(-s,-u);break;case"z":n=!0,e.closePath();break}}!n&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(u){if(u.command==="A"){const h=u.points[4],f=u.points[5],g=u.points[4]+f;let v=Math.PI/180;if(Math.abs(h-g)<v&&(v=Math.abs(h-g)),f<0)for(let p=h-v;p>g;p-=v){const y=Ns.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);e.push(y.x,y.y)}else for(let p=h+v;p<g;p+=v){const y=Ns.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);e.push(y.x,y.y)}}else if(u.command==="C")for(let h=0;h<=1;h+=.01){const f=Ns.getPointOnCubicBezier(h,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3],u.points[4],u.points[5]);e.push(f.x,f.y)}else e=e.concat(u.points)});let r=e[0],n=e[0],i=e[1],a=e[1],o,s;for(let u=0;u<e.length/2;u++)o=e[u*2],s=e[u*2+1],isNaN(o)||(r=Math.min(r,o),n=Math.max(n,o)),isNaN(s)||(i=Math.min(i,s),a=Math.max(a,s));return{x:r,y:i,width:n-r,height:a-i}}getLength(){return this.pathLength}getPointAtLength(e){return Ns.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,r,n,i){return Math.sqrt((n-e)*(n-e)+(i-r)*(i-r))}static getPathLength(e){let r=0;for(let n=0;n<e.length;++n)r+=e[n].pathLength;return r}static getPointAtLengthOfDataArray(e,r){let n,i=0,a=r.length;if(!a)return null;for(;i<a&&e>r[i].pathLength;)e-=r[i].pathLength,++i;if(i===a)return n=r[i-1].points.slice(-2),{x:n[0],y:n[1]};if(e<.01)return r[i].command==="M"?(n=r[i].points.slice(0,2),{x:n[0],y:n[1]}):{x:r[i].start.x,y:r[i].start.y};const o=r[i],s=o.points;switch(o.command){case"L":return Ns.getPointOnLine(e,o.start.x,o.start.y,s[0],s[1]);case"C":return Ns.getPointOnCubicBezier(Y5(e,Ns.getPathLength(r),_=>W5([o.start.x,s[0],s[2],s[4]],[o.start.y,s[1],s[3],s[5]],_)),o.start.x,o.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case"Q":return Ns.getPointOnQuadraticBezier(Y5(e,Ns.getPathLength(r),_=>V5([o.start.x,s[0],s[2]],[o.start.y,s[1],s[3]],_)),o.start.x,o.start.y,s[0],s[1],s[2],s[3]);case"A":const u=s[0],h=s[1],f=s[2],g=s[3],v=s[5],p=s[6];let y=s[4];return y+=v*e/o.pathLength,Ns.getPointOnEllipticalArc(u,h,f,g,y,p)}return null}static getPointOnLine(e,r,n,i,a,o,s){o=o??r,s=s??n;const u=this.getLineLength(r,n,i,a);if(u<1e-10)return{x:r,y:n};if(i===r)return{x:o,y:s+(a>n?e:-e)};const h=(a-n)/(i-r),f=Math.sqrt(e*e/(1+h*h))*(i<r?-1:1),g=h*f;if(Math.abs(s-n-h*(o-r))<1e-10)return{x:o+f,y:s+g};const v=((o-r)*(i-r)+(s-n)*(a-n))/(u*u),p=r+v*(i-r),y=n+v*(a-n),_=this.getLineLength(o,s,p,y),x=Math.sqrt(e*e-_*_),b=Math.sqrt(x*x/(1+h*h))*(i<r?-1:1),E=h*b;return{x:p+b,y:y+E}}static getPointOnCubicBezier(e,r,n,i,a,o,s,u,h){function f(x){return x*x*x}function g(x){return 3*x*x*(1-x)}function v(x){return 3*x*(1-x)*(1-x)}function p(x){return(1-x)*(1-x)*(1-x)}const y=u*f(e)+o*g(e)+i*v(e)+r*p(e),_=h*f(e)+s*g(e)+a*v(e)+n*p(e);return{x:y,y:_}}static getPointOnQuadraticBezier(e,r,n,i,a,o,s){function u(p){return p*p}function h(p){return 2*p*(1-p)}function f(p){return(1-p)*(1-p)}const g=o*u(e)+i*h(e)+r*f(e),v=s*u(e)+a*h(e)+n*f(e);return{x:g,y:v}}static getPointOnEllipticalArc(e,r,n,i,a,o){const s=Math.cos(o),u=Math.sin(o),h={x:n*Math.cos(a),y:i*Math.sin(a)};return{x:e+(h.x*s-h.y*u),y:r+(h.x*u+h.y*s)}}static parsePathData(e){if(!e)return[];let r=e;const n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];r=r.replace(new RegExp(" ","g"),",");for(let g=0;g<n.length;g++)r=r.replace(new RegExp(n[g],"g"),"|"+n[g]);const i=r.split("|"),a=[],o=[];let s=0,u=0;const h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let f;for(let g=1;g<i.length;g++){let v=i[g],p=v.charAt(0);for(v=v.slice(1),o.length=0;f=h.exec(v);)o.push(f[0]);let y=[],_=p==="A"||p==="a"?0:-1;for(let x=0,b=o.length;x<b;x++){const E=o[x];if(E==="00"){y.push(0,0),_>=0&&(_+=2,_>=7&&(_-=7));continue}if(_>=0){if(_===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(E)){y.push(parseInt(E[0],10)),y.push(parseInt(E[1],10)),y.push(parseFloat(E.slice(2))),_+=3,_>=7&&(_-=7);continue}if(E==="11"||E==="10"||E==="01"){y.push(parseInt(E[0],10)),y.push(parseInt(E[1],10)),_+=2,_>=7&&(_-=7);continue}if(E==="0"||E==="1"){y.push(parseInt(E,10)),_+=1,_>=7&&(_-=7);continue}}else if(_===4){if(/^[01]\d+(?:\.\d+)?$/.test(E)){y.push(parseInt(E[0],10)),y.push(parseFloat(E.slice(1))),_+=2,_>=7&&(_-=7);continue}if(E==="0"||E==="1"){y.push(parseInt(E,10)),_+=1,_>=7&&(_-=7);continue}}const A=parseFloat(E);isNaN(A)?y.push(0):y.push(A),_+=1,_>=7&&(_-=7)}else{const A=parseFloat(E);isNaN(A)?y.push(0):y.push(A)}}for(;y.length>0&&!isNaN(y[0]);){let x="",b=[];const E=s,A=u;let S,k,I,O,M,F,j,T,L,$;switch(p){case"l":s+=y.shift(),u+=y.shift(),x="L",b.push(s,u);break;case"L":s=y.shift(),u=y.shift(),b.push(s,u);break;case"m":const q=y.shift(),J=y.shift();if(s+=q,u+=J,x="M",a.length>2&&a[a.length-1].command==="z"){for(let ae=a.length-2;ae>=0;ae--)if(a[ae].command==="M"){s=a[ae].points[0]+q,u=a[ae].points[1]+J;break}}b.push(s,u),p="l";break;case"M":s=y.shift(),u=y.shift(),x="M",b.push(s,u),p="L";break;case"h":s+=y.shift(),x="L",b.push(s,u);break;case"H":s=y.shift(),x="L",b.push(s,u);break;case"v":u+=y.shift(),x="L",b.push(s,u);break;case"V":u=y.shift(),x="L",b.push(s,u);break;case"C":b.push(y.shift(),y.shift(),y.shift(),y.shift()),s=y.shift(),u=y.shift(),b.push(s,u);break;case"c":b.push(s+y.shift(),u+y.shift(),s+y.shift(),u+y.shift()),s+=y.shift(),u+=y.shift(),x="C",b.push(s,u);break;case"S":k=s,I=u,S=a[a.length-1],S.command==="C"&&(k=s+(s-S.points[2]),I=u+(u-S.points[3])),b.push(k,I,y.shift(),y.shift()),s=y.shift(),u=y.shift(),x="C",b.push(s,u);break;case"s":k=s,I=u,S=a[a.length-1],S.command==="C"&&(k=s+(s-S.points[2]),I=u+(u-S.points[3])),b.push(k,I,s+y.shift(),u+y.shift()),s+=y.shift(),u+=y.shift(),x="C",b.push(s,u);break;case"Q":b.push(y.shift(),y.shift()),s=y.shift(),u=y.shift(),b.push(s,u);break;case"q":b.push(s+y.shift(),u+y.shift()),s+=y.shift(),u+=y.shift(),x="Q",b.push(s,u);break;case"T":k=s,I=u,S=a[a.length-1],S.command==="Q"&&(k=s+(s-S.points[0]),I=u+(u-S.points[1])),s=y.shift(),u=y.shift(),x="Q",b.push(k,I,s,u);break;case"t":k=s,I=u,S=a[a.length-1],S.command==="Q"&&(k=s+(s-S.points[0]),I=u+(u-S.points[1])),s+=y.shift(),u+=y.shift(),x="Q",b.push(k,I,s,u);break;case"A":O=y.shift(),M=y.shift(),F=y.shift(),j=y.shift(),T=y.shift(),L=s,$=u,s=y.shift(),u=y.shift(),x="A",b=this.convertEndpointToCenterParameterization(L,$,s,u,j,T,O,M,F);break;case"a":O=y.shift(),M=y.shift(),F=y.shift(),j=y.shift(),T=y.shift(),L=s,$=u,s+=y.shift(),u+=y.shift(),x="A",b=this.convertEndpointToCenterParameterization(L,$,s,u,j,T,O,M,F);break}a.push({command:x||p,points:b,start:{x:E,y:A},pathLength:this.calcLength(E,A,x||p,b)})}(p==="z"||p==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(e,r,n,i){let a,o,s,u;const h=Ns;switch(n){case"L":return h.getLineLength(e,r,i[0],i[1]);case"C":return W5([e,i[0],i[2],i[4]],[r,i[1],i[3],i[5]],1);case"Q":return V5([e,i[0],i[2]],[r,i[1],i[3]],1);case"A":a=0;const f=i[4],g=i[5],v=i[4]+g;let p=Math.PI/180;if(Math.abs(f-v)<p&&(p=Math.abs(f-v)),o=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],f,0),g<0)for(u=f-p;u>v;u-=p)s=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=h.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(u=f+p;u<v;u+=p)s=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],u,0),a+=h.getLineLength(o.x,o.y,s.x,s.y),o=s;return s=h.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],v,0),a+=h.getLineLength(o.x,o.y,s.x,s.y),a}return 0}static convertEndpointToCenterParameterization(e,r,n,i,a,o,s,u,h){const f=h*(Math.PI/180),g=Math.cos(f)*(e-n)/2+Math.sin(f)*(r-i)/2,v=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(r-i)/2,p=g*g/(s*s)+v*v/(u*u);p>1&&(s*=Math.sqrt(p),u*=Math.sqrt(p));let y=Math.sqrt((s*s*(u*u)-s*s*(v*v)-u*u*(g*g))/(s*s*(v*v)+u*u*(g*g)));a===o&&(y*=-1),isNaN(y)&&(y=0);const _=y*s*v/u,x=y*-u*g/s,b=(e+n)/2+Math.cos(f)*_-Math.sin(f)*x,E=(r+i)/2+Math.sin(f)*_+Math.cos(f)*x,A=function(j){return Math.sqrt(j[0]*j[0]+j[1]*j[1])},S=function(j,T){return(j[0]*T[0]+j[1]*T[1])/(A(j)*A(T))},k=function(j,T){return(j[0]*T[1]<j[1]*T[0]?-1:1)*Math.acos(S(j,T))},I=k([1,0],[(g-_)/s,(v-x)/u]),O=[(g-_)/s,(v-x)/u],M=[(-1*g-_)/s,(-1*v-x)/u];let F=k(O,M);return S(O,M)<=-1&&(F=Math.PI),S(O,M)>=1&&(F=0),o===0&&F>0&&(F=F-2*Math.PI),o===1&&F<0&&(F=F+2*Math.PI),[b,E,s,u,I,F,f,o]}};Ol.prototype.className="Path";Ol.prototype._attrsAffectingSize=["data"];Fi(Ol);je.addGetterSetter(Ol,"data");class yh extends _c{_sceneFunc(e){super._sceneFunc(e);const r=Math.PI*2,n=this.points();let i=n;const a=this.tension()!==0&&n.length>4;a&&(i=this.getTensionPoints());const o=this.pointerLength(),s=n.length;let u,h;if(a){const v=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],n[s-2],n[s-1]],p=Ol.calcLength(i[i.length-4],i[i.length-3],"C",v),y=Ol.getPointOnQuadraticBezier(Math.min(1,1-o/p),v[0],v[1],v[2],v[3],v[4],v[5]);u=n[s-2]-y.x,h=n[s-1]-y.y}else u=n[s-2]-n[s-4],h=n[s-1]-n[s-3];const f=(Math.atan2(h,u)+r)%r,g=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[s-2],n[s-1]),e.rotate(f),e.moveTo(0,0),e.lineTo(-o,g/2),e.lineTo(-o,-g/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(n[0],n[1]),a?(u=(i[0]+i[2])/2-n[0],h=(i[1]+i[3])/2-n[1]):(u=n[2]-n[0],h=n[3]-n[1]),e.rotate((Math.atan2(-h,-u)+r)%r),e.moveTo(0,0),e.lineTo(-o,g/2),e.lineTo(-o,-g/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const r=this.dashEnabled();r&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),r&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),r=this.pointerWidth()/2;return{x:e.x,y:e.y-r,width:e.width,height:e.height+r*2}}}yh.prototype.className="Arrow";Fi(yh);je.addGetterSetter(yh,"pointerLength",10,Et());je.addGetterSetter(yh,"pointerWidth",10,Et());je.addGetterSetter(yh,"pointerAtBeginning",!1);je.addGetterSetter(yh,"pointerAtEnding",!0);let xd=class extends mt{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};xd.prototype._centroid=!0;xd.prototype.className="Circle";xd.prototype._attrsAffectingSize=["radius"];Fi(xd);je.addGetterSetter(xd,"radius",0,Et());class kf extends mt{_sceneFunc(e){const r=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),r!==n&&e.scale(1,n/r),e.arc(0,0,r,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}kf.prototype.className="Ellipse";kf.prototype._centroid=!0;kf.prototype._attrsAffectingSize=["radiusX","radiusY"];Fi(kf);je.addComponentsGetterSetter(kf,"radius",["x","y"]);je.addGetterSetter(kf,"radiusX",0,Et());je.addGetterSetter(kf,"radiusY",0,Et());let $u=class m8 extends mt{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",r=>{this._removeImageLoad(r.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const e=!!this.cornerRadius(),r=this.hasShadow();return e&&r?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const r=this.getWidth(),n=this.getHeight(),i=this.cornerRadius(),a=this.attrs.image;let o;if(a){const s=this.attrs.cropWidth,u=this.attrs.cropHeight;s&&u?o=[a,this.cropX(),this.cropY(),s,u,0,0,r,n]:o=[a,0,0,r,n]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?Ze.drawRoundedRectPath(e,r,n,i):e.rect(0,0,r,n),e.closePath(),e.fillStrokeShape(this)),a&&(i&&e.clip(),e.drawImage.apply(e,o))}_hitFunc(e){const r=this.width(),n=this.height(),i=this.cornerRadius();e.beginPath(),i?Ze.drawRoundedRectPath(e,r,n,i):e.rect(0,0,r,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,r;return(e=this.attrs.width)!==null&&e!==void 0?e:(r=this.image())===null||r===void 0?void 0:r.width}getHeight(){var e,r;return(e=this.attrs.height)!==null&&e!==void 0?e:(r=this.image())===null||r===void 0?void 0:r.height}static fromURL(e,r,n=null){const i=Ze.createImageElement();i.onload=function(){const a=new m8({image:i});r(a)},i.onerror=n,i.crossOrigin="Anonymous",i.src=e}};$u.prototype.className="Image";Fi($u);je.addGetterSetter($u,"cornerRadius",0,B0(4));je.addGetterSetter($u,"image");je.addComponentsGetterSetter($u,"crop",["x","y","width","height"]);je.addGetterSetter($u,"cropX",0,Et());je.addGetterSetter($u,"cropY",0,Et());je.addGetterSetter($u,"cropWidth",0,Et());je.addGetterSetter($u,"cropHeight",0,Et());const y8=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],bk="Change.konva",wk="none",um="up",cm="right",fm="down",hm="left",_k=y8.length;let Zm=class extends dd{constructor(e){super(e),this.on("add.konva",function(r){this._addListeners(r.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let r=this,n;const i=function(){r._sync()};for(n=0;n<_k;n++)e.on(y8[n]+bk,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),r=this.getTag(),n,i,a,o,s,u,h;if(e&&r){switch(n=e.width(),i=e.height(),a=r.pointerDirection(),o=r.pointerWidth(),h=r.pointerHeight(),s=0,u=0,a){case um:s=n/2,u=-1*h;break;case cm:s=n+o,u=i/2;break;case fm:s=n/2,u=i+h;break;case hm:s=-1*o,u=i/2;break}r.setAttrs({x:-1*s,y:-1*u,width:n,height:i}),e.setAttrs({x:-1*s,y:-1*u})}}};Zm.prototype.className="Label";Fi(Zm);let bh=class extends mt{_sceneFunc(e){const r=this.width(),n=this.height(),i=this.pointerDirection(),a=this.pointerWidth(),o=this.pointerHeight(),s=this.cornerRadius();let u=0,h=0,f=0,g=0;typeof s=="number"?u=h=f=g=Math.min(s,r/2,n/2):(u=Math.min(s[0]||0,r/2,n/2),h=Math.min(s[1]||0,r/2,n/2),g=Math.min(s[2]||0,r/2,n/2),f=Math.min(s[3]||0,r/2,n/2)),e.beginPath(),e.moveTo(u,0),i===um&&(e.lineTo((r-a)/2,0),e.lineTo(r/2,-1*o),e.lineTo((r+a)/2,0)),e.lineTo(r-h,0),e.arc(r-h,h,h,Math.PI*3/2,0,!1),i===cm&&(e.lineTo(r,(n-o)/2),e.lineTo(r+a,n/2),e.lineTo(r,(n+o)/2)),e.lineTo(r,n-g),e.arc(r-g,n-g,g,0,Math.PI/2,!1),i===fm&&(e.lineTo((r+a)/2,n),e.lineTo(r/2,n+o),e.lineTo((r-a)/2,n)),e.lineTo(f,n),e.arc(f,n-f,f,Math.PI/2,Math.PI,!1),i===hm&&(e.lineTo(0,(n+o)/2),e.lineTo(-1*a,n/2),e.lineTo(0,(n-o)/2)),e.lineTo(0,u),e.arc(u,u,u,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,r=0,n=this.pointerWidth(),i=this.pointerHeight(),a=this.pointerDirection(),o=this.width(),s=this.height();return a===um?(r-=i,s+=i):a===fm?s+=i:a===hm?(e-=n*1.5,o+=n):a===cm&&(o+=n*1.5),{x:e,y:r,width:o,height:s}}};bh.prototype.className="Tag";Fi(bh);je.addGetterSetter(bh,"pointerDirection",wk);je.addGetterSetter(bh,"pointerWidth",0,Et());je.addGetterSetter(bh,"pointerHeight",0,Et());je.addGetterSetter(bh,"cornerRadius",0,B0(4));let Tp=class extends mt{_sceneFunc(e){const r=this.cornerRadius(),n=this.width(),i=this.height();e.beginPath(),r?Ze.drawRoundedRectPath(e,n,i,r):e.rect(0,0,n,i),e.closePath(),e.fillStrokeShape(this)}};Tp.prototype.className="Rect";Fi(Tp);je.addGetterSetter(Tp,"cornerRadius",0,B0(4));class Af extends mt{_sceneFunc(e){const r=this._getPoints(),n=this.radius(),i=this.sides(),a=this.cornerRadius();if(e.beginPath(),a)Ze.drawRoundedPolygonPath(e,r,i,n,a);else{e.moveTo(r[0].x,r[0].y);for(let o=1;o<r.length;o++)e.lineTo(r[o].x,r[o].y)}e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,r=this.attrs.radius||0,n=[];for(let i=0;i<e;i++)n.push({x:r*Math.sin(i*2*Math.PI/e),y:-1*r*Math.cos(i*2*Math.PI/e)});return n}getSelfRect(){const e=this._getPoints();let r=e[0].x,n=e[0].y,i=e[0].x,a=e[0].y;return e.forEach(o=>{r=Math.min(r,o.x),n=Math.max(n,o.x),i=Math.min(i,o.y),a=Math.max(a,o.y)}),{x:r,y:i,width:n-r,height:a-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Af.prototype.className="RegularPolygon";Af.prototype._centroid=!0;Af.prototype._attrsAffectingSize=["radius"];Fi(Af);je.addGetterSetter(Af,"radius",0,Et());je.addGetterSetter(Af,"sides",0,Et());je.addGetterSetter(Af,"cornerRadius",0,B0(4));const X5=Math.PI*2;class wh extends mt{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,X5,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),X5,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}wh.prototype.className="Ring";wh.prototype._centroid=!0;wh.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Fi(wh);je.addGetterSetter(wh,"innerRadius",0,Et());je.addGetterSetter(wh,"outerRadius",0,Et());class Gu extends mt{constructor(e){super(e),this._updated=!0,this.anim=new _d(()=>{const r=this._updated;return this._updated=!1,r}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){const r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),s=a[i+0],u=a[i+1],h=a[i+2],f=a[i+3],g=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,h,f),e.closePath(),e.fillStrokeShape(this)),g)if(o){const v=o[r],p=n*2;e.drawImage(g,s,u,h,f,v[p+0],v[p+1],h,f)}else e.drawImage(g,s,u,h,f,0,0,h,f)}_hitFunc(e){const r=this.animation(),n=this.frameIndex(),i=n*4,a=this.animations()[r],o=this.frameOffsets(),s=a[i+2],u=a[i+3];if(e.beginPath(),o){const h=o[r],f=n*2;e.rect(h[f+0],h[f+1],s,u)}else e.rect(0,0,s,u);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),r=this.animation(),n=this.animations(),i=n[r],a=i.length/4;e<a-1?this.frameIndex(e+1):this.frameIndex(0)}}Gu.prototype.className="Sprite";Fi(Gu);je.addGetterSetter(Gu,"animation");je.addGetterSetter(Gu,"animations");je.addGetterSetter(Gu,"frameOffsets");je.addGetterSetter(Gu,"image");je.addGetterSetter(Gu,"frameIndex",0,Et());je.addGetterSetter(Gu,"frameRate",17,Et());je.backCompat(Gu,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class Pf extends mt{_sceneFunc(e){const r=this.innerRadius(),n=this.outerRadius(),i=this.numPoints();e.beginPath(),e.moveTo(0,0-n);for(let a=1;a<i*2;a++){const o=a%2===0?n:r,s=o*Math.sin(a*Math.PI/i),u=-1*o*Math.cos(a*Math.PI/i);e.lineTo(s,u)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}Pf.prototype.className="Star";Pf.prototype._centroid=!0;Pf.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Fi(Pf);je.addGetterSetter(Pf,"numPoints",5,Et());je.addGetterSetter(Pf,"innerRadius",0,Et());je.addGetterSetter(Pf,"outerRadius",0,Et());function sf(t){return[...t].reduce((e,r,n,i)=>{if(new RegExp("\\p{Emoji}","u").test(r)){const a=i[n+1];a&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(a)?(e.push(r+a),i[n+1]=""):e.push(r)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(r+(i[n+1]||""))?e.push(r+i[n+1]):n>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(r)?e[e.length-1]+=r:r&&e.push(r);return e},[])}const $h="auto",xk="center",b8="inherit",Gh="justify",Sk="Change.konva",Ek="2d",K5="-",w8="left",kk="text",Ak="Text",Pk="top",Ok="bottom",Z5="middle",_8="normal",Ck="px ",E1=" ",Lk="right",Q5="rtl",Nk="word",Tk="char",J5="none",Gg="…",x8=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],Rk=x8.length;function Mk(t){return t.split(",").map(e=>{e=e.trim();const r=e.indexOf(" ")>=0,n=e.indexOf('"')>=0||e.indexOf("'")>=0;return r&&!n&&(e=`"${e}"`),e}).join(", ")}let k1;function Wg(){return k1||(k1=Ze.createCanvasElement().getContext(Ek),k1)}function Ik(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function jk(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Dk(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let pi=class extends mt{constructor(e){super(Dk(e)),this._partialTextX=0,this._partialTextY=0;for(let r=0;r<Rk;r++)this.on(x8[r]+Sk,this._setTextData);this._setTextData()}_sceneFunc(e){var r,n;const i=this.textArr,a=i.length;if(!this.text())return;let o=this.padding(),s=this.fontSize(),u=this.lineHeight()*s,h=this.verticalAlign(),f=this.direction(),g=0,v=this.align(),p=this.getWidth(),y=this.letterSpacing(),_=this.charRenderFunc(),x=this.fill(),b=this.textDecoration(),E=b.indexOf("underline")!==-1,A=b.indexOf("line-through")!==-1,S;f=f===b8?e.direction:f;let k=u/2,I=Z5;if(!Ot.legacyTextRendering){const O=this.measureSize("M");I="alphabetic";const M=(r=O.fontBoundingBoxAscent)!==null&&r!==void 0?r:O.actualBoundingBoxAscent,F=(n=O.fontBoundingBoxDescent)!==null&&n!==void 0?n:O.actualBoundingBoxDescent;k=(M-F)/2+u/2}for(f===Q5&&e.setAttr("direction",f),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",I),e.setAttr("textAlign",w8),h===Z5?g=(this.getHeight()-a*u-o*2)/2:h===Ok&&(g=this.getHeight()-a*u-o*2),e.translate(o,g+o),S=0;S<a;S++){let O=0,M=0;const F=i[S],j=F.text,T=F.width,L=F.lastInParagraph;if(e.save(),v===Lk?O+=p-T-o*2:v===xk&&(O+=(p-T-o*2)/2),E){e.save(),e.beginPath();const $=Ot.legacyTextRendering?Math.round(s/2):Math.round(s/4),q=O,J=k+M+$;e.moveTo(q,J);const ae=v===Gh&&!L?p-o*2:T;e.lineTo(q+Math.round(ae),J),e.lineWidth=s/15;const ie=this._getLinearGradient();e.strokeStyle=ie||x,e.stroke(),e.restore()}if(f!==Q5&&(y!==0||v===Gh||_)){const $=j.split(" ").length-1,q=sf(j);for(let J=0;J<q.length;J++){const ae=q[J];if(ae===" "&&!L&&v===Gh&&(O+=(p-o*2-T)/$),this._partialTextX=O,this._partialTextY=k+M,this._partialText=ae,_){e.save();const Z=i.slice(0,S).reduce((V,B)=>V+sf(B.text).length,0),te=J+Z;_({char:ae,index:te,x:O,y:k+M,lineIndex:S,column:J,isLastInLine:L,width:this.measureSize(ae).width,context:e})}e.fillStrokeShape(this),_&&e.restore(),O+=this.measureSize(ae).width+y}}else y!==0&&e.setAttr("letterSpacing",`${y}px`),this._partialTextX=O,this._partialTextY=k+M,this._partialText=j,e.fillStrokeShape(this);if(A){e.save(),e.beginPath();const $=Ot.legacyTextRendering?0:-Math.round(s/4),q=v===Gh?0:O;e.moveTo(q,k+M+$);const J=v===Gh&&!L?p-o*2:T;e.lineTo(q+Math.round(J),k+M+$),e.lineWidth=s/15;const ae=this._getLinearGradient();e.strokeStyle=ae||x,e.stroke(),e.restore()}e.restore(),a>1&&(k+=u)}}_hitFunc(e){const r=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,r,n),e.closePath(),e.fillStrokeShape(this)}setText(e){const r=Ze._isString(e)?e:e==null?"":e+"";return this._setAttr(kk,r),this}getWidth(){return this.attrs.width===$h||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===$h||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return Ze.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var r,n,i,a,o,s,u,h,f,g,v;let p=Wg(),y=this.fontSize(),_;p.save(),p.font=this._getContextFont(),_=p.measureText(e),p.restore();const x=y/100;return{actualBoundingBoxAscent:(r=_.actualBoundingBoxAscent)!==null&&r!==void 0?r:71.58203125*x,actualBoundingBoxDescent:(n=_.actualBoundingBoxDescent)!==null&&n!==void 0?n:0,actualBoundingBoxLeft:(i=_.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*x,actualBoundingBoxRight:(a=_.actualBoundingBoxRight)!==null&&a!==void 0?a:75.732421875*x,alphabeticBaseline:(o=_.alphabeticBaseline)!==null&&o!==void 0?o:0,emHeightAscent:(s=_.emHeightAscent)!==null&&s!==void 0?s:100*x,emHeightDescent:(u=_.emHeightDescent)!==null&&u!==void 0?u:-20*x,fontBoundingBoxAscent:(h=_.fontBoundingBoxAscent)!==null&&h!==void 0?h:91*x,fontBoundingBoxDescent:(f=_.fontBoundingBoxDescent)!==null&&f!==void 0?f:21*x,hangingBaseline:(g=_.hangingBaseline)!==null&&g!==void 0?g:72.80000305175781*x,ideographicBaseline:(v=_.ideographicBaseline)!==null&&v!==void 0?v:-21*x,width:_.width,height:y}}_getContextFont(){return this.fontStyle()+E1+this.fontVariant()+E1+(this.fontSize()+Ck)+Mk(this.fontFamily())}_addTextLine(e){this.align()===Gh&&(e=e.trim());const n=this._getTextWidth(e);return this.textArr.push({text:e,width:n,lastInParagraph:!1})}_getTextWidth(e){const r=this.letterSpacing(),n=e.length;return Wg().measureText(e).width+r*n}_setTextData(){let e=this.text().split(`
|
|
56
|
-
`),r=+this.fontSize(),n=0,i=this.lineHeight()*r,a=this.attrs.width,o=this.attrs.height,s=a!==$h&&a!==void 0,u=o!==$h&&o!==void 0,h=this.padding(),f=a-h*2,g=o-h*2,v=0,p=this.wrap(),y=p!==J5,_=p!==Tk&&y,x=this.ellipsis();this.textArr=[],Wg().font=this._getContextFont();const b=x?this._getTextWidth(Gg):0;for(let E=0,A=e.length;E<A;++E){let S=e[E],k=this._getTextWidth(S);if(s&&k>f)for(;S.length>0;){let I=0,O=sf(S).length,M="",F=0;for(;I<O;){const j=I+O>>>1,T=sf(S),L=T.slice(0,j+1).join(""),$=this._getTextWidth(L);(x&&u&&v+i>g?$+b:$)<=f?(I=j+1,M=L,F=$):O=j}if(M){if(_){const L=sf(S),$=sf(M),q=L[$.length],J=q===E1||q===K5;let ae;if(J&&F<=f)ae=$.length;else{const ie=$.lastIndexOf(E1),Z=$.lastIndexOf(K5);ae=Math.max(ie,Z)+1}ae>0&&(I=ae,M=L.slice(0,I).join(""),F=this._getTextWidth(M))}if(M=M.trimRight(),this._addTextLine(M),n=Math.max(n,F),v+=i,this._shouldHandleEllipsis(v)){this._tryToAddEllipsisToLastLine();break}if(S=sf(S).slice(I).join("").trimLeft(),S.length>0&&(k=this._getTextWidth(S),k<=f)){this._addTextLine(S),v+=i,n=Math.max(n,k);break}}else break}else this._addTextLine(S),v+=i,n=Math.max(n,k),this._shouldHandleEllipsis(v)&&E<A-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),u&&v+i>g)break}this.textHeight=r,this.textWidth=n}_shouldHandleEllipsis(e){const r=+this.fontSize(),n=this.lineHeight()*r,i=this.attrs.height,a=i!==$h&&i!==void 0,o=this.padding(),s=i-o*2;return!(this.wrap()!==J5)||a&&e+n>s}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,r=e!==$h&&e!==void 0,n=this.padding(),i=e-n*2,a=this.ellipsis(),o=this.textArr[this.textArr.length-1];!o||!a||(r&&(this._getTextWidth(o.text+Gg)<i||(o.text=o.text.slice(0,o.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(o.text+Gg))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,r=this.hasShadow();return e&&r?!0:super._useBufferCanvas()}};pi.prototype._fillFunc=Ik;pi.prototype._strokeFunc=jk;pi.prototype.className=Ak;pi.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];Fi(pi);je.overWriteSetter(pi,"width",Ym());je.overWriteSetter(pi,"height",Ym());je.addGetterSetter(pi,"direction",b8);je.addGetterSetter(pi,"fontFamily","Arial");je.addGetterSetter(pi,"fontSize",12,Et());je.addGetterSetter(pi,"fontStyle",_8);je.addGetterSetter(pi,"fontVariant",_8);je.addGetterSetter(pi,"padding",0,Et());je.addGetterSetter(pi,"align",w8);je.addGetterSetter(pi,"verticalAlign",Pk);je.addGetterSetter(pi,"lineHeight",1,Et());je.addGetterSetter(pi,"wrap",Nk);je.addGetterSetter(pi,"ellipsis",!1,au());je.addGetterSetter(pi,"letterSpacing",0,Et());je.addGetterSetter(pi,"text","",vh());je.addGetterSetter(pi,"textDecoration","");je.addGetterSetter(pi,"charRenderFunc",void 0);const Fk="",S8="normal";function E8(t){t.fillText(this.partialText,0,0)}function k8(t){t.strokeText(this.partialText,0,0)}let Da=class extends mt{constructor(e){super(e),this.dummyCanvas=Ze.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return Ol.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const r=this.pathLength;return e>r?null:Ol.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=Ol.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();const r=this.textDecoration(),n=this.fill(),i=this.fontSize(),a=this.glyphInfo;r==="underline"&&e.beginPath();for(let o=0;o<a.length;o++){e.save();const s=a[o].p0;e.translate(s.x,s.y),e.rotate(a[o].rotation),this.partialText=a[o].text,e.fillStrokeShape(this),r==="underline"&&(o===0&&e.moveTo(0,i/2+1),e.lineTo(i,i/2+1)),e.restore()}r==="underline"&&(e.strokeStyle=n,e.lineWidth=i/20,e.stroke()),e.restore()}_hitFunc(e){e.beginPath();const r=this.glyphInfo;if(r.length>=1){const n=r[0].p0;e.moveTo(n.x,n.y)}for(let n=0;n<r.length;n++){const i=r[n].p1;e.lineTo(i.x,i.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return Ze.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return pi.prototype.setText.call(this,e)}_getContextFont(){return pi.prototype._getContextFont.call(this)}_getTextSize(e){const n=this.dummyCanvas.getContext("2d");n.save(),n.font=this._getContextFont();const i=n.measureText(e);return n.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const e=sf(this.text()),r=[];let n=0;for(let g=0;g<e.length;g++)r.push({char:e[g],width:this._getTextSize(e[g]).width}),n+=r[g].width;const{height:i}=this._getTextSize(this.attrs.text);if(this.textWidth=n,this.textHeight=i,this.glyphInfo=[],!this.attrs.data)return null;const a=this.letterSpacing(),o=this.align(),s=this.kerningFunc(),u=Math.max(this.textWidth+((this.attrs.text||"").length-1)*a,0);let h=0;o==="center"&&(h=Math.max(0,this.pathLength/2-u/2)),o==="right"&&(h=Math.max(0,this.pathLength-u));let f=h;for(let g=0;g<r.length;g++){const v=this._getPointAtLength(f);if(!v)return;const p=r[g].char;let y=r[g].width+a;if(p===" "&&o==="justify"){const S=this.text().split(" ").length-1;y+=(this.pathLength-u)/S}const _=this._getPointAtLength(f+y);if(!_)return;const x=Ol.getLineLength(v.x,v.y,_.x,_.y);let b=0;if(s)try{b=s(r[g-1].char,p)*this.fontSize()}catch{b=0}v.x+=b,_.x+=b,this.textWidth+=b;const E=Ol.getPointOnLine(b+x/2,v.x,v.y,_.x,_.y),A=Math.atan2(_.y-v.y,_.x-v.x);this.glyphInfo.push({transposeX:E.x,transposeY:E.y,text:e[g],rotation:A,p0:v,p1:_}),f+=y}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const e=[];this.glyphInfo.forEach(function(h){e.push(h.p0.x),e.push(h.p0.y),e.push(h.p1.x),e.push(h.p1.y)});let r=e[0]||0,n=e[0]||0,i=e[1]||0,a=e[1]||0,o,s;for(let h=0;h<e.length/2;h++)o=e[h*2],s=e[h*2+1],r=Math.min(r,o),n=Math.max(n,o),i=Math.min(i,s),a=Math.max(a,s);const u=this.fontSize();return{x:r-u/2,y:i-u/2,width:n-r+u,height:a-i+u}}destroy(){return Ze.releaseCanvas(this.dummyCanvas),super.destroy()}};Da.prototype._fillFunc=E8;Da.prototype._strokeFunc=k8;Da.prototype._fillFuncHit=E8;Da.prototype._strokeFuncHit=k8;Da.prototype.className="TextPath";Da.prototype._attrsAffectingSize=["text","fontSize","data"];Fi(Da);je.addGetterSetter(Da,"data");je.addGetterSetter(Da,"fontFamily","Arial");je.addGetterSetter(Da,"fontSize",12,Et());je.addGetterSetter(Da,"fontStyle",S8);je.addGetterSetter(Da,"align","left");je.addGetterSetter(Da,"letterSpacing",0,Et());je.addGetterSetter(Da,"textBaseline","middle");je.addGetterSetter(Da,"fontVariant",S8);je.addGetterSetter(Da,"text",Fk);je.addGetterSetter(Da,"textDecoration","");je.addGetterSetter(Da,"kerningFunc",void 0);const A8="tr-konva",Bk=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(t=>t+`.${A8}`).join(" "),e3="nodesRect",zk=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],qk={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},Uk="ontouchstart"in Ot._global;function Hk(t,e,r){if(t==="rotater")return r;e+=Ze.degToRad(qk[t]||0);const n=(Ze.radToDeg(e)%360+360)%360;return Ze._inRange(n,315+22.5,360)||Ze._inRange(n,0,22.5)?"ns-resize":Ze._inRange(n,45-22.5,45+22.5)?"nesw-resize":Ze._inRange(n,90-22.5,90+22.5)?"ew-resize":Ze._inRange(n,135-22.5,135+22.5)?"nwse-resize":Ze._inRange(n,180-22.5,180+22.5)?"ns-resize":Ze._inRange(n,225-22.5,225+22.5)?"nesw-resize":Ze._inRange(n,270-22.5,270+22.5)?"ew-resize":Ze._inRange(n,315-22.5,315+22.5)?"nwse-resize":(Ze.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}const p0=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function $k(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}function P8(t,e,r){const n=r.x+(t.x-r.x)*Math.cos(e)-(t.y-r.y)*Math.sin(e),i=r.y+(t.x-r.x)*Math.sin(e)+(t.y-r.y)*Math.cos(e);return{...t,rotation:t.rotation+e,x:n,y:i}}function Gk(t,e){const r=$k(t);return P8(t,e,r)}function Wk(t,e,r){let n=e;for(let i=0;i<t.length;i++){const a=Ot.getAngle(t[i]),o=Math.abs(a-e)%(Math.PI*2);Math.min(o,Math.PI*2-o)<r&&(n=a)}return n}let dm=0,Jr=class extends dd{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(Bk,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return Ze.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return A8+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const r=e.filter(i=>i.isAncestorOf(this)?(Ze.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=e=r,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const a=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(i._attrsAffectingSize.length){const o=i._attrsAffectingSize.map(s=>s+"Change."+this._getEventNamespace()).join(" ");i.on(o,a)}i.on(zk.map(o=>o+`.${this._getEventNamespace()}`).join(" "),a),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,a),this._proxyDrag(i)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let r;e.on(`dragstart.${this._getEventNamespace()}`,n=>{r=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(n,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!r)return;const i=e.getAbsolutePosition(),a=i.x-r.x,o=i.y-r.y;this.nodes().forEach(s=>{if(s===e||s.isDragging())return;const u=s.getAbsolutePosition();s.setAbsolutePosition({x:u.x+a,y:u.y+o}),s.startDrag(n)}),r=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(e3),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(e3,this.__getNodeRect)}__getNodeShape(e,r=this.rotation(),n){const i=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=e.getAbsoluteScale(n),o=e.getAbsolutePosition(n),s=i.x*a.x-e.offsetX()*a.x,u=i.y*a.y-e.offsetY()*a.y,h=(Ot.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),f={x:o.x+s*Math.cos(h)+u*Math.sin(-h),y:o.y+u*Math.cos(h)+s*Math.sin(h),width:i.width*a.x,height:i.height*a.y,rotation:h};return P8(f,-Ot.getAngle(r),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const r=[];this.nodes().map(h=>{const f=h.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),g=[{x:f.x,y:f.y},{x:f.x+f.width,y:f.y},{x:f.x+f.width,y:f.y+f.height},{x:f.x,y:f.y+f.height}],v=h.getAbsoluteTransform();g.forEach(function(p){const y=v.point(p);r.push(y)})});const n=new nl;n.rotate(-Ot.getAngle(this.rotation()));let i=1/0,a=1/0,o=-1/0,s=-1/0;r.forEach(function(h){const f=n.point(h);i===void 0&&(i=o=f.x,a=s=f.y),i=Math.min(i,f.x),a=Math.min(a,f.y),o=Math.max(o,f.x),s=Math.max(s,f.y)}),n.invert();const u=n.point({x:i,y:a});return{x:u.x,y:u.y,width:o-i,height:s-a,rotation:Ot.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),p0.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater")}_createAnchor(e){const r=new Tp({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Uk?10:"auto"}),n=this;r.on("mousedown touchstart",function(i){n._handleMouseDown(i)}),r.on("dragstart",i=>{r.stopDrag(),i.cancelBubble=!0}),r.on("dragend",i=>{i.cancelBubble=!0}),r.on("mouseenter",()=>{const i=Ot.getAngle(this.rotation()),a=this.rotateAnchorCursor(),o=Hk(e,i,a);r.getStage().content&&(r.getStage().content.style.cursor=o),this._cursorChange=!0}),r.on("mouseout",()=>{r.getStage().content&&(r.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(r)}_createBack(){const e=new mt({name:"back",width:0,height:0,sceneFunc(r,n){const i=n.getParent(),a=i.padding();r.beginPath(),r.rect(-a,-a,n.width()+a*2,n.height()+a*2),r.moveTo(n.width()/2,-a),i.rotateEnabled()&&i.rotateLineVisible()&&r.lineTo(n.width()/2,-i.rotateAnchorOffset()*Ze._sign(n.height())-a),r.fillStrokeShape(n)},hitFunc:(r,n)=>{if(!this.shouldOverdrawWholeArea())return;const i=this.padding();r.beginPath(),r.rect(-i,-i,n.width()+i*2,n.height()+i*2),r.fillStrokeShape(n)}});this.add(e),this._proxyDrag(e),e.on("dragstart",r=>{r.cancelBubble=!0}),e.on("dragmove",r=>{r.cancelBubble=!0}),e.on("dragend",r=>{r.cancelBubble=!0}),this.on("dragmove",r=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];const r=this._getNodeRect(),n=r.width,i=r.height,a=Math.sqrt(Math.pow(n,2)+Math.pow(i,2));this.sin=Math.abs(i/a),this.cos=Math.abs(n/a),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const o=e.target.getAbsolutePosition(),s=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-o.x,y:s.y-o.y},dm++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(u=>{u._fire("transformstart",{evt:e.evt,target:u})})}_handleMouseMove(e){let r,n,i;const a=this.findOne("."+this._movingAnchorName),o=a.getStage();o.setPointersPositions(e);const s=o.getPointerPosition();let u={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const h=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(u=this.anchorDragBoundFunc()(h,u,e)),a.setAbsolutePosition(u);const f=a.getAbsolutePosition();if(h.x===f.x&&h.y===f.y)return;if(this._movingAnchorName==="rotater"){const E=this._getNodeRect();r=a.x()-E.width/2,n=-a.y()+E.height/2;let A=Math.atan2(-n,r)+Math.PI/2;E.height<0&&(A-=Math.PI);const k=Ot.getAngle(this.rotation())+A,I=Ot.getAngle(this.rotationSnapTolerance()),M=Wk(this.rotationSnaps(),k,I)-E.rotation,F=Gk(E,M);this._fitNodesInto(F,e);return}const g=this.shiftBehavior();let v;g==="inverted"?v=this.keepRatio()&&!e.shiftKey:g==="none"?v=this.keepRatio():v=this.keepRatio()||e.shiftKey;let p=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(v){const E=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(E.x-a.x(),2)+Math.pow(E.y-a.y(),2));const A=this.findOne(".top-left").x()>E.x?-1:1,S=this.findOne(".top-left").y()>E.y?-1:1;r=i*this.cos*A,n=i*this.sin*S,this.findOne(".top-left").x(E.x-r),this.findOne(".top-left").y(E.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(v){const E=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(a.x()-E.x,2)+Math.pow(E.y-a.y(),2));const A=this.findOne(".top-right").x()<E.x?-1:1,S=this.findOne(".top-right").y()>E.y?-1:1;r=i*this.cos*A,n=i*this.sin*S,this.findOne(".top-right").x(E.x+r),this.findOne(".top-right").y(E.y-n)}var y=a.position();this.findOne(".top-left").y(y.y),this.findOne(".bottom-right").x(y.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(a.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(a.x());else if(this._movingAnchorName==="bottom-left"){if(v){const E=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(E.x-a.x(),2)+Math.pow(a.y()-E.y,2));const A=E.x<a.x()?-1:1,S=a.y()<E.y?-1:1;r=i*this.cos*A,n=i*this.sin*S,a.x(E.x-r),a.y(E.y+n)}y=a.position(),this.findOne(".top-left").x(y.x),this.findOne(".bottom-right").y(y.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(v){const E=p?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(a.x()-E.x,2)+Math.pow(a.y()-E.y,2));const A=this.findOne(".bottom-right").x()<E.x?-1:1,S=this.findOne(".bottom-right").y()<E.y?-1:1;r=i*this.cos*A,n=i*this.sin*S,this.findOne(".bottom-right").x(E.x+r),this.findOne(".bottom-right").y(E.y+n)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(p=this.centeredScaling()||e.altKey,p){const E=this.findOne(".top-left"),A=this.findOne(".bottom-right"),S=E.x(),k=E.y(),I=this.getWidth()-A.x(),O=this.getHeight()-A.y();A.move({x:-S,y:-k}),E.move({x:I,y:O})}const _=this.findOne(".top-left").getAbsolutePosition();r=_.x,n=_.y;const x=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),b=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:r,y:n,width:x,height:b,rotation:Ot.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var r;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const n=this.getNode();dm--,this._fire("transformend",{evt:e,target:n}),(r=this.getLayer())===null||r===void 0||r.batchDraw(),n&&this._nodes.forEach(i=>{var a;i._fire("transformend",{evt:e,target:i}),(a=i.getLayer())===null||a===void 0||a.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,r){const n=this._getNodeRect(),i=1;if(Ze._inRange(e.width,-this.padding()*2-i,i)){this.update();return}if(Ze._inRange(e.height,-this.padding()*2-i,i)){this.update();return}const a=new nl;if(a.rotate(Ot.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const v=a.point({x:-this.padding()*2,y:0});e.x+=v.x,e.y+=v.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=v.x,this._anchorDragOffset.y-=v.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const v=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=v.x,this._anchorDragOffset.y-=v.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const v=a.point({x:0,y:-this.padding()*2});e.x+=v.x,e.y+=v.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=v.x,this._anchorDragOffset.y-=v.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const v=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=v.x,this._anchorDragOffset.y-=v.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const v=this.boundBoxFunc()(n,e);v?e=v:Ze.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const o=1e7,s=new nl;s.translate(n.x,n.y),s.rotate(n.rotation),s.scale(n.width/o,n.height/o);const u=new nl,h=e.width/o,f=e.height/o;this.flipEnabled()===!1?(u.translate(e.x,e.y),u.rotate(e.rotation),u.translate(e.width<0?e.width:0,e.height<0?e.height:0),u.scale(Math.abs(h),Math.abs(f))):(u.translate(e.x,e.y),u.rotate(e.rotation),u.scale(h,f));const g=u.multiply(s.invert());this._nodes.forEach(v=>{var p;if(!v.getStage())return;const y=v.getParent().getAbsoluteTransform(),_=v.getTransform().copy();_.translate(v.offsetX(),v.offsetY());const x=new nl;x.multiply(y.copy().invert()).multiply(g).multiply(y).multiply(_);const b=x.decompose();v.setAttrs(b),(p=v.getLayer())===null||p===void 0||p.batchDraw()}),this.rotation(Ze._getRotation(e.rotation)),this._nodes.forEach(v=>{this._fire("transform",{evt:r,target:v}),v._fire("transform",{evt:r,target:v})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,r){this.findOne(e).setAttrs(r)}update(){var e;const r=this._getNodeRect();this.rotation(Ze._getRotation(r.rotation));const n=r.width,i=r.height,a=this.enabledAnchors(),o=this.resizeEnabled(),s=this.padding(),u=this.anchorSize(),h=this.find("._anchor");h.forEach(g=>{g.setAttrs({width:u,height:u,offsetX:u/2,offsetY:u/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:u/2+s,offsetY:u/2+s,visible:o&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:u/2+s,visible:o&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:u/2-s,offsetY:u/2+s,visible:o&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:u/2+s,visible:o&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:i/2,offsetX:u/2-s,visible:o&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:u/2+s,offsetY:u/2-s,visible:o&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:i,offsetY:u/2-s,visible:o&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:i,offsetX:u/2-s,offsetY:u/2-s,visible:o&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*Ze._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(g=>g.draggable()),x:0,y:0});const f=this.anchorStyleFunc();f&&h.forEach(g=>{f(g)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),dd.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return At.prototype.toObject.call(this)}clone(e){return At.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};Jr.isTransforming=()=>dm>0;function Vk(t){return t instanceof Array||Ze.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){p0.indexOf(e)===-1&&Ze.warn("Unknown anchor name: "+e+". Available names are: "+p0.join(", "))}),t||[]}Jr.prototype.className="Transformer";Fi(Jr);je.addGetterSetter(Jr,"enabledAnchors",p0,Vk);je.addGetterSetter(Jr,"flipEnabled",!0,au());je.addGetterSetter(Jr,"resizeEnabled",!0);je.addGetterSetter(Jr,"anchorSize",10,Et());je.addGetterSetter(Jr,"rotateEnabled",!0);je.addGetterSetter(Jr,"rotateLineVisible",!0);je.addGetterSetter(Jr,"rotationSnaps",[]);je.addGetterSetter(Jr,"rotateAnchorOffset",50,Et());je.addGetterSetter(Jr,"rotateAnchorCursor","crosshair");je.addGetterSetter(Jr,"rotationSnapTolerance",5,Et());je.addGetterSetter(Jr,"borderEnabled",!0);je.addGetterSetter(Jr,"anchorStroke","rgb(0, 161, 255)");je.addGetterSetter(Jr,"anchorStrokeWidth",1,Et());je.addGetterSetter(Jr,"anchorFill","white");je.addGetterSetter(Jr,"anchorCornerRadius",0,Et());je.addGetterSetter(Jr,"borderStroke","rgb(0, 161, 255)");je.addGetterSetter(Jr,"borderStrokeWidth",1,Et());je.addGetterSetter(Jr,"borderDash");je.addGetterSetter(Jr,"keepRatio",!0);je.addGetterSetter(Jr,"shiftBehavior","default");je.addGetterSetter(Jr,"centeredScaling",!1);je.addGetterSetter(Jr,"ignoreStroke",!1);je.addGetterSetter(Jr,"padding",0,Et());je.addGetterSetter(Jr,"nodes");je.addGetterSetter(Jr,"node");je.addGetterSetter(Jr,"boundBoxFunc");je.addGetterSetter(Jr,"anchorDragBoundFunc");je.addGetterSetter(Jr,"anchorStyleFunc");je.addGetterSetter(Jr,"shouldOverdrawWholeArea",!1);je.addGetterSetter(Jr,"useSingleNodeRotation",!0);je.backCompat(Jr,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class xc extends mt{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,Ot.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}xc.prototype.className="Wedge";xc.prototype._centroid=!0;xc.prototype._attrsAffectingSize=["radius"];Fi(xc);je.addGetterSetter(xc,"radius",0,Et());je.addGetterSetter(xc,"angle",0,Et());je.addGetterSetter(xc,"clockwise",!1);je.backCompat(xc,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function t3(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const Yk=[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],Xk=[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 Kk(t,e){const r=t.data,n=t.width,i=t.height;let a,o,s,u,h,f,g,v,p,y,_,x,b,E,A,S,k,I,O,M;const F=e+e+1,j=n-1,T=i-1,L=e+1,$=L*(L+1)/2,q=new t3,J=Yk[e],ae=Xk[e];let ie=null,Z=q,te=null,V=null;for(let B=1;B<F;B++)Z=Z.next=new t3,B===L&&(ie=Z);Z.next=q,s=o=0;for(let B=0;B<i;B++){x=b=E=A=u=h=f=g=0,v=L*(S=r[o]),p=L*(k=r[o+1]),y=L*(I=r[o+2]),_=L*(O=r[o+3]),u+=$*S,h+=$*k,f+=$*I,g+=$*O,Z=q;for(let D=0;D<L;D++)Z.r=S,Z.g=k,Z.b=I,Z.a=O,Z=Z.next;for(let D=1;D<L;D++)a=o+((j<D?j:D)<<2),u+=(Z.r=S=r[a])*(M=L-D),h+=(Z.g=k=r[a+1])*M,f+=(Z.b=I=r[a+2])*M,g+=(Z.a=O=r[a+3])*M,x+=S,b+=k,E+=I,A+=O,Z=Z.next;te=q,V=ie;for(let D=0;D<n;D++)r[o+3]=O=g*J>>ae,O!==0?(O=255/O,r[o]=(u*J>>ae)*O,r[o+1]=(h*J>>ae)*O,r[o+2]=(f*J>>ae)*O):r[o]=r[o+1]=r[o+2]=0,u-=v,h-=p,f-=y,g-=_,v-=te.r,p-=te.g,y-=te.b,_-=te.a,a=s+((a=D+e+1)<j?a:j)<<2,x+=te.r=r[a],b+=te.g=r[a+1],E+=te.b=r[a+2],A+=te.a=r[a+3],u+=x,h+=b,f+=E,g+=A,te=te.next,v+=S=V.r,p+=k=V.g,y+=I=V.b,_+=O=V.a,x-=S,b-=k,E-=I,A-=O,V=V.next,o+=4;s+=n}for(let B=0;B<n;B++){b=E=A=x=h=f=g=u=0,o=B<<2,v=L*(S=r[o]),p=L*(k=r[o+1]),y=L*(I=r[o+2]),_=L*(O=r[o+3]),u+=$*S,h+=$*k,f+=$*I,g+=$*O,Z=q;for(let U=0;U<L;U++)Z.r=S,Z.g=k,Z.b=I,Z.a=O,Z=Z.next;let D=n;for(let U=1;U<=e;U++)o=D+B<<2,u+=(Z.r=S=r[o])*(M=L-U),h+=(Z.g=k=r[o+1])*M,f+=(Z.b=I=r[o+2])*M,g+=(Z.a=O=r[o+3])*M,x+=S,b+=k,E+=I,A+=O,Z=Z.next,U<T&&(D+=n);o=B,te=q,V=ie;for(let U=0;U<i;U++)a=o<<2,r[a+3]=O=g*J>>ae,O>0?(O=255/O,r[a]=(u*J>>ae)*O,r[a+1]=(h*J>>ae)*O,r[a+2]=(f*J>>ae)*O):r[a]=r[a+1]=r[a+2]=0,u-=v,h-=p,f-=y,g-=_,v-=te.r,p-=te.g,y-=te.b,_-=te.a,a=B+((a=U+L)<T?a:T)*n<<2,u+=x+=te.r=r[a],h+=b+=te.g=r[a+1],f+=E+=te.b=r[a+2],g+=A+=te.a=r[a+3],te=te.next,v+=S=V.r,p+=k=V.g,y+=I=V.b,_+=O=V.a,x-=S,b-=k,E-=I,A-=O,V=V.next,o+=n}}const Zk=function(e){const r=Math.round(this.blurRadius());r>0&&Kk(e,r)};je.addGetterSetter(At,"blurRadius",0,Et(),je.afterSetFilter);const Qk=function(t){const e=this.brightness()*255,r=t.data,n=r.length;for(let i=0;i<n;i+=4)r[i]+=e,r[i+1]+=e,r[i+2]+=e};je.addGetterSetter(At,"brightness",0,Et(),je.afterSetFilter);const Jk=function(t){const e=this.brightness(),r=t.data,n=r.length;for(let i=0;i<n;i+=4)r[i]=Math.min(255,r[i]*e),r[i+1]=Math.min(255,r[i+1]*e),r[i+2]=Math.min(255,r[i+2]*e)},eA=function(t){const e=Math.pow((this.contrast()+100)/100,2),r=t.data,n=r.length;let i=150,a=150,o=150;for(let s=0;s<n;s+=4)i=r[s],a=r[s+1],o=r[s+2],i/=255,i-=.5,i*=e,i+=.5,i*=255,a/=255,a-=.5,a*=e,a+=.5,a*=255,o/=255,o-=.5,o*=e,o+=.5,o*=255,i=i<0?0:i>255?255:i,a=a<0?0:a>255?255:a,o=o<0?0:o>255?255:o,r[s]=i,r[s+1]=a,r[s+2]=o};je.addGetterSetter(At,"contrast",0,Et(),je.afterSetFilter);const tA=function(t){var e,r,n,i,a,o,s,u,h;const f=t.data,g=t.width,v=t.height,p=Math.min(1,Math.max(0,(r=(e=this.embossStrength)===null||e===void 0?void 0:e.call(this))!==null&&r!==void 0?r:.5)),y=Math.min(1,Math.max(0,(i=(n=this.embossWhiteLevel)===null||n===void 0?void 0:n.call(this))!==null&&i!==void 0?i:.5)),x=(s={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(o=(a=this.embossDirection)===null||a===void 0?void 0:a.call(this))!==null&&o!==void 0?o:"top-left"])!==null&&s!==void 0?s:315,b=!!((h=(u=this.embossBlend)===null||u===void 0?void 0:u.call(this))!==null&&h!==void 0&&h),E=p*10,A=y*255,S=x*Math.PI/180,k=Math.cos(S),I=Math.sin(S),O=128/1020*E,M=new Uint8ClampedArray(f),F=new Float32Array(g*v);for(let q=0,J=0;J<f.length;J+=4,q++)F[q]=.2126*M[J]+.7152*M[J+1]+.0722*M[J+2];const j=[-1,0,1,-2,0,2,-1,0,1],T=[-1,-2,-1,0,0,0,1,2,1],L=[-g-1,-g,-g+1,-1,0,1,g-1,g,g+1],$=q=>q<0?0:q>255?255:q;for(let q=1;q<v-1;q++)for(let J=1;J<g-1;J++){const ae=q*g+J;let ie=0,Z=0;ie+=F[ae+L[0]]*j[0],Z+=F[ae+L[0]]*T[0],ie+=F[ae+L[1]]*j[1],Z+=F[ae+L[1]]*T[1],ie+=F[ae+L[2]]*j[2],Z+=F[ae+L[2]]*T[2],ie+=F[ae+L[3]]*j[3],Z+=F[ae+L[3]]*T[3],ie+=F[ae+L[5]]*j[5],Z+=F[ae+L[5]]*T[5],ie+=F[ae+L[6]]*j[6],Z+=F[ae+L[6]]*T[6],ie+=F[ae+L[7]]*j[7],Z+=F[ae+L[7]]*T[7],ie+=F[ae+L[8]]*j[8],Z+=F[ae+L[8]]*T[8];const te=k*ie+I*Z,V=$(A+te*O),B=ae*4;if(b){const D=V-A;f[B]=$(M[B]+D),f[B+1]=$(M[B+1]+D),f[B+2]=$(M[B+2]+D),f[B+3]=M[B+3]}else f[B]=f[B+1]=f[B+2]=V,f[B+3]=M[B+3]}for(let q=0;q<g;q++){let J=q*4,ae=((v-1)*g+q)*4;f[J]=M[J],f[J+1]=M[J+1],f[J+2]=M[J+2],f[J+3]=M[J+3],f[ae]=M[ae],f[ae+1]=M[ae+1],f[ae+2]=M[ae+2],f[ae+3]=M[ae+3]}for(let q=1;q<v-1;q++){let J=q*g*4,ae=(q*g+(g-1))*4;f[J]=M[J],f[J+1]=M[J+1],f[J+2]=M[J+2],f[J+3]=M[J+3],f[ae]=M[ae],f[ae+1]=M[ae+1],f[ae+2]=M[ae+2],f[ae+3]=M[ae+3]}return t};je.addGetterSetter(At,"embossStrength",.5,Et(),je.afterSetFilter);je.addGetterSetter(At,"embossWhiteLevel",.5,Et(),je.afterSetFilter);je.addGetterSetter(At,"embossDirection","top-left",void 0,je.afterSetFilter);je.addGetterSetter(At,"embossBlend",!1,void 0,je.afterSetFilter);function Vg(t,e,r,n,i){const a=r-e,o=i-n;if(a===0)return n+o/2;if(o===0)return n;let s=(t-e)/a;return s=o*s+n,s}const rA=function(t){const e=t.data,r=e.length;let n=e[0],i=n,a,o=e[1],s=o,u,h=e[2],f=h,g;const v=this.enhance();if(v===0)return;for(let A=0;A<r;A+=4)a=e[A+0],a<n?n=a:a>i&&(i=a),u=e[A+1],u<o?o=u:u>s&&(s=u),g=e[A+2],g<h?h=g:g>f&&(f=g);i===n&&(i=255,n=0),s===o&&(s=255,o=0),f===h&&(f=255,h=0);let p,y,_,x,b,E;if(v>0)p=i+v*(255-i),y=n-v*(n-0),_=s+v*(255-s),x=o-v*(o-0),b=f+v*(255-f),E=h-v*(h-0);else{const A=(i+n)*.5;p=i+v*(i-A),y=n+v*(n-A);const S=(s+o)*.5;_=s+v*(s-S),x=o+v*(o-S);const k=(f+h)*.5;b=f+v*(f-k),E=h+v*(h-k)}for(let A=0;A<r;A+=4)e[A+0]=Vg(e[A+0],n,i,y,p),e[A+1]=Vg(e[A+1],o,s,x,_),e[A+2]=Vg(e[A+2],h,f,E,b)};je.addGetterSetter(At,"enhance",0,Et(),je.afterSetFilter);const nA=function(t){const e=t.data,r=e.length;for(let n=0;n<r;n+=4){const i=.34*e[n]+.5*e[n+1]+.16*e[n+2];e[n]=i,e[n+1]=i,e[n+2]=i}};je.addGetterSetter(At,"hue",0,Et(),je.afterSetFilter);je.addGetterSetter(At,"saturation",0,Et(),je.afterSetFilter);je.addGetterSetter(At,"luminance",0,Et(),je.afterSetFilter);const iA=function(t){const e=t.data,r=e.length,n=1,i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=this.luminance()*127,s=n*i*Math.cos(a*Math.PI/180),u=n*i*Math.sin(a*Math.PI/180),h=.299*n+.701*s+.167*u,f=.587*n-.587*s+.33*u,g=.114*n-.114*s-.497*u,v=.299*n-.299*s-.328*u,p=.587*n+.413*s+.035*u,y=.114*n-.114*s+.293*u,_=.299*n-.3*s+1.25*u,x=.587*n-.586*s-1.05*u,b=.114*n+.886*s-.2*u;let E,A,S,k;for(let I=0;I<r;I+=4)E=e[I+0],A=e[I+1],S=e[I+2],k=e[I+3],e[I+0]=h*E+f*A+g*S+o,e[I+1]=v*E+p*A+y*S+o,e[I+2]=_*E+x*A+b*S+o,e[I+3]=k},aA=function(t){const e=t.data,r=e.length,n=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,o=n*i*Math.cos(a*Math.PI/180),s=n*i*Math.sin(a*Math.PI/180),u=.299*n+.701*o+.167*s,h=.587*n-.587*o+.33*s,f=.114*n-.114*o-.497*s,g=.299*n-.299*o-.328*s,v=.587*n+.413*o+.035*s,p=.114*n-.114*o+.293*s,y=.299*n-.3*o+1.25*s,_=.587*n-.586*o-1.05*s,x=.114*n+.886*o-.2*s;for(let b=0;b<r;b+=4){const E=e[b+0],A=e[b+1],S=e[b+2],k=e[b+3];e[b+0]=u*E+h*A+f*S,e[b+1]=g*E+v*A+p*S,e[b+2]=y*E+_*A+x*S,e[b+3]=k}};je.addGetterSetter(At,"hue",0,Et(),je.afterSetFilter);je.addGetterSetter(At,"saturation",0,Et(),je.afterSetFilter);je.addGetterSetter(At,"value",0,Et(),je.afterSetFilter);const oA=function(t){const e=t.data,r=e.length;for(let n=0;n<r;n+=4)e[n]=255-e[n],e[n+1]=255-e[n+1],e[n+2]=255-e[n+2]},sA=function(t,e,r){const n=t.data,i=e.data,a=t.width,o=t.height,s=r.polarCenterX||a/2,u=r.polarCenterY||o/2;let h=Math.sqrt(s*s+u*u),f=a-s,g=o-u;const v=Math.sqrt(f*f+g*g);h=v>h?v:h;const p=o,y=a,_=360/y*Math.PI/180;for(let x=0;x<y;x+=1){const b=Math.sin(x*_),E=Math.cos(x*_);for(let A=0;A<p;A+=1){f=Math.floor(s+h*A/p*E),g=Math.floor(u+h*A/p*b);let S=(g*a+f)*4;const k=n[S+0],I=n[S+1],O=n[S+2],M=n[S+3];S=(x+A*a)*4,i[S+0]=k,i[S+1]=I,i[S+2]=O,i[S+3]=M}}},lA=function(t,e,r){const n=t.data,i=e.data,a=t.width,o=t.height,s=r.polarCenterX||a/2,u=r.polarCenterY||o/2;let h=Math.sqrt(s*s+u*u),f=a-s,g=o-u;const v=Math.sqrt(f*f+g*g);h=v>h?v:h;const p=o,y=a,_=0;let x,b;for(f=0;f<a;f+=1)for(g=0;g<o;g+=1){const E=f-s,A=g-u,S=Math.sqrt(E*E+A*A)*p/h;let k=(Math.atan2(A,E)*180/Math.PI+360+_)%360;k=k*y/360,x=Math.floor(k),b=Math.floor(S);let I=(b*a+x)*4;const O=n[I+0],M=n[I+1],F=n[I+2],j=n[I+3];I=(g*a+f)*4,i[I+0]=O,i[I+1]=M,i[I+2]=F,i[I+3]=j}},uA=function(t){const e=t.width,r=t.height;let n,i,a,o,s,u,h,f,g,v,p=Math.round(this.kaleidoscopePower());const y=Math.round(this.kaleidoscopeAngle()),_=Math.floor(e*(y%360)/360);if(p<1)return;const x=Ze.createCanvasElement();x.width=e,x.height=r;const b=x.getContext("2d").getImageData(0,0,e,r);Ze.releaseCanvas(x),sA(t,b,{polarCenterX:e/2,polarCenterY:r/2});let E=e/Math.pow(2,p);for(;E<=8;)E=E*2,p-=1;E=Math.ceil(E);let A=E,S=0,k=A,I=1;for(_+E>e&&(S=A,k=0,I=-1),i=0;i<r;i+=1)for(n=S;n!==k;n+=I)a=Math.round(n+_)%e,g=(e*i+a)*4,s=b.data[g+0],u=b.data[g+1],h=b.data[g+2],f=b.data[g+3],v=(e*i+n)*4,b.data[v+0]=s,b.data[v+1]=u,b.data[v+2]=h,b.data[v+3]=f;for(i=0;i<r;i+=1)for(A=Math.floor(E),o=0;o<p;o+=1){for(n=0;n<A+1;n+=1)g=(e*i+n)*4,s=b.data[g+0],u=b.data[g+1],h=b.data[g+2],f=b.data[g+3],v=(e*i+A*2-n-1)*4,b.data[v+0]=s,b.data[v+1]=u,b.data[v+2]=h,b.data[v+3]=f;A*=2}lA(b,t,{})};je.addGetterSetter(At,"kaleidoscopePower",2,Et(),je.afterSetFilter);je.addGetterSetter(At,"kaleidoscopeAngle",0,Et(),je.afterSetFilter);function A1(t,e,r){let n=(r*t.width+e)*4;const i=[];return i.push(t.data[n++],t.data[n++],t.data[n++],t.data[n++]),i}function Bd(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function cA(t){const e=[0,0,0];for(let r=0;r<t.length;r++)e[0]+=t[r][0],e[1]+=t[r][1],e[2]+=t[r][2];return e[0]/=t.length,e[1]/=t.length,e[2]/=t.length,e}function fA(t,e){const r=A1(t,0,0),n=A1(t,t.width-1,0),i=A1(t,0,t.height-1),a=A1(t,t.width-1,t.height-1),o=e||10;if(Bd(r,n)<o&&Bd(n,a)<o&&Bd(a,i)<o&&Bd(i,r)<o){const s=cA([n,r,a,i]),u=[];for(let h=0;h<t.width*t.height;h++){const f=Bd(s,[t.data[h*4],t.data[h*4+1],t.data[h*4+2]]);u[h]=f<o?0:255}return u}}function hA(t,e){for(let r=0;r<t.width*t.height;r++)t.data[4*r+3]=e[r]}function dA(t,e,r){const n=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[];for(let s=0;s<r;s++)for(let u=0;u<e;u++){const h=s*e+u;let f=0;for(let g=0;g<i;g++)for(let v=0;v<i;v++){const p=s+g-a,y=u+v-a;if(p>=0&&p<r&&y>=0&&y<e){const _=p*e+y,x=n[g*i+v];f+=t[_]*x}}o[h]=f===255*8?255:0}return o}function pA(t,e,r){const n=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[];for(let s=0;s<r;s++)for(let u=0;u<e;u++){const h=s*e+u;let f=0;for(let g=0;g<i;g++)for(let v=0;v<i;v++){const p=s+g-a,y=u+v-a;if(p>=0&&p<r&&y>=0&&y<e){const _=p*e+y,x=n[g*i+v];f+=t[_]*x}}o[h]=f>=255*4?255:0}return o}function gA(t,e,r){const n=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=[];for(let s=0;s<r;s++)for(let u=0;u<e;u++){const h=s*e+u;let f=0;for(let g=0;g<i;g++)for(let v=0;v<i;v++){const p=s+g-a,y=u+v-a;if(p>=0&&p<r&&y>=0&&y<e){const _=p*e+y,x=n[g*i+v];f+=t[_]*x}}o[h]=f}return o}const vA=function(t){const e=this.threshold();let r=fA(t,e);return r&&(r=dA(r,t.width,t.height),r=pA(r,t.width,t.height),r=gA(r,t.width,t.height),hA(t,r)),t};je.addGetterSetter(At,"threshold",0,Et(),je.afterSetFilter);const mA=function(t){const e=this.noise()*255,r=t.data,n=r.length,i=e/2;for(let a=0;a<n;a+=4)r[a+0]+=i-2*i*Math.random(),r[a+1]+=i-2*i*Math.random(),r[a+2]+=i-2*i*Math.random()};je.addGetterSetter(At,"noise",.2,Et(),je.afterSetFilter);const yA=function(t){let e=Math.ceil(this.pixelSize()),r=t.width,n=t.height,i=Math.ceil(r/e),a=Math.ceil(n/e),o=t.data;if(e<=0){Ze.error("pixelSize value can not be <= 0");return}for(let s=0;s<i;s+=1)for(let u=0;u<a;u+=1){let h=0,f=0,g=0,v=0;const p=s*e,y=p+e,_=u*e,x=_+e;let b=0;for(let E=p;E<y;E+=1)if(!(E>=r))for(let A=_;A<x;A+=1){if(A>=n)continue;const S=(r*A+E)*4;h+=o[S+0],f+=o[S+1],g+=o[S+2],v+=o[S+3],b+=1}h=h/b,f=f/b,g=g/b,v=v/b;for(let E=p;E<y;E+=1)if(!(E>=r))for(let A=_;A<x;A+=1){if(A>=n)continue;const S=(r*A+E)*4;o[S+0]=h,o[S+1]=f,o[S+2]=g,o[S+3]=v}}};je.addGetterSetter(At,"pixelSize",8,Et(),je.afterSetFilter);const bA=function(t){const e=Math.round(this.levels()*254)+1,r=t.data,n=r.length,i=255/e;for(let a=0;a<n;a+=1)r[a]=Math.floor(r[a]/i)*i};je.addGetterSetter(At,"levels",.5,Et(),je.afterSetFilter);const wA=function(t){const e=t.data,r=e.length,n=this.red(),i=this.green(),a=this.blue();for(let o=0;o<r;o+=4){const s=(.34*e[o]+.5*e[o+1]+.16*e[o+2])/255;e[o]=s*n,e[o+1]=s*i,e[o+2]=s*a,e[o+3]=e[o+3]}};je.addGetterSetter(At,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});je.addGetterSetter(At,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});je.addGetterSetter(At,"blue",0,K6,je.afterSetFilter);const _A=function(t){const e=t.data,r=e.length,n=this.red(),i=this.green(),a=this.blue(),o=this.alpha();for(let s=0;s<r;s+=4){const u=1-o;e[s]=n*o+e[s]*u,e[s+1]=i*o+e[s+1]*u,e[s+2]=a*o+e[s+2]*u}};je.addGetterSetter(At,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});je.addGetterSetter(At,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});je.addGetterSetter(At,"blue",0,K6,je.afterSetFilter);je.addGetterSetter(At,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});const xA=function(t){const e=t.data,r=e.length;for(let n=0;n<r;n+=4){const i=e[n+0],a=e[n+1],o=e[n+2];e[n+0]=Math.min(255,i*.393+a*.769+o*.189),e[n+1]=Math.min(255,i*.349+a*.686+o*.168),e[n+2]=Math.min(255,i*.272+a*.534+o*.131)}},SA=function(t){const r=t.data;for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],o=r[n+2];.2126*i+.7152*a+.0722*o>=128&&(r[n]=255-i,r[n+1]=255-a,r[n+2]=255-o)}return t},EA=function(t){const e=this.threshold()*255,r=t.data,n=r.length;for(let i=0;i<n;i+=1)r[i]=r[i]<e?0:255};je.addGetterSetter(At,"threshold",.5,Et(),je.afterSetFilter);const or=sh.Util._assign(sh,{Arc:wc,Arrow:yh,Circle:xd,Ellipse:kf,Image:$u,Label:Zm,Tag:bh,Line:_c,Path:Ol,Rect:Tp,RegularPolygon:Af,Ring:wh,Sprite:Gu,Star:Pf,Text:pi,TextPath:Da,Transformer:Jr,Wedge:xc,Filters:{Blur:Zk,Brightness:Jk,Brighten:Qk,Contrast:eA,Emboss:tA,Enhance:rA,Grayscale:nA,HSL:iA,HSV:aA,Invert:oA,Kaleidoscope:uA,Mask:vA,Noise:mA,Pixelate:yA,Posterize:bA,RGB:wA,RGBA:_A,Sepia:xA,Solarize:SA,Threshold:EA}});var Yg={exports:{}};/**
|
|
57
|
-
* @license React
|
|
58
|
-
* react-reconciler.production.min.js
|
|
59
|
-
*
|
|
60
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
61
|
-
*
|
|
62
|
-
* This source code is licensed under the MIT license found in the
|
|
63
|
-
* LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/var Xg,r3;function kA(){return r3||(r3=1,Xg=function(e){var r={},n=Ap(),i=Im(),a=Object.assign;function o(d){for(var m="https://reactjs.org/docs/error-decoder.html?invariant="+d,C=1;C<arguments.length;C++)m+="&args[]="+encodeURIComponent(arguments[C]);return"Minified React error #"+d+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),h=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),y=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),S=Symbol.for("react.offscreen"),k=Symbol.iterator;function I(d){return d===null||typeof d!="object"?null:(d=k&&d[k]||d["@@iterator"],typeof d=="function"?d:null)}function O(d){if(d==null)return null;if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case f:return"Fragment";case h:return"Portal";case v:return"Profiler";case g:return"StrictMode";case x:return"Suspense";case b:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case y:return(d.displayName||"Context")+".Consumer";case p:return(d._context.displayName||"Context")+".Provider";case _:var m=d.render;return d=d.displayName,d||(d=m.displayName||m.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case E:return m=d.displayName||null,m!==null?m:O(d.type)||"Memo";case A:m=d._payload,d=d._init;try{return O(d(m))}catch{}}return null}function M(d){var m=d.type;switch(d.tag){case 24:return"Cache";case 9:return(m.displayName||"Context")+".Consumer";case 10:return(m._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return d=m.render,d=d.displayName||d.name||"",m.displayName||(d!==""?"ForwardRef("+d+")":"ForwardRef");case 7:return"Fragment";case 5:return m;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return O(m);case 8:return m===g?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof m=="function")return m.displayName||m.name||null;if(typeof m=="string")return m}return null}function F(d){var m=d,C=d;if(d.alternate)for(;m.return;)m=m.return;else{d=m;do m=d,(m.flags&4098)!==0&&(C=m.return),d=m.return;while(d)}return m.tag===3?C:null}function j(d){if(F(d)!==d)throw Error(o(188))}function T(d){var m=d.alternate;if(!m){if(m=F(d),m===null)throw Error(o(188));return m!==d?null:d}for(var C=d,z=m;;){var W=C.return;if(W===null)break;var ne=W.alternate;if(ne===null){if(z=W.return,z!==null){C=z;continue}break}if(W.child===ne.child){for(ne=W.child;ne;){if(ne===C)return j(W),d;if(ne===z)return j(W),m;ne=ne.sibling}throw Error(o(188))}if(C.return!==z.return)C=W,z=ne;else{for(var _e=!1,Ye=W.child;Ye;){if(Ye===C){_e=!0,C=W,z=ne;break}if(Ye===z){_e=!0,z=W,C=ne;break}Ye=Ye.sibling}if(!_e){for(Ye=ne.child;Ye;){if(Ye===C){_e=!0,C=ne,z=W;break}if(Ye===z){_e=!0,z=ne,C=W;break}Ye=Ye.sibling}if(!_e)throw Error(o(189))}}if(C.alternate!==z)throw Error(o(190))}if(C.tag!==3)throw Error(o(188));return C.stateNode.current===C?d:m}function L(d){return d=T(d),d!==null?$(d):null}function $(d){if(d.tag===5||d.tag===6)return d;for(d=d.child;d!==null;){var m=$(d);if(m!==null)return m;d=d.sibling}return null}function q(d){if(d.tag===5||d.tag===6)return d;for(d=d.child;d!==null;){if(d.tag!==4){var m=q(d);if(m!==null)return m}d=d.sibling}return null}var J=Array.isArray,ae=e.getPublicInstance,ie=e.getRootHostContext,Z=e.getChildHostContext,te=e.prepareForCommit,V=e.resetAfterCommit,B=e.createInstance,D=e.appendInitialChild,U=e.finalizeInitialChildren,X=e.prepareUpdate,ee=e.shouldSetTextContent,K=e.createTextInstance,oe=e.scheduleTimeout,me=e.cancelTimeout,de=e.noTimeout,ye=e.isPrimaryRenderer,Te=e.supportsMutation,Ce=e.supportsPersistence,Ie=e.supportsHydration,Ee=e.getInstanceFromNode,ge=e.preparePortalMount,Re=e.getCurrentEventPriority,Be=e.detachDeletedInstance,Oe=e.supportsMicrotasks,fe=e.scheduleMicrotask,Le=e.supportsTestSelectors,Ne=e.findFiberRoot,ue=e.getBoundingRect,Ae=e.getTextContent,Pe=e.isHiddenSubtree,Ue=e.matchAccessibilityRole,st=e.setFocusIfFocusable,dt=e.setupIntersectionObserver,pt=e.appendChild,xt=e.appendChildToContainer,bt=e.commitTextUpdate,kt=e.commitMount,zr=e.commitUpdate,_r=e.insertBefore,It=e.insertInContainerBefore,Jt=e.removeChild,Ve=e.removeChildFromContainer,qe=e.resetTextContent,Nt=e.hideInstance,Ct=e.hideTextInstance,ir=e.unhideInstance,Ut=e.unhideTextInstance,xr=e.clearContainer,er=e.cloneInstance,pr=e.createContainerChildSet,Bi=e.appendChildToContainerChildSet,oi=e.finalizeContainerChildren,Ei=e.replaceContainerChildren,Sn=e.cloneHiddenInstance,Qt=e.cloneHiddenTextInstance,ca=e.canHydrateInstance,Fa=e.canHydrateTextInstance,Kn=e.canHydrateSuspenseInstance,Yi=e.isSuspenseInstancePending,qr=e.isSuspenseInstanceFallback,En=e.getSuspenseInstanceFallbackErrorDetails,Rn=e.registerSuspenseInstanceRetry,Sa=e.getNextHydratableSibling,Ho=e.getFirstHydratableChild,Ea=e.getFirstHydratableChildWithinContainer,eo=e.getFirstHydratableChildWithinSuspenseInstance,si=e.hydrateInstance,ka=e.hydrateTextInstance,Aa=e.hydrateSuspenseInstance,$o=e.getNextHydratableInstanceAfterSuspenseInstance,zi=e.commitHydratedContainer,to=e.commitHydratedSuspenseInstance,Bs=e.clearSuspenseBoundary,is=e.clearSuspenseBoundaryFromContainer,lu=e.shouldDeleteUnhydratedTailInstances,Nf=e.didNotMatchHydratedContainerTextInstance,kn=e.didNotMatchHydratedTextInstance,uu;function as(d){if(uu===void 0)try{throw Error()}catch(C){var m=C.stack.trim().match(/\n( *(at )?)/);uu=m&&m[1]||""}return`
|
|
65
|
-
`+uu+d}var Pa=!1;function os(d,m){if(!d||Pa)return"";Pa=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(m)if(m=function(){throw Error()},Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(wt){var z=wt}Reflect.construct(d,[],m)}else{try{m.call()}catch(wt){z=wt}d.call(m.prototype)}else{try{throw Error()}catch(wt){z=wt}d()}}catch(wt){if(wt&&z&&typeof wt.stack=="string"){for(var W=wt.stack.split(`
|
|
66
|
-
`),ne=z.stack.split(`
|
|
67
|
-
`),_e=W.length-1,Ye=ne.length-1;1<=_e&&0<=Ye&&W[_e]!==ne[Ye];)Ye--;for(;1<=_e&&0<=Ye;_e--,Ye--)if(W[_e]!==ne[Ye]){if(_e!==1||Ye!==1)do if(_e--,Ye--,0>Ye||W[_e]!==ne[Ye]){var it=`
|
|
68
|
-
`+W[_e].replace(" at new "," at ");return d.displayName&&it.includes("<anonymous>")&&(it=it.replace("<anonymous>",d.displayName)),it}while(1<=_e&&0<=Ye);break}}}finally{Pa=!1,Error.prepareStackTrace=C}return(d=d?d.displayName||d.name:"")?as(d):""}var Ec=Object.prototype.hasOwnProperty,ll=[],_o=-1;function gi(d){return{current:d}}function cn(d){0>_o||(d.current=ll[_o],ll[_o]=null,_o--)}function Sr(d,m){_o++,ll[_o]=d.current,d.current=m}var ss={},Tr=gi(ss),Xi=gi(!1),ro=ss;function Ki(d,m){var C=d.type.contextTypes;if(!C)return ss;var z=d.stateNode;if(z&&z.__reactInternalMemoizedUnmaskedChildContext===m)return z.__reactInternalMemoizedMaskedChildContext;var W={},ne;for(ne in C)W[ne]=m[ne];return z&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=m,d.__reactInternalMemoizedMaskedChildContext=W),W}function Mn(d){return d=d.childContextTypes,d!=null}function Zi(){cn(Xi),cn(Tr)}function ul(d,m,C){if(Tr.current!==ss)throw Error(o(168));Sr(Tr,m),Sr(Xi,C)}function Zn(d,m,C){var z=d.stateNode;if(m=m.childContextTypes,typeof z.getChildContext!="function")return C;z=z.getChildContext();for(var W in z)if(!(W in m))throw Error(o(108,M(d)||"Unknown",W));return a({},C,z)}function ls(d){return d=(d=d.stateNode)&&d.__reactInternalMemoizedMergedChildContext||ss,ro=Tr.current,Sr(Tr,d),Sr(Xi,Xi.current),!0}function Vu(d,m,C){var z=d.stateNode;if(!z)throw Error(o(169));C?(d=Zn(d,m,ro),z.__reactInternalMemoizedMergedChildContext=d,cn(Xi),cn(Tr),Sr(Tr,d)):cn(Xi),Sr(Xi,C)}var Oa=Math.clz32?Math.clz32:cu,Tl=Math.log,us=Math.LN2;function cu(d){return d>>>=0,d===0?32:31-(Tl(d)/us|0)|0}var Rr=64,xo=4194304;function cs(d){switch(d&-d){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return d&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return d}}function cl(d,m){var C=d.pendingLanes;if(C===0)return 0;var z=0,W=d.suspendedLanes,ne=d.pingedLanes,_e=C&268435455;if(_e!==0){var Ye=_e&~W;Ye!==0?z=cs(Ye):(ne&=_e,ne!==0&&(z=cs(ne)))}else _e=C&~W,_e!==0?z=cs(_e):ne!==0&&(z=cs(ne));if(z===0)return 0;if(m!==0&&m!==z&&(m&W)===0&&(W=z&-z,ne=m&-m,W>=ne||W===16&&(ne&4194240)!==0))return m;if((z&4)!==0&&(z|=C&16),m=d.entangledLanes,m!==0)for(d=d.entanglements,m&=z;0<m;)C=31-Oa(m),W=1<<C,z|=d[C],m&=~W;return z}function kc(d,m){switch(d){case 1:case 2:case 4:return m+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return m+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ac(d,m){for(var C=d.suspendedLanes,z=d.pingedLanes,W=d.expirationTimes,ne=d.pendingLanes;0<ne;){var _e=31-Oa(ne),Ye=1<<_e,it=W[_e];it===-1?((Ye&C)===0||(Ye&z)!==0)&&(W[_e]=kc(Ye,m)):it<=m&&(d.expiredLanes|=Ye),ne&=~Ye}}function fl(d){return d=d.pendingLanes&-1073741825,d!==0?d:d&1073741824?1073741824:0}function fs(){var d=Rr;return Rr<<=1,(Rr&4194240)===0&&(Rr=64),d}function no(d){for(var m=[],C=0;31>C;C++)m.push(d);return m}function Ba(d,m,C){d.pendingLanes|=m,m!==536870912&&(d.suspendedLanes=0,d.pingedLanes=0),d=d.eventTimes,m=31-Oa(m),d[m]=C}function za(d,m){var C=d.pendingLanes&~m;d.pendingLanes=m,d.suspendedLanes=0,d.pingedLanes=0,d.expiredLanes&=m,d.mutableReadLanes&=m,d.entangledLanes&=m,m=d.entanglements;var z=d.eventTimes;for(d=d.expirationTimes;0<C;){var W=31-Oa(C),ne=1<<W;m[W]=0,z[W]=-1,d[W]=-1,C&=~ne}}function qa(d,m){var C=d.entangledLanes|=m;for(d=d.entanglements;C;){var z=31-Oa(C),W=1<<z;W&m|d[z]&m&&(d[z]|=m),C&=~W}}var Pt=0;function hl(d){return d&=-d,1<d?4<d?(d&268435455)!==0?16:536870912:4:1}var So=i.unstable_scheduleCallback,Pc=i.unstable_cancelCallback,Oc=i.unstable_shouldYield,io=i.unstable_requestPaint,wn=i.unstable_now,fu=i.unstable_ImmediatePriority,hu=i.unstable_UserBlockingPriority,zs=i.unstable_NormalPriority,Yu=i.unstable_IdlePriority,Ua=null,ki=null;function Go(d){if(ki&&typeof ki.onCommitFiberRoot=="function")try{ki.onCommitFiberRoot(Ua,d,void 0,(d.current.flags&128)===128)}catch{}}function du(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var Ca=typeof Object.is=="function"?Object.is:du,ao=null,Eo=!1,ko=!1;function dl(d){ao===null?ao=[d]:ao.push(d)}function Rl(d){Eo=!0,dl(d)}function li(){if(!ko&&ao!==null){ko=!0;var d=0,m=Pt;try{var C=ao;for(Pt=1;d<C.length;d++){var z=C[d];do z=z(!0);while(z!==null)}ao=null,Eo=!1}catch(W){throw ao!==null&&(ao=ao.slice(d+1)),So(fu,li),W}finally{Pt=m,ko=!1}}return null}var Ha=[],Ao=0,pl=null,La=0,Bn=[],fa=0,Qn=null,vi=1,$a="";function H(d,m){Ha[Ao++]=La,Ha[Ao++]=pl,pl=d,La=m}function ce(d,m,C){Bn[fa++]=vi,Bn[fa++]=$a,Bn[fa++]=Qn,Qn=d;var z=vi;d=$a;var W=32-Oa(z)-1;z&=~(1<<W),C+=1;var ne=32-Oa(m)+W;if(30<ne){var _e=W-W%5;ne=(z&(1<<_e)-1).toString(32),z>>=_e,W-=_e,vi=1<<32-Oa(m)+W|C<<W|z,$a=ne+d}else vi=1<<ne|C<<W|z,$a=d}function ke(d){d.return!==null&&(H(d,1),ce(d,1,0))}function De(d){for(;d===pl;)pl=Ha[--Ao],Ha[Ao]=null,La=Ha[--Ao],Ha[Ao]=null;for(;d===Qn;)Qn=Bn[--fa],Bn[fa]=null,$a=Bn[--fa],Bn[fa]=null,vi=Bn[--fa],Bn[fa]=null}var Ge=null,at=null,ct=!1,Dt=!1,jt=null;function cr(d,m){var C=Jo(5,null,null,0);C.elementType="DELETED",C.stateNode=m,C.return=d,m=d.deletions,m===null?(d.deletions=[C],d.flags|=16):m.push(C)}function fr(d,m){switch(d.tag){case 5:return m=ca(m,d.type,d.pendingProps),m!==null?(d.stateNode=m,Ge=d,at=Ho(m),!0):!1;case 6:return m=Fa(m,d.pendingProps),m!==null?(d.stateNode=m,Ge=d,at=null,!0):!1;case 13:if(m=Kn(m),m!==null){var C=Qn!==null?{id:vi,overflow:$a}:null;return d.memoizedState={dehydrated:m,treeContext:C,retryLane:1073741824},C=Jo(18,null,null,0),C.stateNode=m,C.return=d,d.child=C,Ge=d,at=null,!0}return!1;default:return!1}}function Ur(d){return(d.mode&1)!==0&&(d.flags&128)===0}function An(d){if(ct){var m=at;if(m){var C=m;if(!fr(d,m)){if(Ur(d))throw Error(o(418));m=Sa(C);var z=Ge;m&&fr(d,m)?cr(z,C):(d.flags=d.flags&-4097|2,ct=!1,Ge=d)}}else{if(Ur(d))throw Error(o(418));d.flags=d.flags&-4097|2,ct=!1,Ge=d}}}function ui(d){for(d=d.return;d!==null&&d.tag!==5&&d.tag!==3&&d.tag!==13;)d=d.return;Ge=d}function on(d){if(!Ie||d!==Ge)return!1;if(!ct)return ui(d),ct=!0,!1;if(d.tag!==3&&(d.tag!==5||lu(d.type)&&!ee(d.type,d.memoizedProps))){var m=at;if(m){if(Ur(d))throw mi(),Error(o(418));for(;m;)cr(d,m),m=Sa(m)}}if(ui(d),d.tag===13){if(!Ie)throw Error(o(316));if(d=d.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));at=$o(d)}else at=Ge?Sa(d.stateNode):null;return!0}function mi(){for(var d=at;d;)d=Sa(d)}function _n(){Ie&&(at=Ge=null,Dt=ct=!1)}function Ai(d){jt===null?jt=[d]:jt.push(d)}var Po=s.ReactCurrentBatchConfig;function Qi(d,m){if(Ca(d,m))return!0;if(typeof d!="object"||d===null||typeof m!="object"||m===null)return!1;var C=Object.keys(d),z=Object.keys(m);if(C.length!==z.length)return!1;for(z=0;z<C.length;z++){var W=C[z];if(!Ec.call(m,W)||!Ca(d[W],m[W]))return!1}return!0}function Cc(d){switch(d.tag){case 5:return as(d.type);case 16:return as("Lazy");case 13:return as("Suspense");case 19:return as("SuspenseList");case 0:case 2:case 15:return d=os(d.type,!1),d;case 11:return d=os(d.type.render,!1),d;case 1:return d=os(d.type,!0),d;default:return""}}function Oo(d,m,C){if(d=C.ref,d!==null&&typeof d!="function"&&typeof d!="object"){if(C._owner){if(C=C._owner,C){if(C.tag!==1)throw Error(o(309));var z=C.stateNode}if(!z)throw Error(o(147,d));var W=z,ne=""+d;return m!==null&&m.ref!==null&&typeof m.ref=="function"&&m.ref._stringRef===ne?m.ref:(m=function(_e){var Ye=W.refs;_e===null?delete Ye[ne]:Ye[ne]=_e},m._stringRef=ne,m)}if(typeof d!="string")throw Error(o(284));if(!C._owner)throw Error(o(290,d))}return d}function hs(d,m){throw d=Object.prototype.toString.call(m),Error(o(31,d==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":d))}function qs(d){var m=d._init;return m(d._payload)}function gl(d){function m(rt,Ke){if(d){var ut=rt.deletions;ut===null?(rt.deletions=[Ke],rt.flags|=16):ut.push(Ke)}}function C(rt,Ke){if(!d)return null;for(;Ke!==null;)m(rt,Ke),Ke=Ke.sibling;return null}function z(rt,Ke){for(rt=new Map;Ke!==null;)Ke.key!==null?rt.set(Ke.key,Ke):rt.set(Ke.index,Ke),Ke=Ke.sibling;return rt}function W(rt,Ke){return rt=Pu(rt,Ke),rt.index=0,rt.sibling=null,rt}function ne(rt,Ke,ut){return rt.index=ut,d?(ut=rt.alternate,ut!==null?(ut=ut.index,ut<Ke?(rt.flags|=2,Ke):ut):(rt.flags|=2,Ke)):(rt.flags|=1048576,Ke)}function _e(rt){return d&&rt.alternate===null&&(rt.flags|=2),rt}function Ye(rt,Ke,ut,Rt){return Ke===null||Ke.tag!==6?(Ke=Wc(ut,rt.mode,Rt),Ke.return=rt,Ke):(Ke=W(Ke,ut),Ke.return=rt,Ke)}function it(rt,Ke,ut,Rt){var nr=ut.type;return nr===f?$t(rt,Ke,ut.props.children,Rt,ut.key):Ke!==null&&(Ke.elementType===nr||typeof nr=="object"&&nr!==null&&nr.$$typeof===A&&qs(nr)===Ke.type)?(Rt=W(Ke,ut.props),Rt.ref=Oo(rt,Ke,ut),Rt.return=rt,Rt):(Rt=Mh(ut.type,ut.key,ut.props,null,rt.mode,Rt),Rt.ref=Oo(rt,Ke,ut),Rt.return=rt,Rt)}function wt(rt,Ke,ut,Rt){return Ke===null||Ke.tag!==4||Ke.stateNode.containerInfo!==ut.containerInfo||Ke.stateNode.implementation!==ut.implementation?(Ke=Ih(ut,rt.mode,Rt),Ke.return=rt,Ke):(Ke=W(Ke,ut.children||[]),Ke.return=rt,Ke)}function $t(rt,Ke,ut,Rt,nr){return Ke===null||Ke.tag!==7?(Ke=Ma(ut,rt.mode,Rt,nr),Ke.return=rt,Ke):(Ke=W(Ke,ut),Ke.return=rt,Ke)}function br(rt,Ke,ut){if(typeof Ke=="string"&&Ke!==""||typeof Ke=="number")return Ke=Wc(""+Ke,rt.mode,ut),Ke.return=rt,Ke;if(typeof Ke=="object"&&Ke!==null){switch(Ke.$$typeof){case u:return ut=Mh(Ke.type,Ke.key,Ke.props,null,rt.mode,ut),ut.ref=Oo(rt,null,Ke),ut.return=rt,ut;case h:return Ke=Ih(Ke,rt.mode,ut),Ke.return=rt,Ke;case A:var Rt=Ke._init;return br(rt,Rt(Ke._payload),ut)}if(J(Ke)||I(Ke))return Ke=Ma(Ke,rt.mode,ut,null),Ke.return=rt,Ke;hs(rt,Ke)}return null}function Tt(rt,Ke,ut,Rt){var nr=Ke!==null?Ke.key:null;if(typeof ut=="string"&&ut!==""||typeof ut=="number")return nr!==null?null:Ye(rt,Ke,""+ut,Rt);if(typeof ut=="object"&&ut!==null){switch(ut.$$typeof){case u:return ut.key===nr?it(rt,Ke,ut,Rt):null;case h:return ut.key===nr?wt(rt,Ke,ut,Rt):null;case A:return nr=ut._init,Tt(rt,Ke,nr(ut._payload),Rt)}if(J(ut)||I(ut))return nr!==null?null:$t(rt,Ke,ut,Rt,null);hs(rt,ut)}return null}function Fn(rt,Ke,ut,Rt,nr){if(typeof Rt=="string"&&Rt!==""||typeof Rt=="number")return rt=rt.get(ut)||null,Ye(Ke,rt,""+Rt,nr);if(typeof Rt=="object"&&Rt!==null){switch(Rt.$$typeof){case u:return rt=rt.get(Rt.key===null?ut:Rt.key)||null,it(Ke,rt,Rt,nr);case h:return rt=rt.get(Rt.key===null?ut:Rt.key)||null,wt(Ke,rt,Rt,nr);case A:var Or=Rt._init;return Fn(rt,Ke,ut,Or(Rt._payload),nr)}if(J(Rt)||I(Rt))return rt=rt.get(ut)||null,$t(Ke,rt,Rt,nr,null);hs(Ke,Rt)}return null}function mn(rt,Ke,ut,Rt){for(var nr=null,Or=null,wr=Ke,Yr=Ke=0,ia=null;wr!==null&&Yr<ut.length;Yr++){wr.index>Yr?(ia=wr,wr=null):ia=wr.sibling;var $r=Tt(rt,wr,ut[Yr],Rt);if($r===null){wr===null&&(wr=ia);break}d&&wr&&$r.alternate===null&&m(rt,wr),Ke=ne($r,Ke,Yr),Or===null?nr=$r:Or.sibling=$r,Or=$r,wr=ia}if(Yr===ut.length)return C(rt,wr),ct&&H(rt,Yr),nr;if(wr===null){for(;Yr<ut.length;Yr++)wr=br(rt,ut[Yr],Rt),wr!==null&&(Ke=ne(wr,Ke,Yr),Or===null?nr=wr:Or.sibling=wr,Or=wr);return ct&&H(rt,Yr),nr}for(wr=z(rt,wr);Yr<ut.length;Yr++)ia=Fn(wr,rt,Yr,ut[Yr],Rt),ia!==null&&(d&&ia.alternate!==null&&wr.delete(ia.key===null?Yr:ia.key),Ke=ne(ia,Ke,Yr),Or===null?nr=ia:Or.sibling=ia,Or=ia);return d&&wr.forEach(function(Ka){return m(rt,Ka)}),ct&&H(rt,Yr),nr}function mo(rt,Ke,ut,Rt){var nr=I(ut);if(typeof nr!="function")throw Error(o(150));if(ut=nr.call(ut),ut==null)throw Error(o(151));for(var Or=nr=null,wr=Ke,Yr=Ke=0,ia=null,$r=ut.next();wr!==null&&!$r.done;Yr++,$r=ut.next()){wr.index>Yr?(ia=wr,wr=null):ia=wr.sibling;var Ka=Tt(rt,wr,$r.value,Rt);if(Ka===null){wr===null&&(wr=ia);break}d&&wr&&Ka.alternate===null&&m(rt,wr),Ke=ne(Ka,Ke,Yr),Or===null?nr=Ka:Or.sibling=Ka,Or=Ka,wr=ia}if($r.done)return C(rt,wr),ct&&H(rt,Yr),nr;if(wr===null){for(;!$r.done;Yr++,$r=ut.next())$r=br(rt,$r.value,Rt),$r!==null&&(Ke=ne($r,Ke,Yr),Or===null?nr=$r:Or.sibling=$r,Or=$r);return ct&&H(rt,Yr),nr}for(wr=z(rt,wr);!$r.done;Yr++,$r=ut.next())$r=Fn(wr,rt,Yr,$r.value,Rt),$r!==null&&(d&&$r.alternate!==null&&wr.delete($r.key===null?Yr:$r.key),Ke=ne($r,Ke,Yr),Or===null?nr=$r:Or.sibling=$r,Or=$r);return d&&wr.forEach(function(ag){return m(rt,ag)}),ct&&H(rt,Yr),nr}function Sl(rt,Ke,ut,Rt){if(typeof ut=="object"&&ut!==null&&ut.type===f&&ut.key===null&&(ut=ut.props.children),typeof ut=="object"&&ut!==null){switch(ut.$$typeof){case u:e:{for(var nr=ut.key,Or=Ke;Or!==null;){if(Or.key===nr){if(nr=ut.type,nr===f){if(Or.tag===7){C(rt,Or.sibling),Ke=W(Or,ut.props.children),Ke.return=rt,rt=Ke;break e}}else if(Or.elementType===nr||typeof nr=="object"&&nr!==null&&nr.$$typeof===A&&qs(nr)===Or.type){C(rt,Or.sibling),Ke=W(Or,ut.props),Ke.ref=Oo(rt,Or,ut),Ke.return=rt,rt=Ke;break e}C(rt,Or);break}else m(rt,Or);Or=Or.sibling}ut.type===f?(Ke=Ma(ut.props.children,rt.mode,Rt,ut.key),Ke.return=rt,rt=Ke):(Rt=Mh(ut.type,ut.key,ut.props,null,rt.mode,Rt),Rt.ref=Oo(rt,Ke,ut),Rt.return=rt,rt=Rt)}return _e(rt);case h:e:{for(Or=ut.key;Ke!==null;){if(Ke.key===Or)if(Ke.tag===4&&Ke.stateNode.containerInfo===ut.containerInfo&&Ke.stateNode.implementation===ut.implementation){C(rt,Ke.sibling),Ke=W(Ke,ut.children||[]),Ke.return=rt,rt=Ke;break e}else{C(rt,Ke);break}else m(rt,Ke);Ke=Ke.sibling}Ke=Ih(ut,rt.mode,Rt),Ke.return=rt,rt=Ke}return _e(rt);case A:return Or=ut._init,Sl(rt,Ke,Or(ut._payload),Rt)}if(J(ut))return mn(rt,Ke,ut,Rt);if(I(ut))return mo(rt,Ke,ut,Rt);hs(rt,ut)}return typeof ut=="string"&&ut!==""||typeof ut=="number"?(ut=""+ut,Ke!==null&&Ke.tag===6?(C(rt,Ke.sibling),Ke=W(Ke,ut),Ke.return=rt,rt=Ke):(C(rt,Ke),Ke=Wc(ut,rt.mode,Rt),Ke.return=rt,rt=Ke),_e(rt)):C(rt,Ke)}return Sl}var oo=gl(!0),vl=gl(!1),Pi=gi(null),ds=null,Co=null,Ml=null;function Il(){Ml=Co=ds=null}function zn(d,m,C){ye?(Sr(Pi,m._currentValue),m._currentValue=C):(Sr(Pi,m._currentValue2),m._currentValue2=C)}function so(d){var m=Pi.current;cn(Pi),ye?d._currentValue=m:d._currentValue2=m}function Lo(d,m,C){for(;d!==null;){var z=d.alternate;if((d.childLanes&m)!==m?(d.childLanes|=m,z!==null&&(z.childLanes|=m)):z!==null&&(z.childLanes&m)!==m&&(z.childLanes|=m),d===C)break;d=d.return}}function Us(d,m){ds=d,Ml=Co=null,d=d.dependencies,d!==null&&d.firstContext!==null&&((d.lanes&m)!==0&&(yi=!0),d.firstContext=null)}function In(d){var m=ye?d._currentValue:d._currentValue2;if(Ml!==d)if(d={context:d,memoizedValue:m,next:null},Co===null){if(ds===null)throw Error(o(308));Co=d,ds.dependencies={lanes:0,firstContext:d}}else Co=Co.next=d;return m}var Ga=null;function ml(d){Ga===null?Ga=[d]:Ga.push(d)}function jl(d,m,C,z){var W=m.interleaved;return W===null?(C.next=C,ml(m)):(C.next=W.next,W.next=C),m.interleaved=C,qi(d,z)}function qi(d,m){d.lanes|=m;var C=d.alternate;for(C!==null&&(C.lanes|=m),C=d,d=d.return;d!==null;)d.childLanes|=m,C=d.alternate,C!==null&&(C.childLanes|=m),C=d,d=d.return;return C.tag===3?C.stateNode:null}var Oi=!1;function Na(d){d.updateQueue={baseState:d.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wa(d,m){d=d.updateQueue,m.updateQueue===d&&(m.updateQueue={baseState:d.baseState,firstBaseUpdate:d.firstBaseUpdate,lastBaseUpdate:d.lastBaseUpdate,shared:d.shared,effects:d.effects})}function ha(d,m){return{eventTime:d,lane:m,tag:0,payload:null,callback:null,next:null}}function Ji(d,m,C){var z=d.updateQueue;if(z===null)return null;if(z=z.shared,(sr&2)!==0){var W=z.pending;return W===null?m.next=m:(m.next=W.next,W.next=m),z.pending=m,qi(d,C)}return W=z.interleaved,W===null?(m.next=m,ml(z)):(m.next=W.next,W.next=m),z.interleaved=m,qi(d,C)}function No(d,m,C){if(m=m.updateQueue,m!==null&&(m=m.shared,(C&4194240)!==0)){var z=m.lanes;z&=d.pendingLanes,C|=z,m.lanes=C,qa(d,C)}}function ps(d,m){var C=d.updateQueue,z=d.alternate;if(z!==null&&(z=z.updateQueue,C===z)){var W=null,ne=null;if(C=C.firstBaseUpdate,C!==null){do{var _e={eventTime:C.eventTime,lane:C.lane,tag:C.tag,payload:C.payload,callback:C.callback,next:null};ne===null?W=ne=_e:ne=ne.next=_e,C=C.next}while(C!==null);ne===null?W=ne=m:ne=ne.next=m}else W=ne=m;C={baseState:z.baseState,firstBaseUpdate:W,lastBaseUpdate:ne,shared:z.shared,effects:z.effects},d.updateQueue=C;return}d=C.lastBaseUpdate,d===null?C.firstBaseUpdate=m:d.next=m,C.lastBaseUpdate=m}function lo(d,m,C,z){var W=d.updateQueue;Oi=!1;var ne=W.firstBaseUpdate,_e=W.lastBaseUpdate,Ye=W.shared.pending;if(Ye!==null){W.shared.pending=null;var it=Ye,wt=it.next;it.next=null,_e===null?ne=wt:_e.next=wt,_e=it;var $t=d.alternate;$t!==null&&($t=$t.updateQueue,Ye=$t.lastBaseUpdate,Ye!==_e&&(Ye===null?$t.firstBaseUpdate=wt:Ye.next=wt,$t.lastBaseUpdate=it))}if(ne!==null){var br=W.baseState;_e=0,$t=wt=it=null,Ye=ne;do{var Tt=Ye.lane,Fn=Ye.eventTime;if((z&Tt)===Tt){$t!==null&&($t=$t.next={eventTime:Fn,lane:0,tag:Ye.tag,payload:Ye.payload,callback:Ye.callback,next:null});e:{var mn=d,mo=Ye;switch(Tt=m,Fn=C,mo.tag){case 1:if(mn=mo.payload,typeof mn=="function"){br=mn.call(Fn,br,Tt);break e}br=mn;break e;case 3:mn.flags=mn.flags&-65537|128;case 0:if(mn=mo.payload,Tt=typeof mn=="function"?mn.call(Fn,br,Tt):mn,Tt==null)break e;br=a({},br,Tt);break e;case 2:Oi=!0}}Ye.callback!==null&&Ye.lane!==0&&(d.flags|=64,Tt=W.effects,Tt===null?W.effects=[Ye]:Tt.push(Ye))}else Fn={eventTime:Fn,lane:Tt,tag:Ye.tag,payload:Ye.payload,callback:Ye.callback,next:null},$t===null?(wt=$t=Fn,it=br):$t=$t.next=Fn,_e|=Tt;if(Ye=Ye.next,Ye===null){if(Ye=W.shared.pending,Ye===null)break;Tt=Ye,Ye=Tt.next,Tt.next=null,W.lastBaseUpdate=Tt,W.shared.pending=null}}while(!0);if($t===null&&(it=br),W.baseState=it,W.firstBaseUpdate=wt,W.lastBaseUpdate=$t,m=W.shared.interleaved,m!==null){W=m;do _e|=W.lane,W=W.next;while(W!==m)}else ne===null&&(W.shared.lanes=0);Xs|=_e,d.lanes=_e,d.memoizedState=br}}function Jn(d,m,C){if(d=m.effects,m.effects=null,d!==null)for(m=0;m<d.length;m++){var z=d[m],W=z.callback;if(W!==null){if(z.callback=null,z=C,typeof W!="function")throw Error(o(191,W));W.call(z)}}}var Wo={},ci=gi(Wo),Ta=gi(Wo),To=gi(Wo);function da(d){if(d===Wo)throw Error(o(174));return d}function yl(d,m){Sr(To,m),Sr(Ta,d),Sr(ci,Wo),d=ie(m),cn(ci),Sr(ci,d)}function Vo(){cn(ci),cn(Ta),cn(To)}function gs(d){var m=da(To.current),C=da(ci.current);m=Z(C,d.type,m),C!==m&&(Sr(Ta,d),Sr(ci,m))}function vs(d){Ta.current===d&&(cn(ci),cn(Ta))}var en=gi(0);function ms(d){for(var m=d;m!==null;){if(m.tag===13){var C=m.memoizedState;if(C!==null&&(C=C.dehydrated,C===null||Yi(C)||qr(C)))return m}else if(m.tag===19&&m.memoizedProps.revealOrder!==void 0){if((m.flags&128)!==0)return m}else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===d)break;for(;m.sibling===null;){if(m.return===null||m.return===d)return null;m=m.return}m.sibling.return=m.return,m=m.sibling}return null}var ys=[];function Hs(){for(var d=0;d<ys.length;d++){var m=ys[d];ye?m._workInProgressVersionPrimary=null:m._workInProgressVersionSecondary=null}ys.length=0}var Pn=s.ReactCurrentDispatcher,pa=s.ReactCurrentBatchConfig,Cr=0,ar=null,Er=null,Lr=null,Va=!1,$s=!1,bs=0,Gs=0;function Ci(){throw Error(o(321))}function bl(d,m){if(m===null)return!1;for(var C=0;C<m.length&&C<d.length;C++)if(!Ca(d[C],m[C]))return!1;return!0}function pu(d,m,C,z,W,ne){if(Cr=ne,ar=m,m.memoizedState=null,m.updateQueue=null,m.lanes=0,Pn.current=d===null||d.memoizedState===null?Ju:Ul,d=C(z,W),$s){ne=0;do{if($s=!1,bs=0,25<=ne)throw Error(o(301));ne+=1,Lr=Er=null,m.updateQueue=null,Pn.current=Mf,d=C(z,W)}while($s)}if(Pn.current=Vs,m=Er!==null&&Er.next!==null,Cr=0,Lr=Er=ar=null,Va=!1,m)throw Error(o(300));return d}function Xu(){var d=bs!==0;return bs=0,d}function Ya(){var d={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lr===null?ar.memoizedState=Lr=d:Lr=Lr.next=d,Lr}function Ui(){if(Er===null){var d=ar.alternate;d=d!==null?d.memoizedState:null}else d=Er.next;var m=Lr===null?ar.memoizedState:Lr.next;if(m!==null)Lr=m,Er=d;else{if(d===null)throw Error(o(310));Er=d,d={memoizedState:Er.memoizedState,baseState:Er.baseState,baseQueue:Er.baseQueue,queue:Er.queue,next:null},Lr===null?ar.memoizedState=Lr=d:Lr=Lr.next=d}return Lr}function Yo(d,m){return typeof m=="function"?m(d):m}function Ku(d){var m=Ui(),C=m.queue;if(C===null)throw Error(o(311));C.lastRenderedReducer=d;var z=Er,W=z.baseQueue,ne=C.pending;if(ne!==null){if(W!==null){var _e=W.next;W.next=ne.next,ne.next=_e}z.baseQueue=W=ne,C.pending=null}if(W!==null){ne=W.next,z=z.baseState;var Ye=_e=null,it=null,wt=ne;do{var $t=wt.lane;if((Cr&$t)===$t)it!==null&&(it=it.next={lane:0,action:wt.action,hasEagerState:wt.hasEagerState,eagerState:wt.eagerState,next:null}),z=wt.hasEagerState?wt.eagerState:d(z,wt.action);else{var br={lane:$t,action:wt.action,hasEagerState:wt.hasEagerState,eagerState:wt.eagerState,next:null};it===null?(Ye=it=br,_e=z):it=it.next=br,ar.lanes|=$t,Xs|=$t}wt=wt.next}while(wt!==null&&wt!==ne);it===null?_e=z:it.next=Ye,Ca(z,m.memoizedState)||(yi=!0),m.memoizedState=z,m.baseState=_e,m.baseQueue=it,C.lastRenderedState=z}if(d=C.interleaved,d!==null){W=d;do ne=W.lane,ar.lanes|=ne,Xs|=ne,W=W.next;while(W!==d)}else W===null&&(C.lanes=0);return[m.memoizedState,C.dispatch]}function Dl(d){var m=Ui(),C=m.queue;if(C===null)throw Error(o(311));C.lastRenderedReducer=d;var z=C.dispatch,W=C.pending,ne=m.memoizedState;if(W!==null){C.pending=null;var _e=W=W.next;do ne=d(ne,_e.action),_e=_e.next;while(_e!==W);Ca(ne,m.memoizedState)||(yi=!0),m.memoizedState=ne,m.baseQueue===null&&(m.baseState=ne),C.lastRenderedState=ne}return[ne,z]}function Lc(){}function Nc(d,m){var C=ar,z=Ui(),W=m(),ne=!Ca(z.memoizedState,W);if(ne&&(z.memoizedState=W,yi=!0),z=z.queue,zl(Mc.bind(null,C,z,d),[d]),z.getSnapshot!==m||ne||Lr!==null&&Lr.memoizedState.tag&1){if(C.flags|=2048,Li(9,Rc.bind(null,C,z,W,m),void 0,null),Ir===null)throw Error(o(349));(Cr&30)!==0||Tc(C,m,W)}return W}function Tc(d,m,C){d.flags|=16384,d={getSnapshot:m,value:C},m=ar.updateQueue,m===null?(m={lastEffect:null,stores:null},ar.updateQueue=m,m.stores=[d]):(C=m.stores,C===null?m.stores=[d]:C.push(d))}function Rc(d,m,C,z){m.value=C,m.getSnapshot=z,Ic(m)&&Xo(d)}function Mc(d,m,C){return C(function(){Ic(m)&&Xo(d)})}function Ic(d){var m=d.getSnapshot;d=d.value;try{var C=m();return!Ca(d,C)}catch{return!0}}function Xo(d){var m=qi(d,1);m!==null&&_a(m,d,1,-1)}function Fl(d){var m=Ya();return typeof d=="function"&&(d=d()),m.memoizedState=m.baseState=d,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:d},m.queue=d,d=d.dispatch=Pd.bind(null,ar,d),[m.memoizedState,d]}function Li(d,m,C,z){return d={tag:d,create:m,destroy:C,deps:z,next:null},m=ar.updateQueue,m===null?(m={lastEffect:null,stores:null},ar.updateQueue=m,m.lastEffect=d.next=d):(C=m.lastEffect,C===null?m.lastEffect=d.next=d:(z=C.next,C.next=d,d.next=z,m.lastEffect=d)),d}function uo(){return Ui().memoizedState}function Bl(d,m,C,z){var W=Ya();ar.flags|=d,W.memoizedState=Li(1|m,C,void 0,z===void 0?null:z)}function Ko(d,m,C,z){var W=Ui();z=z===void 0?null:z;var ne=void 0;if(Er!==null){var _e=Er.memoizedState;if(ne=_e.destroy,z!==null&&bl(z,_e.deps)){W.memoizedState=Li(m,C,ne,z);return}}ar.flags|=d,W.memoizedState=Li(1|m,C,ne,z)}function Tf(d,m){return Bl(8390656,8,d,m)}function zl(d,m){return Ko(2048,8,d,m)}function gu(d,m){return Ko(4,2,d,m)}function fn(d,m){return Ko(4,4,d,m)}function Zu(d,m){if(typeof m=="function")return d=d(),m(d),function(){m(null)};if(m!=null)return d=d(),m.current=d,function(){m.current=null}}function ql(d,m,C){return C=C!=null?C.concat([d]):null,Ko(4,4,Zu.bind(null,m,d),C)}function Ws(){}function vu(d,m){var C=Ui();m=m===void 0?null:m;var z=C.memoizedState;return z!==null&&m!==null&&bl(m,z[1])?z[0]:(C.memoizedState=[d,m],d)}function mu(d,m){var C=Ui();m=m===void 0?null:m;var z=C.memoizedState;return z!==null&&m!==null&&bl(m,z[1])?z[0]:(d=d(),C.memoizedState=[d,m],d)}function yu(d,m,C){return(Cr&21)===0?(d.baseState&&(d.baseState=!1,yi=!0),d.memoizedState=C):(Ca(C,m)||(C=fs(),ar.lanes|=C,Xs|=C,d.baseState=!0),m)}function jc(d,m){var C=Pt;Pt=C!==0&&4>C?C:4,d(!0);var z=pa.transition;pa.transition={};try{d(!1),m()}finally{Pt=C,pa.transition=z}}function wl(){return Ui().memoizedState}function Ah(d,m,C){var z=_i(d);if(C={lane:z,action:C,hasEagerState:!1,eagerState:null,next:null},Ph(d))Rf(m,C);else if(C=jl(d,m,C,z),C!==null){var W=xn();_a(C,d,z,W),Qu(C,m,z)}}function Pd(d,m,C){var z=_i(d),W={lane:z,action:C,hasEagerState:!1,eagerState:null,next:null};if(Ph(d))Rf(m,W);else{var ne=d.alternate;if(d.lanes===0&&(ne===null||ne.lanes===0)&&(ne=m.lastRenderedReducer,ne!==null))try{var _e=m.lastRenderedState,Ye=ne(_e,C);if(W.hasEagerState=!0,W.eagerState=Ye,Ca(Ye,_e)){var it=m.interleaved;it===null?(W.next=W,ml(m)):(W.next=it.next,it.next=W),m.interleaved=W;return}}catch{}finally{}C=jl(d,m,W,z),C!==null&&(W=xn(),_a(C,d,z,W),Qu(C,m,z))}}function Ph(d){var m=d.alternate;return d===ar||m!==null&&m===ar}function Rf(d,m){$s=Va=!0;var C=d.pending;C===null?m.next=m:(m.next=C.next,C.next=m),d.pending=m}function Qu(d,m,C){if((C&4194240)!==0){var z=m.lanes;z&=d.pendingLanes,C|=z,m.lanes=C,qa(d,C)}}var Vs={readContext:In,useCallback:Ci,useContext:Ci,useEffect:Ci,useImperativeHandle:Ci,useInsertionEffect:Ci,useLayoutEffect:Ci,useMemo:Ci,useReducer:Ci,useRef:Ci,useState:Ci,useDebugValue:Ci,useDeferredValue:Ci,useTransition:Ci,useMutableSource:Ci,useSyncExternalStore:Ci,useId:Ci,unstable_isNewReconciler:!1},Ju={readContext:In,useCallback:function(d,m){return Ya().memoizedState=[d,m===void 0?null:m],d},useContext:In,useEffect:Tf,useImperativeHandle:function(d,m,C){return C=C!=null?C.concat([d]):null,Bl(4194308,4,Zu.bind(null,m,d),C)},useLayoutEffect:function(d,m){return Bl(4194308,4,d,m)},useInsertionEffect:function(d,m){return Bl(4,2,d,m)},useMemo:function(d,m){var C=Ya();return m=m===void 0?null:m,d=d(),C.memoizedState=[d,m],d},useReducer:function(d,m,C){var z=Ya();return m=C!==void 0?C(m):m,z.memoizedState=z.baseState=m,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:m},z.queue=d,d=d.dispatch=Ah.bind(null,ar,d),[z.memoizedState,d]},useRef:function(d){var m=Ya();return d={current:d},m.memoizedState=d},useState:Fl,useDebugValue:Ws,useDeferredValue:function(d){return Ya().memoizedState=d},useTransition:function(){var d=Fl(!1),m=d[0];return d=jc.bind(null,d[1]),Ya().memoizedState=d,[m,d]},useMutableSource:function(){},useSyncExternalStore:function(d,m,C){var z=ar,W=Ya();if(ct){if(C===void 0)throw Error(o(407));C=C()}else{if(C=m(),Ir===null)throw Error(o(349));(Cr&30)!==0||Tc(z,m,C)}W.memoizedState=C;var ne={value:C,getSnapshot:m};return W.queue=ne,Tf(Mc.bind(null,z,ne,d),[d]),z.flags|=2048,Li(9,Rc.bind(null,z,ne,C,m),void 0,null),C},useId:function(){var d=Ya(),m=Ir.identifierPrefix;if(ct){var C=$a,z=vi;C=(z&~(1<<32-Oa(z)-1)).toString(32)+C,m=":"+m+"R"+C,C=bs++,0<C&&(m+="H"+C.toString(32)),m+=":"}else C=Gs++,m=":"+m+"r"+C.toString(32)+":";return d.memoizedState=m},unstable_isNewReconciler:!1},Ul={readContext:In,useCallback:vu,useContext:In,useEffect:zl,useImperativeHandle:ql,useInsertionEffect:gu,useLayoutEffect:fn,useMemo:mu,useReducer:Ku,useRef:uo,useState:function(){return Ku(Yo)},useDebugValue:Ws,useDeferredValue:function(d){var m=Ui();return yu(m,Er.memoizedState,d)},useTransition:function(){var d=Ku(Yo)[0],m=Ui().memoizedState;return[d,m]},useMutableSource:Lc,useSyncExternalStore:Nc,useId:wl,unstable_isNewReconciler:!1},Mf={readContext:In,useCallback:vu,useContext:In,useEffect:zl,useImperativeHandle:ql,useInsertionEffect:gu,useLayoutEffect:fn,useMemo:mu,useReducer:Dl,useRef:uo,useState:function(){return Dl(Yo)},useDebugValue:Ws,useDeferredValue:function(d){var m=Ui();return Er===null?m.memoizedState=d:yu(m,Er.memoizedState,d)},useTransition:function(){var d=Dl(Yo)[0],m=Ui().memoizedState;return[d,m]},useMutableSource:Lc,useSyncExternalStore:Nc,useId:wl,unstable_isNewReconciler:!1};function co(d,m){if(d&&d.defaultProps){m=a({},m),d=d.defaultProps;for(var C in d)m[C]===void 0&&(m[C]=d[C]);return m}return m}function Dc(d,m,C,z){m=d.memoizedState,C=C(z,m),C=C==null?m:a({},m,C),d.memoizedState=C,d.lanes===0&&(d.updateQueue.baseState=C)}var ec={isMounted:function(d){return(d=d._reactInternals)?F(d)===d:!1},enqueueSetState:function(d,m,C){d=d._reactInternals;var z=xn(),W=_i(d),ne=ha(z,W);ne.payload=m,C!=null&&(ne.callback=C),m=Ji(d,ne,W),m!==null&&(_a(m,d,W,z),No(m,d,W))},enqueueReplaceState:function(d,m,C){d=d._reactInternals;var z=xn(),W=_i(d),ne=ha(z,W);ne.tag=1,ne.payload=m,C!=null&&(ne.callback=C),m=Ji(d,ne,W),m!==null&&(_a(m,d,W,z),No(m,d,W))},enqueueForceUpdate:function(d,m){d=d._reactInternals;var C=xn(),z=_i(d),W=ha(C,z);W.tag=2,m!=null&&(W.callback=m),m=Ji(d,W,z),m!==null&&(_a(m,d,z,C),No(m,d,z))}};function Oh(d,m,C,z,W,ne,_e){return d=d.stateNode,typeof d.shouldComponentUpdate=="function"?d.shouldComponentUpdate(z,ne,_e):m.prototype&&m.prototype.isPureReactComponent?!Qi(C,z)||!Qi(W,ne):!0}function Ch(d,m,C){var z=!1,W=ss,ne=m.contextType;return typeof ne=="object"&&ne!==null?ne=In(ne):(W=Mn(m)?ro:Tr.current,z=m.contextTypes,ne=(z=z!=null)?Ki(d,W):ss),m=new m(C,ne),d.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=ec,d.stateNode=m,m._reactInternals=d,z&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=W,d.__reactInternalMemoizedMaskedChildContext=ne),m}function Fc(d,m,C,z){d=m.state,typeof m.componentWillReceiveProps=="function"&&m.componentWillReceiveProps(C,z),typeof m.UNSAFE_componentWillReceiveProps=="function"&&m.UNSAFE_componentWillReceiveProps(C,z),m.state!==d&&ec.enqueueReplaceState(m,m.state,null)}function ea(d,m,C,z){var W=d.stateNode;W.props=C,W.state=d.memoizedState,W.refs={},Na(d);var ne=m.contextType;typeof ne=="object"&&ne!==null?W.context=In(ne):(ne=Mn(m)?ro:Tr.current,W.context=Ki(d,ne)),W.state=d.memoizedState,ne=m.getDerivedStateFromProps,typeof ne=="function"&&(Dc(d,m,ne,C),W.state=d.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof W.getSnapshotBeforeUpdate=="function"||typeof W.UNSAFE_componentWillMount!="function"&&typeof W.componentWillMount!="function"||(m=W.state,typeof W.componentWillMount=="function"&&W.componentWillMount(),typeof W.UNSAFE_componentWillMount=="function"&&W.UNSAFE_componentWillMount(),m!==W.state&&ec.enqueueReplaceState(W,W.state,null),lo(d,C,W,z),W.state=d.memoizedState),typeof W.componentDidMount=="function"&&(d.flags|=4194308)}function ta(d,m){try{var C="",z=m;do C+=Cc(z),z=z.return;while(z);var W=C}catch(ne){W=`
|
|
69
|
-
Error generating stack: `+ne.message+`
|
|
70
|
-
`+ne.stack}return{value:d,source:m,stack:W,digest:null}}function ga(d,m,C){return{value:d,source:null,stack:C??null,digest:m??null}}function Ro(d,m){try{console.error(m.value)}catch(C){setTimeout(function(){throw C})}}var bu=typeof WeakMap=="function"?WeakMap:Map;function ra(d,m,C){C=ha(-1,C),C.tag=3,C.payload={element:null};var z=m.value;return C.callback=function(){$n||($n=!0,Gn=z),Ro(d,m)},C}function Ra(d,m,C){C=ha(-1,C),C.tag=3;var z=d.type.getDerivedStateFromError;if(typeof z=="function"){var W=m.value;C.payload=function(){return z(W)},C.callback=function(){Ro(d,m)}}var ne=d.stateNode;return ne!==null&&typeof ne.componentDidCatch=="function"&&(C.callback=function(){Ro(d,m),typeof z!="function"&&(ho===null?ho=new Set([this]):ho.add(this));var _e=m.stack;this.componentDidCatch(m.value,{componentStack:_e!==null?_e:""})}),C}function Lh(d,m,C){var z=d.pingCache;if(z===null){z=d.pingCache=new bu;var W=new Set;z.set(m,W)}else W=z.get(m),W===void 0&&(W=new Set,z.set(m,W));W.has(C)||(W.add(C),d=qp.bind(null,d,m,C),m.then(d,d))}function Nh(d){do{var m;if((m=d.tag===13)&&(m=d.memoizedState,m=m!==null?m.dehydrated!==null:!0),m)return d;d=d.return}while(d!==null);return null}function Ys(d,m,C,z,W){return(d.mode&1)===0?(d===m?d.flags|=65536:(d.flags|=128,C.flags|=131072,C.flags&=-52805,C.tag===1&&(C.alternate===null?C.tag=17:(m=ha(-1,1),m.tag=2,Ji(C,m,1))),C.lanes|=1),d):(d.flags|=65536,d.lanes=W,d)}var wu=s.ReactCurrentOwner,yi=!1;function Ni(d,m,C,z){m.child=d===null?vl(m,null,C,z):oo(m,d.child,C,z)}function Bc(d,m,C,z,W){C=C.render;var ne=m.ref;return Us(m,W),z=pu(d,m,C,z,ne,W),C=Xu(),d!==null&&!yi?(m.updateQueue=d.updateQueue,m.flags&=-2053,d.lanes&=~W,Y(d,m,W)):(ct&&C&&ke(m),m.flags|=1,Ni(d,m,z,W),m.child)}function ws(d,m,C,z,W){if(d===null){var ne=C.type;return typeof ne=="function"&&!$c(ne)&&ne.defaultProps===void 0&&C.compare===null&&C.defaultProps===void 0?(m.tag=15,m.type=ne,Mo(d,m,ne,z,W)):(d=Mh(C.type,null,z,m,m.mode,W),d.ref=m.ref,d.return=m,m.child=d)}if(ne=d.child,(d.lanes&W)===0){var _e=ne.memoizedProps;if(C=C.compare,C=C!==null?C:Qi,C(_e,z)&&d.ref===m.ref)return Y(d,m,W)}return m.flags|=1,d=Pu(ne,z),d.ref=m.ref,d.return=m,m.child=d}function Mo(d,m,C,z,W){if(d!==null){var ne=d.memoizedProps;if(Qi(ne,z)&&d.ref===m.ref)if(yi=!1,m.pendingProps=z=ne,(d.lanes&W)!==0)(d.flags&131072)!==0&&(yi=!0);else return m.lanes=d.lanes,Y(d,m,W)}return _s(d,m,C,z,W)}function tn(d,m,C){var z=m.pendingProps,W=z.children,ne=d!==null?d.memoizedState:null;if(z.mode==="hidden")if((m.mode&1)===0)m.memoizedState={baseLanes:0,cachePool:null,transitions:null},Sr(Zo,hi),hi|=C;else{if((C&1073741824)===0)return d=ne!==null?ne.baseLanes|C:C,m.lanes=m.childLanes=1073741824,m.memoizedState={baseLanes:d,cachePool:null,transitions:null},m.updateQueue=null,Sr(Zo,hi),hi|=d,null;m.memoizedState={baseLanes:0,cachePool:null,transitions:null},z=ne!==null?ne.baseLanes:C,Sr(Zo,hi),hi|=z}else ne!==null?(z=ne.baseLanes|C,m.memoizedState=null):z=C,Sr(Zo,hi),hi|=z;return Ni(d,m,W,C),m.child}function sn(d,m){var C=m.ref;(d===null&&C!==null||d!==null&&d.ref!==C)&&(m.flags|=512,m.flags|=2097152)}function _s(d,m,C,z,W){var ne=Mn(C)?ro:Tr.current;return ne=Ki(m,ne),Us(m,W),C=pu(d,m,C,z,ne,W),z=Xu(),d!==null&&!yi?(m.updateQueue=d.updateQueue,m.flags&=-2053,d.lanes&=~W,Y(d,m,W)):(ct&&z&&ke(m),m.flags|=1,Ni(d,m,C,W),m.child)}function Hi(d,m,C,z,W){if(Mn(C)){var ne=!0;ls(m)}else ne=!1;if(Us(m,W),m.stateNode===null)R(d,m),Ch(m,C,z),ea(m,C,z,W),z=!0;else if(d===null){var _e=m.stateNode,Ye=m.memoizedProps;_e.props=Ye;var it=_e.context,wt=C.contextType;typeof wt=="object"&&wt!==null?wt=In(wt):(wt=Mn(C)?ro:Tr.current,wt=Ki(m,wt));var $t=C.getDerivedStateFromProps,br=typeof $t=="function"||typeof _e.getSnapshotBeforeUpdate=="function";br||typeof _e.UNSAFE_componentWillReceiveProps!="function"&&typeof _e.componentWillReceiveProps!="function"||(Ye!==z||it!==wt)&&Fc(m,_e,z,wt),Oi=!1;var Tt=m.memoizedState;_e.state=Tt,lo(m,z,_e,W),it=m.memoizedState,Ye!==z||Tt!==it||Xi.current||Oi?(typeof $t=="function"&&(Dc(m,C,$t,z),it=m.memoizedState),(Ye=Oi||Oh(m,C,Ye,z,Tt,it,wt))?(br||typeof _e.UNSAFE_componentWillMount!="function"&&typeof _e.componentWillMount!="function"||(typeof _e.componentWillMount=="function"&&_e.componentWillMount(),typeof _e.UNSAFE_componentWillMount=="function"&&_e.UNSAFE_componentWillMount()),typeof _e.componentDidMount=="function"&&(m.flags|=4194308)):(typeof _e.componentDidMount=="function"&&(m.flags|=4194308),m.memoizedProps=z,m.memoizedState=it),_e.props=z,_e.state=it,_e.context=wt,z=Ye):(typeof _e.componentDidMount=="function"&&(m.flags|=4194308),z=!1)}else{_e=m.stateNode,Wa(d,m),Ye=m.memoizedProps,wt=m.type===m.elementType?Ye:co(m.type,Ye),_e.props=wt,br=m.pendingProps,Tt=_e.context,it=C.contextType,typeof it=="object"&&it!==null?it=In(it):(it=Mn(C)?ro:Tr.current,it=Ki(m,it));var Fn=C.getDerivedStateFromProps;($t=typeof Fn=="function"||typeof _e.getSnapshotBeforeUpdate=="function")||typeof _e.UNSAFE_componentWillReceiveProps!="function"&&typeof _e.componentWillReceiveProps!="function"||(Ye!==br||Tt!==it)&&Fc(m,_e,z,it),Oi=!1,Tt=m.memoizedState,_e.state=Tt,lo(m,z,_e,W);var mn=m.memoizedState;Ye!==br||Tt!==mn||Xi.current||Oi?(typeof Fn=="function"&&(Dc(m,C,Fn,z),mn=m.memoizedState),(wt=Oi||Oh(m,C,wt,z,Tt,mn,it)||!1)?($t||typeof _e.UNSAFE_componentWillUpdate!="function"&&typeof _e.componentWillUpdate!="function"||(typeof _e.componentWillUpdate=="function"&&_e.componentWillUpdate(z,mn,it),typeof _e.UNSAFE_componentWillUpdate=="function"&&_e.UNSAFE_componentWillUpdate(z,mn,it)),typeof _e.componentDidUpdate=="function"&&(m.flags|=4),typeof _e.getSnapshotBeforeUpdate=="function"&&(m.flags|=1024)):(typeof _e.componentDidUpdate!="function"||Ye===d.memoizedProps&&Tt===d.memoizedState||(m.flags|=4),typeof _e.getSnapshotBeforeUpdate!="function"||Ye===d.memoizedProps&&Tt===d.memoizedState||(m.flags|=1024),m.memoizedProps=z,m.memoizedState=mn),_e.props=z,_e.state=mn,_e.context=it,z=wt):(typeof _e.componentDidUpdate!="function"||Ye===d.memoizedProps&&Tt===d.memoizedState||(m.flags|=4),typeof _e.getSnapshotBeforeUpdate!="function"||Ye===d.memoizedProps&&Tt===d.memoizedState||(m.flags|=1024),z=!1)}return va(d,m,C,z,ne,W)}function va(d,m,C,z,W,ne){sn(d,m);var _e=(m.flags&128)!==0;if(!z&&!_e)return W&&Vu(m,C,!1),Y(d,m,ne);z=m.stateNode,wu.current=m;var Ye=_e&&typeof C.getDerivedStateFromError!="function"?null:z.render();return m.flags|=1,d!==null&&_e?(m.child=oo(m,d.child,null,ne),m.child=oo(m,null,Ye,ne)):Ni(d,m,Ye,ne),m.memoizedState=z.state,W&&Vu(m,C,!0),m.child}function _l(d){var m=d.stateNode;m.pendingContext?ul(d,m.pendingContext,m.pendingContext!==m.context):m.context&&ul(d,m.context,!1),yl(d,m.containerInfo)}function Hl(d,m,C,z,W){return _n(),Ai(W),m.flags|=256,Ni(d,m,C,z),m.child}var ma={dehydrated:null,treeContext:null,retryLane:0};function _u(d){return{baseLanes:d,cachePool:null,transitions:null}}function If(d,m,C){var z=m.pendingProps,W=en.current,ne=!1,_e=(m.flags&128)!==0,Ye;if((Ye=_e)||(Ye=d!==null&&d.memoizedState===null?!1:(W&2)!==0),Ye?(ne=!0,m.flags&=-129):(d===null||d.memoizedState!==null)&&(W|=1),Sr(en,W&1),d===null)return An(m),d=m.memoizedState,d!==null&&(d=d.dehydrated,d!==null)?((m.mode&1)===0?m.lanes=1:qr(d)?m.lanes=8:m.lanes=1073741824,null):(_e=z.children,d=z.fallback,ne?(z=m.mode,ne=m.child,_e={mode:"hidden",children:_e},(z&1)===0&&ne!==null?(ne.childLanes=0,ne.pendingProps=_e):ne=Gc(_e,z,0,null),d=Ma(d,z,C,null),ne.return=m,d.return=m,ne.sibling=d,m.child=ne,m.child.memoizedState=_u(C),m.memoizedState=ma,d):tc(m,_e));if(W=d.memoizedState,W!==null&&(Ye=W.dehydrated,Ye!==null))return Th(d,m,_e,z,Ye,W,C);if(ne){ne=z.fallback,_e=m.mode,W=d.child,Ye=W.sibling;var it={mode:"hidden",children:z.children};return(_e&1)===0&&m.child!==W?(z=m.child,z.childLanes=0,z.pendingProps=it,m.deletions=null):(z=Pu(W,it),z.subtreeFlags=W.subtreeFlags&14680064),Ye!==null?ne=Pu(Ye,ne):(ne=Ma(ne,_e,C,null),ne.flags|=2),ne.return=m,z.return=m,z.sibling=ne,m.child=z,z=ne,ne=m.child,_e=d.child.memoizedState,_e=_e===null?_u(C):{baseLanes:_e.baseLanes|C,cachePool:null,transitions:_e.transitions},ne.memoizedState=_e,ne.childLanes=d.childLanes&~C,m.memoizedState=ma,z}return ne=d.child,d=ne.sibling,z=Pu(ne,{mode:"visible",children:z.children}),(m.mode&1)===0&&(z.lanes=C),z.return=m,z.sibling=null,d!==null&&(C=m.deletions,C===null?(m.deletions=[d],m.flags|=16):C.push(d)),m.child=z,m.memoizedState=null,z}function tc(d,m){return m=Gc({mode:"visible",children:m},d.mode,0,null),m.return=d,d.child=m}function xs(d,m,C,z){return z!==null&&Ai(z),oo(m,d.child,null,C),d=tc(m,m.pendingProps.children),d.flags|=2,m.memoizedState=null,d}function Th(d,m,C,z,W,ne,_e){if(C)return m.flags&256?(m.flags&=-257,z=ga(Error(o(422))),xs(d,m,_e,z)):m.memoizedState!==null?(m.child=d.child,m.flags|=128,null):(ne=z.fallback,W=m.mode,z=Gc({mode:"visible",children:z.children},W,0,null),ne=Ma(ne,W,_e,null),ne.flags|=2,z.return=m,ne.return=m,z.sibling=ne,m.child=z,(m.mode&1)!==0&&oo(m,d.child,null,_e),m.child.memoizedState=_u(_e),m.memoizedState=ma,ne);if((m.mode&1)===0)return xs(d,m,_e,null);if(qr(W))return z=En(W).digest,ne=Error(o(419)),z=ga(ne,z,void 0),xs(d,m,_e,z);if(C=(_e&d.childLanes)!==0,yi||C){if(z=Ir,z!==null){switch(_e&-_e){case 4:W=2;break;case 16:W=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:W=32;break;case 536870912:W=268435456;break;default:W=0}W=(W&(z.suspendedLanes|_e))!==0?0:W,W!==0&&W!==ne.retryLane&&(ne.retryLane=W,qi(d,W),_a(z,d,W,-1))}return vo(),z=ga(Error(o(421))),xs(d,m,_e,z)}return Yi(W)?(m.flags|=128,m.child=d.child,m=Hp.bind(null,d),Rn(W,m),null):(d=ne.treeContext,Ie&&(at=eo(W),Ge=m,ct=!0,jt=null,Dt=!1,d!==null&&(Bn[fa++]=vi,Bn[fa++]=$a,Bn[fa++]=Qn,vi=d.id,$a=d.overflow,Qn=m)),m=tc(m,z.children),m.flags|=4096,m)}function Ss(d,m,C){d.lanes|=m;var z=d.alternate;z!==null&&(z.lanes|=m),Lo(d.return,m,C)}function $l(d,m,C,z,W){var ne=d.memoizedState;ne===null?d.memoizedState={isBackwards:m,rendering:null,renderingStartTime:0,last:z,tail:C,tailMode:W}:(ne.isBackwards=m,ne.rendering=null,ne.renderingStartTime=0,ne.last=z,ne.tail=C,ne.tailMode=W)}function P(d,m,C){var z=m.pendingProps,W=z.revealOrder,ne=z.tail;if(Ni(d,m,z.children,C),z=en.current,(z&2)!==0)z=z&1|2,m.flags|=128;else{if(d!==null&&(d.flags&128)!==0)e:for(d=m.child;d!==null;){if(d.tag===13)d.memoizedState!==null&&Ss(d,C,m);else if(d.tag===19)Ss(d,C,m);else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===m)break e;for(;d.sibling===null;){if(d.return===null||d.return===m)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}z&=1}if(Sr(en,z),(m.mode&1)===0)m.memoizedState=null;else switch(W){case"forwards":for(C=m.child,W=null;C!==null;)d=C.alternate,d!==null&&ms(d)===null&&(W=C),C=C.sibling;C=W,C===null?(W=m.child,m.child=null):(W=C.sibling,C.sibling=null),$l(m,!1,W,C,ne);break;case"backwards":for(C=null,W=m.child,m.child=null;W!==null;){if(d=W.alternate,d!==null&&ms(d)===null){m.child=W;break}d=W.sibling,W.sibling=C,C=W,W=d}$l(m,!0,C,null,ne);break;case"together":$l(m,!1,null,null,void 0);break;default:m.memoizedState=null}return m.child}function R(d,m){(m.mode&1)===0&&d!==null&&(d.alternate=null,m.alternate=null,m.flags|=2)}function Y(d,m,C){if(d!==null&&(m.dependencies=d.dependencies),Xs|=m.lanes,(C&m.childLanes)===0)return null;if(d!==null&&m.child!==d.child)throw Error(o(153));if(m.child!==null){for(d=m.child,C=Pu(d,d.pendingProps),m.child=C,C.return=m;d.sibling!==null;)d=d.sibling,C=C.sibling=Pu(d,d.pendingProps),C.return=m;C.sibling=null}return m.child}function re(d,m,C){switch(m.tag){case 3:_l(m),_n();break;case 5:gs(m);break;case 1:Mn(m.type)&&ls(m);break;case 4:yl(m,m.stateNode.containerInfo);break;case 10:zn(m,m.type._context,m.memoizedProps.value);break;case 13:var z=m.memoizedState;if(z!==null)return z.dehydrated!==null?(Sr(en,en.current&1),m.flags|=128,null):(C&m.child.childLanes)!==0?If(d,m,C):(Sr(en,en.current&1),d=Y(d,m,C),d!==null?d.sibling:null);Sr(en,en.current&1);break;case 19:if(z=(C&m.childLanes)!==0,(d.flags&128)!==0){if(z)return P(d,m,C);m.flags|=128}var W=m.memoizedState;if(W!==null&&(W.rendering=null,W.tail=null,W.lastEffect=null),Sr(en,en.current),z)break;return null;case 22:case 23:return m.lanes=0,tn(d,m,C)}return Y(d,m,C)}function le(d){d.flags|=4}function pe(d,m){if(d!==null&&d.child===m.child)return!0;if((m.flags&16)!==0)return!1;for(d=m.child;d!==null;){if((d.flags&12854)!==0||(d.subtreeFlags&12854)!==0)return!1;d=d.sibling}return!0}var ve,be,we,Se;if(Te)ve=function(d,m){for(var C=m.child;C!==null;){if(C.tag===5||C.tag===6)D(d,C.stateNode);else if(C.tag!==4&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===m)break;for(;C.sibling===null;){if(C.return===null||C.return===m)return;C=C.return}C.sibling.return=C.return,C=C.sibling}},be=function(){},we=function(d,m,C,z,W){if(d=d.memoizedProps,d!==z){var ne=m.stateNode,_e=da(ci.current);C=X(ne,C,d,z,W,_e),(m.updateQueue=C)&&le(m)}},Se=function(d,m,C,z){C!==z&&le(m)};else if(Ce){ve=function(d,m,C,z){for(var W=m.child;W!==null;){if(W.tag===5){var ne=W.stateNode;C&&z&&(ne=Sn(ne,W.type,W.memoizedProps,W)),D(d,ne)}else if(W.tag===6)ne=W.stateNode,C&&z&&(ne=Qt(ne,W.memoizedProps,W)),D(d,ne);else if(W.tag!==4){if(W.tag===22&&W.memoizedState!==null)ne=W.child,ne!==null&&(ne.return=W),ve(d,W,!0,!0);else if(W.child!==null){W.child.return=W,W=W.child;continue}}if(W===m)break;for(;W.sibling===null;){if(W.return===null||W.return===m)return;W=W.return}W.sibling.return=W.return,W=W.sibling}};var Fe=function(d,m,C,z){for(var W=m.child;W!==null;){if(W.tag===5){var ne=W.stateNode;C&&z&&(ne=Sn(ne,W.type,W.memoizedProps,W)),Bi(d,ne)}else if(W.tag===6)ne=W.stateNode,C&&z&&(ne=Qt(ne,W.memoizedProps,W)),Bi(d,ne);else if(W.tag!==4){if(W.tag===22&&W.memoizedState!==null)ne=W.child,ne!==null&&(ne.return=W),Fe(d,W,!0,!0);else if(W.child!==null){W.child.return=W,W=W.child;continue}}if(W===m)break;for(;W.sibling===null;){if(W.return===null||W.return===m)return;W=W.return}W.sibling.return=W.return,W=W.sibling}};be=function(d,m){var C=m.stateNode;if(!pe(d,m)){d=C.containerInfo;var z=pr(d);Fe(z,m,!1,!1),C.pendingChildren=z,le(m),oi(d,z)}},we=function(d,m,C,z,W){var ne=d.stateNode,_e=d.memoizedProps;if((d=pe(d,m))&&_e===z)m.stateNode=ne;else{var Ye=m.stateNode,it=da(ci.current),wt=null;_e!==z&&(wt=X(Ye,C,_e,z,W,it)),d&&wt===null?m.stateNode=ne:(ne=er(ne,wt,C,_e,z,m,d,Ye),U(ne,C,z,W,it)&&le(m),m.stateNode=ne,d?le(m):ve(ne,m,!1,!1))}},Se=function(d,m,C,z){C!==z?(d=da(To.current),C=da(ci.current),m.stateNode=K(z,d,C,m),le(m)):m.stateNode=d.stateNode}}else be=function(){},we=function(){},Se=function(){};function Je(d,m){if(!ct)switch(d.tailMode){case"hidden":m=d.tail;for(var C=null;m!==null;)m.alternate!==null&&(C=m),m=m.sibling;C===null?d.tail=null:C.sibling=null;break;case"collapsed":C=d.tail;for(var z=null;C!==null;)C.alternate!==null&&(z=C),C=C.sibling;z===null?m||d.tail===null?d.tail=null:d.tail.sibling=null:z.sibling=null}}function xe(d){var m=d.alternate!==null&&d.alternate.child===d.child,C=0,z=0;if(m)for(var W=d.child;W!==null;)C|=W.lanes|W.childLanes,z|=W.subtreeFlags&14680064,z|=W.flags&14680064,W.return=d,W=W.sibling;else for(W=d.child;W!==null;)C|=W.lanes|W.childLanes,z|=W.subtreeFlags,z|=W.flags,W.return=d,W=W.sibling;return d.subtreeFlags|=z,d.childLanes=C,m}function $e(d,m,C){var z=m.pendingProps;switch(De(m),m.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xe(m),null;case 1:return Mn(m.type)&&Zi(),xe(m),null;case 3:return C=m.stateNode,Vo(),cn(Xi),cn(Tr),Hs(),C.pendingContext&&(C.context=C.pendingContext,C.pendingContext=null),(d===null||d.child===null)&&(on(m)?le(m):d===null||d.memoizedState.isDehydrated&&(m.flags&256)===0||(m.flags|=1024,jt!==null&&(rc(jt),jt=null))),be(d,m),xe(m),null;case 5:vs(m),C=da(To.current);var W=m.type;if(d!==null&&m.stateNode!=null)we(d,m,W,z,C),d.ref!==m.ref&&(m.flags|=512,m.flags|=2097152);else{if(!z){if(m.stateNode===null)throw Error(o(166));return xe(m),null}if(d=da(ci.current),on(m)){if(!Ie)throw Error(o(175));d=si(m.stateNode,m.type,m.memoizedProps,C,d,m,!Dt),m.updateQueue=d,d!==null&&le(m)}else{var ne=B(W,z,C,d,m);ve(ne,m,!1,!1),m.stateNode=ne,U(ne,W,z,C,d)&&le(m)}m.ref!==null&&(m.flags|=512,m.flags|=2097152)}return xe(m),null;case 6:if(d&&m.stateNode!=null)Se(d,m,d.memoizedProps,z);else{if(typeof z!="string"&&m.stateNode===null)throw Error(o(166));if(d=da(To.current),C=da(ci.current),on(m)){if(!Ie)throw Error(o(176));if(d=m.stateNode,C=m.memoizedProps,(z=ka(d,C,m,!Dt))&&(W=Ge,W!==null))switch(W.tag){case 3:Nf(W.stateNode.containerInfo,d,C,(W.mode&1)!==0);break;case 5:kn(W.type,W.memoizedProps,W.stateNode,d,C,(W.mode&1)!==0)}z&&le(m)}else m.stateNode=K(z,d,C,m)}return xe(m),null;case 13:if(cn(en),z=m.memoizedState,d===null||d.memoizedState!==null&&d.memoizedState.dehydrated!==null){if(ct&&at!==null&&(m.mode&1)!==0&&(m.flags&128)===0)mi(),_n(),m.flags|=98560,W=!1;else if(W=on(m),z!==null&&z.dehydrated!==null){if(d===null){if(!W)throw Error(o(318));if(!Ie)throw Error(o(344));if(W=m.memoizedState,W=W!==null?W.dehydrated:null,!W)throw Error(o(317));Aa(W,m)}else _n(),(m.flags&128)===0&&(m.memoizedState=null),m.flags|=4;xe(m),W=!1}else jt!==null&&(rc(jt),jt=null),W=!0;if(!W)return m.flags&65536?m:null}return(m.flags&128)!==0?(m.lanes=C,m):(C=z!==null,C!==(d!==null&&d.memoizedState!==null)&&C&&(m.child.flags|=8192,(m.mode&1)!==0&&(d===null||(en.current&1)!==0?hn===0&&(hn=3):vo())),m.updateQueue!==null&&(m.flags|=4),xe(m),null);case 4:return Vo(),be(d,m),d===null&&ge(m.stateNode.containerInfo),xe(m),null;case 10:return so(m.type._context),xe(m),null;case 17:return Mn(m.type)&&Zi(),xe(m),null;case 19:if(cn(en),W=m.memoizedState,W===null)return xe(m),null;if(z=(m.flags&128)!==0,ne=W.rendering,ne===null)if(z)Je(W,!1);else{if(hn!==0||d!==null&&(d.flags&128)!==0)for(d=m.child;d!==null;){if(ne=ms(d),ne!==null){for(m.flags|=128,Je(W,!1),d=ne.updateQueue,d!==null&&(m.updateQueue=d,m.flags|=4),m.subtreeFlags=0,d=C,C=m.child;C!==null;)z=C,W=d,z.flags&=14680066,ne=z.alternate,ne===null?(z.childLanes=0,z.lanes=W,z.child=null,z.subtreeFlags=0,z.memoizedProps=null,z.memoizedState=null,z.updateQueue=null,z.dependencies=null,z.stateNode=null):(z.childLanes=ne.childLanes,z.lanes=ne.lanes,z.child=ne.child,z.subtreeFlags=0,z.deletions=null,z.memoizedProps=ne.memoizedProps,z.memoizedState=ne.memoizedState,z.updateQueue=ne.updateQueue,z.type=ne.type,W=ne.dependencies,z.dependencies=W===null?null:{lanes:W.lanes,firstContext:W.firstContext}),C=C.sibling;return Sr(en,en.current&1|2),m.child}d=d.sibling}W.tail!==null&&wn()>Eu&&(m.flags|=128,z=!0,Je(W,!1),m.lanes=4194304)}else{if(!z)if(d=ms(ne),d!==null){if(m.flags|=128,z=!0,d=d.updateQueue,d!==null&&(m.updateQueue=d,m.flags|=4),Je(W,!0),W.tail===null&&W.tailMode==="hidden"&&!ne.alternate&&!ct)return xe(m),null}else 2*wn()-W.renderingStartTime>Eu&&C!==1073741824&&(m.flags|=128,z=!0,Je(W,!1),m.lanes=4194304);W.isBackwards?(ne.sibling=m.child,m.child=ne):(d=W.last,d!==null?d.sibling=ne:m.child=ne,W.last=ne)}return W.tail!==null?(m=W.tail,W.rendering=m,W.tail=m.sibling,W.renderingStartTime=wn(),m.sibling=null,d=en.current,Sr(en,z?d&1|2:d&1),m):(xe(m),null);case 22:case 23:return Au(),C=m.memoizedState!==null,d!==null&&d.memoizedState!==null!==C&&(m.flags|=8192),C&&(m.mode&1)!==0?(hi&1073741824)!==0&&(xe(m),Te&&m.subtreeFlags&6&&(m.flags|=8192)):xe(m),null;case 24:return null;case 25:return null}throw Error(o(156,m.tag))}function Qe(d,m){switch(De(m),m.tag){case 1:return Mn(m.type)&&Zi(),d=m.flags,d&65536?(m.flags=d&-65537|128,m):null;case 3:return Vo(),cn(Xi),cn(Tr),Hs(),d=m.flags,(d&65536)!==0&&(d&128)===0?(m.flags=d&-65537|128,m):null;case 5:return vs(m),null;case 13:if(cn(en),d=m.memoizedState,d!==null&&d.dehydrated!==null){if(m.alternate===null)throw Error(o(340));_n()}return d=m.flags,d&65536?(m.flags=d&-65537|128,m):null;case 19:return cn(en),null;case 4:return Vo(),null;case 10:return so(m.type._context),null;case 22:case 23:return Au(),null;case 24:return null;default:return null}}var lt=!1,Xe=!1,ot=typeof WeakSet=="function"?WeakSet:Set,He=null;function ft(d,m){var C=d.ref;if(C!==null)if(typeof C=="function")try{C(null)}catch(z){Vn(d,m,z)}else C.current=null}function ht(d,m,C){try{C()}catch(z){Vn(d,m,z)}}var Wt=!1;function Bt(d,m){for(te(d.containerInfo),He=m;He!==null;)if(d=He,m=d.child,(d.subtreeFlags&1028)!==0&&m!==null)m.return=d,He=m;else for(;He!==null;){d=He;try{var C=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var z=C.memoizedProps,W=C.memoizedState,ne=d.stateNode,_e=ne.getSnapshotBeforeUpdate(d.elementType===d.type?z:co(d.type,z),W);ne.__reactInternalSnapshotBeforeUpdate=_e}break;case 3:Te&&xr(d.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Ye){Vn(d,d.return,Ye)}if(m=d.sibling,m!==null){m.return=d.return,He=m;break}He=d.return}return C=Wt,Wt=!1,C}function hr(d,m,C){var z=m.updateQueue;if(z=z!==null?z.lastEffect:null,z!==null){var W=z=z.next;do{if((W.tag&d)===d){var ne=W.destroy;W.destroy=void 0,ne!==void 0&&ht(m,C,ne)}W=W.next}while(W!==z)}}function zt(d,m){if(m=m.updateQueue,m=m!==null?m.lastEffect:null,m!==null){var C=m=m.next;do{if((C.tag&d)===d){var z=C.create;C.destroy=z()}C=C.next}while(C!==m)}}function Pr(d){var m=d.ref;if(m!==null){var C=d.stateNode;switch(d.tag){case 5:d=ae(C);break;default:d=C}typeof m=="function"?m(d):m.current=d}}function qn(d){var m=d.alternate;m!==null&&(d.alternate=null,qn(m)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(m=d.stateNode,m!==null&&Be(m)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function vr(d){return d.tag===5||d.tag===3||d.tag===4}function Ft(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||vr(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function St(d,m,C){var z=d.tag;if(z===5||z===6)d=d.stateNode,m?It(C,d,m):xt(C,d);else if(z!==4&&(d=d.child,d!==null))for(St(d,m,C),d=d.sibling;d!==null;)St(d,m,C),d=d.sibling}function Un(d,m,C){var z=d.tag;if(z===5||z===6)d=d.stateNode,m?_r(C,d,m):pt(C,d);else if(z!==4&&(d=d.child,d!==null))for(Un(d,m,C),d=d.sibling;d!==null;)Un(d,m,C),d=d.sibling}var Ht=null,dr=!1;function Mr(d,m,C){for(C=C.child;C!==null;)bi(d,m,C),C=C.sibling}function bi(d,m,C){if(ki&&typeof ki.onCommitFiberUnmount=="function")try{ki.onCommitFiberUnmount(Ua,C)}catch{}switch(C.tag){case 5:Xe||ft(C,m);case 6:if(Te){var z=Ht,W=dr;Ht=null,Mr(d,m,C),Ht=z,dr=W,Ht!==null&&(dr?Ve(Ht,C.stateNode):Jt(Ht,C.stateNode))}else Mr(d,m,C);break;case 18:Te&&Ht!==null&&(dr?is(Ht,C.stateNode):Bs(Ht,C.stateNode));break;case 4:Te?(z=Ht,W=dr,Ht=C.stateNode.containerInfo,dr=!0,Mr(d,m,C),Ht=z,dr=W):(Ce&&(z=C.stateNode.containerInfo,W=pr(z),Ei(z,W)),Mr(d,m,C));break;case 0:case 11:case 14:case 15:if(!Xe&&(z=C.updateQueue,z!==null&&(z=z.lastEffect,z!==null))){W=z=z.next;do{var ne=W,_e=ne.destroy;ne=ne.tag,_e!==void 0&&((ne&2)!==0||(ne&4)!==0)&&ht(C,m,_e),W=W.next}while(W!==z)}Mr(d,m,C);break;case 1:if(!Xe&&(ft(C,m),z=C.stateNode,typeof z.componentWillUnmount=="function"))try{z.props=C.memoizedProps,z.state=C.memoizedState,z.componentWillUnmount()}catch(Ye){Vn(C,m,Ye)}Mr(d,m,C);break;case 21:Mr(d,m,C);break;case 22:C.mode&1?(Xe=(z=Xe)||C.memoizedState!==null,Mr(d,m,C),Xe=z):Mr(d,m,C);break;default:Mr(d,m,C)}}function fi(d){var m=d.updateQueue;if(m!==null){d.updateQueue=null;var C=d.stateNode;C===null&&(C=d.stateNode=new ot),m.forEach(function(z){var W=rg.bind(null,d,z);C.has(z)||(C.add(z),z.then(W,W))})}}function Hr(d,m){var C=m.deletions;if(C!==null)for(var z=0;z<C.length;z++){var W=C[z];try{var ne=d,_e=m;if(Te){var Ye=_e;e:for(;Ye!==null;){switch(Ye.tag){case 5:Ht=Ye.stateNode,dr=!1;break e;case 3:Ht=Ye.stateNode.containerInfo,dr=!0;break e;case 4:Ht=Ye.stateNode.containerInfo,dr=!0;break e}Ye=Ye.return}if(Ht===null)throw Error(o(160));bi(ne,_e,W),Ht=null,dr=!1}else bi(ne,_e,W);var it=W.alternate;it!==null&&(it.return=null),W.return=null}catch(wt){Vn(W,m,wt)}}if(m.subtreeFlags&12854)for(m=m.child;m!==null;)wi(m,d),m=m.sibling}function wi(d,m){var C=d.alternate,z=d.flags;switch(d.tag){case 0:case 11:case 14:case 15:if(Hr(m,d),vn(d),z&4){try{hr(3,d,d.return),zt(3,d)}catch(Tt){Vn(d,d.return,Tt)}try{hr(5,d,d.return)}catch(Tt){Vn(d,d.return,Tt)}}break;case 1:Hr(m,d),vn(d),z&512&&C!==null&&ft(C,C.return);break;case 5:if(Hr(m,d),vn(d),z&512&&C!==null&&ft(C,C.return),Te){if(d.flags&32){var W=d.stateNode;try{qe(W)}catch(Tt){Vn(d,d.return,Tt)}}if(z&4&&(W=d.stateNode,W!=null)){var ne=d.memoizedProps;if(C=C!==null?C.memoizedProps:ne,z=d.type,m=d.updateQueue,d.updateQueue=null,m!==null)try{zr(W,m,z,C,ne,d)}catch(Tt){Vn(d,d.return,Tt)}}}break;case 6:if(Hr(m,d),vn(d),z&4&&Te){if(d.stateNode===null)throw Error(o(162));W=d.stateNode,ne=d.memoizedProps,C=C!==null?C.memoizedProps:ne;try{bt(W,C,ne)}catch(Tt){Vn(d,d.return,Tt)}}break;case 3:if(Hr(m,d),vn(d),z&4){if(Te&&Ie&&C!==null&&C.memoizedState.isDehydrated)try{zi(m.containerInfo)}catch(Tt){Vn(d,d.return,Tt)}if(Ce){W=m.containerInfo,ne=m.pendingChildren;try{Ei(W,ne)}catch(Tt){Vn(d,d.return,Tt)}}}break;case 4:if(Hr(m,d),vn(d),z&4&&Ce){ne=d.stateNode,W=ne.containerInfo,ne=ne.pendingChildren;try{Ei(W,ne)}catch(Tt){Vn(d,d.return,Tt)}}break;case 13:Hr(m,d),vn(d),W=d.child,W.flags&8192&&(ne=W.memoizedState!==null,W.stateNode.isHidden=ne,!ne||W.alternate!==null&&W.alternate.memoizedState!==null||(Su=wn())),z&4&&fi(d);break;case 22:var _e=C!==null&&C.memoizedState!==null;if(d.mode&1?(Xe=(C=Xe)||_e,Hr(m,d),Xe=C):Hr(m,d),vn(d),z&8192){if(C=d.memoizedState!==null,(d.stateNode.isHidden=C)&&!_e&&(d.mode&1)!==0)for(He=d,z=d.child;z!==null;){for(m=He=z;He!==null;){_e=He;var Ye=_e.child;switch(_e.tag){case 0:case 11:case 14:case 15:hr(4,_e,_e.return);break;case 1:ft(_e,_e.return);var it=_e.stateNode;if(typeof it.componentWillUnmount=="function"){var wt=_e,$t=_e.return;try{var br=wt;it.props=br.memoizedProps,it.state=br.memoizedState,it.componentWillUnmount()}catch(Tt){Vn(wt,$t,Tt)}}break;case 5:ft(_e,_e.return);break;case 22:if(_e.memoizedState!==null){On(m);continue}}Ye!==null?(Ye.return=_e,He=Ye):On(m)}z=z.sibling}if(Te){e:if(z=null,Te)for(m=d;;){if(m.tag===5){if(z===null){z=m;try{W=m.stateNode,C?Nt(W):ir(m.stateNode,m.memoizedProps)}catch(Tt){Vn(d,d.return,Tt)}}}else if(m.tag===6){if(z===null)try{ne=m.stateNode,C?Ct(ne):Ut(ne,m.memoizedProps)}catch(Tt){Vn(d,d.return,Tt)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===d)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===d)break e;for(;m.sibling===null;){if(m.return===null||m.return===d)break e;z===m&&(z=null),m=m.return}z===m&&(z=null),m.sibling.return=m.return,m=m.sibling}}}break;case 19:Hr(m,d),vn(d),z&4&&fi(d);break;case 21:break;default:Hr(m,d),vn(d)}}function vn(d){var m=d.flags;if(m&2){try{if(Te){e:{for(var C=d.return;C!==null;){if(vr(C)){var z=C;break e}C=C.return}throw Error(o(160))}switch(z.tag){case 5:var W=z.stateNode;z.flags&32&&(qe(W),z.flags&=-33);var ne=Ft(d);Un(d,ne,W);break;case 3:case 4:var _e=z.stateNode.containerInfo,Ye=Ft(d);St(d,Ye,_e);break;default:throw Error(o(161))}}}catch(it){Vn(d,d.return,it)}d.flags&=-3}m&4096&&(d.flags&=-4097)}function jn(d,m,C){He=d,Nr(d)}function Nr(d,m,C){for(var z=(d.mode&1)!==0;He!==null;){var W=He,ne=W.child;if(W.tag===22&&z){var _e=W.memoizedState!==null||lt;if(!_e){var Ye=W.alternate,it=Ye!==null&&Ye.memoizedState!==null||Xe;Ye=lt;var wt=Xe;if(lt=_e,(Xe=it)&&!wt)for(He=W;He!==null;)_e=He,it=_e.child,_e.tag===22&&_e.memoizedState!==null?Wr(W):it!==null?(it.return=_e,He=it):Wr(W);for(;ne!==null;)He=ne,Nr(ne),ne=ne.sibling;He=W,lt=Ye,Xe=wt}Gr(d)}else(W.subtreeFlags&8772)!==0&&ne!==null?(ne.return=W,He=ne):Gr(d)}}function Gr(d){for(;He!==null;){var m=He;if((m.flags&8772)!==0){var C=m.alternate;try{if((m.flags&8772)!==0)switch(m.tag){case 0:case 11:case 15:Xe||zt(5,m);break;case 1:var z=m.stateNode;if(m.flags&4&&!Xe)if(C===null)z.componentDidMount();else{var W=m.elementType===m.type?C.memoizedProps:co(m.type,C.memoizedProps);z.componentDidUpdate(W,C.memoizedState,z.__reactInternalSnapshotBeforeUpdate)}var ne=m.updateQueue;ne!==null&&Jn(m,ne,z);break;case 3:var _e=m.updateQueue;if(_e!==null){if(C=null,m.child!==null)switch(m.child.tag){case 5:C=ae(m.child.stateNode);break;case 1:C=m.child.stateNode}Jn(m,_e,C)}break;case 5:var Ye=m.stateNode;C===null&&m.flags&4&&kt(Ye,m.type,m.memoizedProps,m);break;case 6:break;case 4:break;case 12:break;case 13:if(Ie&&m.memoizedState===null){var it=m.alternate;if(it!==null){var wt=it.memoizedState;if(wt!==null){var $t=wt.dehydrated;$t!==null&&to($t)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Xe||m.flags&512&&Pr(m)}catch(br){Vn(m,m.return,br)}}if(m===d){He=null;break}if(C=m.sibling,C!==null){C.return=m.return,He=C;break}He=m.return}}function On(d){for(;He!==null;){var m=He;if(m===d){He=null;break}var C=m.sibling;if(C!==null){C.return=m.return,He=C;break}He=m.return}}function Wr(d){for(;He!==null;){var m=He;try{switch(m.tag){case 0:case 11:case 15:var C=m.return;try{zt(4,m)}catch(it){Vn(m,C,it)}break;case 1:var z=m.stateNode;if(typeof z.componentDidMount=="function"){var W=m.return;try{z.componentDidMount()}catch(it){Vn(m,W,it)}}var ne=m.return;try{Pr(m)}catch(it){Vn(m,ne,it)}break;case 5:var _e=m.return;try{Pr(m)}catch(it){Vn(m,_e,it)}}}catch(it){Vn(m,m.return,it)}if(m===d){He=null;break}var Ye=m.sibling;if(Ye!==null){Ye.return=m.return,He=Ye;break}He=m.return}}var Cn=0,Ln=1,rn=2,Ti=3,Kr=4;if(typeof Symbol=="function"&&Symbol.for){var Zr=Symbol.for;Cn=Zr("selector.component"),Ln=Zr("selector.has_pseudo_class"),rn=Zr("selector.role"),Ti=Zr("selector.test_id"),Kr=Zr("selector.text")}function ei(d){var m=Ee(d);if(m!=null){if(typeof m.memoizedProps["data-testname"]!="string")throw Error(o(364));return m}if(d=Ne(d),d===null)throw Error(o(362));return d.stateNode.current}function Ri(d,m){switch(m.$$typeof){case Cn:if(d.type===m.value)return!0;break;case Ln:e:{m=m.value,d=[d,0];for(var C=0;C<d.length;){var z=d[C++],W=d[C++],ne=m[W];if(z.tag!==5||!Pe(z)){for(;ne!=null&&Ri(z,ne);)W++,ne=m[W];if(W===m.length){m=!0;break e}else for(z=z.child;z!==null;)d.push(z,W),z=z.sibling}}m=!1}return m;case rn:if(d.tag===5&&Ue(d.stateNode,m.value))return!0;break;case Kr:if((d.tag===5||d.tag===6)&&(d=Ae(d),d!==null&&0<=d.indexOf(m.value)))return!0;break;case Ti:if(d.tag===5&&(d=d.memoizedProps["data-testname"],typeof d=="string"&&d.toLowerCase()===m.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function ya(d){switch(d.$$typeof){case Cn:return"<"+(O(d.value)||"Unknown")+">";case Ln:return":has("+(ya(d)||"")+")";case rn:return'[role="'+d.value+'"]';case Kr:return'"'+d.value+'"';case Ti:return'[data-testname="'+d.value+'"]';default:throw Error(o(365))}}function ti(d,m){var C=[];d=[d,0];for(var z=0;z<d.length;){var W=d[z++],ne=d[z++],_e=m[ne];if(W.tag!==5||!Pe(W)){for(;_e!=null&&Ri(W,_e);)ne++,_e=m[ne];if(ne===m.length)C.push(W);else for(W=W.child;W!==null;)d.push(W,ne),W=W.sibling}}return C}function Hn(d,m){if(!Le)throw Error(o(363));d=ei(d),d=ti(d,m),m=[],d=Array.from(d);for(var C=0;C<d.length;){var z=d[C++];if(z.tag===5)Pe(z)||m.push(z.stateNode);else for(z=z.child;z!==null;)d.push(z),z=z.sibling}return m}var ba=Math.ceil,nn=s.ReactCurrentDispatcher,$i=s.ReactCurrentOwner,Vr=s.ReactCurrentBatchConfig,sr=0,Ir=null,kr=null,Dn=0,hi=0,Zo=gi(0),hn=0,xu=null,Xs=0,dn=0,fo=0,Gl=null,wa=null,Su=0,Eu=1/0,Gi=null;function ln(){Eu=wn()+500}var $n=!1,Gn=null,ho=null,Io=!1,po=null,zc=0,Wn=0,ku=null,xl=-1,go=0;function xn(){return(sr&6)!==0?wn():xl!==-1?xl:xl=wn()}function _i(d){return(d.mode&1)===0?1:(sr&2)!==0&&Dn!==0?Dn&-Dn:Po.transition!==null?(go===0&&(go=fs()),go):(d=Pt,d!==0?d:Re())}function _a(d,m,C,z){if(50<Wn)throw Wn=0,ku=null,Error(o(185));Ba(d,C,z),((sr&2)===0||d!==Ir)&&(d===Ir&&((sr&2)===0&&(dn|=C),hn===4&&Es(d,Dn)),na(d,z),C===1&&sr===0&&(m.mode&1)===0&&(ln(),Eo&&li()))}function na(d,m){var C=d.callbackNode;Ac(d,m);var z=cl(d,d===Ir?Dn:0);if(z===0)C!==null&&Pc(C),d.callbackNode=null,d.callbackPriority=0;else if(m=z&-z,d.callbackPriority!==m){if(C!=null&&Pc(C),m===1)d.tag===0?Rl(jf.bind(null,d)):dl(jf.bind(null,d)),Oe?fe(function(){(sr&6)===0&&li()}):So(fu,li),C=null;else{switch(hl(z)){case 1:C=fu;break;case 4:C=hu;break;case 16:C=zs;break;case 536870912:C=Yu;break;default:C=zs}C=Cd(C,Ks.bind(null,d))}d.callbackPriority=m,d.callbackNode=C}}function Ks(d,m){if(xl=-1,go=0,(sr&6)!==0)throw Error(o(327));var C=d.callbackNode;if(Vl()&&d.callbackNode!==C)return null;var z=cl(d,d===Ir?Dn:0);if(z===0)return null;if((z&30)!==0||(z&d.expiredLanes)!==0||m)m=As(d,z);else{m=z;var W=sr;sr|=2;var ne=ks();(Ir!==d||Dn!==m)&&(Gi=null,ln(),Qo(d,m));do try{Hc();break}catch(Ye){Xa(d,Ye)}while(!0);Il(),nn.current=ne,sr=W,kr!==null?m=0:(Ir=null,Dn=0,m=hn)}if(m!==0){if(m===2&&(W=fl(d),W!==0&&(z=W,m=qc(d,W))),m===1)throw C=xu,Qo(d,0),Es(d,z),na(d,wn()),C;if(m===6)Es(d,z);else{if(W=d.current.alternate,(z&30)===0&&!Rh(W)&&(m=As(d,z),m===2&&(ne=fl(d),ne!==0&&(z=ne,m=qc(d,ne))),m===1))throw C=xu,Qo(d,0),Es(d,z),na(d,wn()),C;switch(d.finishedWork=W,d.finishedLanes=z,m){case 0:case 1:throw Error(o(345));case 2:Ps(d,wa,Gi);break;case 3:if(Es(d,z),(z&130023424)===z&&(m=Su+500-wn(),10<m)){if(cl(d,0)!==0)break;if(W=d.suspendedLanes,(W&z)!==z){xn(),d.pingedLanes|=d.suspendedLanes&W;break}d.timeoutHandle=oe(Ps.bind(null,d,wa,Gi),m);break}Ps(d,wa,Gi);break;case 4:if(Es(d,z),(z&4194240)===z)break;for(m=d.eventTimes,W=-1;0<z;){var _e=31-Oa(z);ne=1<<_e,_e=m[_e],_e>W&&(W=_e),z&=~ne}if(z=W,z=wn()-z,z=(120>z?120:480>z?480:1080>z?1080:1920>z?1920:3e3>z?3e3:4320>z?4320:1960*ba(z/1960))-z,10<z){d.timeoutHandle=oe(Ps.bind(null,d,wa,Gi),z);break}Ps(d,wa,Gi);break;case 5:Ps(d,wa,Gi);break;default:throw Error(o(329))}}}return na(d,wn()),d.callbackNode===C?Ks.bind(null,d):null}function qc(d,m){var C=Gl;return d.current.memoizedState.isDehydrated&&(Qo(d,m).flags|=256),d=As(d,m),d!==2&&(m=wa,wa=C,m!==null&&rc(m)),d}function rc(d){wa===null?wa=d:wa.push.apply(wa,d)}function Rh(d){for(var m=d;;){if(m.flags&16384){var C=m.updateQueue;if(C!==null&&(C=C.stores,C!==null))for(var z=0;z<C.length;z++){var W=C[z],ne=W.getSnapshot;W=W.value;try{if(!Ca(ne(),W))return!1}catch{return!1}}}if(C=m.child,m.subtreeFlags&16384&&C!==null)C.return=m,m=C;else{if(m===d)break;for(;m.sibling===null;){if(m.return===null||m.return===d)return!0;m=m.return}m.sibling.return=m.return,m=m.sibling}}return!0}function Es(d,m){for(m&=~fo,m&=~dn,d.suspendedLanes|=m,d.pingedLanes&=~m,d=d.expirationTimes;0<m;){var C=31-Oa(m),z=1<<C;d[C]=-1,m&=~z}}function jf(d){if((sr&6)!==0)throw Error(o(327));Vl();var m=cl(d,0);if((m&1)===0)return na(d,wn()),null;var C=As(d,m);if(d.tag!==0&&C===2){var z=fl(d);z!==0&&(m=z,C=qc(d,z))}if(C===1)throw C=xu,Qo(d,0),Es(d,m),na(d,wn()),C;if(C===6)throw Error(o(345));return d.finishedWork=d.current.alternate,d.finishedLanes=m,Ps(d,wa,Gi),na(d,wn()),null}function Wl(d){po!==null&&po.tag===0&&(sr&6)===0&&Vl();var m=sr;sr|=1;var C=Vr.transition,z=Pt;try{if(Vr.transition=null,Pt=1,d)return d()}finally{Pt=z,Vr.transition=C,sr=m,(sr&6)===0&&li()}}function Au(){hi=Zo.current,cn(Zo)}function Qo(d,m){d.finishedWork=null,d.finishedLanes=0;var C=d.timeoutHandle;if(C!==de&&(d.timeoutHandle=de,me(C)),kr!==null)for(C=kr.return;C!==null;){var z=C;switch(De(z),z.tag){case 1:z=z.type.childContextTypes,z!=null&&Zi();break;case 3:Vo(),cn(Xi),cn(Tr),Hs();break;case 5:vs(z);break;case 4:Vo();break;case 13:cn(en);break;case 19:cn(en);break;case 10:so(z.type._context);break;case 22:case 23:Au()}C=C.return}if(Ir=d,kr=d=Pu(d.current,null),Dn=hi=m,hn=0,xu=null,fo=dn=Xs=0,wa=Gl=null,Ga!==null){for(m=0;m<Ga.length;m++)if(C=Ga[m],z=C.interleaved,z!==null){C.interleaved=null;var W=z.next,ne=C.pending;if(ne!==null){var _e=ne.next;ne.next=W,z.next=_e}C.pending=z}Ga=null}return d}function Xa(d,m){do{var C=kr;try{if(Il(),Pn.current=Vs,Va){for(var z=ar.memoizedState;z!==null;){var W=z.queue;W!==null&&(W.pending=null),z=z.next}Va=!1}if(Cr=0,Lr=Er=ar=null,$s=!1,bs=0,$i.current=null,C===null||C.return===null){hn=1,xu=m,kr=null;break}e:{var ne=d,_e=C.return,Ye=C,it=m;if(m=Dn,Ye.flags|=32768,it!==null&&typeof it=="object"&&typeof it.then=="function"){var wt=it,$t=Ye,br=$t.tag;if(($t.mode&1)===0&&(br===0||br===11||br===15)){var Tt=$t.alternate;Tt?($t.updateQueue=Tt.updateQueue,$t.memoizedState=Tt.memoizedState,$t.lanes=Tt.lanes):($t.updateQueue=null,$t.memoizedState=null)}var Fn=Nh(_e);if(Fn!==null){Fn.flags&=-257,Ys(Fn,_e,Ye,ne,m),Fn.mode&1&&Lh(ne,wt,m),m=Fn,it=wt;var mn=m.updateQueue;if(mn===null){var mo=new Set;mo.add(it),m.updateQueue=mo}else mn.add(it);break e}else{if((m&1)===0){Lh(ne,wt,m),vo();break e}it=Error(o(426))}}else if(ct&&Ye.mode&1){var Sl=Nh(_e);if(Sl!==null){(Sl.flags&65536)===0&&(Sl.flags|=256),Ys(Sl,_e,Ye,ne,m),Ai(ta(it,Ye));break e}}ne=it=ta(it,Ye),hn!==4&&(hn=2),Gl===null?Gl=[ne]:Gl.push(ne),ne=_e;do{switch(ne.tag){case 3:ne.flags|=65536,m&=-m,ne.lanes|=m;var rt=ra(ne,it,m);ps(ne,rt);break e;case 1:Ye=it;var Ke=ne.type,ut=ne.stateNode;if((ne.flags&128)===0&&(typeof Ke.getDerivedStateFromError=="function"||ut!==null&&typeof ut.componentDidCatch=="function"&&(ho===null||!ho.has(ut)))){ne.flags|=65536,m&=-m,ne.lanes|=m;var Rt=Ra(ne,Ye,m);ps(ne,Rt);break e}}ne=ne.return}while(ne!==null)}nc(C)}catch(nr){m=nr,kr===C&&C!==null&&(kr=C=C.return);continue}break}while(!0)}function ks(){var d=nn.current;return nn.current=Vs,d===null?Vs:d}function vo(){(hn===0||hn===3||hn===2)&&(hn=4),Ir===null||(Xs&268435455)===0&&(dn&268435455)===0||Es(Ir,Dn)}function As(d,m){var C=sr;sr|=2;var z=ks();(Ir!==d||Dn!==m)&&(Gi=null,Qo(d,m));do try{Uc();break}catch(W){Xa(d,W)}while(!0);if(Il(),sr=C,nn.current=z,kr!==null)throw Error(o(261));return Ir=null,Dn=0,hn}function Uc(){for(;kr!==null;)Df(kr)}function Hc(){for(;kr!==null&&!Oc();)Df(kr)}function Df(d){var m=$p(d.alternate,d,hi);d.memoizedProps=d.pendingProps,m===null?nc(d):kr=m,$i.current=null}function nc(d){var m=d;do{var C=m.alternate;if(d=m.return,(m.flags&32768)===0){if(C=$e(C,m,hi),C!==null){kr=C;return}}else{if(C=Qe(C,m),C!==null){C.flags&=32767,kr=C;return}if(d!==null)d.flags|=32768,d.subtreeFlags=0,d.deletions=null;else{hn=6,kr=null;return}}if(m=m.sibling,m!==null){kr=m;return}kr=m=d}while(m!==null);hn===0&&(hn=5)}function Ps(d,m,C){var z=Pt,W=Vr.transition;try{Vr.transition=null,Pt=1,zp(d,m,C,z)}finally{Vr.transition=W,Pt=z}return null}function zp(d,m,C,z){do Vl();while(po!==null);if((sr&6)!==0)throw Error(o(327));C=d.finishedWork;var W=d.finishedLanes;if(C===null)return null;if(d.finishedWork=null,d.finishedLanes=0,C===d.current)throw Error(o(177));d.callbackNode=null,d.callbackPriority=0;var ne=C.lanes|C.childLanes;if(za(d,ne),d===Ir&&(kr=Ir=null,Dn=0),(C.subtreeFlags&2064)===0&&(C.flags&2064)===0||Io||(Io=!0,Cd(zs,function(){return Vl(),null})),ne=(C.flags&15990)!==0,(C.subtreeFlags&15990)!==0||ne){ne=Vr.transition,Vr.transition=null;var _e=Pt;Pt=1;var Ye=sr;sr|=4,$i.current=null,Bt(d,C),wi(C,d),V(d.containerInfo),d.current=C,jn(C),io(),sr=Ye,Pt=_e,Vr.transition=ne}else d.current=C;if(Io&&(Io=!1,po=d,zc=W),ne=d.pendingLanes,ne===0&&(ho=null),Go(C.stateNode),na(d,wn()),m!==null)for(z=d.onRecoverableError,C=0;C<m.length;C++)W=m[C],z(W.value,{componentStack:W.stack,digest:W.digest});if($n)throw $n=!1,d=Gn,Gn=null,d;return(zc&1)!==0&&d.tag!==0&&Vl(),ne=d.pendingLanes,(ne&1)!==0?d===ku?Wn++:(Wn=0,ku=d):Wn=0,li(),null}function Vl(){if(po!==null){var d=hl(zc),m=Vr.transition,C=Pt;try{if(Vr.transition=null,Pt=16>d?16:d,po===null)var z=!1;else{if(d=po,po=null,zc=0,(sr&6)!==0)throw Error(o(331));var W=sr;for(sr|=4,He=d.current;He!==null;){var ne=He,_e=ne.child;if((He.flags&16)!==0){var Ye=ne.deletions;if(Ye!==null){for(var it=0;it<Ye.length;it++){var wt=Ye[it];for(He=wt;He!==null;){var $t=He;switch($t.tag){case 0:case 11:case 15:hr(8,$t,ne)}var br=$t.child;if(br!==null)br.return=$t,He=br;else for(;He!==null;){$t=He;var Tt=$t.sibling,Fn=$t.return;if(qn($t),$t===wt){He=null;break}if(Tt!==null){Tt.return=Fn,He=Tt;break}He=Fn}}}var mn=ne.alternate;if(mn!==null){var mo=mn.child;if(mo!==null){mn.child=null;do{var Sl=mo.sibling;mo.sibling=null,mo=Sl}while(mo!==null)}}He=ne}}if((ne.subtreeFlags&2064)!==0&&_e!==null)_e.return=ne,He=_e;else e:for(;He!==null;){if(ne=He,(ne.flags&2048)!==0)switch(ne.tag){case 0:case 11:case 15:hr(9,ne,ne.return)}var rt=ne.sibling;if(rt!==null){rt.return=ne.return,He=rt;break e}He=ne.return}}var Ke=d.current;for(He=Ke;He!==null;){_e=He;var ut=_e.child;if((_e.subtreeFlags&2064)!==0&&ut!==null)ut.return=_e,He=ut;else e:for(_e=Ke;He!==null;){if(Ye=He,(Ye.flags&2048)!==0)try{switch(Ye.tag){case 0:case 11:case 15:zt(9,Ye)}}catch(nr){Vn(Ye,Ye.return,nr)}if(Ye===_e){He=null;break e}var Rt=Ye.sibling;if(Rt!==null){Rt.return=Ye.return,He=Rt;break e}He=Ye.return}}if(sr=W,li(),ki&&typeof ki.onPostCommitFiberRoot=="function")try{ki.onPostCommitFiberRoot(Ua,d)}catch{}z=!0}return z}finally{Pt=C,Vr.transition=m}}return!1}function Od(d,m,C){m=ta(C,m),m=ra(d,m,1),d=Ji(d,m,1),m=xn(),d!==null&&(Ba(d,1,m),na(d,m))}function Vn(d,m,C){if(d.tag===3)Od(d,d,C);else for(;m!==null;){if(m.tag===3){Od(m,d,C);break}else if(m.tag===1){var z=m.stateNode;if(typeof m.type.getDerivedStateFromError=="function"||typeof z.componentDidCatch=="function"&&(ho===null||!ho.has(z))){d=ta(C,d),d=Ra(m,d,1),m=Ji(m,d,1),d=xn(),m!==null&&(Ba(m,1,d),na(m,d));break}}m=m.return}}function qp(d,m,C){var z=d.pingCache;z!==null&&z.delete(m),m=xn(),d.pingedLanes|=d.suspendedLanes&C,Ir===d&&(Dn&C)===C&&(hn===4||hn===3&&(Dn&130023424)===Dn&&500>wn()-Su?Qo(d,0):fo|=C),na(d,m)}function Up(d,m){m===0&&((d.mode&1)===0?m=1:(m=xo,xo<<=1,(xo&130023424)===0&&(xo=4194304)));var C=xn();d=qi(d,m),d!==null&&(Ba(d,m,C),na(d,C))}function Hp(d){var m=d.memoizedState,C=0;m!==null&&(C=m.retryLane),Up(d,C)}function rg(d,m){var C=0;switch(d.tag){case 13:var z=d.stateNode,W=d.memoizedState;W!==null&&(C=W.retryLane);break;case 19:z=d.stateNode;break;default:throw Error(o(314))}z!==null&&z.delete(m),Up(d,C)}var $p;$p=function(d,m,C){if(d!==null)if(d.memoizedProps!==m.pendingProps||Xi.current)yi=!0;else{if((d.lanes&C)===0&&(m.flags&128)===0)return yi=!1,re(d,m,C);yi=(d.flags&131072)!==0}else yi=!1,ct&&(m.flags&1048576)!==0&&ce(m,La,m.index);switch(m.lanes=0,m.tag){case 2:var z=m.type;R(d,m),d=m.pendingProps;var W=Ki(m,Tr.current);Us(m,C),W=pu(null,m,z,d,W,C);var ne=Xu();return m.flags|=1,typeof W=="object"&&W!==null&&typeof W.render=="function"&&W.$$typeof===void 0?(m.tag=1,m.memoizedState=null,m.updateQueue=null,Mn(z)?(ne=!0,ls(m)):ne=!1,m.memoizedState=W.state!==null&&W.state!==void 0?W.state:null,Na(m),W.updater=ec,m.stateNode=W,W._reactInternals=m,ea(m,z,d,C),m=va(null,m,z,!0,ne,C)):(m.tag=0,ct&&ne&&ke(m),Ni(null,m,W,C),m=m.child),m;case 16:z=m.elementType;e:{switch(R(d,m),d=m.pendingProps,W=z._init,z=W(z._payload),m.type=z,W=m.tag=ng(z),d=co(z,d),W){case 0:m=_s(null,m,z,d,C);break e;case 1:m=Hi(null,m,z,d,C);break e;case 11:m=Bc(null,m,z,d,C);break e;case 14:m=ws(null,m,z,co(z.type,d),C);break e}throw Error(o(306,z,""))}return m;case 0:return z=m.type,W=m.pendingProps,W=m.elementType===z?W:co(z,W),_s(d,m,z,W,C);case 1:return z=m.type,W=m.pendingProps,W=m.elementType===z?W:co(z,W),Hi(d,m,z,W,C);case 3:e:{if(_l(m),d===null)throw Error(o(387));z=m.pendingProps,ne=m.memoizedState,W=ne.element,Wa(d,m),lo(m,z,null,C);var _e=m.memoizedState;if(z=_e.element,Ie&&ne.isDehydrated)if(ne={element:z,isDehydrated:!1,cache:_e.cache,pendingSuspenseBoundaries:_e.pendingSuspenseBoundaries,transitions:_e.transitions},m.updateQueue.baseState=ne,m.memoizedState=ne,m.flags&256){W=ta(Error(o(423)),m),m=Hl(d,m,z,C,W);break e}else if(z!==W){W=ta(Error(o(424)),m),m=Hl(d,m,z,C,W);break e}else for(Ie&&(at=Ea(m.stateNode.containerInfo),Ge=m,ct=!0,jt=null,Dt=!1),C=vl(m,null,z,C),m.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling;else{if(_n(),z===W){m=Y(d,m,C);break e}Ni(d,m,z,C)}m=m.child}return m;case 5:return gs(m),d===null&&An(m),z=m.type,W=m.pendingProps,ne=d!==null?d.memoizedProps:null,_e=W.children,ee(z,W)?_e=null:ne!==null&&ee(z,ne)&&(m.flags|=32),sn(d,m),Ni(d,m,_e,C),m.child;case 6:return d===null&&An(m),null;case 13:return If(d,m,C);case 4:return yl(m,m.stateNode.containerInfo),z=m.pendingProps,d===null?m.child=oo(m,null,z,C):Ni(d,m,z,C),m.child;case 11:return z=m.type,W=m.pendingProps,W=m.elementType===z?W:co(z,W),Bc(d,m,z,W,C);case 7:return Ni(d,m,m.pendingProps,C),m.child;case 8:return Ni(d,m,m.pendingProps.children,C),m.child;case 12:return Ni(d,m,m.pendingProps.children,C),m.child;case 10:e:{if(z=m.type._context,W=m.pendingProps,ne=m.memoizedProps,_e=W.value,zn(m,z,_e),ne!==null)if(Ca(ne.value,_e)){if(ne.children===W.children&&!Xi.current){m=Y(d,m,C);break e}}else for(ne=m.child,ne!==null&&(ne.return=m);ne!==null;){var Ye=ne.dependencies;if(Ye!==null){_e=ne.child;for(var it=Ye.firstContext;it!==null;){if(it.context===z){if(ne.tag===1){it=ha(-1,C&-C),it.tag=2;var wt=ne.updateQueue;if(wt!==null){wt=wt.shared;var $t=wt.pending;$t===null?it.next=it:(it.next=$t.next,$t.next=it),wt.pending=it}}ne.lanes|=C,it=ne.alternate,it!==null&&(it.lanes|=C),Lo(ne.return,C,m),Ye.lanes|=C;break}it=it.next}}else if(ne.tag===10)_e=ne.type===m.type?null:ne.child;else if(ne.tag===18){if(_e=ne.return,_e===null)throw Error(o(341));_e.lanes|=C,Ye=_e.alternate,Ye!==null&&(Ye.lanes|=C),Lo(_e,C,m),_e=ne.sibling}else _e=ne.child;if(_e!==null)_e.return=ne;else for(_e=ne;_e!==null;){if(_e===m){_e=null;break}if(ne=_e.sibling,ne!==null){ne.return=_e.return,_e=ne;break}_e=_e.return}ne=_e}Ni(d,m,W.children,C),m=m.child}return m;case 9:return W=m.type,z=m.pendingProps.children,Us(m,C),W=In(W),z=z(W),m.flags|=1,Ni(d,m,z,C),m.child;case 14:return z=m.type,W=co(z,m.pendingProps),W=co(z.type,W),ws(d,m,z,W,C);case 15:return Mo(d,m,m.type,m.pendingProps,C);case 17:return z=m.type,W=m.pendingProps,W=m.elementType===z?W:co(z,W),R(d,m),m.tag=1,Mn(z)?(d=!0,ls(m)):d=!1,Us(m,C),Ch(m,z,W),ea(m,z,W,C),va(null,m,z,!0,d,C);case 19:return P(d,m,C);case 22:return tn(d,m,C)}throw Error(o(156,m.tag))};function Cd(d,m){return So(d,m)}function Gp(d,m,C,z){this.tag=d,this.key=C,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=m,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=z,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jo(d,m,C,z){return new Gp(d,m,C,z)}function $c(d){return d=d.prototype,!(!d||!d.isReactComponent)}function ng(d){if(typeof d=="function")return $c(d)?1:0;if(d!=null){if(d=d.$$typeof,d===_)return 11;if(d===E)return 14}return 2}function Pu(d,m){var C=d.alternate;return C===null?(C=Jo(d.tag,m,d.key,d.mode),C.elementType=d.elementType,C.type=d.type,C.stateNode=d.stateNode,C.alternate=d,d.alternate=C):(C.pendingProps=m,C.type=d.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=d.flags&14680064,C.childLanes=d.childLanes,C.lanes=d.lanes,C.child=d.child,C.memoizedProps=d.memoizedProps,C.memoizedState=d.memoizedState,C.updateQueue=d.updateQueue,m=d.dependencies,C.dependencies=m===null?null:{lanes:m.lanes,firstContext:m.firstContext},C.sibling=d.sibling,C.index=d.index,C.ref=d.ref,C}function Mh(d,m,C,z,W,ne){var _e=2;if(z=d,typeof d=="function")$c(d)&&(_e=1);else if(typeof d=="string")_e=5;else e:switch(d){case f:return Ma(C.children,W,ne,m);case g:_e=8,W|=8;break;case v:return d=Jo(12,C,m,W|2),d.elementType=v,d.lanes=ne,d;case x:return d=Jo(13,C,m,W),d.elementType=x,d.lanes=ne,d;case b:return d=Jo(19,C,m,W),d.elementType=b,d.lanes=ne,d;case S:return Gc(C,W,ne,m);default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case p:_e=10;break e;case y:_e=9;break e;case _:_e=11;break e;case E:_e=14;break e;case A:_e=16,z=null;break e}throw Error(o(130,d==null?d:typeof d,""))}return m=Jo(_e,C,m,W),m.elementType=d,m.type=z,m.lanes=ne,m}function Ma(d,m,C,z){return d=Jo(7,d,z,m),d.lanes=C,d}function Gc(d,m,C,z){return d=Jo(22,d,z,m),d.elementType=S,d.lanes=C,d.stateNode={isHidden:!1},d}function Wc(d,m,C){return d=Jo(6,d,null,m),d.lanes=C,d}function Ih(d,m,C){return m=Jo(4,d.children!==null?d.children:[],d.key,m),m.lanes=C,m.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},m}function Wp(d,m,C,z,W){this.tag=m,this.containerInfo=d,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=de,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=no(0),this.expirationTimes=no(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=no(0),this.identifierPrefix=z,this.onRecoverableError=W,Ie&&(this.mutableSourceEagerHydrationData=null)}function Ld(d,m,C,z,W,ne,_e,Ye,it){return d=new Wp(d,m,C,Ye,it),m===1?(m=1,ne===!0&&(m|=8)):m=0,ne=Jo(3,null,null,m),d.current=ne,ne.stateNode=d,ne.memoizedState={element:z,isDehydrated:C,cache:null,transitions:null,pendingSuspenseBoundaries:null},Na(ne),d}function jh(d){if(!d)return ss;d=d._reactInternals;e:{if(F(d)!==d||d.tag!==1)throw Error(o(170));var m=d;do{switch(m.tag){case 3:m=m.stateNode.context;break e;case 1:if(Mn(m.type)){m=m.stateNode.__reactInternalMemoizedMergedChildContext;break e}}m=m.return}while(m!==null);throw Error(o(171))}if(d.tag===1){var C=d.type;if(Mn(C))return Zn(d,C,m)}return m}function ic(d){var m=d._reactInternals;if(m===void 0)throw typeof d.render=="function"?Error(o(188)):(d=Object.keys(d).join(","),Error(o(268,d)));return d=L(m),d===null?null:d.stateNode}function Dh(d,m){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var C=d.retryLane;d.retryLane=C!==0&&C<m?C:m}}function Vc(d,m){Dh(d,m),(d=d.alternate)&&Dh(d,m)}function ig(d){return d=L(d),d===null?null:d.stateNode}function Vp(){return null}return r.attemptContinuousHydration=function(d){if(d.tag===13){var m=qi(d,134217728);if(m!==null){var C=xn();_a(m,d,134217728,C)}Vc(d,134217728)}},r.attemptDiscreteHydration=function(d){if(d.tag===13){var m=qi(d,1);if(m!==null){var C=xn();_a(m,d,1,C)}Vc(d,1)}},r.attemptHydrationAtCurrentPriority=function(d){if(d.tag===13){var m=_i(d),C=qi(d,m);if(C!==null){var z=xn();_a(C,d,m,z)}Vc(d,m)}},r.attemptSynchronousHydration=function(d){switch(d.tag){case 3:var m=d.stateNode;if(m.current.memoizedState.isDehydrated){var C=cs(m.pendingLanes);C!==0&&(qa(m,C|1),na(m,wn()),(sr&6)===0&&(ln(),li()))}break;case 13:Wl(function(){var z=qi(d,1);if(z!==null){var W=xn();_a(z,d,1,W)}}),Vc(d,1)}},r.batchedUpdates=function(d,m){var C=sr;sr|=1;try{return d(m)}finally{sr=C,sr===0&&(ln(),Eo&&li())}},r.createComponentSelector=function(d){return{$$typeof:Cn,value:d}},r.createContainer=function(d,m,C,z,W,ne,_e){return Ld(d,m,!1,null,C,z,W,ne,_e)},r.createHasPseudoClassSelector=function(d){return{$$typeof:Ln,value:d}},r.createHydrationContainer=function(d,m,C,z,W,ne,_e,Ye,it){return d=Ld(C,z,!0,d,W,ne,_e,Ye,it),d.context=jh(null),C=d.current,z=xn(),W=_i(C),ne=ha(z,W),ne.callback=m??null,Ji(C,ne,W),d.current.lanes=W,Ba(d,W,z),na(d,z),d},r.createPortal=function(d,m,C){var z=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:z==null?null:""+z,children:d,containerInfo:m,implementation:C}},r.createRoleSelector=function(d){return{$$typeof:rn,value:d}},r.createTestNameSelector=function(d){return{$$typeof:Ti,value:d}},r.createTextSelector=function(d){return{$$typeof:Kr,value:d}},r.deferredUpdates=function(d){var m=Pt,C=Vr.transition;try{return Vr.transition=null,Pt=16,d()}finally{Pt=m,Vr.transition=C}},r.discreteUpdates=function(d,m,C,z,W){var ne=Pt,_e=Vr.transition;try{return Vr.transition=null,Pt=1,d(m,C,z,W)}finally{Pt=ne,Vr.transition=_e,sr===0&&ln()}},r.findAllNodes=Hn,r.findBoundingRects=function(d,m){if(!Le)throw Error(o(363));m=Hn(d,m),d=[];for(var C=0;C<m.length;C++)d.push(ue(m[C]));for(m=d.length-1;0<m;m--){C=d[m];for(var z=C.x,W=z+C.width,ne=C.y,_e=ne+C.height,Ye=m-1;0<=Ye;Ye--)if(m!==Ye){var it=d[Ye],wt=it.x,$t=wt+it.width,br=it.y,Tt=br+it.height;if(z>=wt&&ne>=br&&W<=$t&&_e<=Tt){d.splice(m,1);break}else if(z!==wt||C.width!==it.width||Tt<ne||br>_e){if(!(ne!==br||C.height!==it.height||$t<z||wt>W)){wt>z&&(it.width+=wt-z,it.x=z),$t<W&&(it.width=W-wt),d.splice(m,1);break}}else{br>ne&&(it.height+=br-ne,it.y=ne),Tt<_e&&(it.height=_e-br),d.splice(m,1);break}}}return d},r.findHostInstance=ic,r.findHostInstanceWithNoPortals=function(d){return d=T(d),d=d!==null?q(d):null,d===null?null:d.stateNode},r.findHostInstanceWithWarning=function(d){return ic(d)},r.flushControlled=function(d){var m=sr;sr|=1;var C=Vr.transition,z=Pt;try{Vr.transition=null,Pt=1,d()}finally{Pt=z,Vr.transition=C,sr=m,sr===0&&(ln(),li())}},r.flushPassiveEffects=Vl,r.flushSync=Wl,r.focusWithin=function(d,m){if(!Le)throw Error(o(363));for(d=ei(d),m=ti(d,m),m=Array.from(m),d=0;d<m.length;){var C=m[d++];if(!Pe(C)){if(C.tag===5&&st(C.stateNode))return!0;for(C=C.child;C!==null;)m.push(C),C=C.sibling}}return!1},r.getCurrentUpdatePriority=function(){return Pt},r.getFindAllNodesFailureDescription=function(d,m){if(!Le)throw Error(o(363));var C=0,z=[];d=[ei(d),0];for(var W=0;W<d.length;){var ne=d[W++],_e=d[W++],Ye=m[_e];if((ne.tag!==5||!Pe(ne))&&(Ri(ne,Ye)&&(z.push(ya(Ye)),_e++,_e>C&&(C=_e)),_e<m.length))for(ne=ne.child;ne!==null;)d.push(ne,_e),ne=ne.sibling}if(C<m.length){for(d=[];C<m.length;C++)d.push(ya(m[C]));return`findAllNodes was able to match part of the selector:
|
|
71
|
-
`+(z.join(" > ")+`
|
|
72
|
-
|
|
73
|
-
No matching component was found for:
|
|
74
|
-
`)+d.join(" > ")}return null},r.getPublicRootInstance=function(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return ae(d.child.stateNode);default:return d.child.stateNode}},r.injectIntoDevTools=function(d){if(d={bundleType:d.bundleType,version:d.version,rendererPackageName:d.rendererPackageName,rendererConfig:d.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:ig,findFiberByHostInstance:d.findFiberByHostInstance||Vp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")d=!1;else{var m=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(m.isDisabled||!m.supportsFiber)d=!0;else{try{Ua=m.inject(d),ki=m}catch{}d=!!m.checkDCE}}return d},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(d,m,C,z){if(!Le)throw Error(o(363));d=Hn(d,m);var W=dt(d,C,z).disconnect;return{disconnect:function(){W()}}},r.registerMutableSourceForHydration=function(d,m){var C=m._getVersion;C=C(m._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[m,C]:d.mutableSourceEagerHydrationData.push(m,C)},r.runWithPriority=function(d,m){var C=Pt;try{return Pt=d,m()}finally{Pt=C}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(d,m,C,z){var W=m.current,ne=xn(),_e=_i(W);return C=jh(C),m.context===null?m.context=C:m.pendingContext=C,m=ha(ne,_e),m.payload={element:d},z=z===void 0?null:z,z!==null&&(m.callback=z),d=Ji(W,m,_e),d!==null&&(_a(d,W,_e,ne),No(d,W,_e)),_e},r}),Xg}var n3;function AA(){return n3||(n3=1,Yg.exports=kA()),Yg.exports}var PA=AA();const OA=hh(PA);var Kg={exports:{}},tf={};/**
|
|
75
|
-
* @license React
|
|
76
|
-
* react-reconciler-constants.production.min.js
|
|
77
|
-
*
|
|
78
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
79
|
-
*
|
|
80
|
-
* This source code is licensed under the MIT license found in the
|
|
81
|
-
* LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/var i3;function CA(){return i3||(i3=1,tf.ConcurrentRoot=1,tf.ContinuousEventPriority=4,tf.DefaultEventPriority=16,tf.DiscreteEventPriority=1,tf.IdleEventPriority=536870912,tf.LegacyRoot=0),tf}var a3;function LA(){return a3||(a3=1,Kg.exports=CA()),Kg.exports}var O8=LA();const o3={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let s3=!1,l3=!1;const Qm=".react-konva-event",NA=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
|
|
83
|
-
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
|
|
84
|
-
Consider to add onDragMove or onDragEnd events.
|
|
85
|
-
For more info see: https://github.com/konvajs/react-konva/issues/256
|
|
86
|
-
`,TA=`ReactKonva: You are using "zIndex" attribute for a Konva node.
|
|
87
|
-
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
|
|
88
|
-
For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
89
|
-
`,RA={};function q0(t,e,r=RA){if(!s3&&"zIndex"in e&&(console.warn(TA),s3=!0),!l3&&e.draggable){var n=e.x!==void 0||e.y!==void 0,i=e.onDragEnd||e.onDragMove;n&&!i&&(console.warn(NA),l3=!0)}for(var a in r)if(!o3[a]){var o=a.slice(0,2)==="on",s=r[a]!==e[a];if(o&&s){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t.off(u,r[a])}var h=!e.hasOwnProperty(a);h&&t.setAttr(a,void 0)}var f=e._useStrictMode,g={},v=!1;const p={};for(var a in e)if(!o3[a]){var o=a.slice(0,2)==="on",y=r[a]!==e[a];if(o&&y){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e[a]&&(p[u]=e[a])}!o&&(e[a]!==r[a]||f&&e[a]!==t.getAttr(a))&&(v=!0,g[a]=e[a])}v&&(t.setAttrs(g),Of(t));for(var u in p)t.on(u+Qm,p[u])}function Of(t){if(!Ot.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}var Zg=Im();const C8={},MA={};sh.Node.prototype._applyProps=q0;function IA(t,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}t.add(e),Of(t)}function jA(t,e,r){let n=sh[t];n||(console.error(`Konva has no node with the type ${t}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${t}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),n=sh.Group);const i={},a={};for(var o in e){var s=o.slice(0,2)==="on";s?a[o]=e[o]:i[o]=e[o]}const u=new n(i);return q0(u,a),u}function DA(t,e,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function FA(t,e,r){return!1}function BA(t){return t}function zA(){return null}function qA(){return null}function UA(t,e,r,n){return MA}function HA(){}function $A(t){}function GA(t,e){return!1}function WA(){return C8}function VA(){return C8}const YA=setTimeout,XA=clearTimeout,KA=-1;function ZA(t,e){return!1}const QA=!1,JA=!0,eP=!0;function tP(t,e){e.parent===t?e.moveToTop():t.add(e),Of(t)}function rP(t,e){e.parent===t?e.moveToTop():t.add(e),Of(t)}function L8(t,e,r){e._remove(),t.add(e),e.setZIndex(r.getZIndex()),Of(t)}function nP(t,e,r){L8(t,e,r)}function iP(t,e){e.destroy(),e.off(Qm),Of(t)}function aP(t,e){e.destroy(),e.off(Qm),Of(t)}function oP(t,e,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function sP(t,e,r){}function lP(t,e,r,n,i){q0(t,i,n)}function uP(t){t.hide(),Of(t)}function cP(t){}function fP(t,e){(e.visible==null||e.visible)&&t.show()}function hP(t,e){}function dP(t){}function pP(){}const gP=()=>O8.DefaultEventPriority,vP=Object.freeze(Object.defineProperty({__proto__:null,appendChild:tP,appendChildToContainer:rP,appendInitialChild:IA,cancelTimeout:XA,clearContainer:dP,commitMount:sP,commitTextUpdate:oP,commitUpdate:lP,createInstance:jA,createTextInstance:DA,detachDeletedInstance:pP,finalizeInitialChildren:FA,getChildHostContext:VA,getCurrentEventPriority:gP,getPublicInstance:BA,getRootHostContext:WA,hideInstance:uP,hideTextInstance:cP,idlePriority:Zg.unstable_IdlePriority,insertBefore:L8,insertInContainerBefore:nP,isPrimaryRenderer:QA,noTimeout:KA,now:Zg.unstable_now,prepareForCommit:zA,preparePortalMount:qA,prepareUpdate:UA,removeChild:iP,removeChildFromContainer:aP,resetAfterCommit:HA,resetTextContent:$A,run:Zg.unstable_runWithPriority,scheduleTimeout:YA,shouldDeprioritizeSubtree:GA,shouldSetTextContent:ZA,supportsMutation:eP,unhideInstance:fP,unhideTextInstance:hP,warnsIfNotActing:JA},Symbol.toStringTag,{value:"Module"}));var mP=Object.defineProperty,yP=Object.defineProperties,bP=Object.getOwnPropertyDescriptors,u3=Object.getOwnPropertySymbols,wP=Object.prototype.hasOwnProperty,_P=Object.prototype.propertyIsEnumerable,c3=(t,e,r)=>e in t?mP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,f3=(t,e)=>{for(var r in e||(e={}))wP.call(e,r)&&c3(t,r,e[r]);if(u3)for(var r of u3(e))_P.call(e,r)&&c3(t,r,e[r]);return t},xP=(t,e)=>yP(t,bP(e)),h3,d3;typeof window<"u"&&((h3=window.document)!=null&&h3.createElement||((d3=window.navigator)==null?void 0:d3.product)==="ReactNative")?ji.useLayoutEffect:ji.useEffect;function N8(t,e,r){if(!t)return;if(r(t)===!0)return t;let n=t.child;for(;n;){const i=N8(n,e,r);if(i)return i;n=n.sibling}}function T8(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const p3=console.error;console.error=function(){const t=[...arguments].join("");if(t?.startsWith("Warning:")&&t.includes("useContext")){console.error=p3;return}return p3.apply(this,arguments)};const Jm=T8(ji.createContext(null));class R8 extends ji.Component{render(){return ji.createElement(Jm.Provider,{value:this._reactInternals},this.props.children)}}function SP(){const t=ji.useContext(Jm);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=ji.useId();return ji.useMemo(()=>{for(const n of[t,t?.alternate]){if(!n)continue;const i=N8(n,!1,a=>{let o=a.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(i)return i}},[t,e])}function EP(){const t=SP(),[e]=ji.useState(()=>new Map);e.clear();let r=t;for(;r;){if(r.type&&typeof r.type=="object"){const i=r.type._context===void 0&&r.type.Provider===r.type?r.type:r.type._context;i&&i!==Jm&&!e.has(i)&&e.set(i,ji.useContext(T8(i)))}r=r.return}return e}function M8(){const t=EP();return ji.useMemo(()=>Array.from(t.keys()).reduce((e,r)=>n=>ji.createElement(e,null,ji.createElement(r.Provider,xP(f3({},n),{value:t.get(r)}))),e=>ji.createElement(R8,f3({},e))),[t])}function kP(t){const e=se.useRef({});return se.useLayoutEffect(()=>{e.current=t}),se.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const AP=t=>{const e=se.useRef(null),r=se.useRef(null),n=se.useRef(null),i=kP(t),a=M8(),o=s=>{const{forwardedRef:u}=t;u&&(typeof u=="function"?u(s):u.current=s)};return se.useLayoutEffect(()=>(r.current=new sh.Stage({width:t.width,height:t.height,container:e.current}),o(r.current),n.current=Zd.createContainer(r.current,O8.LegacyRoot,!1,null),Zd.updateContainer(se.createElement(a,{},t.children),n.current),()=>{sh.isBrowser&&(o(null),Zd.updateContainer(null,n.current,null),r.current.destroy())}),[]),se.useLayoutEffect(()=>{o(r.current),q0(r.current,t,i),Zd.updateContainer(se.createElement(a,{},t.children),n.current,null)}),se.createElement("div",{ref:e,id:t.id,accessKey:t.accessKey,className:t.className,role:t.role,style:t.style,tabIndex:t.tabIndex,title:t.title})},PP="Layer",bn="Group",g0="Label",Tn="Rect",OP="Circle",hf="Line",Tu="Image",Fu="Text",CP="TextPath",ey="Arc",v0="Tag",mp="Path",yp="Transformer",Zd=OA(vP);Zd.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:se.version,rendererPackageName:"react-konva"});const LP=se.forwardRef((t,e)=>se.createElement(R8,{},se.createElement(AP,{...t,forwardedRef:e})));var Qg,g3;function NP(){if(g3)return Qg;g3=1;var t=Ap();return Qg=function(r,n,i){const a=t.useRef("loading"),o=t.useRef(),[s,u]=t.useState(0),h=t.useRef(),f=t.useRef(),g=t.useRef();return(h.current!==r||f.current!==n||g.current!==i)&&(a.current="loading",o.current=void 0,h.current=r,f.current=n,g.current=i),t.useLayoutEffect(function(){if(!r)return;var v=document.createElement("img");function p(){v.decode().catch(()=>{}).finally(()=>{a.current="loaded",o.current=v,u(Math.random())})}function y(){a.current="failed",o.current=void 0,u(Math.random())}return v.addEventListener("load",p),v.addEventListener("error",y),n&&(v.crossOrigin=n),i&&(v.referrerPolicy=i),v.src=r,function(){v.removeEventListener("load",p),v.removeEventListener("error",y)}},[r,n,i]),[o.current,a.current]},Qg}var TP=NP();const ty=hh(TP);var RP=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};const MP=t=>{const e=window.getComputedStyle(t).position;return!(e==="absolute"||e==="relative")};function IP(t=()=>{}){const e=se.useRef(t);return e.current=t,se.useCallback((...r)=>e.current.apply(null,r),[])}const m0=({children:t,groupProps:e,divProps:r,transform:n,transformFunc:i,parentNodeFunc:a})=>{const o=M8(),s=se.useRef(null),[u]=se.useState(()=>document.createElement("div")),h=se.useMemo(()=>Kw.createRoot(u),[u]),f=n??!0,g=IP(()=>{if(f&&s.current){let x=s.current.getAbsoluteTransform().decompose();i&&(x=i(x)),u.style.position="absolute",u.style.zIndex="10",u.style.top="0px",u.style.left="0px",u.style.transform=`translate(${x.x}px, ${x.y}px) rotate(${x.rotation}deg) scaleX(${x.scaleX}) scaleY(${x.scaleY})`,u.style.transformOrigin="top left"}else u.style.position="",u.style.zIndex="",u.style.top="",u.style.left="",u.style.transform="",u.style.transformOrigin="";const v=r||{},{style:p}=v,y=RP(v,["style"]);Object.assign(u.style,p),Object.assign(u,y)});return se.useLayoutEffect(()=>{var v;const p=s.current;if(!p)return;const y=a?a({stage:p.getStage()}):(v=p.getStage())===null||v===void 0?void 0:v.container();if(y)return y.appendChild(u),f&&MP(y)&&(y.style.position="relative"),p.on("absoluteTransformChange",g),g(),()=>{var _;p.off("absoluteTransformChange",g),(_=u.parentNode)===null||_===void 0||_.removeChild(u)}},[f,a]),se.useLayoutEffect(()=>{g()},[r,i]),se.useLayoutEffect(()=>{queueMicrotask(()=>{Y6.flushSync(()=>{h.render(se.createElement(o,null,t))})})}),se.useLayoutEffect(()=>()=>{setTimeout(()=>{h.unmount()})},[]),se.createElement(bn,Object.assign({ref:s},e))},ry=({selector:t,enabled:e,children:r})=>{const n=se.useRef(null),i=se.useRef(null),a=se.useRef(null),o=e??!0;return se.useLayoutEffect(()=>{if(!n.current||!i.current)return;a.current=i.current;const u=n.current.getStage().findOne(t);o&&u?i.current.moveTo(u):i.current.moveTo(n.current);const h=n.current.getLayer();if(h&&(h.batchDraw(),u)){const f=u.getLayer();if(!f)return;f.batchDraw()}},[t,o]),se.useEffect(()=>()=>{var s;(s=a.current)===null||s===void 0||s.destroy()},[]),se.createElement(bn,{name:"_outer_portal",ref:n},se.createElement(bn,{name:"_inner_portal",ref:i},r))};function I8(t,e,r){const n=e-1,i=r[D8(n,r.length)];return i.marker!=="Z"?i:I8(t,n,r)}function j8(t,e,r){const n=e+1,i=r[D8(n,r.length)];return i.marker==="Z"?j8(t,n,r):i}function jP(t,e,r){let n=r[e-1]||{values:{x:0,y:0}};if(t.marker===t.marker.toLowerCase())switch(t.marker=t.marker.toUpperCase(),t.marker){case"M":t.values.x+=n.values.x,t.values.y+=n.values.y;break;case"L":case"A":t.values.x+=n.values.x,t.values.y+=n.values.y;break;case"H":t.marker="L",t.values.x+=n.values.x,t.values.y=n.values.y;break;case"V":t.marker="L",t.values.x=n.values.x,t.values.y+=n.values.y;break;case"C":t.values.x+=n.values.x,t.values.y+=n.values.y,t.values.x1+=n.values.x,t.values.y1+=n.values.y,t.values.x2+=n.values.x,t.values.y2+=n.values.y;break;case"S":t.values.x+=n.values.x,t.values.y+=n.values.y,t.values.x2+=n.values.x,t.values.y2+=n.values.y;break;case"Q":t.values.x+=n.values.x,t.values.y+=n.values.y,t.values.x1+=n.values.x,t.values.y1+=n.values.y;break;case"T":t.values.x+=n.values.x,t.values.y+=n.values.y;break}else if(t.marker===t.marker.toUpperCase())switch(t.marker){case"H":t.marker="L",t.values.y=n.values.y;break;case"V":t.marker="L",t.values.x=n.values.x;break}if(t.marker==="Z"){let i=function(o,s){return o[s].marker==="M"?o[s]:i(o,s-1)},a=i(r,e);t.values.x=a.values.x,t.values.y=a.values.y}return t}function DP(t,e){const r=[];switch(t.toUpperCase()){case"M":for(let n=0;n<e.length;n+=2){let i;t===t.toUpperCase()?i=n===0?"M":"L":i=n===0?"m":"l",r.push({marker:i,values:{x:e[n],y:e[n+1]}})}break;case"L":for(let n=0;n<e.length;n+=2)r.push({marker:t,values:{x:e[n],y:e[n+1]}});break;case"H":for(let n=0;n<e.length;n++)r.push({marker:t,values:{x:e[n],y:0}});break;case"V":for(let n=0;n<e.length;n++)r.push({marker:t,values:{x:0,y:e[n]}});break;case"C":for(let n=0;n<e.length;n+=6)r.push({marker:t,values:{x1:e[n],y1:e[n+1],x2:e[n+2],y2:e[n+3],x:e[n+4],y:e[n+5]}});break;case"S":for(let n=0;n<e.length;n+=4)r.push({marker:t,values:{x2:e[n],y2:e[n+1],x:e[n+2],y:e[n+3]}});break;case"Q":for(let n=0;n<e.length;n+=4)r.push({marker:t,values:{x1:e[n],y1:e[n+1],x:e[n+2],y:e[n+3]}});break;case"T":for(let n=0;n<e.length;n+=2)r.push({marker:t,values:{x:e[n],y:e[n+1]}});break;case"A":for(let n=0;n<e.length;n+=7)r.push({marker:t,values:{radiusX:e[n],radiusY:e[n+1],rotation:e[n+2],largeArc:e[n+3],sweep:e[n+4],x:e[n+5],y:e[n+6]}});break;case"Z":r.push({marker:t,values:{x:0,y:0}});break}return r}function D8(t,e){return(t%e+e)%e}function FP(t,e,r){if(e!==0&&t.marker==="L"){let n=r[e-1];["x","y"].every(a=>Math.round(Math.abs(n.values[a]-t.values[a]))===0)&&(t.overlap=!0)}return t}function pm(t,e){const r=["x","y"].every(n=>Math.round(Math.abs(t[e].values[n]-t[0].values[n]))===0);t[e].marker==="L"&&r&&(t[e].overlap=!0,pm(t,e-1)),t[e].marker==="Z"&&pm(t,e-1)}function BP(t,e,r){const n=m3(t.values,r.values),i=m3(e.values,t.values);return Math.min(i,n)}function v3(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}function m3(t,e){const r=t.x-e.x,n=t.y-e.y;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2))}function y3(t,e){return Math.sin(t)*e}function b3(t,e){return Math.cos(t)*e}function w3(t,e){const r=e/Math.tan(t);return r===1/0||r===-1/0||isNaN(r)?e:r}function zP(t,e){return e*Math.tan(t)}function qP(t,e){let r,n=0,i=t*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=w3(t/2,-e):(r=w3(t/2,e),n=1,r===1/0&&(r=e)),{offset:r,sweepFlag:n}}function UP(t){const e=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return t.map(r=>{let n="";if(r.marker!=="Z"){const i=Object.keys(r.values);n=e.filter(a=>i.indexOf(a)!==-1).map(a=>r.values[a]).join()}return`${r.marker}${n}`}).join("").trim()}function HP(t){const e=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,r=/-?[0-9]*\.?\d+/g;return[...t.matchAll(e)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,i)=>{const a=t.substring(i.index,n.length?n[n.length-1].index:t.length);return n.concat([{marker:i.marker,index:i.index,chunk:a.length>0?a.substr(1,a.length-1):a}])},[]).reverse().flatMap(n=>{const i=n.chunk.match(r),a=i?i.map(parseFloat):[];return DP(n.marker,a)}).map(jP)}function $P(t,e,r){let n=[],i=[];return t.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(FP),pm(a,a.length-1);const o=a[a.length-1].marker=="Z";a.filter(s=>!s.overlap).map((s,u,h)=>{const g=I8(s,u,h),v=j8(s,u,h),p=v3(s.values,g.values),y=v3(s.values,v.values),_=y-p,x=_*(180/Math.PI),b=BP(s,g,v),E=Math.abs(zP(_/2,b/2)),A=Math.min(e,E),S=qP(_,A),k=S.offset,I=S.sweepFlag,O=(u==0||u==h.length-1)&&!o;switch(s.marker){case"M":case"L":const M=[s.values.x+y3(p,k),s.values.y+b3(p,k)],F=[s.values.x+y3(y,k),s.values.y+b3(y,k)];O?i.push({marker:s.marker,values:s.values}):i.push({marker:s.marker,values:{x:parseFloat(M[0].toFixed(3)),y:parseFloat(M[1].toFixed(3))}}),!O&&(v.marker==="L"||v.marker==="M")&&i.push({marker:"A",radius:A,values:{radiusX:parseFloat(A.toFixed(3)),radiusY:parseFloat(A.toFixed(3)),rotation:x,largeArc:0,sweep:I,x:parseFloat(F[0].toFixed(3)),y:parseFloat(F[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":i.push({marker:s.marker,values:s.values});break}})}),{path:UP(i),commands:i}}var P1={},_3;function GP(){if(_3)return P1;_3=1;var t=t||{};t.stringify=function(){var e={"visit_linear-gradient":function(r){return e.visit_gradient(r)},"visit_repeating-linear-gradient":function(r){return e.visit_gradient(r)},"visit_radial-gradient":function(r){return e.visit_gradient(r)},"visit_repeating-radial-gradient":function(r){return e.visit_gradient(r)},visit_gradient:function(r){var n=e.visit(r.orientation);return n&&(n+=", "),r.type+"("+n+e.visit(r.colorStops)+")"},visit_shape:function(r){var n=r.value,i=e.visit(r.at),a=e.visit(r.style);return a&&(n+=" "+a),i&&(n+=" at "+i),n},"visit_default-radial":function(r){var n="",i=e.visit(r.at);return i&&(n+=i),n},"visit_extent-keyword":function(r){var n=r.value,i=e.visit(r.at);return i&&(n+=" at "+i),n},"visit_position-keyword":function(r){return r.value},visit_position:function(r){return e.visit(r.value.x)+" "+e.visit(r.value.y)},"visit_%":function(r){return r.value+"%"},visit_em:function(r){return r.value+"em"},visit_px:function(r){return r.value+"px"},visit_calc:function(r){return"calc("+r.value+")"},visit_literal:function(r){return e.visit_color(r.value,r)},visit_hex:function(r){return e.visit_color("#"+r.value,r)},visit_rgb:function(r){return e.visit_color("rgb("+r.value.join(", ")+")",r)},visit_rgba:function(r){return e.visit_color("rgba("+r.value.join(", ")+")",r)},visit_hsl:function(r){return e.visit_color("hsl("+r.value[0]+", "+r.value[1]+"%, "+r.value[2]+"%)",r)},visit_hsla:function(r){return e.visit_color("hsla("+r.value[0]+", "+r.value[1]+"%, "+r.value[2]+"%, "+r.value[3]+")",r)},visit_var:function(r){return e.visit_color("var("+r.value+")",r)},visit_color:function(r,n){var i=r,a=e.visit(n.length);return a&&(i+=" "+a),i},visit_angular:function(r){return r.value+"deg"},visit_directional:function(r){return"to "+r.value},visit_array:function(r){var n="",i=r.length;return r.forEach(function(a,o){n+=e.visit(a),o<i-1&&(n+=", ")}),n},visit_object:function(r){return r.width&&r.height?e.visit(r.width)+" "+e.visit(r.height):""},visit:function(r){if(!r)return"";if(r instanceof Array)return e.visit_array(r);if(typeof r=="object"&&!r.type)return e.visit_object(r);if(r.type){var n=e["visit_"+r.type];if(n)return n(r);throw Error("Missing visitor visit_"+r.type)}else throw Error("Invalid node.")}};return function(r){return e.visit(r)}}();var t=t||{};return t.parse=function(){var e={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,radianValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-zA-Z0-9-,\s\#]+)/,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i},r="";function n(U){var X=new Error(r+": "+U);throw X.source=r,X}function i(){var U=a();return r.length>0&&n("Invalid input not EOF"),U}function a(){return S(o)}function o(){return s("linear-gradient",e.linearGradient,h)||s("repeating-linear-gradient",e.repeatingLinearGradient,h)||s("radial-gradient",e.radialGradient,v)||s("repeating-radial-gradient",e.repeatingRadialGradient,v)}function s(U,X,ee){return u(X,function(K){var oe=ee();return oe&&(B(e.comma)||n("Missing comma before color stops")),{type:U,orientation:oe,colorStops:S(k)}})}function u(U,X){var ee=B(U);if(ee){B(e.startCall)||n("Missing (");var K=X(ee);return B(e.endCall)||n("Missing )"),K}}function h(){var U=f();if(U)return U;var X=V("position-keyword",e.positionKeywords,1);return X?{type:"directional",value:X.value}:g()}function f(){return V("directional",e.sideOrCorner,1)}function g(){return V("angular",e.angleValue,1)||V("angular",e.radianValue,1)}function v(){var U,X=p(),ee;return X&&(U=[],U.push(X),ee=r,B(e.comma)&&(X=p(),X?U.push(X):r=ee)),U}function p(){var U=y()||_();if(U)U.at=b();else{var X=x();if(X){U=X;var ee=b();ee&&(U.at=ee)}else{var K=b();if(K)U={type:"default-radial",at:K};else{var oe=E();oe&&(U={type:"default-radial",at:oe})}}}return U}function y(){var U=V("shape",/^(circle)/i,0);return U&&(U.style=te()||x()),U}function _(){var U=V("shape",/^(ellipse)/i,0);return U&&(U.style=E()||ae()||x()),U}function x(){return V("extent-keyword",e.extentKeywords,1)}function b(){if(V("position",/^at/,0)){var U=E();return U||n("Missing positioning value"),U}}function E(){var U=A();if(U.x||U.y)return{type:"position",value:U}}function A(){return{x:ae(),y:ae()}}function S(U){var X=U(),ee=[];if(X)for(ee.push(X);B(e.comma);)X=U(),X?ee.push(X):n("One extra comma");return ee}function k(){var U=I();return U||n("Expected color definition"),U.length=ae(),U}function I(){return M()||$()||L()||j()||F()||T()||O()}function O(){return V("literal",e.literalColor,0)}function M(){return V("hex",e.hexColor,1)}function F(){return u(e.rgbColor,function(){return{type:"rgb",value:S(J)}})}function j(){return u(e.rgbaColor,function(){return{type:"rgba",value:S(J)}})}function T(){return u(e.varColor,function(){return{type:"var",value:q()}})}function L(){return u(e.hslColor,function(){var U=B(e.percentageValue);U&&n("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var X=J();B(e.comma);var ee=B(e.percentageValue),K=ee?ee[1]:null;B(e.comma),ee=B(e.percentageValue);var oe=ee?ee[1]:null;return(!K||!oe)&&n("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[X,K,oe]}})}function $(){return u(e.hslaColor,function(){var U=J();B(e.comma);var X=B(e.percentageValue),ee=X?X[1]:null;B(e.comma),X=B(e.percentageValue);var K=X?X[1]:null;B(e.comma);var oe=J();return(!ee||!K)&&n("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[U,ee,K,oe]}})}function q(){return B(e.variableName)[1]}function J(){return B(e.number)[1]}function ae(){return V("%",e.percentageValue,1)||ie()||Z()||te()}function ie(){return V("position-keyword",e.positionKeywords,1)}function Z(){return u(e.calcValue,function(){for(var U=1,X=0;U>0&&X<r.length;){var ee=r.charAt(X);ee==="("?U++:ee===")"&&U--,X++}U>0&&n("Missing closing parenthesis in calc() expression");var K=r.substring(0,X-1);return D(X-1),{type:"calc",value:K}})}function te(){return V("px",e.pixelValue,1)||V("em",e.emValue,1)}function V(U,X,ee){var K=B(X);if(K)return{type:U,value:K[ee]}}function B(U){var X,ee;return ee=/^[\n\r\t\s]+/.exec(r),ee&&D(ee[0].length),X=U.exec(r),X&&D(X[0].length),X}function D(U){r=r.substr(U)}return function(U){return r=U.toString().trim(),r.endsWith(";")&&(r=r.slice(0,-1)),i()}}(),P1.parse=t.parse,P1.stringify=t.stringify,P1}var WP=GP();const VP=hh(WP),U0=t=>t.indexOf("linear-gradient")>=0,YP=t=>t.type==="hex"?"#"+t.value:t.type==="literal"?t.value:`${t.type}(${t.value.join(",")})`,F8=t=>{if(!U0(t))return{rotation:0,stops:[{offset:0,color:t},{offset:1,color:t}]};const e=VP.parse(t)[0];return{rotation:parseFloat(e.orientation.value),stops:e.colorStops.map((r,n)=>({color:YP(r),offset:r.length?parseFloat(r.length.value)/100:n/(e.colorStops.length-1)}))}},bf=(t,e=t.fill,r="fill")=>se.useMemo(()=>{if(!U0(e))return{[r]:e};const{stops:n,rotation:i}=F8(e),a=t.a.width/2,o=t.a.height/2,s=(i%180+180)%180,u=s>45&&s<135?t.a.width:t.a.height,h=or.Util.degToRad(i)-Math.PI/2,f=[];return n.forEach(({offset:g,color:v})=>{f.push(g,v)}),r==="fill"?{fillLinearGradientStartPointX:a-u/2*Math.cos(h),fillLinearGradientStartPointY:o-u/2*Math.sin(h),fillLinearGradientColorStops:f,fillLinearGradientEndPointX:a+u/2*Math.cos(h),fillLinearGradientEndPointY:o+u/2*Math.sin(h),fill:n[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:a-u/2*Math.cos(h),strokeLinearGradientStartPointY:o-u/2*Math.sin(h),strokeLinearGradientColorStops:f,strokeLinearGradientEndPointX:a+u/2*Math.cos(h),strokeLinearGradientEndPointY:o+u/2*Math.sin(h)}},[e,t.width,t.height]);let y0=!1;const XP=(t=!y0)=>{y0=t},KP=()=>y0;function Rp(t,e){const r=se.useRef();se.useLayoutEffect(()=>{r.current&&r.current.destroy()},[e]),se.useLayoutEffect(()=>{if(!y0)return;const n=t.current.opacity();return n?(t.current.opacity(0),r.current=new or.Tween({node:t.current,opacity:n,onFinish:()=>{var i;(i=r.current)===null||i===void 0||i.destroy()}}),r.current.play(),()=>{var i;(i=r.current)===null||i===void 0||i.destroy()}):void 0},[])}let b0=0,gm=[],B8=3e4;const ZP=t=>{B8=t};let z8=6e3;const QP=t=>{z8=t},JP=()=>z8;function pd(t){b0+=1;let e=!1,r=!1;const n=setTimeout(()=>{e||(Mp(`Timeout loading asset ${t}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",t),e=!0,x3())},B8);return()=>{r?console.error("Finish called twice! That is not expected. id: ",t):(r=!0,e||(clearTimeout(n),x3()))}}function x3(){b0-=1,b0===0&&(gm.forEach(t=>t()),gm=[])}function eO(){return new Promise(t=>{return e=()=>{KP()?setTimeout(t,300):t(!0)},void(b0===0?e():gm.push(e));var e})}let q8=[];function tO(t){q8.push(t)}function Mp(t){q8.forEach(e=>e(t))}Xr(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]);Xr({value:!1});const ny=Xr([]);function rO(t){ny.push(t)}var nO="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1";let Jg;function Wh(t,e="Arial",r="normal",n="normal"){Jg||(Jg=document.createElement("canvas"));var i=Jg.getContext("2d");return i.font=`${r} ${n} 40px '${t}', ${e}`,i.measureText(nO).width}const V1={Arial:!0},S3=t=>!!V1[t];async function Zh(t,e,r){var n;if(V1[t])return;const i=!!(!((n=document.fonts)===null||n===void 0)&&n.load),a=Wh("Arial","Arial",e,r);if(i)try{if(await document.fonts.load(`16px '${t}', ${e} ${r}`),a!==Wh(t,"Arial",e,r))return void(V1[t]=!0)}catch{}const o=Wh("Times","Times",e,r),s=Wh(t,"Arial",e,r),u=Math.min(6e3,JP())/60;for(let h=0;h<u;h++){const f=Wh(t,"Arial",e,r),g=Wh(t,"Times",e,r);if(f!==s||f!==a||g!==o)return await new Promise(v=>setTimeout(v,60)),void(V1[t]=!0);await new Promise(v=>setTimeout(v,60))}console.warn(`Timeout for loading font "${t}". Looks like polotno can't load it. Is it a correct font family?`),Mp(`Timeout for loading font "${t}"`)}const E3={};let U8="400,400italic,700,700italic";function iO(){return U8}function H8(t){return`https://fonts.googleapis.com/css?family=${t.replace(/ /g,"+")}:${U8}`}function $8(t){if(E3[t])return;const e=H8(t),r=document.createElement("link");r.type="text/css",r.href=e,r.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(r),E3[t]=!0}const k3={};let $f;function G8(t){const e=t.fontFamily;if(k3[e]||!t.url&&!t.styles)return;const r=t.styles||(t.url?[{src:`url("${t.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(`
|
|
90
|
-
@font-face{
|
|
91
|
-
font-family:'${e}';
|
|
92
|
-
src:${i.src};
|
|
93
|
-
font-style:${i.fontStyle||"normal"};
|
|
94
|
-
font-weight:${i.fontWeight||"normal"};
|
|
95
|
-
font-display:swap; /* optional but recommended */
|
|
96
|
-
}`,n.cssRules.length)}),k3[t.fontFamily]=!0}const Si=Xr({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1}),aO=Qr(t=>{Si.textVerticalResizeEnabled=t}),oO=Qr(t=>{Si.removeBackgroundEnabled=t}),sO=Qr(t=>{Si.htmlRenderEnabled=t}),lO=Qr(t=>{Si.imageDownScalingEnabled=t});Qr(t=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),lO(t)});Qr(t=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),Si.textOverflow="change-font-size"});const W8=Qr(t=>{Si.textOverflow=t}),uO=Qr(t=>{Si.textSplitAllowed=t});Qr(t=>{Si.animationsEnabled=t});function ns(t=""){return(t.match(/<\/p>/gi)||[]).length>1&&(t=t.replace(/<\/p>/gi,(e,r,n)=>(n.slice(r+e.length).match(/<\/p>/gi)||[]).length>0?`
|
|
97
|
-
`:e)),t.replace(/(<([^>]+)>)/gi,"")}function cO(t){return t?/<[a-z][a-z0-9]*(\s[^>]*)?>[^<]*<\/[a-z][a-z0-9]*>/i.test(t)?t=(t=t.replace(/<(?![a-z/!])/gi,"<")).replace(/([^a-z0-9"'\s/])>/gi,"$1>"):t.replace(/</g,"<").replace(/>/g,">"):""}const fO={warm:t=>e=>{const r=e.data;t=Math.max(0,Math.min(1,t));for(let n=0;n<r.length;n+=4)r[n]=Math.min(r[n]+30*t,255),r[n+1]=Math.min(r[n+1]+15*t,255);return e},cold:t=>e=>{const r=e.data;t=Math.max(0,Math.min(1,t));for(let n=0;n<r.length;n+=4)r[n]=Math.min(r[n]-15*t,255),r[n+1]=Math.min(r[n+1]-10*t,255),r[n+2]=Math.min(r[n+2]+15*t,255);return e},natural:t=>e=>{const r=e.data;t=Math.max(0,Math.min(1,t));for(let n=0;n<r.length;n+=4){r[n]=Math.min(r[n]*(1+.1*t),255),r[n+1]=Math.min(r[n+1]*(1+.1*t),255),r[n+2]=Math.min(r[n+2]*(1+.1*t),255);const i=(r[n]+r[n+1]+r[n+2])/3;r[n]=Math.min((r[n]-i)*(1+.2*t)+i,255),r[n+1]=Math.min((r[n+1]-i)*(1+.2*t)+i,255),r[n+2]=Math.min((r[n+2]-i)*(1+.2*t)+i,255)}return e},temperature:t=>e=>{const r=e.data;t=Math.max(-1,Math.min(1,t));for(let n=0;n<r.length;n+=4){const i=r[n],a=(r[n+1],r[n+2]);r[n]=Math.min(Math.max(i+15*t,0),255),r[n+2]=Math.min(Math.max(a-15*t,0),255)}return e},contrast:t=>e=>{const r=e.data,n=100*(t=Math.max(-1,Math.min(1,t))),i=259*(n+255)/(255*(259-n));for(let a=0;a<r.length;a+=4)r[a]=Math.min(Math.max(i*(r[a]-128)+128,0),255),r[a+1]=Math.min(Math.max(i*(r[a+1]-128)+128,0),255),r[a+2]=Math.min(Math.max(i*(r[a+2]-128)+128,0),255);return e},shadows:t=>e=>{const r=e.data;t=Math.max(-1,Math.min(1,t));for(let n=0;n<r.length;n+=4){const i=(r[n]+r[n+1]+r[n+2])/3;if(i<128){const a=1+t*(1-i/128)*2;r[n]=Math.min(Math.max(r[n]*a,0),255),r[n+1]=Math.min(Math.max(r[n+1]*a,0),255),r[n+2]=Math.min(Math.max(r[n+2]*a,0),255)}}return e},white:t=>e=>{const r=e.data;t=Math.max(-1,Math.min(1,t));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],o=r[n+2],s=(i+a+o)/3;if(s>128){const u=1+t*((s-128)/127);r[n]=Math.min(Math.max(i*u,0),255),r[n+1]=Math.min(Math.max(a*u,0),255),r[n+2]=Math.min(Math.max(o*u,0),255)}}return e},black:t=>e=>{const r=e.data;t=Math.max(-1,Math.min(1,t));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],o=r[n+2],s=(i+a+o)/3;if(s<128){const u=1+t*((128-s)/128);r[n]=Math.min(Math.max(i*u,0),255),r[n+1]=Math.min(Math.max(a*u,0),255),r[n+2]=Math.min(Math.max(o*u,0),255)}}return e},vibrance:t=>e=>{const r=e.data;t=Math.max(-1,Math.min(1,t));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],o=r[n+2],s=Math.max(i,a,o),u=t<0?(1-(s===0?0:(s-(i+a+o)/3)/s))*t*1.5:.5*t;r[n]=Math.min(Math.max(i-(s-i)*u,0),255),r[n+1]=Math.min(Math.max(a-(s-a)*u,0),255),r[n+2]=Math.min(Math.max(o-(s-o)*u,0),255)}return e},saturation:t=>e=>{const r=e.data;t=Math.max(-1,Math.min(1,t));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],o=r[n+2],s=.2126*i+.7152*a+.0722*o;r[n]=Math.min(Math.max(s+(i-s)*(1+t),0),255),r[n+1]=Math.min(Math.max(s+(a-s)*(1+t),0),255),r[n+2]=Math.min(Math.max(s+(o-s)*(1+t),0),255)}return e}};function Ms(t,e){var r;const n={filters:[]},i={};e.brightnessEnabled&&(n.filters.push(or.Filters.Brighten),n.brightness=e.brightness),e.blurEnabled&&(n.filters.push(or.Filters.Blur),n.blurRadius=e.blurRadius,e.type==="text"&&e.lineHeight<1&&(i.offset=e.fontSize)),e.sepiaEnabled&&n.filters.push(or.Filters.Sepia),e.grayscaleEnabled&&n.filters.push(or.Filters.Grayscale),e.filters.forEach((a,o)=>{const s=fO[o];s&&n.filters.push(s(a.intensity))}),t.setAttrs(n),n.filters.length?t.cache(Object.assign(Object.assign({},i),{pixelRatio:e.store._elementsPixelRatio})):t.clearCache(),(r=t.getLayer())===null||r===void 0||r.batchDraw()}const Cf=()=>"ontouchstart"in window||navigator.maxTouchPoints>0;var A3={},V8="warn";function hO(t){V8=t}function dO(){return V8}var ja;(function(t){t.afterCreate="afterCreate",t.afterAttach="afterAttach",t.afterCreationFinalization="afterCreationFinalization",t.beforeDetach="beforeDetach",t.beforeDestroy="beforeDestroy"})(ja||(ja={}));var vm=function(t,e){return vm=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])},vm(t,e)};function ai(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");vm(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Uu=function(){return Uu=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Uu.apply(this,arguments)};function pO(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function op(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function wf(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function lh(t,e,r){if(arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}function Y8(t){return Br(t).type}function X8(t,e){return Br(t).onSnapshot(e)}function P3(t,e){Br(t).applyPatches(i7(e))}function mm(t,e){return Br(t).applySnapshot(e)}function Ru(t,e){e===void 0&&(e=!0);var r=Br(t);return e?r.snapshot:r.type.getSnapshot(r,!1)}function O1(t,e){for(var r=Br(t).parent;r;){if(e.is(r.storedValue))return!0;r=r.parent}return!1}function Yf(t,e){for(var r=Br(t).parent;r;){if(e.is(r.storedValue))return r.storedValue;r=r.parent}throw new rr("Failed to find the parent of ".concat(Br(t)," of a given type"))}function gO(t){return Br(t).root.storedValue}function vO(t){return Br(t).path}function mO(t,e){var r=FO(Br(t),e);return r?r.value:void 0}function yO(t){return Br(t).identifier}function Jf(t){return Br(t).detach(),t}function e2(t){var e=Br(t);e.isRoot?e.die():e.parent.removeChild(e.subpath)}function O3(t){return Br(t).observableIsAlive}var K8=function(){function t(e,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:wo.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(r,n)}return Object.defineProperty(t.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(e){var r=this.isAlive;this._state=e;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._hookSubscribers&&this._hookSubscribers.emit(e,this,e)}}),Object.defineProperty(t.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return this._hookSubscribers||(this._hookSubscribers=new s7),this._hookSubscribers.register(e,r)}}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(t.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){this._parent=e,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(t.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e&&(this.pathAtom||(this.pathAtom=o0("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?th(this._subpath):""),this.parent.getEscapedPath(e)+"/"+this._escapedSubpath):""}}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlive",{get:function(){return this.state!==wo.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDetaching",{get:function(){return this.state===wo.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=o0("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.state===wo.CREATED){if(this.parent){if(this.parent.state!==wo.FINALIZED)return;this.fireHook(ja.afterAttach)}this.state=wo.FINALIZED,e&&e()}}}),Object.defineProperty(t.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=wo.DEAD}}),Object.defineProperty(t.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(ja.beforeDestroy)}}),t}(),bp=function(t){ai(e,t);function e(r,n,i,a,o){var s=t.call(this,r,n,i,a)||this;try{s.storedValue=r.createNewInstance(o)}catch(u){throw s.state=wo.DEAD,u}return s.state=wo.CREATED,s.finalizeCreation(),s}return Object.defineProperty(e.prototype,"root",{get:function(){if(!this.parent)throw new rr("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.parent!==r,a=this.subpath!==n;!i&&!a||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(e.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(e.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===wo.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(e.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(e.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(e.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(e.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),e}(K8);bp.prototype.die=Qr(bp.prototype.die);var bO=1,Ql;(function(t){t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.CREATING=1]="CREATING",t[t.CREATED=2]="CREATED"})(Ql||(Ql={}));var Js;(function(t){t.Dispose="dispose",t.Patch="patch",t.Snapshot="snapshot"})(Js||(Js={}));var wO={onError:function(t){throw t}},Is=function(t){ai(e,t);function e(r,n,i,a,o){var s=t.call(this,r,n,i,a)||this;if(Object.defineProperty(s,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++bO}),Object.defineProperty(s,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(s,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(s,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:Ql.UNINITIALIZED}),Object.defineProperty(s,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(s,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),s._snapshotComputed=dh(function(){return s.getSnapshot()}),s.unbox=s.unbox.bind(s),s._initialSnapshot=o,s.identifierAttribute=r.identifierAttribute,n||(s.identifierCache=new IO),s._childNodes=r.initializeChildNodes(s,s._initialSnapshot),s.identifier=null,s.unnormalizedIdentifier=null,s.identifierAttribute&&s._initialSnapshot){var u=s._initialSnapshot[s.identifierAttribute];if(u===void 0){var h=s._childNodes[s.identifierAttribute];h&&(u=h.value)}if(typeof u!="string"&&typeof u!="number")throw new rr("Instance identifier '".concat(s.identifierAttribute,"' for type '").concat(s.type.name,"' must be a string or a number"));s.identifier=Ip(u),s.unnormalizedIdentifier=u}return n?n.root.identifierCache.addNodeToCache(s):s.identifierCache.addNodeToCache(s),s}return Object.defineProperty(e.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applyPatches(r)}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applySnapshot(r)}}),Object.defineProperty(e.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=!0),this._observableInstanceState===Ql.UNINITIALIZED&&this.createObservableInstance(r)}}),Object.defineProperty(e.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n,i,a,o;r===void 0&&(r=!0),this._observableInstanceState=Ql.CREATING;for(var s=[],u=this.parent;u&&u._observableInstanceState===Ql.UNINITIALIZED;)s.unshift(u),u=u.parent;try{for(var h=op(s),f=h.next();!f.done;f=h.next()){var g=f.value;g.createObservableInstanceIfNeeded(!1)}}catch(_){n={error:_}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}var v=this.type;try{this.storedValue=v.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,v.finalizeNewInstance(this,this.storedValue)}catch(_){throw this.state=wo.DEAD,_}finally{this._isRunningAction=!1}if(this._observableInstanceState=Ql.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=md,this.state=wo.CREATED,r){this.fireHook(ja.afterCreate),this.finalizeCreation();try{for(var p=op(s.reverse()),y=p.next();!y.done;y=p.next()){var g=y.value;g.fireHook(ja.afterCreate),g.finalizeCreation()}}catch(_){a={error:_}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}}}}),Object.defineProperty(e.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(ja.beforeDetach);var r=this.state;this.state=wo.DETACHING;var n=this.root,i=n.environment,a=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=r}}}}),Object.defineProperty(e.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,a=n!==this.subpath;!i&&!a||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(ja.afterAttach)):a&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(e.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.fireInternalHook(r);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[r];typeof i=="function"&&(dc?dc(function(){i.apply(n.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(e.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===Ql.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(e.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(e.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var r=this.type,n=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=r.processInitialSnapshot(n,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(e.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(e.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=dO();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw new rr(i);case"warn":YO(i)}}}}),Object.defineProperty(e.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",i=r.subpath&&th(r.subpath)||"",a=r.actionContext||SO();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var o="";if(a&&a.name!=null){var s=a&&a.context&&vO(a.context)||n;o="".concat(s,".").concat(a.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(n,"', Subpath: '").concat(i,"', Action: '").concat(o,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertAlive({subpath:r}),this._autoUnbox=!1;try{return this._observableInstanceState===Ql.CREATED?this.type.getChildNode(this,r):this._childNodes[r]}finally{this._autoUnbox=!0}}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(md),this._autoUnbox=!1;try{return this._observableInstanceState===Ql.CREATED?this.type.getChildren(this):r7(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.type.getChildType(r)}}),Object.defineProperty(e.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.assertAlive(r),!this.isRunningAction()&&this.isProtected)throw new rr("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.type.removeChild(this,r)}}),Object.defineProperty(e.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.assertAlive({subpath:r.subpath||r.subpathUponDeath}),this._autoUnbox?r.value:r)}}),Object.defineProperty(e.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(r).concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(e.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this.baseFinalizeCreation(function(){var n,i;try{for(var a=op(r.getChildren()),o=a.next();!o.done;o=a.next()){var s=o.value;s.finalizeCreation()}}catch(u){n={error:u}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}r.fireInternalHook(ja.afterCreationFinalization)})}}),Object.defineProperty(e.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new rr("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(e.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=wp(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=l7(i.path),o=t7(r,a.slice(0,-1));o.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=wp(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),eh(this.storedValue,"$treenode",this),eh(this.storedValue,"toJSON",DO)}}),Object.defineProperty(e.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===wo.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(e.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==Ql.UNINITIALIZED&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(Js.Dispose),this._internalEventsClear(Js.Dispose))}}),Object.defineProperty(e.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var r=this.snapshot;this._snapshotUponDeath=r,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(e.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._addSnapshotReaction(),this._internalEventsRegister(Js.Snapshot,r)}}),Object.defineProperty(e.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit(Js.Snapshot,r)}}),Object.defineProperty(e.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister(Js.Patch,r)}}),Object.defineProperty(e.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers(Js.Patch)){var i=n.path.substr(this.path.length)+(r.path?"/"+r.path:""),a=$O({},r,{path:i}),o=wf(KO(a),2),s=o[0],u=o[1];this._internalEventsEmit(Js.Patch,s,u)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(e.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas(Js.Dispose,r)}}),Object.defineProperty(e.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister(Js.Dispose,r,!0);return}throw new rr("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(e.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas(Js.Dispose,r))throw new rr("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(Js.Dispose,r)}}),Object.defineProperty(e.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.middlewares){var n=this.middlewares.indexOf(r);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(e.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={handler:r,includeHooks:n};return this.middlewares?this.middlewares.push(a):this.middlewares=[a],function(){i.removeMiddleware(a)}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this.assertWritable({subpath:r}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,r,n)}}),Object.defineProperty(e.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;if(!this._hasSnapshotReaction){var n=C6(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},wO);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(e.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return!!this._internalEvents&&this._internalEvents.hasSubscribers(r)}}),Object.defineProperty(e.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new s7),this._internalEvents.register(r,n,i)}}),Object.defineProperty(e.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!!this._internalEvents&&this._internalEvents.has(r,n)}}),Object.defineProperty(e.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this._internalEvents&&this._internalEvents.unregister(r,n)}}),Object.defineProperty(e.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var n,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];this._internalEvents&&(n=this._internalEvents).emit.apply(n,lh([r],wf(i),!1))}}),Object.defineProperty(e.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEvents&&this._internalEvents.clear(r)}}),Object.defineProperty(e.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),e}(K8);Is.prototype.createObservableInstance=Qr(Is.prototype.createObservableInstance);Is.prototype.detach=Qr(Is.prototype.detach);Is.prototype.die=Qr(Is.prototype.die);var Z8,an;(function(t){t[t.String=1]="String",t[t.Number=2]="Number",t[t.Boolean=4]="Boolean",t[t.Date=8]="Date",t[t.Literal=16]="Literal",t[t.Array=32]="Array",t[t.Map=64]="Map",t[t.Object=128]="Object",t[t.Frozen=256]="Frozen",t[t.Optional=512]="Optional",t[t.Reference=1024]="Reference",t[t.Identifier=2048]="Identifier",t[t.Late=4096]="Late",t[t.Refinement=8192]="Refinement",t[t.Union=16384]="Union",t[t.Null=32768]="Null",t[t.Undefined=65536]="Undefined",t[t.Integer=131072]="Integer",t[t.Custom=262144]="Custom",t[t.SnapshotProcessor=524288]="SnapshotProcessor",t[t.Lazy=1048576]="Lazy",t[t.Finite=2097152]="Finite",t[t.Float=4194304]="Float"})(an||(an={}));var Q8="cannotDetermine",_O=Symbol("$type"),yc=function(){function t(e){Object.defineProperty(this,Z8,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){return mc(this,e),this.instantiate(null,"",r,e).value}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){throw new rr("unimplemented method")}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e===this}}),Object.defineProperty(t.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=e7(e);if(n){var i=Y8(e);return this.isAssignableFrom(i)?js():Ds(r,e)}return this.isValidSnapshot(e,r)}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.validate(e,[{path:"",type:this}]).length===0}}),Object.defineProperty(t.prototype,"Type",{get:function(){throw new rr("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TypeWithoutSTN",{get:function(){throw new rr("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"SnapshotType",{get:function(){throw new rr("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CreationType",{get:function(){throw new rr("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),t}();Z8=_O;yc.prototype.create=Qr(yc.prototype.create);var gd=function(t){ai(e,t);function e(r){var n=t.call(this,r)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r===void 0&&(r=this.getDefaultSnapshot()),t.prototype.create.call(this,r,n)}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.createObservableInstanceIfNeeded(),r.storedValue}}),Object.defineProperty(e.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!r.identifierAttribute||r.identifier===Ip(n[r.identifierAttribute])}}),Object.defineProperty(e.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r.isDetaching?!1:r.snapshot===n||Di(n)&&Br(n)===r?!0:r.type===this&&a7(n)&&!Di(n)&&this.isMatchingSnapshotId(r,n)?(r.applySnapshot(n),!0):!1}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.tryToReconcileNode(r,n);if(o)return r.setParent(i,a),r;if(r.die(),Di(n)&&this.isAssignableFrom(Y8(n))){var s=Br(n);return s.setParent(i,a),s}return this.instantiate(i,a,void 0,n)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),e}(yc);gd.prototype.create=Qr(gd.prototype.create);var _h=function(t){ai(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r}}),Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this&&r.storedValue===n)return r;var o=this.instantiate(i,a,void 0,n);return r.die(),o}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),e}(yc);function bc(t){return typeof t=="object"&&t&&t.isType===!0}var xO=1,sp;function SO(){return sp}function EO(){return xO++}function kO(t,e){var r=Br(t.context);t.type==="action"&&r.assertAlive({actionContext:t});var n=r._isRunningAction;r._isRunningAction=!0;var i=sp;sp=t;try{return OO(r,t,e)}finally{sp=i,r._isRunningAction=n}}function AO(t){if(t)return t.type==="action"?t:t.parentActionEvent}function wp(t,e,r){var n=function(){var i=EO(),a=sp,o=AO(a);return kO({type:"action",name:e,id:i,args:VO(arguments),context:t,tree:gO(t),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?lh(lh([],wf(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:o},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}var PO=function(){function t(e,r){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),r.$mst_middleware&&this.middlewares.push(r.$mst_middleware);for(var n=e;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.middlewares[this.arrayIndex];if(e){var r=e[this.inArrayIndex++];return r||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),t}();function OO(t,e,r){var n=new PO(t,r);if(n.isEmpty)return Qr(r).apply(null,e.args);var i=null;function a(o){var s=n.getNextMiddleware(),u=s&&s.handler;if(!u)return Qr(r).apply(null,o.args);if(!s.includeHooks&&ja[o.name])return a(o);function h(g,v){i=a(g),v&&(i=v(i))}function f(g){i=g}return u(o,h,f),i}return a(e)}function CO(t){try{return JSON.stringify(t)}catch(e){return"<Unserializable: ".concat(e,">")}}function J8(t){return typeof t=="function"?"<function".concat(t.name?" "+t.name:"",">"):Di(t)?"<".concat(t,">"):"`".concat(CO(t),"`")}function LO(t){return t.length<280?t:"".concat(t.substring(0,272),"......").concat(t.substring(t.length-8))}function NO(t){var e=t.value,r=t.context[t.context.length-1].type,n=t.context.map(function(s){var u=s.path;return u}).filter(function(s){return s.length>0}).join("/"),i=n.length>0?'at path "/'.concat(n,'" '):"",a=Di(e)?"value of type ".concat(Br(e).type.name,":"):_p(e)?"value":"snapshot",o=r&&Di(e)&&r.is(Br(e).snapshot);return"".concat(i).concat(a," ").concat(J8(e)," is not assignable ").concat(r?"to type: `".concat(r.name,"`"):"")+(t.message?" (".concat(t.message,")"):"")+(r?vC(r)||_p(e)?".":", expected an instance of `".concat(r.name,"` or a snapshot like `").concat(r.describe(),"` instead.")+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function iy(t,e,r){return t.concat([{path:e,type:r}])}function js(){return vd}function Ds(t,e,r){return[{context:t,value:e,message:r}]}function H0(t){return t.reduce(function(e,r){return e.concat(r)},[])}function mc(t,e){XO()&&TO(t,e)}function TO(t,e){var r=t.validate(e,[{path:"",type:t}]);if(r.length>0)throw new rr(RO(t,e,r))}function RO(t,e,r){if(r.length!==0)return"Error while converting ".concat(LO(J8(e))," to `").concat(t.name,`\`:
|
|
98
|
-
|
|
99
|
-
`)+r.map(NO).join(`
|
|
100
|
-
`)}var MO=0,IO=function(){function t(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:MO++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:Xr.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:Xr.map()})}return Object.defineProperty(t.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.lastCacheModificationPerId.get(e);this.lastCacheModificationPerId.set(e,r===void 0?1:r+1)}}),Object.defineProperty(t.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.lastCacheModificationPerId.get(e)||0;return"".concat(this.cacheId,"-").concat(r)}}),Object.defineProperty(t.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){if(r===void 0&&(r=!0),e.identifierAttribute){var n=e.identifier;this.cache.has(n)||this.cache.set(n,Xr.array([],$0));var i=this.cache.get(n);if(i.indexOf(e)!==-1)throw new rr("Already registered");i.push(e),r&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(t.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this;j6(e.identifierCache.cache).forEach(function(n){return n.forEach(function(i){r.addNodeToCache(i)})})}}),Object.defineProperty(t.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.identifierAttribute){var r=e.identifier,n=this.cache.get(r);n&&(n.remove(e),n.length||this.cache.delete(r),this.updateLastCacheModificationPerId(e.identifier))}}}),Object.defineProperty(t.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this,n=new t,i=e.path+"/";return bS(this.cache).forEach(function(a){for(var o=wf(a,2),s=o[0],u=o[1],h=!1,f=u.length-1;f>=0;f--){var g=u[f];(g===e||g.path.indexOf(i)===0)&&(n.addNodeToCache(g,!1),u.splice(f,1),u.length||r.cache.delete(s),h=!0)}h&&r.updateLastCacheModificationPerId(s)}),n}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.cache.get(r);return n?n.some(function(i){return e.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(t.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.cache.get(r);if(!n)return null;var i=n.filter(function(a){return e.isAssignableFrom(a.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw new rr("Cannot resolve a reference to type '".concat(e.name,"' with id: '").concat(r,"' unambigously, there are multiple candidates: ").concat(i.map(function(a){return a.path}).join(", ")))}}}),t}();function ay(t,e,r,n,i){var a=e7(i);if(a){if(a.parent)throw new rr("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e?e.path:"","/").concat(r,"', but it lives already at '").concat(a.path,"'"));return e&&a.setParent(e,r),a}return new Is(t,e,r,n,i)}function Lf(t,e,r,n,i){return new bp(t,e,r,n,i)}function jO(t){return t instanceof bp||t instanceof Is}var wo;(function(t){t[t.INITIALIZING=0]="INITIALIZING",t[t.CREATED=1]="CREATED",t[t.FINALIZED=2]="FINALIZED",t[t.DETACHING=3]="DETACHING",t[t.DEAD=4]="DEAD"})(wo||(wo={}));function Di(t){return!!(t&&t.$treenode)}function Br(t){if(!Di(t))throw new rr("Value ".concat(t," is no MST Node"));return t.$treenode}function e7(t){return t&&t.$treenode||null}function DO(){return Br(this).snapshot}function FO(t,e,r){return r===void 0&&(r=!0),t7(t,l7(e),r)}function t7(t,e,r){r===void 0&&(r=!0);var n=t;try{for(var i=0;i<e.length;i++){var a=e[i];if(a===".."){if(n=n.parent,n)continue}else{if(a===".")continue;if(n){if(n instanceof bp){var o=n.value;Di(o)&&(n=Br(o))}if(n instanceof Is){var s=n.getChildType(a);if(s&&(n=n.getChildNode(a),n))continue}}}throw new rr("Could not resolve '".concat(a,"' in path '").concat(C3(e.slice(0,i))||"/","' while resolving '").concat(C3(e),"'"))}}catch(u){if(!r)return;throw u}return n}function r7(t){if(!t)return vd;var e=Object.keys(t);if(!e.length)return vd;var r=new Array(e.length);return e.forEach(function(n,i){r[i]=t[n]}),r}var BO=Object.toString(),vd=Object.freeze([]),md=Object.freeze({}),$0=G9().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze($0);var rr=function(t){ai(e,t);function e(r){return r===void 0&&(r="Illegal state"),t.call(this,"[mobx-state-tree] ".concat(r))||this}return e}(Error);function zO(t){return t}var qO=Number.isInteger;function UO(t){return Number(t)===t&&t%1!==0}function HO(t){return Number.isFinite(t)}function n7(t){return Array.isArray(t)||Hu(t)}function i7(t){return t?n7(t)?t:[t]:vd}function $O(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=0;n<e.length;n++){var i=e[n];for(var a in i)t[a]=i[a]}return t}function nd(t){var e;if(t===null||typeof t!="object")return!1;var r=Object.getPrototypeOf(t);return r==null?!0:((e=r.constructor)===null||e===void 0?void 0:e.toString())===BO}function a7(t){return t!==null&&typeof t=="object"&&!(t instanceof Date)&&!(t instanceof RegExp)}function _p(t,e){return e===void 0&&(e=!0),t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||e&&t instanceof Date}function o7(t){return typeof t!="function"}function GO(t,e,r){iu(t)?F6(t,e,r):Object.defineProperty(t,e,r)}function eh(t,e,r){GO(t,e,{enumerable:!1,writable:!1,configurable:!0,value:r})}var WO=function(){function t(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(t.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this;return r===void 0&&(r=!1),r?this.handlers.unshift(e):this.handlers.push(e),function(){n.unregister(e)}}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.handlers.indexOf(e)>=0}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.handlers.indexOf(e);r>=0&&this.handlers.splice(r,1)}}),Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(t.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=this.handlers.slice();n.forEach(function(i){return i.apply(void 0,lh([],wf(e),!1))})}}),t}(),s7=function(){function t(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(t.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.eventHandlers&&this.eventHandlers[e];return!!r&&r.hasSubscribers}}),Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[e];return i||(i=this.eventHandlers[e]=new WO),i.register(r,n)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.eventHandlers&&this.eventHandlers[e];return!!n&&n.has(r)}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r){var n=this.eventHandlers&&this.eventHandlers[e];n&&n.unregister(r)}}),Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.eventHandlers&&delete this.eventHandlers[e]}}),Object.defineProperty(t.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(t.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this.eventHandlers&&this.eventHandlers[e];a&&(r=a).emit.apply(r,lh([],wf(n),!1))}}),t}();function VO(t){for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=t[r];return e}function t2(t,e){return t.indexOf(e)===0}function YO(t){console.warn(new Error("[mobx-state-tree] ".concat(t)))}function XO(){return typeof process<"u"&&A3&&A3.ENABLE_TYPE_CHECK==="true"}function KO(t){if(!("oldValue"in t))throw new rr("Patches without `oldValue` field cannot be inversed");return[ZO(t),QO(t)]}function ZO(t){switch(t.op){case"add":return{op:"add",path:t.path,value:t.value};case"remove":return{op:"remove",path:t.path};case"replace":return{op:"replace",path:t.path,value:t.value}}}function QO(t){switch(t.op){case"add":return{op:"remove",path:t.path};case"remove":return{op:"add",path:t.path,value:t.oldValue};case"replace":return{op:"replace",path:t.path,value:t.oldValue}}}function JO(t){return typeof t=="number"}function th(t){return JO(t)===!0?""+t:t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function eC(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function C3(t){if(t.length===0)return"";var e=function(r){return r.map(th).join("/")};return t[0]==="."||t[0]===".."?e(t):"/"+e(t)}function l7(t){var e=t.split("/").map(eC),r=t===""||t==="."||t===".."||t2(t,"/")||t2(t,"./")||t2(t,"../");if(!r)throw new rr("a json path must be either rooted, empty or relative, but got '".concat(t,"'"));return e[0]===""&&e.shift(),e}var r2=Symbol("$preProcessorFailed"),tC=function(t){ai(e,t);function e(r,n,i){var a=t.call(this,i||r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|an.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(e.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._processors.preProcessor?this._processors.preProcessor.call(null,r):r}}),Object.defineProperty(e.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(r){try{return this.preProcessSnapshot(r)}catch{return r2}}}),Object.defineProperty(e.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,r,n.storedValue):r}}),Object.defineProperty(e.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;rC(r.type,this,"create"),r instanceof Is&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},xC(this._subtype)||(r.getReconciliationType=function(){return n})}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Di(a)?a:this.preProcessSnapshot(a),s=this._subtype.instantiate(r,n,i,o);return this._fixNode(s),s}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this._subtype.reconcile(r,Di(n)?n:this.preProcessSnapshot(n),i,a);return o!==r&&this._fixNode(o),o}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=!0);var i=this._subtype.getSnapshot(r);return n?this.postProcessSnapshot(i,r):i}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.preProcessSnapshotSafe(r);return i===r2?Ds(n,r,"Failed to preprocess value"):this._subtype.validate(i,n)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=bc(r)?this._subtype:Di(r)?Ru(r,!1):this.preProcessSnapshotSafe(r);return n===r2?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!(this._subtype instanceof gd))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),e}(yc);function rC(t,e){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=op(i),s=o.next();!s.done;s=o.next()){var u=s.value;t[u]=e[u].bind(e)}}catch(h){r={error:h}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}function nC(t,e,r){return new tC(t,e,r)}var L3="Map.put can only be used to store complex values that have an identifier type attribute";function u7(t,e){var r,n,i=t.getSubTypes();if(i===Q8)return!1;if(i){var a=i7(i);try{for(var o=op(a),s=o.next();!s.done;s=o.next()){var u=s.value;if(!u7(u,e))return!1}}catch(h){r={error:h}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}return t instanceof xp&&e.push(t),!0}var uf;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.YES=1]="YES",t[t.NO=2]="NO"})(uf||(uf={}));var iC=function(t){ai(e,t);function e(r,n){return t.call(this,r,Xr.ref.enhancer,n)||this}return Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return t.prototype.get.call(this,""+r)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return t.prototype.has.call(this,""+r)}}),Object.defineProperty(e.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return t.prototype.delete.call(this,""+r)}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return t.prototype.set.call(this,""+r,n)}}),Object.defineProperty(e.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!r)throw new rr("Map.put cannot be used to set empty values");if(Di(r)){var n=Br(r);if(n.identifier===null)throw new rr(L3);return this.set(n.identifier,r),r}else if(a7(r)){var i=Br(this),a=i.type;if(a.identifierMode!==uf.YES)throw new rr(L3);var o=a.mapIdentifierAttribute,s=r[o];if(!oy(s)){var u=this.put(a.getChildType().create(r,i.environment));return this.put(Ru(u))}var h=Ip(s);return this.set(h,r),this.get(h)}else throw new rr("Map.put can only be used to store complex values")}}),e}(Hm),w0=function(t){ai(e,t);function e(r,n,i){i===void 0&&(i=[]);var a=t.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:uf.UNKNOWN}),Object.defineProperty(a,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Map}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a._determineIdentifierMode(),a.hookInitializers=i,a}return Object.defineProperty(e.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new e(this.name,this._subType,n)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._determineIdentifierMode(),ay(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===uf.UNKNOWN){var r=[];if(u7(this._subType,r)){var n=r.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw new rr("The objects in a map should all have the same identifier attribute, expected '".concat(i,"', but child of type '").concat(a.name,"' declared attribute '").concat(a.identifierAttribute,"' as identifier"));return a.identifierAttribute},void 0);n?(this.identifierMode=uf.YES,this.mapIdentifierAttribute=n):this.identifierMode=uf.NO}}}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type._subType,a={};return Object.keys(n).forEach(function(o){a[o]=i.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new iC(r,this.name)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){M6(n,r.unbox);var i=r.type;i.hookInitializers.forEach(function(a){var o=a(n);Object.keys(o).forEach(function(s){var u=o[s],h=wp(n,s,u);eh(n,s,h)})}),zm(n,this.willChange),qm(n,this.didChange)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return j6(r.storedValue)}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r.storedValue.get(""+n);if(!i)throw new rr("Not a child "+n);return i}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Br(r.object),i=r.name;n.assertWritable({subpath:i});var a=n.type,o=a._subType;switch(r.type){case"update":{var s=r.newValue,u=r.object.get(i);if(s===u)return null;mc(o,s),r.newValue=o.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":mc(o,r.newValue),r.newValue=o.instantiate(n,i,void 0,r.newValue),a.processIdentifier(i,r.newValue);break}return r}}),Object.defineProperty(e.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.identifierMode===uf.YES&&n instanceof Is){var i=n.identifier;if(i!==r)throw new rr("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(i,"', but expected: '").concat(r,"'"))}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return r.getChildren().forEach(function(i){n[i.subpath]=i.snapshot}),n}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),n}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Br(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:th(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:th(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:th(r.name),oldValue:i},n)}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue;switch(i.op){case"add":case"replace":a.set(n,i.value);break;case"remove":a.delete(n);break}}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){mc(this,n);var i=r.storedValue,a={};if(Array.from(i.keys()).forEach(function(s){a[s]=!1}),n)for(var o in n)i.set(o,n[o]),a[""+o]=!0;Object.keys(a).forEach(function(s){a[s]===!1&&i.delete(s)})}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return nd(r)?H0(Object.keys(r).map(function(a){return i._subType.validate(r[a],iy(n,a,i._subType))})):Ds(n,r,"Value is not a plain object")}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return md}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),e}(gd);w0.prototype.applySnapshot=Qr(w0.prototype.applySnapshot);function aC(t){return new w0("Map<string, ".concat(t.name,">"),t)}var _0=function(t){ai(e,t);function e(r,n,i){i===void 0&&(i=[]);var a=t.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Array}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a.hookInitializers=i,a}return Object.defineProperty(e.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new e(this.name,this._subType,n)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return ay(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=[]);var i=r.type._subType,a={};return n.forEach(function(o,s){var u=""+s;a[u]=i.instantiate(r,u,void 0,o)}),a}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Uu(Uu({},$0),{name:this.name});return Xr.array(r7(r),n)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){qu(n).dehancer=r.unbox;var i=r.type;i.hookInitializers.forEach(function(a){var o=a(n);Object.keys(o).forEach(function(s){var u=o[s],h=wp(n,s,u);eh(n,s,h)})}),zm(n,this.willChange),qm(n,this.didChange)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue.slice()}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=Number(n);if(i<r.storedValue.length)return r.storedValue[i];throw new rr("Not a child: "+n)}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Br(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=N3(n,i,[a[r.index]],[r.newValue],[r.index]);if(!o)return null;r.newValue=o[0]}break;case"splice":{var s=r.index,u=r.removedCount,h=r.added,f=N3(n,i,a.slice(s,s+u),h,h.map(function(v,p){return s+p}));if(!f)return null;r.added=f;for(var g=s+u;g<a.length;g++)a[g].setParent(n,""+(g+h.length-u))}break}return r}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=[];return Object.keys(r).forEach(function(i){n.push(r[i].getSnapshot())}),n}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Br(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:""+r.index,value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"splice":if(r.removedCount&&r.addedCount===r.object.length)return void n.emitPatch({op:"replace",path:"",value:n.snapshot,oldValue:r.removed.map(function(a){return a.snapshot})},n);for(var i=r.removedCount-1;i>=0;i--)n.emitPatch({op:"remove",path:""+(r.index+i),oldValue:r.removed[i].snapshot},n);for(var i=0;i<r.addedCount;i++)n.emitPatch({op:"add",path:""+(r.index+i),value:r.added[i].snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue,o=n==="-"?a.length:Number(n);switch(i.op){case"replace":a[o]=i.value;break;case"add":a.splice(o,0,i.value);break;case"remove":a.splice(o,1);break}}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){mc(this,n);var i=r.storedValue;i.replace(n)}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return n7(r)?H0(r.map(function(a,o){return i._subType.validate(a,iy(n,""+o,i._subType))})):Ds(n,r,"Value is not an array")}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return vd}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),e}(gd);_0.prototype.applySnapshot=Qr(_0.prototype.applySnapshot);function oC(t){return new _0("".concat(t.name,"[]"),t)}function N3(t,e,r,n,i){for(var a=!0,o=0;;o++){var s=o<=n.length-1,u=r[o],h=s?n[o]:void 0,f=""+i[o];if(jO(h)&&(h=h.storedValue),!u&&!s)break;if(!s)a=!1,r.splice(o,1),u instanceof Is&&u.createObservableInstanceIfNeeded(),u.die(),o--;else if(u)if(T3(u,h))r[o]=n2(e,t,f,h,u);else{for(var v=void 0,p=o;p<r.length;p++)if(T3(r[p],h)){v=r.splice(p,1)[0];break}a=!1;var g=n2(e,t,f,h,v);r.splice(o,0,g)}else{if(Di(h)&&Br(h).parent===t)throw new rr("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(t.path,"/").concat(f,"', but it lives already at '").concat(Br(h).path,"'"));a=!1;var g=n2(e,t,f,h);r.splice(o,0,g)}}return a?null:r}function n2(t,e,r,n,i){mc(t,n);function a(){if(Di(n)){var s=Br(n);if(s.assertAlive(md),s.parent!==null&&s.parent===e)return s.setParent(e,r),s}return i?t.reconcile(i,n,e,r):t.instantiate(e,r,void 0,n)}var o=a();return i&&i!==o&&(i instanceof Is&&i.createObservableInstanceIfNeeded(),i.die()),o}function T3(t,e){if(!t.isAlive)return!1;if(Di(e)){var r=Br(e);return r.isAlive&&r===t}if(t.snapshot===e)return!0;if(!(t instanceof Is))return!1;var n=t.getReconciliationType();return t.identifier!==null&&t.identifierAttribute&&nd(e)&&n.is(e)&&n.isMatchingSnapshotId(t,e)}var R3="preProcessSnapshot",M3="postProcessSnapshot";function sC(){return Br(this).toString()}var I3={name:"AnonymousModel",properties:{},initializers:vd};function lC(t){var e=Object.keys(t),r=new Set;return e.forEach(function(n){if(r.has(n))throw new rr("".concat(n," is declared twice in the model. Model should not contain the same keys"));r.add(n)}),e.reduce(function(n,i){if(i in ja)throw new rr("Hook '".concat(i,"' was defined as property. Hooks should be defined as part of the actions"));var a=Object.getOwnPropertyDescriptor(t,i);if("get"in a)throw new rr("Getters are not supported as properties. Please use views instead");var o=a.value;if(o==null)throw new rr("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(_p(o))n[i]=rh(gC(o),o);else if(o instanceof w0)n[i]=rh(o,{});else if(o instanceof _0)n[i]=rh(o,[]);else if(!bc(o))throw new rr("Invalid type definition for property '".concat(i,"', cannot infer a type from a value like '").concat(o,"' (").concat(typeof o,")"));return n},Uu({},t))}var xp=function(t){ai(e,t);function e(r){var n=t.call(this,r.name||I3.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Object}),Object.defineProperty(n,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({name:i})}}),Object.defineProperty(n,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(i){return n.cloneAndEnhance({properties:i})}}),Object.defineProperty(n,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=n.preProcessor;return a?n.cloneAndEnhance({preProcessor:function(o){return a(i(o))}}):n.cloneAndEnhance({preProcessor:i})}}),Object.defineProperty(n,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(i){var a=n.postProcessor;return a?n.cloneAndEnhance({postProcessor:function(o){return i(a(o))}}):n.cloneAndEnhance({postProcessor:i})}}),Object.assign(n,I3,r),n.properties=lC(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(e.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=void 0;return this.forAllProps(function(n,i){if(i.flags&an.Identifier){if(r)throw new rr("Cannot define property '".concat(n,"' as object identifier, property '").concat(r,"' is already defined as identifier property"));r=n}}),r}}),Object.defineProperty(e.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new e({name:r.name||this.name,properties:Object.assign({},this.properties,r.properties),initializers:this.initializers.concat(r.initializers||[]),preProcessor:r.preProcessor||this.preProcessor,postProcessor:r.postProcessor||this.postProcessor})}}),Object.defineProperty(e.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateActions(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!nd(n))throw new rr("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===R3)throw new rr("Cannot define action '".concat(R3,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(i===M3)throw new rr("Cannot define action '".concat(M3,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var a=n[i],o=r[i];if(i in ja&&o){var s=a;a=function(){o.apply(null,arguments),s.apply(null,arguments)}}var u=a.$mst_middleware,h=a.bind(n);h._isFlowAction=a._isFlowAction||!1,h.$mst_middleware=u;var f=wp(r,i,h);n[i]=f,eh(r,i,f)})}}),Object.defineProperty(e.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw new rr("You passed an ".concat(typeof r," to volatile state as an argument, when function is expected"));var i=function(a){return n.instantiateVolatileState(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!nd(n))throw new rr("volatile state initializer should return a plain object containing state");D6(r,n)}}),Object.defineProperty(e.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){var o=r(a),s=o.actions,u=o.views,h=o.state,f=pO(o,["actions","views","state"]);for(var g in f)throw new rr("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(g,"'"));return h&&n.instantiateVolatileState(a,h),u&&n.instantiateViews(a,u),s&&n.instantiateActions(a,s),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateViews(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(e.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!nd(n))throw new rr("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(i){var a,o=Object.getOwnPropertyDescriptor(n,i);if("get"in o)F6(r,i,o),z6(r,(a={},a[i]=dh,a));else if(typeof o.value=="function")eh(r,i,o.value);else throw new rr("A view member should either be a function or getter based property")})}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Di(a)?a:this.applySnapshotPreProcessor(a);return ay(this,r,n,i,o)}}),Object.defineProperty(e.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type,a={};return i.forAllProps(function(o,s){a[o]=s.instantiate(r,o,void 0,n[o])}),a}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Uu(Uu({},$0),{name:this.name});return Xr.object(r,md,n)}}),Object.defineProperty(e.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){eh(n,"toString",sC),this.forAllProps(function(i){M6(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),zm(n,this.willChange),qm(n,this.didChange)}}),Object.defineProperty(e.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Br(n.object),a=n.name;i.assertWritable({subpath:a});var o=i.type.properties[a];return o&&(mc(o,n.newValue),n.newValue=o.reconcile(i.getChildNode(a),n.newValue,i,a)),n}}),Object.defineProperty(e.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Br(n.object),a=i.type.properties[n.name];if(a){var o=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:th(n.name),value:n.newValue.snapshot,oldValue:o},i)}}}),Object.defineProperty(e.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=[];return this.forAllProps(function(a){i.push(n.getChildNode(r,a))}),i}}),Object.defineProperty(e.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i;if(!(n in this.properties))throw new rr("Not a value property: "+n);var a=qu(r.storedValue,n),o=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!o)throw new rr("Node not available for property "+n);return o}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={};return this.forAllProps(function(o,s){try{var u=hd(r.storedValue,o);u.reportObserved()}catch{throw new rr("".concat(o," property is declared twice"))}a[o]=i.getChildNode(r,o).snapshot}),n?this.applySnapshotPostProcessor(a):a}}),Object.defineProperty(e.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(e.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){if(!(i.op==="replace"||i.op==="add"))throw new rr("object does not support operation ".concat(i.op));r.storedValue[n]=i.value}}),Object.defineProperty(e.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){mc(this,n);var i=this.applySnapshotPreProcessor(n);this.forAllProps(function(a){r.storedValue[a]=i[a]})}}),Object.defineProperty(e.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.preProcessor;return n?n.call(null,r):r}}),Object.defineProperty(e.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.postProcessor;return n?n.call(null,r):r}}),Object.defineProperty(e.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.properties[r]}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.applySnapshotPreProcessor(r);return nd(a)?H0(this.propertyNames.map(function(o){return i.properties[o].validate(a[o],iy(n,o,i.properties[o]))})):Ds(n,a,"Value is not a plain object")}}),Object.defineProperty(e.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.propertyNames.forEach(function(i){return r(i,n.properties[i])})}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;return"{ "+this.propertyNames.map(function(n){return n+": "+r.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(e.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return md}}),Object.defineProperty(e.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),e}(gd);xp.prototype.applySnapshot=Qr(xp.prototype.applySnapshot);function uC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=typeof t[0]=="string"?t.shift():"AnonymousModel",n=t.shift()||{};return new xp({name:r,properties:n})}function cC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=typeof t[0]=="string",n=r?t[0]:"AnonymousModel";return r&&t.shift(),t.reduce(function(i,a){return i.cloneAndEnhance({name:i.name+"_"+a.name,properties:a.properties,initializers:a.initializers,preProcessor:function(o){return a.applySnapshotPreProcessor(i.applySnapshotPreProcessor(o))},postProcessor:function(o){return a.applySnapshotPostProcessor(i.applySnapshotPostProcessor(o))}})}).named(n)}function fC(t){return bc(t)&&(t.flags&an.Object)>0}var Sc=function(t){ai(e,t);function e(r,n,i,a){a===void 0&&(a=zO);var o=t.call(this,r)||this;return Object.defineProperty(o,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:a}),o.flags=n,o}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Lf(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.initializer(r)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(_p(r)&&this.checker(r))return js();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return Ds(n,r,"Value is not a ".concat(i))}}),e}(_h),c7=new Sc("string",an.String,function(t){return typeof t=="string"}),f7=new Sc("number",an.Number,function(t){return typeof t=="number"}),hC=new Sc("integer",an.Integer,function(t){return qO(t)}),dC=new Sc("float",an.Float,function(t){return UO(t)}),pC=new Sc("finite",an.Finite,function(t){return HO(t)}),h7=new Sc("boolean",an.Boolean,function(t){return typeof t=="boolean"}),d7=new Sc("null",an.Null,function(t){return t===null}),p7=new Sc("undefined",an.Undefined,function(t){return t===void 0}),g7=new Sc("Date",an.Date,function(t){return typeof t=="number"||t instanceof Date},function(t){return t instanceof Date?t:new Date(t)});g7.getSnapshot=function(t){return t.storedValue.getTime()};var v7=g7;function gC(t){switch(typeof t){case"string":return c7;case"number":return f7;case"boolean":return h7;case"object":if(t instanceof Date)return v7}throw new rr("Cannot determine primitive type from value "+t)}function vC(t){return bc(t)&&(t.flags&(an.String|an.Number|an.Integer|an.Boolean|an.Date))>0}var mC=function(t){ai(e,t);function e(r){var n=t.call(this,JSON.stringify(r))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Literal}),n.value=r,n}return Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Lf(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return _p(r)&&r===this.value?js():Ds(n,r,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),e}(_h);function m7(t){return new mC(t)}var yC=function(t){ai(e,t);function e(r,n,i,a){var o=t.call(this,r)||this;return Object.defineProperty(o,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"_message",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|an.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this._subtype.validate(r,n);if(i.length>0)return i;var a=Di(r)?Br(r).snapshot:r;return this._predicate(a)?js():Ds(n,r,this._message(r))}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,n,i,a)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),e}(yc);function bC(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=typeof t[0]=="string"?t.shift():bc(t[0])?t[0].name:null,n=t[0],i=t[1],a=t[2]?t[2]:function(o){return"Value does not respect the refinement predicate"};return new yC(r,n,i,a)}function wC(t,e){var r=typeof t=="string"?e:t,n=G0.apply(void 0,lh([],wf(r.map(function(i){return m7(""+i)})),!1));return typeof t=="string"&&(n.name=t),n}var _C=function(t){ai(e,t);function e(r,n,i){var a=t.call(this,r)||this;return Object.defineProperty(a,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=Uu({eager:!0,dispatcher:void 0},i),a._dispatcher=i.dispatcher,i.eager||(a._eager=!1),a}return Object.defineProperty(e.prototype,"flags",{get:function(){var r=an.Union;return this._types.forEach(function(n){r|=n.flags}),r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._types.some(function(n){return n.isAssignableFrom(r)})}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(r){return r.describe()}).join(" | ")+")"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(a,void 0);if(!o)throw new rr("No matching type for union "+this.describe());return o.instantiate(r,n,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.determineType(n,r.getReconciliationType());if(!o)throw new rr("No matching type for union "+this.describe());return o.reconcile(r,n,i,a)}}),Object.defineProperty(e.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._dispatcher?this._dispatcher(r):n?n.is(r)?n:this._types.filter(function(i){return i!==n}).find(function(i){return i.is(r)}):this._types.find(function(i){return i.is(r)})}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._dispatcher)return this._dispatcher(r).validate(r,n);for(var i=[],a=0,o=0;o<this._types.length;o++){var s=this._types[o],u=s.validate(r,n);if(u.length===0){if(this._eager)return js();a++}else i.push(u)}return a===1?js():Ds(n,r,"No type is applicable for the union").concat(H0(i))}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),e}(yc);function G0(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=bc(t)?void 0:t,i=bc(t)?lh([t],wf(e),!1):e,a="("+i.map(function(o){return o.name}).join(" | ")+")";return new _C(a,i,n)}function xC(t){return bc(t)&&(t.flags&an.Union)>0}var SC=function(t){ai(e,t);function e(r,n,i){var a=t.call(this,r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),a}return Object.defineProperty(e.prototype,"flags",{get:function(){return this._subtype.flags|an.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(this.optionalValues.indexOf(a)>=0){var o=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(r,n,i,o)}return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),i,a)}}),Object.defineProperty(e.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&mc(this,r),r}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?js():this._subtype.validate(r,n)}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),e}(yc);function EC(t,e){if(typeof e!="function"&&Di(e))throw new rr("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function rh(t,e,r){return EC(t,e),new SC(t,e,r||kC)}var kC=[void 0],AC=rh(p7,void 0),PC=rh(d7,null);function y7(t){return G0(t,AC)}function OC(t){return G0(t,PC)}var CC=function(t){ai(e,t);function e(r,n){var i=t.call(this,r)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(e.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|an.Late},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._subType){var n=void 0;try{n=this._definition()}catch(i){if(i instanceof ReferenceError)n=void 0;else throw i}if(r&&n===void 0)throw new rr("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).instantiate(r,n,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).reconcile(r,n,i,a)}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r?r.name:"<uknown late type>"}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.getSubType(!1);return i?i.validate(r,n):js()}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getSubType(!1);return n?n.isAssignableFrom(r):!1}}),Object.defineProperty(e.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r||Q8}}),e}(yc);function LC(t,e){var r=typeof t=="string"?t:"late(".concat(t.toString(),")"),n=typeof t=="string"?e:t;return new CC(r,n)}function NC(t,e){return new TC(t,e)}var TC=function(t){ai(e,t);function e(r,n){var i=t.call(this,r)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:Xr.array()}),h5(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(Qr(function(a){i.loadedType=a,i.pendingNodeList.forEach(function(o){o.parent&&i.loadedType&&o.parent.applyPatches([{op:"replace",path:"/".concat(o.subpath),value:o.snapshot}])})}))}),i}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this;if(this.loadedType)return this.loadedType.instantiate(r,n,i,a);var s=Lf(this,r,n,i,a);return this.pendingNodeList.push(s),h5(function(){return!s.isAlive},function(){return o.pendingNodeList.splice(o.pendingNodeList.indexOf(s),1)}),s}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.loadedType?this.loadedType.validate(r,n):o7(r)?js():Ds(n,r,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.loadedType?(r.die(),this.loadedType.instantiate(i,a,i.environment,n)):t.prototype.reconcile.call(this,r,n,i,a)}}),e}(_h),b7=function(t){ai(e,t);function e(r){var n=t.call(this,r?"frozen(".concat(r.name,")"):"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Frozen}),n}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return Lf(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return o7(r)?this.subType?this.subType.validate(r,n):js():Ds(n,r,"Value is not serializable and cannot be frozen")}}),e}(_h),j3=new b7;function RC(t){return arguments.length===0?j3:bc(t)?new b7(t):rh(j3,t)}function MC(t){switch(t){case ja.beforeDestroy:return"destroy";case ja.beforeDetach:return"detach";default:return}}var IC=function(){function t(e,r){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),oy(e))this.identifier=e;else if(Di(e)){var n=Br(e);if(!n.identifierAttribute)throw new rr("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw new rr("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new rr("Can only store references to tree nodes or identifiers, got: '".concat(e,"'"))}return Object.defineProperty(t.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=Ip(this.identifier),n=e.root,i=n.identifierCache.getLastCacheModificationPerId(r);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var a=this.targetType,o=n.identifierCache.resolve(a,r);if(!o)throw new jC("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(e.path,")"));this.resolvedReference={node:o,lastCacheModification:i}}}}),Object.defineProperty(t.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),t}(),jC=function(t){ai(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return e}(Error),w7=function(t){ai(e,t);function e(r,n){var i=t.call(this,"reference(".concat(r.name,")"))||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Reference}),i}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.targetType.isAssignableFrom(r)}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return oy(r)?js():Ds(n,r,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(e.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=n.parent;if(!(!o||!o.isAlive)){var s=o.storedValue;s&&this.onInvalidated({cause:r,parent:s,invalidTarget:a?a.storedValue:void 0,invalidId:i,replaceRef:function(u){P3(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){fC(o.type)?this.replaceRef(void 0):P3(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(e.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.getValue(r);if(a){var o=Br(a),s=function(f,g){var v=MC(g);v&&i.fireInvalidated(v,r,n,o)},u=o.registerHook(ja.beforeDetach,s),h=o.registerHook(ja.beforeDestroy,s);return function(){u(),h()}}}}),Object.defineProperty(e.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=this;if(this.onInvalidated){var o;r.registerHook(ja.beforeDestroy,function(){o&&o()});var s=function(u){o&&o();var h=r.parent,f=h&&h.storedValue;if(h&&h.isAlive&&f){var g=void 0;i?g=!!i.get(n,f):g=r.root.identifierCache.has(a.targetType,Ip(n)),g?o=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===wo.FINALIZED?s(!0):(r.isRoot||r.root.registerHook(ja.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(ja.afterAttach,function(){s(!1)}))}}}),e}(_h),DC=function(t){ai(e,t);function e(r,n){return t.call(this,r,n)||this}return Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=r.storedValue;return n.resolvedValue}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r.storedValue;return n.identifier}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Di(a)?yO(a):a,s=new IC(a,this.targetType),u=Lf(this,r,n,i,s);return s.node=u,this.watchTargetNodeForInvalidations(u,o,void 0),u}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this){var o=Di(n),s=r.storedValue;if(!o&&s.identifier===n||o&&s.resolvedValue===n)return r.setParent(i,a),r}var u=this.instantiate(i,a,void 0,n);return r.die(),u}}),e}(w7),FC=function(t){ai(e,t);function e(r,n,i){var a=t.call(this,r,i)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(e.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=this.options.get(r.storedValue,r.parent?r.parent.storedValue:null);return n}}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Di(a)?this.options.set(a,r?r.storedValue:null):a,s=Lf(this,r,n,i,o);return this.watchTargetNodeForInvalidations(s,o,this.options),s}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=Di(n)?this.options.set(n,r?r.storedValue:null):n;if(!r.isDetaching&&r.type===this&&r.storedValue===o)return r.setParent(i,a),r;var s=this.instantiate(i,a,void 0,o);return r.die(),s}}),e}(w7);function _7(t,e){var r=e||void 0,n=e?e.onInvalidated:void 0;return r&&(r.get||r.set)?new FC(t,{get:r.get,set:r.set},n):new DC(t,n)}function BC(t,e){var r=_7(t,Uu(Uu({},e),{onInvalidated:function(n){e&&e.onInvalidated&&e.onInvalidated(n),n.removeRef()}}));return e&&e.acceptsUndefined===!1?r:y7(r)}var x7=function(t){ai(e,t);function e(r,n){var i=t.call(this,r)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Identifier}),i}return Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r||!(r.type instanceof xp))throw new rr("Identifier types can only be instantiated as direct child of a model type");return Lf(this,r,n,i,a)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(r.storedValue!==n)throw new rr("Tried to change identifier from '".concat(r.storedValue,"' to '").concat(n,"'. Changing identifiers is not allowed."));return r.setParent(i,a),r}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return typeof r!==this.validType?Ds(n,r,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):js()}}),e}(_h),zC=function(t){ai(e,t);function e(){var r=t.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Identifier}),r}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),e}(x7),qC=function(t){ai(e,t);function e(){return t.call(this,"identifierNumber","number")||this}return Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),e}(x7),UC=new zC,HC=new qC;function Ip(t){return""+t}function oy(t){return typeof t=="string"||typeof t=="number"}function $C(t){return new GC(t)}var GC=function(t){ai(e,t);function e(r){var n=t.call(this,r.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:an.Custom}),n}return Object.defineProperty(e.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(e.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.options.isTargetType(r))return js();var i=this.options.getValidationMessage(r);return i?Ds(n,r,"Invalid value for type '".concat(this.name,"': ").concat(i)):js()}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.options.toSnapshot(r.storedValue)}}),Object.defineProperty(e.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=this.options.isTargetType(a)?a:this.options.fromSnapshot(a,r&&r.root.environment);return Lf(this,r,n,i,o)}}),Object.defineProperty(e.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var o=!this.options.isTargetType(n);if(!r.isDetaching){var s=r.type===this&&(o?n===r.snapshot:n===r.storedValue);if(s)return r.setParent(i,a),r}var u=o?this.options.fromSnapshot(n,i.root.environment):n,h=this.instantiate(i,a,void 0,u);return r.die(),h}}),e}(_h),Zt={enumeration:wC,model:uC,compose:cC,custom:$C,reference:_7,safeReference:BC,union:G0,optional:rh,literal:m7,maybe:y7,maybeNull:OC,refinement:bC,string:c7,boolean:h7,number:f7,integer:hC,float:dC,finite:pC,Date:v7,map:aC,array:oC,frozen:RC,identifier:UC,identifierNumber:HC,late:LC,lazy:NC,undefined:p7,null:d7,snapshotProcessor:nC};function S7({oldText:t,newText:e,element:r}){if(!(e.length/Math.max(20,t.length)>=4))return r.fontSize;const n=r.width*r.page.computedHeight/e.length,i=1.5*Math.sqrt(n),a=r.fontSize;return Math.min(a,Math.max(5,Math.round(i)))}function D3(t){const{r:e,g:r,b:n}=or.Util.colorToRGBA(t);return(e*299+r*587+n*114)/1e3}function E7(t){const{outlineSize:e,outlineColor:r}=function(a){const o=a.strokeWidth||0;return o>0?{outlineSize:o,outlineColor:a.stroke}:{outlineSize:a.shadowEnabled&&a.shadowBlur>0&&a.shadowOpacity>.1?a.shadowBlur*a.shadowOpacity:0,outlineColor:a.shadowColor}}(t);if(e<.001)return t.fill;const n=D3(t.fill),i=D3(r);return Math.abs(n-i)>=50?r:t.fill}let Gf;function WC(){return Gf||(Gf=document.getElementById("polotno-text-style"),Gf||(Gf=document.createElement("style"),Gf.id="polotno-text-style",document.head.appendChild(Gf)),Gf)}or._fixTextRendering=!0;const F3={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 VC(t){var e="֑-߿יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+e+"]*?["+e+"]").test(t)}function YC(t){t=t.replace(/\s/g,"");let e=0;for(var r=0;r<t.length;r++)VC(t[r])&&(e+=1);return e>t.length/2}function W0(t){return YC(t)?"rtl":"ltr"}const XC=ni(({textNodeRef:t,element:e,onBlur:r,selectAll:n,cursorPosition:i})=>{const[a,o]=se.useState(F3),s=t.current;se.useLayoutEffect(()=>{const v={};v.width=s.width()-2*s.padding()+"px",v.height=s.height()-2*s.padding()+s.fontSize()*s.lineHeight()+"px",v.fontSize=s.fontSize()+"px",v.lineHeight=s.lineHeight()+.01,v.fontFamily=s.fontFamily(),v.textAlign=s.align(),v.color=s.fill(),v.fontWeight=e.fontWeight,v.fontStyle=e.fontStyle,v.letterSpacing=e.letterSpacing+"em",v.opacity=Math.max(e.a.opacity,.2),v.textTransform=e.textTransform,v.caretColor=E7(e);const p=`
|
|
101
|
-
.polotno-input::placeholder {
|
|
102
|
-
color: ${a.color};
|
|
103
|
-
opacity: 0.6;
|
|
104
|
-
}
|
|
105
|
-
`,y=WC();y.innerHTML="",y.appendChild(document.createTextNode(p)),JSON.stringify(v)!==JSON.stringify(a)&&o(v)});const u=se.useRef(null);se.useLayoutEffect(()=>{var v;const p=u.current;if(!p)return;(v=u.current)===null||v===void 0||v.focus();const y=i||p.value.length;p.selectionStart=p.selectionEnd=y,n&&(p?.select(),document.execCommand("selectAll",!1,null))},[]),se.useEffect(()=>{window.addEventListener("blur",r);const v=p=>{var y;!((y=u.current)===null||y===void 0)&&y.contains(p.target)||r()};return window.addEventListener("touchstart",v),()=>{window.removeEventListener("blur",r),window.removeEventListener("touchstart",v)}},[]);let h=0;const f=s.textArr.length*s.lineHeight()*s.fontSize();e.verticalAlign==="middle"&&(h=(e.a.height-f)/2),e.verticalAlign==="bottom"&&(h=e.a.height-f);const g=ns(e.text);return se.createElement("textarea",{className:"polotno-input",ref:u,dir:W0(g),style:Object.assign(Object.assign(Object.assign({},F3),a),{paddingTop:h+"px"}),value:g,onChange:v=>{const p=S7({oldText:e.text,newText:v.target.value,element:e});e.set({text:v.target.value,fontSize:p})},placeholder:e.placeholder,onBlur:r})}),KC=t=>se.createElement(m0,null,se.createElement(XC,Object.assign({},t))),k7=(t,e)=>{const[r,n]=se.useReducer(o=>o+1,0),i=se.useRef(S3(e)),a=se.useRef(null);return se.useLayoutEffect(()=>{if(i.current=S3(e),i.current)return;let o=!0;return(async()=>{i.current=!1,n();const s=pd(`text ${e}`);await t.loadFont(e),o?(a.current=s,i.current=!0,n()):s()})(),()=>{a.current&&(a.current(),a.current=null),o=!1}},[e]),se.useEffect(()=>{i.current&&setTimeout(()=>{a.current&&(a.current(),a.current=null)},100)},[i.current]),[i.current]},A7=({fontLoaded:t,fontFamily:e,fontSize:r,lineHeight:n})=>se.useMemo(()=>{if(typeof n=="number")return n;const i=document.createElement("div");i.style.fontFamily=e,i.style.fontSize=r+"px",i.style.lineHeight=n,i.innerText="Test text",document.body.appendChild(i);const a=i.offsetHeight;return document.body.removeChild(i),a/r},[t,e,r,n]);function P7(t){const e=se.useRef(t),r=se.useRef(t);return se.useMemo(()=>{r.current=e.current,e.current=t},[t]),r.current}function uh(t,e,r,n){const i=Math.max(-.9999,Math.min(.9999,r));if(Math.abs(i)<1e-4)return`M 0 ${e/2} L ${t} ${e/2}`;const a=5*n/(2*Math.abs(i))-n,o=t/2;if(i>0){const s=2*a+n/2;return[`M ${o} ${s}`,`A ${a} ${a} 0 1 1 ${o} ${s-2*a}`,`A ${a} ${a} 0 1 1 ${o} ${s}`].join(" ")}{const s=-(2*a-Math.round(e))-n/2;return[`M ${o} ${s}`,`A ${a} ${a} 0 1 0 ${o} ${s+2*a}`,`A ${a} ${a} 0 1 0 ${o} ${s}`].join(" ")}}const ZC=ni(({element:t,store:e})=>{const r=se.useRef(null),n=se.useRef(null),i=se.useRef(null),{editorEnabled:a,selectAll:o}=(q=>{const[J,ae]=se.useState(!1),ie=se.useRef(!1);return se.useEffect(()=>{var Z=!0;return setTimeout(()=>{Z&&(q._editModeEnabled&&(ie.current=!0),ae(!0),setTimeout(()=>{ie.current=!1},50))},50),()=>{Z=!1}},[]),{editorEnabled:J&&q._editModeEnabled,selectAll:ie.current}})(t),[s,u]=se.useState(!1),h=se.useRef(t.a.height),f=e.selectedShapes.indexOf(t)>=0&&t.selectable,{textVerticalResizeEnabled:g}=Si,v=P7(t.fontFamily),[p,y]=se.useState([]);se.useEffect(()=>{var q,J;const ae=(J=(q=r.current)===null||q===void 0?void 0:q.textArr)!==null&&J!==void 0?J:[];JSON.stringify(ae)!==JSON.stringify(p)&&y(ae)}),se.useEffect(()=>{if(t.a.width)return;const q=r.current;q.width(600),t.set({width:1.4*q.getTextWidth()})},[]),se.useEffect(()=>{f||t.text!==""||!t.removable||t.placeholder||e.deleteElements([t.id])},[f]),se.useLayoutEffect(()=>zu(()=>{const q=r.current;Ms(q,t)}));const[_]=k7(e,t.fontFamily);let x=ns(t.text);t.textTransform==="uppercase"&&(x=x.toUpperCase());const b=()=>{if(t.curveEnabled){const ae=n.current;return ae.getSelfRect().height||ae.fontSize()}const q=r.current.clone({height:void 0}),J=Math.ceil(q.fontSize()*q.lineHeight()*q.textArr.length+1);return q.destroy(),J};se.useLayoutEffect(()=>{if(!_)return;const{textOverflow:q,textSplitAllowed:J}=Si;if(!t.a.height){const ae=b();return void e.history.ignore(()=>{t.set({height:ae})})}if(!e.isPlaying)if(q!=="change-font-size"||s){if(q==="resize"){const ae=b();g&&t.a.height<ae&&!s&&e.history.ignore(()=>{var ie;O3(t)&&t.set({height:ae}),(ie=r.current)===null||ie===void 0||ie.height(ae)},!1,!0),g||t.a.height===ae||s||e.history.ignore(()=>{var ie;O3(t)&&t.set({height:ae}),(ie=r.current)===null||ie===void 0||ie.height(ae)},!1,!0)}}else{const ae=function(Z,te,V=!1){const B=Z.fontSize(),D=Z.height(),U=ns(te.text);let X=te.a.fontSize;Z.height(void 0);const ee=Math.round(2*te.a.fontSize)-1;for(let K=1;K<ee;K++){const oe=te.a.height&&Z.height()>te.a.height;let me=U.split(`
|
|
106
|
-
`).join(" ").split(/[\s-]+/).reduce((Te,Ce)=>/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(Ce)?Te.concat(Ce.split("")):Te.concat(Ce),[]),de=Z.textArr.map(Te=>Te.text).join(";");const ye=me.find(Te=>!de.includes(Te)||(de=de.replace(Te,""),!1));if(!(oe||ye&&!V))break;X-=.5,Z.fontSize(X)}return Z.fontSize(B),Z.height(D),X}(r.current,t,J);if(ae!==t.a.fontSize)return void e.history.ignore(()=>{t.set({fontSize:ae})},!1,!0);const ie=b();t.a.height===ie||g||e.history.ignore(()=>{t.set({height:ie})},!1,!0)}}),se.useLayoutEffect(()=>{var q;if(_&&t.curveEnabled){const J=(q=n.current)===null||q===void 0?void 0:q.getSelfRect().width;if(J){const ae=J-t.a.width,ie=t.a.rotation*Math.PI/180,Z=-ae/2*Math.cos(ie),te=-ae/2*Math.sin(ie);t.set({width:J,x:t.a.x+Z,y:t.a.y+te})}}},[_,t.curveEnabled,t.curvePower,t.text,t.fontSize,t.fontFamily,t.fontWeight,t.fontStyle,t.letterSpacing]),se.useLayoutEffect(()=>{const q=r.current;q&&(q.width(q.width()+1e-8),q.width(q.width()-1e-8),q._setTextData(),Ms(q,t))},[_]);const E=se.useRef(null),A=se.useRef(0),S=q=>{q.evt.preventDefault(),e.selectedShapes.find(ae=>ae===t)&&t.contentEditable&&(A.current=function(ae){var ie;const Z=ae.target,te=function(ee){var K=ee.getAbsoluteTransform().copy();K.invert();var oe=ee.getStage().getPointerPosition();return K.point(oe)}(Z),V=Z.textArr,B=Math.floor(te.y/(Z.fontSize()*Z.lineHeight())),D=V.slice(0,B).reduce((ee,K)=>ee+K.text.length,B),U=(ie=V[B])!==null&&ie!==void 0?ie:V[0];let X=0;return Z.align()==="right"?X=Z.width()-U.width:Z.align()==="center"&&(X=Z.width()/2-U.width/2),D+Math.round((te.x-X)/U.width*U.text.length)}(q),t.toggleEditMode())},k=!x&&t.placeholder?.6:t.a.opacity;Rp(r,k);const I=A7({fontLoaded:_,fontFamily:t.fontFamily,fontSize:t.a.fontSize,lineHeight:t.lineHeight}),O=t.selectable||e.role==="admin",M=bf(t),F=se.useMemo(()=>t.backgroundEnabled?function({lines:q,lineHeight:J,width:ae,align:ie="left",padding:Z=0,cornerRadius:te=0}){var V;q.forEach((X,ee)=>{X.cx=ae/2,ie==="right"?X.cx=ae-X.width/2:ie==="left"&&(X.cx=X.width/2),ie!=="justify"||X.lastInParagraph||(X.width=ae),ie==="justify"&&(X.cx=X.width/2)});let B=`M ${(V=q[0])===null||V===void 0?void 0:V.cx} ${-Z}`;q.forEach((X,ee)=>{const{cx:K}=X,oe=q[ee-1];oe&&oe.width>X.width?B+=` L ${K+X.width/2+Z} ${ee*J+Z}`:B+=` L ${K+X.width/2+Z} ${ee*J-Z}`;const me=q[ee+1];me&&me.width>X.width?B+=` L ${K+X.width/2+Z} ${(ee+1)*J-Z}`:B+=` L ${K+X.width/2+Z} ${(ee+1)*J+Z}`});for(var D=q.length-1;D>=0;D--){const X=q[D],{cx:ee}=X,K=q[D+1];K&&K.width>X.width?B+=` L ${ee-X.width/2-Z} ${(D+1)*J-Z}`:B+=` L ${ee-X.width/2-Z} ${(D+1)*J+Z}`;const oe=q[D-1];oe&&oe.width>X.width?B+=` L ${ee-X.width/2-Z} ${D*J+Z}`:B+=` L ${ee-X.width/2-Z} ${D*J-Z}`}B+=" Z";const U=HP(B);return $P(U,te).path}({lines:JSON.parse(JSON.stringify(p)),cornerRadius:t.backgroundCornerRadius*(t.a.fontSize*I*.5),lineHeight:I*t.a.fontSize,padding:t.backgroundPadding*(t.a.fontSize*I*.5),width:t.a.width,align:t.align}):"",[t.backgroundEnabled,t.backgroundCornerRadius,t.a.fontSize,I,t.backgroundPadding,t.a.width,t.align,p]),j=Cf();let T=0;t.verticalAlign==="middle"?T=(t.a.height-p.length*I*t.a.fontSize)/2:t.verticalAlign==="bottom"&&(T=t.a.height-p.length*I*t.a.fontSize);const L=t.curveEnabled?uh(t.a.width,t.a.height,t.curvePower,t.a.fontSize):"",$=_?'"'+t.fontFamily+'"':v===t.fontFamily?"Arial":'"'+v+'"';return se.createElement(se.Fragment,null,se.createElement(mp,{ref:i,x:t.a.x,y:t.a.y,rotation:t.a.rotation,hideInExport:!t.showInExport,listening:!1,visible:t.backgroundEnabled,opacity:t.backgroundOpacity*k,data:F,fill:t.backgroundColor,offsetY:-T}),se.createElement(mp,{data:L,stroke:"red",strokeWidth:1,x:t.a.x,y:t.a.y,rotation:t.a.rotation,visible:!1}),se.createElement(CP,Object.assign({ref:n,visible:t.curveEnabled,data:L,text:x||t.placeholder,listening:!1,align:"center",textBaseline:"middle"},M,{stroke:t.stroke,strokeWidth:t.strokeWidth,lineJoin:"round",fillAfterStrokeEnabled:!0,fontSize:t.a.fontSize,fontFamily:`"${t.fontFamily}", "${v}"`,fontStyle:t.fontStyle+" "+t.fontWeight,letterSpacing:t.letterSpacing*t.a.fontSize,x:t.a.x,y:t.a.y,rotation:t.a.rotation,opacity:t._editModeEnabled?.3:k,hideInExport:!t.showInExport,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity})),se.createElement(Fu,Object.assign({ref:r,id:t.id,name:"element",hideInExport:!t.showInExport,editModeEnabled:t._editModeEnabled,x:t.a.x,y:t.a.y,rotation:t.a.rotation,width:t.a.width,height:t.a.height,text:x||t.placeholder,direction:W0(x)},M,{stroke:t.stroke,lineJoin:"round",strokeWidth:t.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:t.a.fontSize,fontFamily:$,fontStyle:t.fontStyle+" "+t.fontWeight,textDecoration:t.textDecoration,align:t.align,verticalAlign:t.verticalAlign,draggable:j?t.draggable&&f:t.draggable,preventDefault:!j||f,opacity:t.curveEnabled?0:k,visible:!t._editModeEnabled,ellipsis:Si.textOverflow==="ellipsis",shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,lineHeight:I,letterSpacing:t.letterSpacing*t.a.fontSize,listening:O,onDragMove:q=>{t.set({x:q.target.x(),y:q.target.y()})},onDragEnd:q=>{t.set({x:q.target.x(),y:q.target.y()})},onClick:S,onTap:S,onTransformStart:()=>{u(!0),h.current=r.current.height()},onTransform:q=>{var J,ae,ie;const Z=q.target;(J=i.current)===null||J===void 0||J.setAttrs({x:Z.x(),y:Z.y(),rotation:Z.rotation(),scale:Z.scale()});const te=((ae=Z.getStage())===null||ae===void 0?void 0:ae.findOne("Transformer")).getActiveAnchor();if(te==="middle-left"||te==="middle-right"){const B=Z.scaleX(),D=Z.width()*B,U=t.a.fontSize;let X=D;D<U&&(X=U,E.current&&Z.position(E.current)),Z.width(X),Z.scaleX(1),Z.scaleY(1);const ee=b();if(Si.textOverflow!=="ellipsis"){const oe=Math.max(ee,h.current);Z.height(oe),t.set({height:Z.height()})}const K=Si.textVerticalResizeEnabled?Math.max(ee,h.current):b();t.set({x:Z.x(),width:Z.width(),rotation:Z.rotation(),height:K}),Ms(Z,t)}if(te==="top-center"||te==="bottom-center"){let B=Si.textOverflow==="resize"?b():I*t.a.fontSize;q.target.height(Math.max(B,q.target.height()*q.target.scaleY())),q.target.scaleY(1)}E.current=q.target.position();const V=q.target.scaleX();(ie=i.current)===null||ie===void 0||ie.setAttrs({scaleX:1,scaleY:1}),q.target.scaleX(1),q.target.scaleY(1),t.set({fontSize:t.a.fontSize*V,width:q.target.width()*V,x:q.target.x(),y:q.target.y(),rotation:q.target.rotation(),height:q.target.height()*V,shadowBlur:t.shadowBlur*V,shadowOffsetX:t.shadowOffsetX*V,shadowOffsetY:t.shadowOffsetY*V,strokeWidth:t.strokeWidth*V})},onTransformEnd:q=>{var J;const ae=q.target.scaleX();q.target.scaleX(1),q.target.scaleY(1),t.set({fontSize:Math.round(t.a.fontSize*ae),width:Math.ceil(q.target.width()*ae),x:q.target.x(),y:q.target.y(),rotation:q.target.rotation(),height:q.target.height()*ae,shadowBlur:t.shadowBlur*ae,shadowOffsetX:t.shadowOffsetX*ae,shadowOffsetY:t.shadowOffsetY*ae,strokeWidth:t.strokeWidth*ae}),(J=i.current)===null||J===void 0||J.setAttrs({scaleX:1,scaleY:1}),u(!1)}})),a&&se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation},se.createElement(KC,{textNodeRef:r,element:t,selectAll:o,cursorPosition:A.current,onBlur:()=>{t.toggleEditMode(!1)}})))});var i2={exports:{}},a2={exports:{}},B3;function sy(){return B3||(B3=1,function(t,e){t.exports=r;function r(i){return n.bind(null,i)}function n(i){var a=[].slice.call(arguments,1);a.unshift("["+i+"]"),process.stderr.write(a.join(" ")+`
|
|
107
|
-
`)}}(a2)),a2.exports}var z3;function O7(){return z3||(z3=1,function(t,e){sy()("lex"),t.exports=r;function r(n){var i="",a,o=0,s=-1,u=0,h=1,f="before-selector",g=[f],v={},p=[],y=["media","keyframes",{name:"-webkit-keyframes",type:"keyframes",prefix:"-webkit-"},{name:"-moz-keyframes",type:"keyframes",prefix:"-moz-"},{name:"-ms-keyframes",type:"keyframes",prefix:"-ms-"},{name:"-o-keyframes",type:"keyframes",prefix:"-o-"},"font-face",{name:"import",state:"before-at-value"},{name:"charset",state:"before-at-value"},"supports","viewport",{name:"namespace",state:"before-at-value"},"document",{name:"-moz-document",type:"document",prefix:"-moz-"},"page"];function _(){return M(),n[s]}function x(ie){return ie?g[g.length-1-ie]:f}function b(ie){var Z=s+1;return ie===n.slice(Z,Z+ie.length)}function E(ie){var Z=n.slice(s).indexOf(ie);return Z>0?Z:!1}function A(ie){return ie===S(1)}function S(ie){return n[s+(ie||1)]}function k(){var ie=g.pop();return f=g[g.length-1],ie}function I(ie){return f=ie,g.push(f),g.length}function O(ie){var Z=f;return g[g.length-1]=f=ie,Z}function M(ie){if((ie||1)==1)n[s]==`
|
|
108
|
-
`?(h++,o=1):o++,s++;else{var Z=n.slice(s,s+ie).split(`
|
|
109
|
-
`);Z.length>1&&(h+=Z.length-1,o=1),o+=Z[Z.length-1].length,s=s+ie}}function F(){v.end={line:h,col:o},p.push(v),i="",v={}}function j(ie){v={type:ie,start:{line:h,col:o}}}for(;a=_();)switch(a){case" ":switch(x()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":i+=a;break}break;case`
|
|
110
|
-
`:case" ":case"\r":case"\f":switch(x()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":i+=a;break;case"at-value":a===`
|
|
111
|
-
`&&(v.value=i.trim(),F(),k());break}break;case":":switch(x()){case"name":v.name=i.trim(),i="",O("before-value");break;case"before-selector":i+=a,j("selector"),I("selector");break;case"before-value":O("value"),i+=a;break;default:i+=a;break}break;case";":switch(x()){case"name":case"before-value":case"value":i.trim().length>0&&(v.value=i.trim(),F()),O("before-name");break;case"value-paren":i+=a;break;case"at-value":v.value=i.trim(),F(),k();break;case"before-name":break;default:i+=a;break}break;case"{":switch(x()){case"selector":if(S(-1)==="\\"){i+=a;break}v.text=i.trim(),F(),O("before-name"),u=u+1;break;case"at-group":switch(v.name=i.trim(),v.type){case"font-face":case"viewport":case"page":I("before-name");break;default:I("before-selector")}F(),u=u+1;break;case"name":case"at-rule":v.name=i.trim(),F(),I("before-name"),u=u+1;break;case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":O("value"),i+=a;break}break;case"}":switch(x()){case"before-name":case"name":case"before-value":case"value":i&&(v.value=i.trim()),v.name&&v.value&&F(),j("end"),F(),k(),x()==="at-group"&&(j("at-group-end"),F(),k()),u>0&&(u=u-1);break;case"at-group":case"before-selector":case"selector":if(S(-1)==="\\"){i+=a;break}u>0&&x(1)==="at-group"&&(j("at-group-end"),F()),u>1&&k(),u>0&&(u=u-1);break;case"double-string":case"single-string":case"comment":i+=a;break}break;case'"':case"'":switch(x()){case"double-string":a==='"'&&S(-1)!=="\\"&&k();break;case"single-string":a==="'"&&S(-1)!=="\\"&&k();break;case"before-at-value":O("at-value"),I(a==='"'?"double-string":"single-string");break;case"before-value":O("value"),I(a==='"'?"double-string":"single-string");break;case"comment":break;default:S(-1)!=="\\"&&I(a==='"'?"double-string":"single-string")}i+=a;break;case"/":switch(x()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":case"selector":case"name":case"value":if(A("*")){var T=E("*/");T&&M(T+1)}else x()=="before-value"&&O("value"),i+=a;break;default:A("*")?(j("comment"),I("comment"),M()):i+=a;break}break;case"*":switch(x()){case"comment":A("/")?(v.text=i,M(),F(),k()):i+=a;break;case"before-selector":i+=a,j("selector"),I("selector");break;case"before-value":O("value"),i+=a;break;default:i+=a}break;case"@":switch(x()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":O("value"),i+=a;break;default:for(var L=!1,$,q,J=0,ae=y.length;!L&&J<ae;++J)q=y[J],$=q.name||q,b($)&&(L=!0,j($),I(q.state||"at-group"),M($.length),q.prefix&&(v.prefix=q.prefix),q.type&&(v.type=q.type));L||(i+=a);break}break;case"(":switch(x()){case"value":I("value-paren");break;case"before-value":O("value");break}i+=a;break;case")":switch(x()){case"value-paren":k();break;case"before-value":O("value");break}i+=a;break;default:switch(x()){case"before-selector":j("selector"),I("selector");break;case"before-name":j("property"),O("name");break;case"before-value":O("value");break;case"before-at-value":O("at-value");break}i+=a;break}return p}}(i2)),i2.exports}var o2={exports:{}},q3;function QC(){return q3||(q3=1,function(t,e){sy()("parse");var r=O7();t.exports=s;var n,i,a,o;function s(k,I){I||(I={}),n=!!I.comments,a=!!I.position,i=0,o=Array.isArray(k)?k.slice():r(k);for(var O,M=[],F;F=h();)O=b(F),O&&M.push(O);return{type:"stylesheet",stylesheet:{rules:M}}}function u(k,I){I||(I={});for(var O,M=["type","name","value"],F={},j=0;j<M.length;++j)O=M[j],k[O]&&(F[O]=I[O]||k[O]);for(M=Object.keys(I),j=0;j<M.length;++j)O=M[j],F[O]||(F[O]=I[O]);return a&&(F.position={start:k.start,end:k.end}),F}function h(){var k=o.shift();return k}function f(k){i=i+1;var I={};switch(k.type){case"font-face":case"viewport":I.declarations=A();break;case"page":I.prefix=k.prefix,I.declarations=A();break;default:I.prefix=k.prefix,I.rules=S()}return u(k,I)}function g(k){return u(k)}function v(k){return u(k)}function p(k){return u(k,{text:k.text})}function y(k){return u(k)}function _(k){return u(k)}function x(k){function I(O){return O.trim()}return u(k,{type:"rule",selectors:k.text.split(",").map(I),declarations:A()})}function b(k){switch(k.type){case"property":return _(k);case"selector":return x(k);case"at-group-end":i=i-1;return;case"media":case"keyframes":return f(k);case"comment":if(n)return p(k);break;case"charset":return v(k);case"import":return g(k);case"namespace":return y(k);case"font-face":case"supports":case"viewport":case"document":case"page":return f(k)}}function E(k){for(var I,O=[],M;(M=h())&&k&&k(M);)I=b(M),I&&O.push(I);return M&&M.type!=="end"&&o.unshift(M),O}function A(){return E(function(k){return k.type==="property"||k.type==="comment"})}function S(){return E(function(){return i})}}(o2)),o2.exports}var s2={exports:{}},U3;function JC(){return U3||(U3=1,function(t,e){sy()("stringify");var r,n,i,a,o,s;t.exports=u;function u(S,k){k||(k={}),i=k.indentation||"",n=!!k.compress,r=!!k.comments,a=1,n?o=s="":(o=`
|
|
112
|
-
`,s=" ");var I=y(S.stylesheet.rules,E).join(`
|
|
113
|
-
`).trim();return I}function h(S){if(S){a+=S;return}return n?"":Array(a).join(i||"")}function f(S){return"@"+S.type+" "+S.value+";"+o}function g(S){var k="",I=S.prefix||"";S.name&&(k=" "+S.name);var O=S.type!=="page";return"@"+I+S.type+k+s+_(S,O)+o}function v(S){return r?"/*"+(S.text||"")+"*/"+o:""}function p(S){var k;return S.selectors?k=S.selectors.join(","+o):(k="@"+S.type,k+=S.name?" "+S.name:""),h()+k+s+_(S)+o}function y(S,k){return S.reduce(function(I,O){var M=O.type==="comment"?v(O):k(O);return M&&I.push(M),I},[])}function _(S,k){var I=S.declarations,O=b;return S.rules&&(I=S.rules,O=p),I=x(I,O),I&&(I=o+I+(k?"":o)),"{"+I+h()+"}"}function x(S,k){if(!S)return"";h(1);var I=y(S,k);return h(-1),I.length?I.join(o):""}function b(S){if(S.type==="property")return A(S)}function E(S){switch(S.type){case"rule":return p(S);case"media":case"keyframes":return g(S);case"comment":return v(S);case"import":case"charset":case"namespace":return f(S);case"font-face":case"supports":case"viewport":case"document":case"page":return g(S)}}function A(S){var k=S.name?S.name+":"+s:"";return h()+k+S.value+";"}}(s2)),s2.exports}var l2,H3;function eL(){return H3||(H3=1,l2={lex:O7(),parse:QC(),stringify:JC()}),l2}var tL=eL();const rL=hh(tL);function nL(t){for(;t.parentNode;){if(t.nodeName==="defs")return!0;t=t.parentNode}return!1}function iL(t){const e={};return t.querySelectorAll("style").forEach(r=>{const n=rL.parse(r.textContent).stylesheet.rules;for(let i of n)i.selectors&&i.selectors.forEach(a=>{const o=e[a]||{};i.declarations.forEach(s=>{o[s.name]=s.value}),e[a]=o})}),e}function C7(t,e){var r;const n={fill:"",stroke:""},i=((r=t.getAttribute("class"))===null||r===void 0?void 0:r.split(" "))||[],a=t.getAttribute("id");let o={};if(a&&e[`#${a}`]?o=e[`#${a}`]:i.forEach(s=>{e[`.${s}`]&&(o=Object.assign(Object.assign({},o),e[`.${s}`]))}),e[t.nodeName]&&(o=Object.assign(Object.assign({},o),e[t.nodeName])),t.getAttribute("fill")&&t.getAttribute("fill")!=="none"?n.fill=t.getAttribute("fill"):o.fill&&o.fill!=="none"&&(n.fill=o.fill),t.getAttribute("stroke")&&t.getAttribute("stroke")!=="none"?n.stroke=t.getAttribute("stroke"):o.stroke&&o.stroke!=="none"&&(n.stroke=o.stroke),!n.fill&&t.style.fill&&t.style.fill!=="none"&&(n.fill=t.style.fill),!n.stroke&&t.style.stroke&&t.style.stroke!=="none"&&(n.stroke=t.style.stroke),!n.stroke&&!n.fill){const s=t.ownerSVGElement,u=s&&s!==t&&C7(s,e);u?.fill==="currentColor"||u?.stroke==="currentColor"||(n.fill="black")}return n}const aL=["path","rect","circle","line","polygon","polyline","ellipse","text"];function oL(t){for(var e=[],r=t.getElementsByTagName("*"),n=0,i=r.length;n<i;n++){const a=r[n];nL(a)||(a.getAttribute("fill")!==null&&e.push(a),(a.getAttribute("stroke")!==null||a.style&&a.style.fill||aL.indexOf(a.nodeName)>=0)&&e.push(a))}return e}async function $3(t){const e=await fetch(t);return xh(await e.text())}async function jp(t){return await(await fetch(t,{mode:"cors"})).text()}function xh(t){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(t)))}function ly(t){var e=new DOMParser().parseFromString(t,"image/svg+xml");const r=e.documentElement.getAttribute("viewBox"),[n,i,a,o]=r?.split(" ")||[],s=e.documentElement.getAttribute("width");!s&&e.documentElement.setAttribute("width",a+"px");const u=e.documentElement.getAttribute("height");if((!u||u.indexOf("%")>=0)&&e.documentElement.setAttribute("height",o+"px"),s&&s.indexOf("%")>=0&&u&&u.indexOf("%")===-1){const h=parseFloat(u)/parseFloat(o);e.documentElement.setAttribute("width",h*parseFloat(a)+"px")}if(u&&u.indexOf("%")>=0&&s&&s.indexOf("%")===-1){const h=parseFloat(s)/parseFloat(a);e.documentElement.setAttribute("height",h*parseFloat(o)+"px")}return s==="100%"&&u==="100%"&&(e.documentElement.setAttribute("width",a+"px"),e.documentElement.setAttribute("height",o+"px")),new XMLSerializer().serializeToString(e)}const sL=(t,e)=>{if(!t||!e)return!1;if(e==="currentColor"&&t==="black")return!0;const r=or.Util.colorToRGBA(t),n=or.Util.colorToRGBA(e);return r&&n?r.r===n.r&&r.g===n.g&&r.b===n.b&&r.a===n.a:void 0};function uy(t,e){var r=new DOMParser().parseFromString(t,"image/svg+xml");const n=oL(r),i=Array.from(e.keys()),a=iL(r);return n.forEach(o=>{const{fill:s,stroke:u}=C7(o,a);[{prop:"fill",color:s},{prop:"stroke",color:u}].forEach(({prop:h,color:f})=>{const g=i.find(v=>sL(v,f));if(g){const v=e.get(g);if(U0(v)){const{rotation:p,stops:y}=F8(v),_=y.map(b=>({offset:100*b.offset+"%","stop-color":b.color})),x="color"+Math.round(1e8*Math.random());(function(b,E,A,S){var k=b.namespaceURI,I=document.createElementNS(k,"linearGradient");const O=or.Util.degToRad(A+90),M=(Math.cos(O)+1)/2,F=(Math.sin(O)+1)/2,j=(Math.cos(O+Math.PI)+1)/2,T=(Math.sin(O+Math.PI)+1)/2;I.setAttribute("x1",100*M+"%"),I.setAttribute("y1",100*F+"%"),I.setAttribute("x2",100*j+"%"),I.setAttribute("y2",100*T+"%"),I.setAttribute("gradientUnits","userSpaceOnUse"),I.setAttribute("id",E);for(var L=0;L<S.length;L++){var $=S[L],q=document.createElementNS(k,"stop");for(var J in $)$.hasOwnProperty(J)&&q.setAttribute(J,$[J]);I.appendChild(q)}(b.querySelector("defs")||b.insertBefore(document.createElementNS(k,"defs"),b.firstChild)).appendChild(I)})(r.children[0],x,p,_),o.style[h]=null,o.setAttribute(h,`url('#${x}')`)}else o.style[h]=e.get(g)}})}),xh(new XMLSerializer().serializeToString(r))}const cy=(t,e,r)=>{let n=e,i=r,a=1;for(;n>0&&i>0;){t.width=n,t.height=i;const o=t.getContext("2d");if(!o)return;if(o.fillStyle="rgba(0,0,0,0.1)",o.fillRect(0,0,1,1),o.getImageData(0,0,1,1).data[3]!==0)return void o.clearRect(0,0,t.width,t.height);if(a*=.9,n=Math.floor(e*a),i=Math.floor(r*a),n=Math.max(n,1),i=Math.max(i,1),n<=1&&i<=1)return t.width=1,void(t.height=1)}},ym=(t,e=100,r=!1,n)=>{const i=se.useRef(n??t),[,a]=se.useReducer(u=>u+1,0),o=se.useCallback(u=>{i.current!==u&&(i.current=u,a())},[i]),s=se.useRef(null);return t===r&&(s.current&&(clearTimeout(s.current),s.current=null),i.current=r),se.useEffect(()=>(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{o(t),s.current=null},e),()=>{s.current&&clearTimeout(s.current)}),[t,e,r]),[i.current,o]};function Qf(){return document.createElement("canvas")}const L7=t=>t.indexOf("data:image/svg+xml")>=0||t.indexOf(".svg")>=0,G3=t=>{const[e,r]=se.useState(t);return se.useEffect(()=>{(async()=>{const n=await async function(i){if(!L7(i))return i;const a=await jp(i),o=ly(a);return xh(o)}(t);n!==e&&r(n)})()},[t]),e};function W3(t,e){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}const lL={boundBoxFunc:(t,e)=>e.width<5||e.height<5?t:e,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2},uL={boundBoxFunc:(t,e)=>e.width<5||e.height<5?t:e,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2},V3=(t,e,r)=>Math.max(e,Math.min(r,t)),cL=(t,e,r,n,i=0,a=!1,o=!0)=>{const s=Math.floor(V3(t.a.width*n,1,1e4)),u=Math.floor(V3(t.a.height*n,1,1e4)),h=Math.min(i*n,s/2,u/2),f=Math.max(t.a.width/r.width,t.a.height/r.height)*n,g=t.page._exportingOrRendering&&Si.imageDownScalingEnabled&&f<1&&!a,v=r.x===0&&r.y===0&&r.width===e?.width&&r.height===e?.height,p=se.useMemo(()=>{if(e&&e.width&&e.height)return v&&h===0&&!g?void 0:Qf()},[e,h,g,v]);return se.useLayoutEffect(()=>{if(!p||!e)return;cy(p,s,u);const y=p.getContext("2d");if(!y)return;h&&(y.beginPath(),y.moveTo(h,0),y.lineTo(s-h,0),y.arc(s-h,h,h,3*Math.PI/2,0,!1),y.lineTo(s,u-h),y.arc(s-h,u-h,h,0,Math.PI/2,!1),y.lineTo(h,u),y.arc(h,u-h,h,Math.PI/2,Math.PI,!1),y.lineTo(0,h),y.arc(h,h,h,Math.PI,3*Math.PI/2,!1),y.clip());const _=g?function(b,E){var A,S;const k=Qf();k.width=b.width,k.height=b.height;const I=Math.max(1,Math.floor(k.width*E)),O=Math.max(1,Math.floor(k.height*E));(A=k.getContext("2d"))===null||A===void 0||A.drawImage(b,0,0,k.width,k.height);const M=function(F,j,T,L,$,q,J){for(var ae=new ImageData(j,T),ie=new Int32Array(F.data.buffer),Z=F.width,te=new Int32Array(ae.data.buffer),V=ae.width,B=j/q,D=T/J,U=Math.round(1/B),X=Math.round(1/D),ee=U*X,K=0;K<ae.height;K++)for(var oe=0;oe<V;oe++){for(var me=0+Math.round(oe/B)+(0+Math.round(K/D))*Z,de=0,ye=0,Te=0,Ce=0,Ie=0;Ie<X;Ie++)for(var Ee=0;Ee<U;Ee++){var ge=ie[me+Ee+Ie*Z];de+=ge<<24>>>24,ye+=ge<<16>>>24,Te+=ge<<8>>>24,Ce+=ge>>>24}de=Math.round(de/ee),ye=Math.round(ye/ee),Te=Math.round(Te/ee),Ce=Math.round(Ce/ee),te[oe+K*V]=Ce<<24|Te<<16|ye<<8|de}return ae}(k.getContext("2d").getImageData(0,0,k.width,k.height),I,O,0,0,k.width,k.height);return k.width=I,k.height=O,(S=k.getContext("2d"))===null||S===void 0||S.putImageData(M,0,0),k}(e,f):e,x=g?{x:Math.floor(r.x*f),y:Math.floor(r.y*f),width:Math.floor(r.width*f),height:Math.floor(r.height*f)}:r;y.drawImage(_,x.x,x.y,x.width,x.height,0,0,p.width,p.height)},[p,t.a.width,t.a.height,r.x,r.y,r.width,r.height,i,n,a,t.page._exportingOrRendering,g]),se.useEffect(()=>()=>{p&&p.nodeName==="CANVAS"&&or.Util.releaseCanvas(p)},[p]),p||e},fL=Qf(),hL=ni(({element:t})=>{const e=Math.min(30,t.a.width/4,t.a.height/4),r=se.useRef(null);return se.useEffect(()=>{const n=r.current;if(!n)return;const i=new or.Animation(a=>{n.rotate((a?.timeDiff||0)/2)},n.getLayer());return i.start(),()=>{i.stop()}}),se.createElement(bn,{x:t.x,y:t.y,rotation:t.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tn,{width:t.a.width,height:t.a.height,fill:"rgba(124, 173, 212, 0.8)"}),se.createElement(ey,{ref:r,x:t.a.width/2,y:t.a.height/2,fill:"white",outerRadius:Math.abs(e),innerRadius:Math.max(1,e-5),angle:270}))}),dL=ni(({element:t})=>{const e=Math.max(10,Math.min(30,t.a.width/25));return se.createElement(bn,{x:t.x,y:t.y,rotation:t.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tn,{width:t.a.width,height:t.a.height,fill:"rgba(223, 102, 102, 0.8)"}),se.createElement(Fu,{text:"Can not load the image...",fontSize:e,width:t.a.width,height:t.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let u2=ty;const lp=(t,e="",r="")=>{const n=se.useRef(),i=()=>{var a;(a=n.current)===null||a===void 0||a.call(n),n.current=void 0};se.useEffect(()=>i,[]),se.useLayoutEffect(()=>{const a=e.slice(0,200),o=`image with id ${r} url: ${a}`;t!=="loading"||n.current||(n.current=pd(o)),t!=="loading"&&i(),t==="failed"&&Mp(o)},[t])},Y3=ni(({element:t,store:e})=>{var r;const[n,i]=se.useState(!1),a=se.useRef(null),o=se.useRef(null),s=e.selectedShapes.indexOf(t)>=0&&t.selectable,[u,h]=(Re=>{const[Be,Oe]=se.useReducer(Ae=>Ae+1,0),fe=se.useRef("loading"),Le=se.useRef(Re.src),Ne=se.useRef(Re.src);Ne.current!==Re.src&&(Ne.current=Re.src,fe.current="loading");const ue=se.useMemo(()=>L7(Re.src)||Re.type==="svg",[Re.src,Re.type]);return se.useEffect(()=>{if(!ue||!Re.src)return;let Ae=!1;return(async()=>{fe.current="loading",Oe();const Pe=await jp(Re.src),Ue=ly(Pe);let st;st=Re.colorsReplace?uy(Ue,Re.colorsReplace||new Map):xh(Ue),Ae||(Le.current=st,fe.current="loaded",Oe())})(),()=>{Ae=!0}},[Re.src,JSON.stringify(Re.colorsReplace)]),ue?[Le.current,fe.current]:[Re.src,"loaded"]})(t),[f,g]=u2(u,"anonymous"),v=t.type!=="svg"||h==="loaded"?g:"loading";lp(v,t.src,t.id);const p=t.page._exportingOrRendering?1:Math.max(1,e.scale),y=e._elementsPixelRatio*p,_=(({image:Re,status:Be,type:Oe})=>{const fe=se.useRef();return se.useEffect(()=>{fe.current=Re||fe.current},[Re]),Be!=="failed"||Be!=="failed"&&Oe==="svg"?fe.current:void 0})({image:f,status:g,type:t.type}),x=((Re,Be,Oe)=>{const fe=se.useMemo(()=>{var Le,Ne;const{flipX:ue,flipY:Ae}=Re,Pe=Re.type==="svg"||Re.src.indexOf("data:image/svg+xml")>=0||Re.src.indexOf(".svg")>=0,Ue=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,st=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||Ue)&&Pe||Re.maskSrc;if(!ue&&!Ae&&!st)return Be;if(!Be||!Be.width||!Be.height)return null;const dt=Qf();let pt=1;Re.type==="svg"&&(pt=Math.max(Re.a.width/Be.width*Oe,Re.a.height/Be.height*Oe)),cy(dt,Math.max(Be.width*pt,1),Math.max(Be.height*pt,1));let xt=ue?-dt.width:0,bt=Ae?-dt.height:0;return(Le=dt.getContext("2d"))===null||Le===void 0||Le.scale(ue?-1:1,Ae?-1:1),(Ne=dt.getContext("2d"))===null||Ne===void 0||Ne.drawImage(Be,xt,bt,dt.width,dt.height),dt},[Re.maskSrc,Re.flipX,Re.flipY,Be,Re.a.width,Re.a.height,Oe]);return se.useEffect(()=>()=>{fe&&fe.nodeName==="CANVAS"&&or.Util.releaseCanvas(fe)},[fe]),fe})(t,f||_,y),b=((Re,Be)=>{const Oe=G3(Re.maskSrc||""),[fe,Le]=u2(Oe,"anonymous");return lp(Oe?Le:"loaded",Oe||"",Re.id),se.useMemo(()=>{if(!fe||!Be||!Be.width||!Be.height)return Be;const Ne=Qf();Ne.width=Math.max(Be.width,1),Ne.height=Math.max(Be.height,1);const ue=Ne.getContext("2d");if(!ue)return Be;ue.drawImage(Be,0,0),ue.globalCompositeOperation="source-in";const Ae=function(Pe,Ue){const st=Ue.width/Ue.height;let dt,pt;return st>=Pe.width/Pe.height?(dt=Pe.width,pt=Pe.width/st):(dt=Pe.height*st,pt=Pe.height),{x:(Pe.width-dt)/2,y:(Pe.height-pt)/2,width:dt,height:pt}}(fe,Re);return ue.drawImage(fe,Ae.x,Ae.y,Ae.width,Ae.height,0,0,Be.width,Be.height),Ne},[Be,fe,Re.a.width,Re.a.height])})(t,x)||fL;let{cropX:E,cropY:A,cropWidth:S,cropHeight:k}=t.a;g!=="loaded"&&(E=A=0,S=k=1);const I=b.width*S,O=b.height*k,M=t.a.width/t.a.height;let F,j;const T=I/O,L=t.stretchEnabled;L?(F=I,j=O):M>=T?(F=I,j=I/M):(F=O*M,j=O);const $={x:b.width*E,y:b.height*A,width:F,height:j},q=(r=t.cornerRadius)!==null&&r!==void 0?r:0,J=t.page._exportingOrRendering?1:Math.min(2,e.scale),ae=e._elementsPixelRatio*J;let ie=((Re,Be,Oe,fe)=>{const Le=G3(Re.clipSrc||""),[Ne,ue]=u2(Le,"anonymous"),Ae=Re.clipSrc?ue:"loaded";lp(Ae,Re.clipSrc,Re.id);const Pe=se.useMemo(()=>{if(Be&&Ne)return Qf()},[Be,Ne]);return se.useLayoutEffect(()=>{var Ue;if(!Ne||!Be||!Be.width||!Be.height||!Ne||!Ne.width||!Ne.height||!Pe)return;const st=Qf(),dt=Math.max(Re.a.width/Ne.width*Oe,Re.a.height/Ne.height*Oe);st.width=Math.max(Ne.width*dt,1),st.height=Math.max(Ne.height*dt,1),(Ue=st.getContext("2d"))===null||Ue===void 0||Ue.drawImage(Ne,0,0,st.width,st.height),Pe.width=Math.max(Be.width,1),Pe.height=Math.max(Be.height,1);const pt=Pe.getContext("2d");pt&&(pt.save(),pt.drawImage(st,0,0,Be.width,Be.height),or.Util.releaseCanvas(st),pt.globalCompositeOperation="source-in",pt.drawImage(Be,0,0,Pe.width,Pe.height),pt.restore())},[Pe,Be,Ne,Re.a.width,Re.a.height,Oe,...fe]),Re.clipSrc&&Ne?Pe:Be})(t,cL(t,b,$,ae,q,n||t._cropModeEnabled||t.type==="svg",!0),ae,[$,q,ae]);const Z=Math.max(t.a.width/F,t.a.height/j);se.useEffect(()=>{var Re;if(!t._cropModeEnabled)return;const Be=(Re=a.current)===null||Re===void 0?void 0:Re.getStage();function Oe(Le){t._cropModeEnabled&&Le.target!==o.current&&t.toggleCropMode(!1)}function fe(Le){t._cropModeEnabled&&Le.target.parentNode!==Be.content&&t.toggleCropMode(!1)}return document.body.addEventListener("click",fe),Be?.on("click",Oe),Be?.on("tap",Oe),()=>{document.body.removeEventListener("click",fe),document.body.removeEventListener("touchstart",fe),Be?.off("click",Oe),Be?.off("click",Oe)}},[t._cropModeEnabled]),se.useLayoutEffect(()=>{if(!n&&!t._cropModeEnabled)return Ms(a.current,t),zu(()=>{Ms(a.current,t)},{delay:100})},[ie,t.page._exportingOrRendering,n,S,k,t._cropModeEnabled]),se.useLayoutEffect(()=>{var Re;n||t._cropModeEnabled?(Re=a.current)===null||Re===void 0||Re.clearCache():Ms(a.current,t)},[n,t.a.width,t.a.height,t._cropModeEnabled]),se.useEffect(()=>{Ms(a.current,t)},[t.shadowEnabled,t.shadowBlur,t.cornerRadius,t.shadowColor,t.shadowOffsetX,t.shadowOffsetY,t.shadowOpacity]);const te=se.useRef(null),V=se.useRef(null),B=se.useRef(null);se.useLayoutEffect(()=>{t._cropModeEnabled&&(V.current.nodes([te.current]),B.current.nodes([o.current]))},[t._cropModeEnabled]);var D=se.useRef(null),U=se.useRef(0),X=se.useRef(!1);const ee=Re=>{var Be;((Be=Re.evt.touches)===null||Be===void 0?void 0:Be.length)>2&&Re.target.stopDrag(),Math.round(Re.target.x())>0&&(Re.target.x(0),Re.target.scaleX(1)),Math.round(Re.target.y())>0&&(Re.target.y(0),Re.target.scaleY(1));const Oe=Re.target.width()*Re.target.scaleX(),fe=Re.target.height()*Re.target.scaleY(),Le=Math.min(1,F/Oe),Ne=Math.min(1,j/fe),ue=1-Le,Ae=Math.min(ue,Math.max(0,Math.round(-Re.target.x())/Oe)),Pe=1-Ne,Ue=Math.min(Pe,Math.max(0,Math.round(-Re.target.y())/fe));Re.target.setAttrs({x:-Ae*b.width,y:-Ue*b.height,scaleX:1,scaleY:1}),t.set({cropX:Ae,cropY:Ue,cropWidth:Le,cropHeight:Ne})},K=()=>{t.type!=="svg"&&t.contentEditable&&(t.stretchEnabled||setTimeout(()=>{t.toggleCropMode(!0)}))},oe=t.type==="svg"&&_,me=g==="loading"&&!oe,[de]=ym(me,100,!1,!1),ye=g==="failed",Te=!de&&!ye,Ce=se.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Ie=Te?t.a.opacity:0;Rp(a,Ie);const Ee=t.selectable||e.role==="admin",ge=Cf();return se.createElement(se.Fragment,null,de&&se.createElement(hL,{element:t}),ye&&se.createElement(dL,{element:t}),se.createElement(Tu,{ref:a,name:"element",id:t.id,image:ie,x:t.a.x,y:t.a.y,width:t.a.width||1,height:t.a.height||1,rotation:t.a.rotation,opacity:Ie,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,customCrop:$,listening:Ee,draggable:ge?t.draggable&&s:t.draggable,preventDefault:!ge||s,hideInExport:!t.showInExport,onDragMove:Re=>{t.set({x:Re.target.x(),y:Re.target.y()})},onDragEnd:Re=>{t.set({x:Re.target.x(),y:Re.target.y()})},onDblClick:K,onDblTap:K,onTransformStart:()=>{i(!0),Ce.current={cropX:t.cropX,cropY:t.cropY,cropWidth:t.cropWidth,cropHeight:t.cropHeight}},onTransform:Re=>{var Be;const Oe=Re.currentTarget,fe=Math.abs(Oe.scaleX()-1)<1e-7?1:Oe.scaleX(),Le=Math.abs(Oe.scaleY()-1)<1e-7?1:Oe.scaleY();Oe.scaleX(1),Oe.scaleY(1);const Ne=(Be=Re.target.getStage())===null||Be===void 0?void 0:Be.findOne("Transformer"),ue=1-F/b.width,Ae=Math.min(ue,Math.max(0,t.cropX)),Pe=1-j/b.height,Ue=Math.min(Pe,Math.max(0,t.cropY)),st=Ne.getActiveAnchor(),dt=!(st.indexOf("middle")>=0||st.indexOf("center")>=0),pt=!dt&&fe<1&&Ce.current.cropHeight>j/b.height;let xt=dt?t.cropWidth:t.cropWidth*fe;pt&&(xt=t.cropWidth);const bt=!dt&&Le<1&&Ce.current.cropWidth>F/b.width;let kt=dt?t.cropHeight:t.cropHeight*Le;bt&&(kt=t.cropHeight),L&&(xt=t.cropWidth,kt=t.cropHeight),t.set({cropX:Ae,cropY:Ue,x:Oe.x(),y:Oe.y(),width:Oe.width()*fe,height:Oe.height()*Le,rotation:Re.target.rotation(),cropWidth:Math.min(xt,1-Ae),cropHeight:Math.min(kt,1-Ue)})},onTransformEnd:Re=>{const Be=Re.currentTarget;t.set({width:Be.width(),height:Be.height(),x:Be.x(),y:Be.y(),rotation:Re.target.rotation(),cropWidth:F/b.width,cropHeight:j/b.height}),i(!1)}}),se.createElement(Tn,{x:t.x,y:t.y,width:Math.max(t.a.width-t.borderSize,0),height:Math.max(t.a.height-t.borderSize,0),opacity:Ie,offsetX:-t.borderSize/2,offsetY:-t.borderSize/2,stroke:t.borderColor,strokeWidth:t.borderSize,listening:!1,visible:!!t.borderSize,rotation:t.rotation,cornerRadius:Math.max(0,q-t.borderSize),hideInExport:!t.showInExport}),t._cropModeEnabled&&se.createElement(ry,{selector:".page-abs-container",enabled:!0},se.createElement(Tn,{x:-window.innerWidth/e.scale,y:-window.innerWidth/e.scale,width:window.innerWidth/e.scale*3,height:window.innerWidth/e.scale*3,fill:"rgba(0,0,0,0.3)"}),se.createElement(Tu,{listening:!1,image:ie,x:t.x,y:t.y,width:t.a.width,height:t.a.height,rotation:t.rotation,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur}),se.createElement(bn,{x:t.x,y:t.y,rotation:t.rotation,scaleX:Z,scaleY:Z},se.createElement(Tu,{image:b,ref:o,opacity:.4,draggable:!0,x:-t.cropX*b.width,y:-t.cropY*b.height,onDragMove:ee,onTransform:ee,onTouchMove:Re=>{Re.evt.preventDefault();const Be=Re.target.getStage().getPointersPositions();var Oe=Be[0],fe=Be[1];const Le=Re.target;if(Oe&&!fe&&!Le.isDragging()&&X.current&&(Le.startDrag(),X.current=!1),Oe&&fe){or.hitOnDragEnabled=!0,Le.isDragging()&&(X.current=!0,Le.stopDrag());const bt=Re.target.getAbsoluteTransform().copy();bt.invert();var Ne={x:Oe.x,y:Oe.y},ue={x:fe.x,y:fe.y};if(!D.current)return void(D.current=W3(Ne,ue));var Ae=W3(Ne,ue),Pe=function(It,Jt){return Math.sqrt(Math.pow(Jt.x-It.x,2)+Math.pow(Jt.y-It.y,2))}(Ne,ue);U.current||(U.current=Pe);const kt=Le.position();var Ue={x:Ae.x-kt.x,y:Ae.y-kt.y},st=Pe/U.current;Le.scaleX(st),Le.scaleY(st);const zr=bt.point(Ae),_r=bt.point(D.current);var dt=zr.x-_r.x,pt=zr.y-_r.y,xt={x:Math.min(0,Ae.x-Ue.x*st+dt),y:Math.min(0,Ae.y-Ue.y*st+pt)};Le.position(xt),U.current=Pe,D.current=Ae,ee(Re)}},onTouchEnd:Re=>{U.current=0,D.current=null,or.hitOnDragEnabled=!1}}),se.createElement(yp,Object.assign({ref:B},uL)),se.createElement(Tn,{width:F,height:j,ref:te,listening:!1,onTransform:Re=>{if(t.cropX<Math.abs(Re.target.x()/b.width)&&Re.target.x()<0&&t.cropX>0){const Pe=(t.cropWidth+t.cropX)*b.width;Re.target.scaleX(1),Re.target.width(Pe)}if(t.cropY<Math.abs(Re.target.y()/b.height)&&Re.target.y()<0&&t.cropY>0){const Pe=(t.cropHeight+t.cropY)*b.height;Re.target.scaleY(1),Re.target.height(Pe)}Re.target.x()<-t.cropX*b.width-1e-9&&(Re.target.x(-t.cropX*b.width),Re.target.scaleX(1)),Re.target.y()<-t.cropY*b.height-1e-9&&(Re.target.y(-t.cropY*b.height),Re.target.scaleY(1));const Be=Math.min(1,Math.max(0,t.cropX+Re.target.x()/b.width)),Oe=Math.min(1,Math.max(0,Re.target.y()/b.height+t.cropY)),fe=Re.target.width()*Re.target.scaleX(),Le=Re.target.height()*Re.target.scaleY(),Ne=Math.min(1-Be,fe/b.width),ue=Math.min(1-Oe,Le/b.height),Ae=Re.target.getAbsolutePosition(Re.target.getParent().getParent());Re.target.scale({x:1,y:1}),Re.target.position({x:0,y:0}),t.set({x:Ae.x,y:Ae.y,cropX:Be,cropY:Oe,cropWidth:Ne,cropHeight:ue,width:Math.min(fe*Z,b.width*(1-Be)*Z),height:Math.min(Le*Z,b.height*(1-Oe)*Z)})}}),se.createElement(yp,Object.assign({ref:V},lL,{visible:t.resizable})))))});var Y1={exports:{}};/*!
|
|
114
|
-
* Quill Editor v1.3.7
|
|
115
|
-
* https://quilljs.com/
|
|
116
|
-
* Copyright (c) 2014, Jason Chen
|
|
117
|
-
* Copyright (c) 2013, salesforce.com
|
|
118
|
-
*/var pL=Y1.exports,X3;function gL(){return X3||(X3=1,function(t,e){(function(n,i){t.exports=i()})(typeof self<"u"?self:pL,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,s){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:s})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),o=i(18),s=i(19),u=i(45),h=i(46),f=i(47),g=i(48),v=i(49),p=i(12),y=i(32),_=i(33),x=i(31),b=i(1),E={Scope:b.Scope,create:b.create,find:b.find,query:b.query,register:b.register,Container:a.default,Format:o.default,Leaf:s.default,Embed:g.default,Scroll:u.default,Block:f.default,Inline:h.default,Text:v.default,Attributor:{Attribute:p.default,Class:y.default,Style:_.default,Store:x.default}};n.default=E},function(r,n,i){var a=this&&this.__extends||function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,E){b.__proto__=E}||function(b,E){for(var A in E)E.hasOwnProperty(A)&&(b[A]=E[A])};return function(b,E){x(b,E);function A(){this.constructor=b}b.prototype=E===null?Object.create(E):(A.prototype=E.prototype,new A)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=function(x){a(b,x);function b(E){var A=this;return E="[Parchment] "+E,A=x.call(this,E)||this,A.message=E,A.name=A.constructor.name,A}return b}(Error);n.ParchmentError=o;var s={},u={},h={},f={};n.DATA_KEY="__blot";var g;(function(x){x[x.TYPE=3]="TYPE",x[x.LEVEL=12]="LEVEL",x[x.ATTRIBUTE=13]="ATTRIBUTE",x[x.BLOT=14]="BLOT",x[x.INLINE=7]="INLINE",x[x.BLOCK=11]="BLOCK",x[x.BLOCK_BLOT=10]="BLOCK_BLOT",x[x.INLINE_BLOT=6]="INLINE_BLOT",x[x.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",x[x.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",x[x.ANY=15]="ANY"})(g=n.Scope||(n.Scope={}));function v(x,b){var E=y(x);if(E==null)throw new o("Unable to create "+x+" blot");var A=E,S=x instanceof Node||x.nodeType===Node.TEXT_NODE?x:A.create(b);return new A(S,b)}n.create=v;function p(x,b){return b===void 0&&(b=!1),x==null?null:x[n.DATA_KEY]!=null?x[n.DATA_KEY].blot:b?p(x.parentNode,b):null}n.find=p;function y(x,b){b===void 0&&(b=g.ANY);var E;if(typeof x=="string")E=f[x]||s[x];else if(x instanceof Text||x.nodeType===Node.TEXT_NODE)E=f.text;else if(typeof x=="number")x&g.LEVEL&g.BLOCK?E=f.block:x&g.LEVEL&g.INLINE&&(E=f.inline);else if(x instanceof HTMLElement){var A=(x.getAttribute("class")||"").split(/\s+/);for(var S in A)if(E=u[A[S]],E)break;E=E||h[x.tagName]}return E==null?null:b&g.LEVEL&E.scope&&b&g.TYPE&E.scope?E:null}n.query=y;function _(){for(var x=[],b=0;b<arguments.length;b++)x[b]=arguments[b];if(x.length>1)return x.map(function(S){return _(S)});var E=x[0];if(typeof E.blotName!="string"&&typeof E.attrName!="string")throw new o("Invalid definition");if(E.blotName==="abstract")throw new o("Cannot register abstract class");if(f[E.blotName||E.attrName]=E,typeof E.keyName=="string")s[E.keyName]=E;else if(E.className!=null&&(u[E.className]=E),E.tagName!=null){Array.isArray(E.tagName)?E.tagName=E.tagName.map(function(S){return S.toUpperCase()}):E.tagName=E.tagName.toUpperCase();var A=Array.isArray(E.tagName)?E.tagName:[E.tagName];A.forEach(function(S){(h[S]==null||E.className==null)&&(h[S]=E)})}return E}n.register=_},function(r,n,i){var a=i(51),o=i(11),s=i(3),u=i(20),h="\0",f=function(g){Array.isArray(g)?this.ops=g:g!=null&&Array.isArray(g.ops)?this.ops=g.ops:this.ops=[]};f.prototype.insert=function(g,v){var p={};return g.length===0?this:(p.insert=g,v!=null&&typeof v=="object"&&Object.keys(v).length>0&&(p.attributes=v),this.push(p))},f.prototype.delete=function(g){return g<=0?this:this.push({delete:g})},f.prototype.retain=function(g,v){if(g<=0)return this;var p={retain:g};return v!=null&&typeof v=="object"&&Object.keys(v).length>0&&(p.attributes=v),this.push(p)},f.prototype.push=function(g){var v=this.ops.length,p=this.ops[v-1];if(g=s(!0,{},g),typeof p=="object"){if(typeof g.delete=="number"&&typeof p.delete=="number")return this.ops[v-1]={delete:p.delete+g.delete},this;if(typeof p.delete=="number"&&g.insert!=null&&(v-=1,p=this.ops[v-1],typeof p!="object"))return this.ops.unshift(g),this;if(o(g.attributes,p.attributes)){if(typeof g.insert=="string"&&typeof p.insert=="string")return this.ops[v-1]={insert:p.insert+g.insert},typeof g.attributes=="object"&&(this.ops[v-1].attributes=g.attributes),this;if(typeof g.retain=="number"&&typeof p.retain=="number")return this.ops[v-1]={retain:p.retain+g.retain},typeof g.attributes=="object"&&(this.ops[v-1].attributes=g.attributes),this}}return v===this.ops.length?this.ops.push(g):this.ops.splice(v,0,g),this},f.prototype.chop=function(){var g=this.ops[this.ops.length-1];return g&&g.retain&&!g.attributes&&this.ops.pop(),this},f.prototype.filter=function(g){return this.ops.filter(g)},f.prototype.forEach=function(g){this.ops.forEach(g)},f.prototype.map=function(g){return this.ops.map(g)},f.prototype.partition=function(g){var v=[],p=[];return this.forEach(function(y){var _=g(y)?v:p;_.push(y)}),[v,p]},f.prototype.reduce=function(g,v){return this.ops.reduce(g,v)},f.prototype.changeLength=function(){return this.reduce(function(g,v){return v.insert?g+u.length(v):v.delete?g-v.delete:g},0)},f.prototype.length=function(){return this.reduce(function(g,v){return g+u.length(v)},0)},f.prototype.slice=function(g,v){g=g||0,typeof v!="number"&&(v=1/0);for(var p=[],y=u.iterator(this.ops),_=0;_<v&&y.hasNext();){var x;_<g?x=y.next(g-_):(x=y.next(v-_),p.push(x)),_+=u.length(x)}return new f(p)},f.prototype.compose=function(g){var v=u.iterator(this.ops),p=u.iterator(g.ops),y=[],_=p.peek();if(_!=null&&typeof _.retain=="number"&&_.attributes==null){for(var x=_.retain;v.peekType()==="insert"&&v.peekLength()<=x;)x-=v.peekLength(),y.push(v.next());_.retain-x>0&&p.next(_.retain-x)}for(var b=new f(y);v.hasNext()||p.hasNext();)if(p.peekType()==="insert")b.push(p.next());else if(v.peekType()==="delete")b.push(v.next());else{var E=Math.min(v.peekLength(),p.peekLength()),A=v.next(E),S=p.next(E);if(typeof S.retain=="number"){var k={};typeof A.retain=="number"?k.retain=E:k.insert=A.insert;var I=u.attributes.compose(A.attributes,S.attributes,typeof A.retain=="number");if(I&&(k.attributes=I),b.push(k),!p.hasNext()&&o(b.ops[b.ops.length-1],k)){var O=new f(v.rest());return b.concat(O).chop()}}else typeof S.delete=="number"&&typeof A.retain=="number"&&b.push(S)}return b.chop()},f.prototype.concat=function(g){var v=new f(this.ops.slice());return g.ops.length>0&&(v.push(g.ops[0]),v.ops=v.ops.concat(g.ops.slice(1))),v},f.prototype.diff=function(g,v){if(this.ops===g.ops)return new f;var p=[this,g].map(function(E){return E.map(function(A){if(A.insert!=null)return typeof A.insert=="string"?A.insert:h;var S=E===g?"on":"with";throw new Error("diff() called "+S+" non-document")}).join("")}),y=new f,_=a(p[0],p[1],v),x=u.iterator(this.ops),b=u.iterator(g.ops);return _.forEach(function(E){for(var A=E[1].length;A>0;){var S=0;switch(E[0]){case a.INSERT:S=Math.min(b.peekLength(),A),y.push(b.next(S));break;case a.DELETE:S=Math.min(A,x.peekLength()),x.next(S),y.delete(S);break;case a.EQUAL:S=Math.min(x.peekLength(),b.peekLength(),A);var k=x.next(S),I=b.next(S);o(k.insert,I.insert)?y.retain(S,u.attributes.diff(k.attributes,I.attributes)):y.push(I).delete(S);break}A-=S}}),y.chop()},f.prototype.eachLine=function(g,v){v=v||`
|
|
119
|
-
`;for(var p=u.iterator(this.ops),y=new f,_=0;p.hasNext();){if(p.peekType()!=="insert")return;var x=p.peek(),b=u.length(x)-p.peekLength(),E=typeof x.insert=="string"?x.insert.indexOf(v,b)-b:-1;if(E<0)y.push(p.next());else if(E>0)y.push(p.next(E));else{if(g(y,p.next(1).attributes||{},_)===!1)return;_+=1,y=new f}}y.length()>0&&g(y,{},_)},f.prototype.transform=function(g,v){if(v=!!v,typeof g=="number")return this.transformPosition(g,v);for(var p=u.iterator(this.ops),y=u.iterator(g.ops),_=new f;p.hasNext()||y.hasNext();)if(p.peekType()==="insert"&&(v||y.peekType()!=="insert"))_.retain(u.length(p.next()));else if(y.peekType()==="insert")_.push(y.next());else{var x=Math.min(p.peekLength(),y.peekLength()),b=p.next(x),E=y.next(x);if(b.delete)continue;E.delete?_.push(E):_.retain(x,u.attributes.transform(b.attributes,E.attributes,v))}return _.chop()},f.prototype.transformPosition=function(g,v){v=!!v;for(var p=u.iterator(this.ops),y=0;p.hasNext()&&y<=g;){var _=p.peekLength(),x=p.peekType();if(p.next(),x==="delete"){g-=Math.min(_,g-y);continue}else x==="insert"&&(y<g||!v)&&(g+=_);y+=_}return g},r.exports=f},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u=function(p){return typeof Array.isArray=="function"?Array.isArray(p):a.call(p)==="[object Array]"},h=function(p){if(!p||a.call(p)!=="[object Object]")return!1;var y=i.call(p,"constructor"),_=p.constructor&&p.constructor.prototype&&i.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!y&&!_)return!1;var x;for(x in p);return typeof x>"u"||i.call(p,x)},f=function(p,y){o&&y.name==="__proto__"?o(p,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):p[y.name]=y.newValue},g=function(p,y){if(y==="__proto__")if(i.call(p,y)){if(s)return s(p,y).value}else return;return p[y]};r.exports=function v(){var p,y,_,x,b,E,A=arguments[0],S=1,k=arguments.length,I=!1;for(typeof A=="boolean"&&(I=A,A=arguments[1]||{},S=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});S<k;++S)if(p=arguments[S],p!=null)for(y in p)_=g(A,y),x=g(p,y),A!==x&&(I&&x&&(h(x)||(b=u(x)))?(b?(b=!1,E=_&&u(_)?_:[]):E=_&&h(_)?_:{},f(A,{name:y,newValue:v(I,E,x)})):typeof x<"u"&&f(A,{name:y,newValue:x}));return A}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var a=function(){function T(L,$){for(var q=0;q<$.length;q++){var J=$[q];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(L,J.key,J)}}return function(L,$,q){return $&&T(L.prototype,$),q&&T(L,q),L}}(),o=function T(L,$,q){L===null&&(L=Function.prototype);var J=Object.getOwnPropertyDescriptor(L,$);if(J===void 0){var ae=Object.getPrototypeOf(L);return ae===null?void 0:T(ae,$,q)}else{if("value"in J)return J.value;var ie=J.get;return ie===void 0?void 0:ie.call(q)}},s=i(3),u=A(s),h=i(2),f=A(h),g=i(0),v=A(g),p=i(16),y=A(p),_=i(6),x=A(_),b=i(7),E=A(b);function A(T){return T&&T.__esModule?T:{default:T}}function S(T,L){if(!(T instanceof L))throw new TypeError("Cannot call a class as a function")}function k(T,L){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:T}function I(T,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);T.prototype=Object.create(L&&L.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(T,L):T.__proto__=L)}var O=1,M=function(T){I(L,T);function L(){return S(this,L),k(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 v.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new f.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(q,J){var ae=v.default.query(q,v.default.Scope.BLOCK_ATTRIBUTE);ae!=null&&this.attributes.attribute(ae,J)}},{key:"formatAt",value:function(q,J,ae,ie){this.format(ae,ie)}},{key:"insertAt",value:function(q,J,ae){if(typeof J=="string"&&J.endsWith(`
|
|
120
|
-
`)){var ie=v.default.create(F.blotName);this.parent.insertBefore(ie,q===0?this:this.next),ie.insertAt(0,J.slice(0,-1))}else o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,q,J,ae)}}]),L}(v.default.Embed);M.scope=v.default.Scope.BLOCK_BLOT;var F=function(T){I(L,T);function L($){S(this,L);var q=k(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,$));return q.cache={},q}return a(L,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(v.default.Leaf).reduce(function(q,J){return J.length()===0?q:q.insert(J.value(),j(J))},new f.default).insert(`
|
|
121
|
-
`,j(this))),this.cache.delta}},{key:"deleteAt",value:function(q,J){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"deleteAt",this).call(this,q,J),this.cache={}}},{key:"formatAt",value:function(q,J,ae,ie){J<=0||(v.default.query(ae,v.default.Scope.BLOCK)?q+J===this.length()&&this.format(ae,ie):o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"formatAt",this).call(this,q,Math.min(J,this.length()-q-1),ae,ie),this.cache={})}},{key:"insertAt",value:function(q,J,ae){if(ae!=null)return o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,q,J,ae);if(J.length!==0){var ie=J.split(`
|
|
122
|
-
`),Z=ie.shift();Z.length>0&&(q<this.length()-1||this.children.tail==null?o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertAt",this).call(this,Math.min(q,this.length()-1),Z):this.children.tail.insertAt(this.children.tail.length(),Z),this.cache={});var te=this;ie.reduce(function(V,B){return te=te.split(V,!0),te.insertAt(0,B),B.length},q+Z.length)}}},{key:"insertBefore",value:function(q,J){var ae=this.children.head;o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"insertBefore",this).call(this,q,J),ae instanceof y.default&&ae.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"length",this).call(this)+O),this.cache.length}},{key:"moveChildren",value:function(q,J){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"moveChildren",this).call(this,q,J),this.cache={}}},{key:"optimize",value:function(q){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"optimize",this).call(this,q),this.cache={}}},{key:"path",value:function(q){return o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"path",this).call(this,q,!0)}},{key:"removeChild",value:function(q){o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"removeChild",this).call(this,q),this.cache={}}},{key:"split",value:function(q){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(J&&(q===0||q>=this.length()-O)){var ae=this.clone();return q===0?(this.parent.insertBefore(ae,this),this):(this.parent.insertBefore(ae,this.next),ae)}else{var ie=o(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"split",this).call(this,q,J);return this.cache={},ie}}}]),L}(v.default.Block);F.blotName="block",F.tagName="P",F.defaultChild="break",F.allowedChildren=[x.default,v.default.Embed,E.default];function j(T){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return T==null||(typeof T.formats=="function"&&(L=(0,u.default)(L,T.formats())),T.parent==null||T.parent.blotName=="scroll"||T.parent.statics.scope!==T.statics.scope)?L:j(T.parent,L)}n.bubbleFormats=j,n.BlockEmbed=M,n.default=F},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},o=function(){function te(V,B){var D=[],U=!0,X=!1,ee=void 0;try{for(var K=V[Symbol.iterator](),oe;!(U=(oe=K.next()).done)&&(D.push(oe.value),!(B&&D.length===B));U=!0);}catch(me){X=!0,ee=me}finally{try{!U&&K.return&&K.return()}finally{if(X)throw ee}}return D}return function(V,B){if(Array.isArray(V))return V;if(Symbol.iterator in Object(V))return te(V,B);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function te(V,B){for(var D=0;D<B.length;D++){var U=B[D];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(V,U.key,U)}}return function(V,B,D){return B&&te(V.prototype,B),D&&te(V,D),V}}();i(50);var u=i(2),h=j(u),f=i(14),g=j(f),v=i(8),p=j(v),y=i(9),_=j(y),x=i(0),b=j(x),E=i(15),A=j(E),S=i(3),k=j(S),I=i(10),O=j(I),M=i(34),F=j(M);function j(te){return te&&te.__esModule?te:{default:te}}function T(te,V,B){return V in te?Object.defineProperty(te,V,{value:B,enumerable:!0,configurable:!0,writable:!0}):te[V]=B,te}function L(te,V){if(!(te instanceof V))throw new TypeError("Cannot call a class as a function")}var $=(0,O.default)("quill"),q=function(){s(te,null,[{key:"debug",value:function(B){B===!0&&(B="log"),O.default.level(B)}},{key:"find",value:function(B){return B.__quill||b.default.find(B)}},{key:"import",value:function(B){return this.imports[B]==null&&$.error("Cannot import "+B+". Are you sure it was registered?"),this.imports[B]}},{key:"register",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof B!="string"){var ee=B.attrName||B.blotName;typeof ee=="string"?this.register("formats/"+ee,B,D):Object.keys(B).forEach(function(K){U.register(K,B[K],D)})}else this.imports[B]!=null&&!X&&$.warn("Overwriting "+B+" with",D),this.imports[B]=D,(B.startsWith("blots/")||B.startsWith("formats/"))&&D.blotName!=="abstract"?b.default.register(D):B.startsWith("modules")&&typeof D.register=="function"&&D.register()}}]);function te(V){var B=this,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(L(this,te),this.options=J(V,D),this.container=this.options.container,this.container==null)return $.error("Invalid Quill container",V);this.options.debug&&te.debug(this.options.debug);var U=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new p.default,this.scroll=b.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new g.default(this.scroll),this.selection=new A.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(p.default.events.EDITOR_CHANGE,function(ee){ee===p.default.events.TEXT_CHANGE&&B.root.classList.toggle("ql-blank",B.editor.isBlank())}),this.emitter.on(p.default.events.SCROLL_UPDATE,function(ee,K){var oe=B.selection.lastRange,me=oe&&oe.length===0?oe.index:void 0;ae.call(B,function(){return B.editor.update(null,K,me)},ee)});var X=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+U+"<p><br></p></div>");this.setContents(X),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return s(te,[{key:"addContainer",value:function(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof B=="string"){var U=B;B=document.createElement("div"),B.classList.add(U)}return this.container.insertBefore(B,D),B}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(B,D,U){var X=this,ee=ie(B,D,U),K=o(ee,4);return B=K[0],D=K[1],U=K[3],ae.call(this,function(){return X.editor.deleteText(B,D)},U,B,-1*D)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(B),this.container.classList.toggle("ql-disabled",!B)}},{key:"focus",value:function(){var B=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=B,this.scrollIntoView()}},{key:"format",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;return ae.call(this,function(){var ee=U.getSelection(!0),K=new h.default;if(ee==null)return K;if(b.default.query(B,b.default.Scope.BLOCK))K=U.editor.formatLine(ee.index,ee.length,T({},B,D));else{if(ee.length===0)return U.selection.format(B,D),K;K=U.editor.formatText(ee.index,ee.length,T({},B,D))}return U.setSelection(ee,p.default.sources.SILENT),K},X)}},{key:"formatLine",value:function(B,D,U,X,ee){var K=this,oe=void 0,me=ie(B,D,U,X,ee),de=o(me,4);return B=de[0],D=de[1],oe=de[2],ee=de[3],ae.call(this,function(){return K.editor.formatLine(B,D,oe)},ee,B,0)}},{key:"formatText",value:function(B,D,U,X,ee){var K=this,oe=void 0,me=ie(B,D,U,X,ee),de=o(me,4);return B=de[0],D=de[1],oe=de[2],ee=de[3],ae.call(this,function(){return K.editor.formatText(B,D,oe)},ee,B,0)}},{key:"getBounds",value:function(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,U=void 0;typeof B=="number"?U=this.selection.getBounds(B,D):U=this.selection.getBounds(B.index,B.length);var X=this.container.getBoundingClientRect();return{bottom:U.bottom-X.top,height:U.height,left:U.left-X.left,right:U.right-X.left,top:U.top-X.top,width:U.width}}},{key:"getContents",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-B,U=ie(B,D),X=o(U,2);return B=X[0],D=X[1],this.editor.getContents(B,D)}},{key:"getFormat",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof B=="number"?this.editor.getFormat(B,D):this.editor.getFormat(B.index,B.length)}},{key:"getIndex",value:function(B){return B.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(B){return this.scroll.leaf(B)}},{key:"getLine",value:function(B){return this.scroll.line(B)}},{key:"getLines",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof B!="number"?this.scroll.lines(B.index,B.length):this.scroll.lines(B,D)}},{key:"getModule",value:function(B){return this.theme.modules[B]}},{key:"getSelection",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return B&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-B,U=ie(B,D),X=o(U,2);return B=X[0],D=X[1],this.editor.getText(B,D)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(B,D,U){var X=this,ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:te.sources.API;return ae.call(this,function(){return X.editor.insertEmbed(B,D,U)},ee,B)}},{key:"insertText",value:function(B,D,U,X,ee){var K=this,oe=void 0,me=ie(B,0,U,X,ee),de=o(me,4);return B=de[0],oe=de[2],ee=de[3],ae.call(this,function(){return K.editor.insertText(B,D,oe)},ee,B,D.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(B,D,U){this.clipboard.dangerouslyPasteHTML(B,D,U)}},{key:"removeFormat",value:function(B,D,U){var X=this,ee=ie(B,D,U),K=o(ee,4);return B=K[0],D=K[1],U=K[3],ae.call(this,function(){return X.editor.removeFormat(B,D)},U,B)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(B){var D=this,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return ae.call(this,function(){B=new h.default(B);var X=D.getLength(),ee=D.editor.deleteText(0,X),K=D.editor.applyDelta(B),oe=K.ops[K.ops.length-1];oe!=null&&typeof oe.insert=="string"&&oe.insert[oe.insert.length-1]===`
|
|
123
|
-
`&&(D.editor.deleteText(D.getLength()-1,1),K.delete(1));var me=ee.compose(K);return me},U)}},{key:"setSelection",value:function(B,D,U){if(B==null)this.selection.setRange(null,D||te.sources.API);else{var X=ie(B,D,U),ee=o(X,4);B=ee[0],D=ee[1],U=ee[3],this.selection.setRange(new E.Range(B,D),U),U!==p.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API,U=new h.default().insert(B);return this.setContents(U,D)}},{key:"update",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p.default.sources.USER,D=this.scroll.update(B);return this.selection.update(B),D}},{key:"updateContents",value:function(B){var D=this,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return ae.call(this,function(){return B=new h.default(B),D.editor.applyDelta(B,U)},U,!0)}}]),te}();q.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},q.events=p.default.events,q.sources=p.default.sources,q.version="1.3.7",q.imports={delta:h.default,parchment:b.default,"core/module":_.default,"core/theme":F.default};function J(te,V){if(V=(0,k.default)(!0,{container:te,modules:{clipboard:!0,keyboard:!0,history:!0}},V),!V.theme||V.theme===q.DEFAULTS.theme)V.theme=F.default;else if(V.theme=q.import("themes/"+V.theme),V.theme==null)throw new Error("Invalid theme "+V.theme+". Did you register it?");var B=(0,k.default)(!0,{},V.theme.DEFAULTS);[B,V].forEach(function(X){X.modules=X.modules||{},Object.keys(X.modules).forEach(function(ee){X.modules[ee]===!0&&(X.modules[ee]={})})});var D=Object.keys(B.modules).concat(Object.keys(V.modules)),U=D.reduce(function(X,ee){var K=q.import("modules/"+ee);return K==null?$.error("Cannot load "+ee+" module. Are you sure you registered it?"):X[ee]=K.DEFAULTS||{},X},{});return V.modules!=null&&V.modules.toolbar&&V.modules.toolbar.constructor!==Object&&(V.modules.toolbar={container:V.modules.toolbar}),V=(0,k.default)(!0,{},q.DEFAULTS,{modules:U},B,V),["bounds","container","scrollingContainer"].forEach(function(X){typeof V[X]=="string"&&(V[X]=document.querySelector(V[X]))}),V.modules=Object.keys(V.modules).reduce(function(X,ee){return V.modules[ee]&&(X[ee]=V.modules[ee]),X},{}),V}function ae(te,V,B,D){if(this.options.strict&&!this.isEnabled()&&V===p.default.sources.USER)return new h.default;var U=B==null?null:this.getSelection(),X=this.editor.delta,ee=te();if(U!=null&&(B===!0&&(B=U.index),D==null?U=Z(U,ee,V):D!==0&&(U=Z(U,B,D,V)),this.setSelection(U,p.default.sources.SILENT)),ee.length()>0){var K,oe=[p.default.events.TEXT_CHANGE,ee,X,V];if((K=this.emitter).emit.apply(K,[p.default.events.EDITOR_CHANGE].concat(oe)),V!==p.default.sources.SILENT){var me;(me=this.emitter).emit.apply(me,oe)}}return ee}function ie(te,V,B,D,U){var X={};return typeof te.index=="number"&&typeof te.length=="number"?typeof V!="number"?(U=D,D=B,B=V,V=te.length,te=te.index):(V=te.length,te=te.index):typeof V!="number"&&(U=D,D=B,B=V,V=0),(typeof B>"u"?"undefined":a(B))==="object"?(X=B,U=D):typeof B=="string"&&(D!=null?X[B]=D:U=B),U=U||p.default.sources.API,[te,V,X,U]}function Z(te,V,B,D){if(te==null)return null;var U=void 0,X=void 0;if(V instanceof h.default){var ee=[te.index,te.index+te.length].map(function(de){return V.transformPosition(de,D!==p.default.sources.USER)}),K=o(ee,2);U=K[0],X=K[1]}else{var oe=[te.index,te.index+te.length].map(function(de){return de<V||de===V&&D===p.default.sources.USER?de:B>=0?de+B:Math.max(V,de+B)}),me=o(oe,2);U=me[0],X=me[1]}return new E.Range(U,X-U)}n.expandConfig=J,n.overload=ie,n.default=q},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(b,E){for(var A=0;A<E.length;A++){var S=E[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,A){return E&&x(b.prototype,E),A&&x(b,A),b}}(),o=function x(b,E,A){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,E);if(S===void 0){var k=Object.getPrototypeOf(b);return k===null?void 0:x(k,E,A)}else{if("value"in S)return S.value;var I=S.get;return I===void 0?void 0:I.call(A)}},s=i(7),u=g(s),h=i(0),f=g(h);function g(x){return x&&x.__esModule?x:{default:x}}function v(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function p(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function y(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var _=function(x){y(b,x);function b(){return v(this,b),p(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"formatAt",value:function(A,S,k,I){if(b.compare(this.statics.blotName,k)<0&&f.default.query(k,f.default.Scope.BLOT)){var O=this.isolate(A,S);I&&O.wrap(k,I)}else o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"formatAt",this).call(this,A,S,k,I)}},{key:"optimize",value:function(A){if(o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,A),this.parent instanceof b&&b.compare(this.statics.blotName,this.parent.statics.blotName)>0){var S=this.parent.isolate(this.offset(),this.length());this.moveChildren(S),S.wrap(this)}}}],[{key:"compare",value:function(A,S){var k=b.order.indexOf(A),I=b.order.indexOf(S);return k>=0||I>=0?k-I:A===S?0:A<S?-1:1}}]),b}(f.default.Inline);_.allowedChildren=[_,f.default.Embed,u.default],_.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=s(a);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,p){if(!(v instanceof p))throw new TypeError("Cannot call a class as a function")}function h(v,p){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:v}function f(v,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);v.prototype=Object.create(p&&p.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(v,p):v.__proto__=p)}var g=function(v){f(p,v);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default.Text);n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(A,S){for(var k=0;k<S.length;k++){var I=S[k];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(A,I.key,I)}}return function(A,S,k){return S&&E(A.prototype,S),k&&E(A,k),A}}(),o=function E(A,S,k){A===null&&(A=Function.prototype);var I=Object.getOwnPropertyDescriptor(A,S);if(I===void 0){var O=Object.getPrototypeOf(A);return O===null?void 0:E(O,S,k)}else{if("value"in I)return I.value;var M=I.get;return M===void 0?void 0:M.call(k)}},s=i(54),u=g(s),h=i(10),f=g(h);function g(E){return E&&E.__esModule?E:{default:E}}function v(E,A){if(!(E instanceof A))throw new TypeError("Cannot call a class as a function")}function p(E,A){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:E}function y(E,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);E.prototype=Object.create(A&&A.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(E,A):E.__proto__=A)}var _=(0,f.default)("quill:events"),x=["selectionchange","mousedown","mouseup","click"];x.forEach(function(E){document.addEventListener(E,function(){for(var A=arguments.length,S=Array(A),k=0;k<A;k++)S[k]=arguments[k];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(I){if(I.__quill&&I.__quill.emitter){var O;(O=I.__quill.emitter).handleDOM.apply(O,S)}})})});var b=function(E){y(A,E);function A(){v(this,A);var S=p(this,(A.__proto__||Object.getPrototypeOf(A)).call(this));return S.listeners={},S.on("error",_.error),S}return a(A,[{key:"emit",value:function(){_.log.apply(_,arguments),o(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(k){for(var I=arguments.length,O=Array(I>1?I-1:0),M=1;M<I;M++)O[M-1]=arguments[M];(this.listeners[k.type]||[]).forEach(function(F){var j=F.node,T=F.handler;(k.target===j||j.contains(k.target))&&T.apply(void 0,[k].concat(O))})}},{key:"listenDOM",value:function(k,I,O){this.listeners[k]||(this.listeners[k]=[]),this.listeners[k].push({node:I,handler:O})}}]),A}(u.default);b.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},b.sources={API:"api",SILENT:"silent",USER:"user"},n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function a(s,u){if(!(s instanceof u))throw new TypeError("Cannot call a class as a function")}var o=function s(u){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,s),this.quill=u,this.options=h};o.DEFAULTS={},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=["error","warn","log","info"],o="warn";function s(h){if(a.indexOf(h)<=a.indexOf(o)){for(var f,g=arguments.length,v=Array(g>1?g-1:0),p=1;p<g;p++)v[p-1]=arguments[p];(f=console)[h].apply(f,v)}}function u(h){return a.reduce(function(f,g){return f[g]=s.bind(console,g,h),f},{})}s.level=u.level=function(h){o=h},n.default=u},function(r,n,i){var a=Array.prototype.slice,o=i(52),s=i(53),u=r.exports=function(v,p,y){return y||(y={}),v===p?!0:v instanceof Date&&p instanceof Date?v.getTime()===p.getTime():!v||!p||typeof v!="object"&&typeof p!="object"?y.strict?v===p:v==p:g(v,p,y)};function h(v){return v==null}function f(v){return!(!v||typeof v!="object"||typeof v.length!="number"||typeof v.copy!="function"||typeof v.slice!="function"||v.length>0&&typeof v[0]!="number")}function g(v,p,y){var _,x;if(h(v)||h(p)||v.prototype!==p.prototype)return!1;if(s(v))return s(p)?(v=a.call(v),p=a.call(p),u(v,p,y)):!1;if(f(v)){if(!f(p)||v.length!==p.length)return!1;for(_=0;_<v.length;_++)if(v[_]!==p[_])return!1;return!0}try{var b=o(v),E=o(p)}catch{return!1}if(b.length!=E.length)return!1;for(b.sort(),E.sort(),_=b.length-1;_>=0;_--)if(b[_]!=E[_])return!1;for(_=b.length-1;_>=0;_--)if(x=b[_],!u(v[x],p[x],y))return!1;return typeof v==typeof p}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function s(u,h,f){f===void 0&&(f={}),this.attrName=u,this.keyName=h;var g=a.Scope.TYPE&a.Scope.ATTRIBUTE;f.scope!=null?this.scope=f.scope&a.Scope.LEVEL|g:this.scope=a.Scope.ATTRIBUTE,f.whitelist!=null&&(this.whitelist=f.whitelist)}return s.keys=function(u){return[].map.call(u.attributes,function(h){return h.name})},s.prototype.add=function(u,h){return this.canAdd(u,h)?(u.setAttribute(this.keyName,h),!0):!1},s.prototype.canAdd=function(u,h){var f=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return f==null?!1:this.whitelist==null?!0:typeof h=="string"?this.whitelist.indexOf(h.replace(/["']/g,""))>-1:this.whitelist.indexOf(h)>-1},s.prototype.remove=function(u){u.removeAttribute(this.keyName)},s.prototype.value=function(u){var h=u.getAttribute(this.keyName);return this.canAdd(u,h)&&h?h:""},s}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var a=function(){function M(F,j){var T=[],L=!0,$=!1,q=void 0;try{for(var J=F[Symbol.iterator](),ae;!(L=(ae=J.next()).done)&&(T.push(ae.value),!(j&&T.length===j));L=!0);}catch(ie){$=!0,q=ie}finally{try{!L&&J.return&&J.return()}finally{if($)throw q}}return T}return function(F,j){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return M(F,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function M(F,j){for(var T=0;T<j.length;T++){var L=j[T];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(F,L.key,L)}}return function(F,j,T){return j&&M(F.prototype,j),T&&M(F,T),F}}(),s=function M(F,j,T){F===null&&(F=Function.prototype);var L=Object.getOwnPropertyDescriptor(F,j);if(L===void 0){var $=Object.getPrototypeOf(F);return $===null?void 0:M($,j,T)}else{if("value"in L)return L.value;var q=L.get;return q===void 0?void 0:q.call(T)}},u=i(2),h=E(u),f=i(0),g=E(f),v=i(4),p=E(v),y=i(6),_=E(y),x=i(7),b=E(x);function E(M){return M&&M.__esModule?M:{default:M}}function A(M,F){if(!(M instanceof F))throw new TypeError("Cannot call a class as a function")}function S(M,F){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return F&&(typeof F=="object"||typeof F=="function")?F:M}function k(M,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);M.prototype=Object.create(F&&F.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(M,F):M.__proto__=F)}var I=function(M){k(F,M);function F(){return A(this,F),S(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return F}(_.default);I.blotName="code",I.tagName="CODE";var O=function(M){k(F,M);function F(){return A(this,F),S(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}return o(F,[{key:"delta",value:function(){var T=this,L=this.domNode.textContent;return L.endsWith(`
|
|
124
|
-
`)&&(L=L.slice(0,-1)),L.split(`
|
|
125
|
-
`).reduce(function($,q){return $.insert(q).insert(`
|
|
126
|
-
`,T.formats())},new h.default)}},{key:"format",value:function(T,L){if(!(T===this.statics.blotName&&L)){var $=this.descendant(b.default,this.length()-1),q=a($,1),J=q[0];J?.deleteAt(J.length()-1,1),s(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"format",this).call(this,T,L)}}},{key:"formatAt",value:function(T,L,$,q){if(L!==0&&!(g.default.query($,g.default.Scope.BLOCK)==null||$===this.statics.blotName&&q===this.statics.formats(this.domNode))){var J=this.newlineIndex(T);if(!(J<0||J>=T+L)){var ae=this.newlineIndex(T,!0)+1,ie=J-ae+1,Z=this.isolate(ae,ie),te=Z.next;Z.format($,q),te instanceof F&&te.formatAt(0,T-ae+L-ie,$,q)}}}},{key:"insertAt",value:function(T,L,$){if($==null){var q=this.descendant(b.default,T),J=a(q,2),ae=J[0],ie=J[1];ae.insertAt(ie,L)}}},{key:"length",value:function(){var T=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
|
127
|
-
`)?T:T+1}},{key:"newlineIndex",value:function(T){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(L)return this.domNode.textContent.slice(0,T).lastIndexOf(`
|
|
128
|
-
`);var $=this.domNode.textContent.slice(T).indexOf(`
|
|
129
|
-
`);return $>-1?T+$:-1}},{key:"optimize",value:function(T){this.domNode.textContent.endsWith(`
|
|
130
|
-
`)||this.appendChild(g.default.create("text",`
|
|
131
|
-
`)),s(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"optimize",this).call(this,T);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(T),L.moveChildren(this),L.remove())}},{key:"replace",value:function(T){s(F.prototype.__proto__||Object.getPrototypeOf(F.prototype),"replace",this).call(this,T),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(L){var $=g.default.find(L);$==null?L.parentNode.removeChild(L):$ instanceof g.default.Embed?$.remove():$.unwrap()})}}],[{key:"create",value:function(T){var L=s(F.__proto__||Object.getPrototypeOf(F),"create",this).call(this,T);return L.setAttribute("spellcheck",!1),L}},{key:"formats",value:function(){return!0}}]),F}(p.default);O.blotName="code-block",O.tagName="PRE",O.TAB=" ",n.Code=I,n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},o=function(){function te(V,B){var D=[],U=!0,X=!1,ee=void 0;try{for(var K=V[Symbol.iterator](),oe;!(U=(oe=K.next()).done)&&(D.push(oe.value),!(B&&D.length===B));U=!0);}catch(me){X=!0,ee=me}finally{try{!U&&K.return&&K.return()}finally{if(X)throw ee}}return D}return function(V,B){if(Array.isArray(V))return V;if(Symbol.iterator in Object(V))return te(V,B);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function te(V,B){for(var D=0;D<B.length;D++){var U=B[D];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(V,U.key,U)}}return function(V,B,D){return B&&te(V.prototype,B),D&&te(V,D),V}}(),u=i(2),h=L(u),f=i(20),g=L(f),v=i(0),p=L(v),y=i(13),_=L(y),x=i(24),b=L(x),E=i(4),A=L(E),S=i(16),k=L(S),I=i(21),O=L(I),M=i(11),F=L(M),j=i(3),T=L(j);function L(te){return te&&te.__esModule?te:{default:te}}function $(te,V,B){return V in te?Object.defineProperty(te,V,{value:B,enumerable:!0,configurable:!0,writable:!0}):te[V]=B,te}function q(te,V){if(!(te instanceof V))throw new TypeError("Cannot call a class as a function")}var J=/^[ -~]*$/,ae=function(){function te(V){q(this,te),this.scroll=V,this.delta=this.getDelta()}return s(te,[{key:"applyDelta",value:function(B){var D=this,U=!1;this.scroll.update();var X=this.scroll.length();return this.scroll.batchStart(),B=Z(B),B.reduce(function(ee,K){var oe=K.retain||K.delete||K.insert.length||1,me=K.attributes||{};if(K.insert!=null){if(typeof K.insert=="string"){var de=K.insert;de.endsWith(`
|
|
132
|
-
`)&&U&&(U=!1,de=de.slice(0,-1)),ee>=X&&!de.endsWith(`
|
|
133
|
-
`)&&(U=!0),D.scroll.insertAt(ee,de);var ye=D.scroll.line(ee),Te=o(ye,2),Ce=Te[0],Ie=Te[1],Ee=(0,T.default)({},(0,E.bubbleFormats)(Ce));if(Ce instanceof A.default){var ge=Ce.descendant(p.default.Leaf,Ie),Re=o(ge,1),Be=Re[0];Ee=(0,T.default)(Ee,(0,E.bubbleFormats)(Be))}me=g.default.attributes.diff(Ee,me)||{}}else if(a(K.insert)==="object"){var Oe=Object.keys(K.insert)[0];if(Oe==null)return ee;D.scroll.insertAt(ee,Oe,K.insert[Oe])}X+=oe}return Object.keys(me).forEach(function(fe){D.scroll.formatAt(ee,oe,fe,me[fe])}),ee+oe},0),B.reduce(function(ee,K){return typeof K.delete=="number"?(D.scroll.deleteAt(ee,K.delete),ee):ee+(K.retain||K.insert.length||1)},0),this.scroll.batchEnd(),this.update(B)}},{key:"deleteText",value:function(B,D){return this.scroll.deleteAt(B,D),this.update(new h.default().retain(B).delete(D))}},{key:"formatLine",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(X).forEach(function(ee){if(!(U.scroll.whitelist!=null&&!U.scroll.whitelist[ee])){var K=U.scroll.lines(B,Math.max(D,1)),oe=D;K.forEach(function(me){var de=me.length();if(!(me instanceof _.default))me.format(ee,X[ee]);else{var ye=B-me.offset(U.scroll),Te=me.newlineIndex(ye+oe)-ye+1;me.formatAt(ye,Te,ee,X[ee])}oe-=de})}}),this.scroll.optimize(),this.update(new h.default().retain(B).retain(D,(0,O.default)(X)))}},{key:"formatText",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(X).forEach(function(ee){U.scroll.formatAt(B,D,ee,X[ee])}),this.update(new h.default().retain(B).retain(D,(0,O.default)(X)))}},{key:"getContents",value:function(B,D){return this.delta.slice(B,B+D)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(B,D){return B.concat(D.delta())},new h.default)}},{key:"getFormat",value:function(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,U=[],X=[];D===0?this.scroll.path(B).forEach(function(K){var oe=o(K,1),me=oe[0];me instanceof A.default?U.push(me):me instanceof p.default.Leaf&&X.push(me)}):(U=this.scroll.lines(B,D),X=this.scroll.descendants(p.default.Leaf,B,D));var ee=[U,X].map(function(K){if(K.length===0)return{};for(var oe=(0,E.bubbleFormats)(K.shift());Object.keys(oe).length>0;){var me=K.shift();if(me==null)return oe;oe=ie((0,E.bubbleFormats)(me),oe)}return oe});return T.default.apply(T.default,ee)}},{key:"getText",value:function(B,D){return this.getContents(B,D).filter(function(U){return typeof U.insert=="string"}).map(function(U){return U.insert}).join("")}},{key:"insertEmbed",value:function(B,D,U){return this.scroll.insertAt(B,D,U),this.update(new h.default().retain(B).insert($({},D,U)))}},{key:"insertText",value:function(B,D){var U=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return D=D.replace(/\r\n/g,`
|
|
134
|
-
`).replace(/\r/g,`
|
|
135
|
-
`),this.scroll.insertAt(B,D),Object.keys(X).forEach(function(ee){U.scroll.formatAt(B,D.length,ee,X[ee])}),this.update(new h.default().retain(B).insert(D,(0,O.default)(X)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var B=this.scroll.children.head;return B.statics.blotName!==A.default.blotName||B.children.length>1?!1:B.children.head instanceof k.default}},{key:"removeFormat",value:function(B,D){var U=this.getText(B,D),X=this.scroll.line(B+D),ee=o(X,2),K=ee[0],oe=ee[1],me=0,de=new h.default;K!=null&&(K instanceof _.default?me=K.newlineIndex(oe)-oe+1:me=K.length()-oe,de=K.delta().slice(oe,oe+me-1).insert(`
|
|
136
|
-
`));var ye=this.getContents(B,D+me),Te=ye.diff(new h.default().insert(U).concat(de)),Ce=new h.default().retain(B).concat(Te);return this.applyDelta(Ce)}},{key:"update",value:function(B){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,X=this.delta;if(D.length===1&&D[0].type==="characterData"&&D[0].target.data.match(J)&&p.default.find(D[0].target)){var ee=p.default.find(D[0].target),K=(0,E.bubbleFormats)(ee),oe=ee.offset(this.scroll),me=D[0].oldValue.replace(b.default.CONTENTS,""),de=new h.default().insert(me),ye=new h.default().insert(ee.value()),Te=new h.default().retain(oe).concat(de.diff(ye,U));B=Te.reduce(function(Ce,Ie){return Ie.insert?Ce.insert(Ie.insert,K):Ce.push(Ie)},new h.default),this.delta=X.compose(B)}else this.delta=this.getDelta(),(!B||!(0,F.default)(X.compose(B),this.delta))&&(B=X.diff(this.delta,U));return B}}]),te}();function ie(te,V){return Object.keys(V).reduce(function(B,D){return te[D]==null||(V[D]===te[D]?B[D]=V[D]:Array.isArray(V[D])?V[D].indexOf(te[D])<0&&(B[D]=V[D].concat([te[D]])):B[D]=[V[D],te[D]]),B},{})}function Z(te){return te.reduce(function(V,B){if(B.insert===1){var D=(0,O.default)(B.attributes);return delete D.image,V.insert({image:B.attributes.image},D)}if(B.attributes!=null&&(B.attributes.list===!0||B.attributes.bullet===!0)&&(B=(0,O.default)(B),B.attributes.list?B.attributes.list="ordered":(B.attributes.list="bullet",delete B.attributes.bullet)),typeof B.insert=="string"){var U=B.insert.replace(/\r\n/g,`
|
|
137
|
-
`).replace(/\r/g,`
|
|
138
|
-
`);return V.insert(U,B.attributes)}return V.push(B)},new h.default)}n.default=ae},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function M(F,j){var T=[],L=!0,$=!1,q=void 0;try{for(var J=F[Symbol.iterator](),ae;!(L=(ae=J.next()).done)&&(T.push(ae.value),!(j&&T.length===j));L=!0);}catch(ie){$=!0,q=ie}finally{try{!L&&J.return&&J.return()}finally{if($)throw q}}return T}return function(F,j){if(Array.isArray(F))return F;if(Symbol.iterator in Object(F))return M(F,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function M(F,j){for(var T=0;T<j.length;T++){var L=j[T];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(F,L.key,L)}}return function(F,j,T){return j&&M(F.prototype,j),T&&M(F,T),F}}(),s=i(0),u=b(s),h=i(21),f=b(h),g=i(11),v=b(g),p=i(8),y=b(p),_=i(10),x=b(_);function b(M){return M&&M.__esModule?M:{default:M}}function E(M){if(Array.isArray(M)){for(var F=0,j=Array(M.length);F<M.length;F++)j[F]=M[F];return j}else return Array.from(M)}function A(M,F){if(!(M instanceof F))throw new TypeError("Cannot call a class as a function")}var S=(0,x.default)("quill:selection"),k=function M(F){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;A(this,M),this.index=F,this.length=j},I=function(){function M(F,j){var T=this;A(this,M),this.emitter=j,this.scroll=F,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new k(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){T.mouseDown||setTimeout(T.update.bind(T,y.default.sources.USER),1)}),this.emitter.on(y.default.events.EDITOR_CHANGE,function(L,$){L===y.default.events.TEXT_CHANGE&&$.length()>0&&T.update(y.default.sources.SILENT)}),this.emitter.on(y.default.events.SCROLL_BEFORE_UPDATE,function(){if(T.hasFocus()){var L=T.getNativeRange();L!=null&&L.start.node!==T.cursor.textNode&&T.emitter.once(y.default.events.SCROLL_UPDATE,function(){try{T.setNativeRange(L.start.node,L.start.offset,L.end.node,L.end.offset)}catch{}})}}),this.emitter.on(y.default.events.SCROLL_OPTIMIZE,function(L,$){if($.range){var q=$.range,J=q.startNode,ae=q.startOffset,ie=q.endNode,Z=q.endOffset;T.setNativeRange(J,ae,ie,Z)}}),this.update(y.default.sources.SILENT)}return o(M,[{key:"handleComposition",value:function(){var j=this;this.root.addEventListener("compositionstart",function(){j.composing=!0}),this.root.addEventListener("compositionend",function(){if(j.composing=!1,j.cursor.parent){var T=j.cursor.restore();if(!T)return;setTimeout(function(){j.setNativeRange(T.startNode,T.startOffset,T.endNode,T.endOffset)},1)}})}},{key:"handleDragging",value:function(){var j=this;this.emitter.listenDOM("mousedown",document.body,function(){j.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){j.mouseDown=!1,j.update(y.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(j,T){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[j])){this.scroll.update();var L=this.getNativeRange();if(!(L==null||!L.native.collapsed||u.default.query(j,u.default.Scope.BLOCK))){if(L.start.node!==this.cursor.textNode){var $=u.default.find(L.start.node,!1);if($==null)return;if($ instanceof u.default.Leaf){var q=$.split(L.start.offset);$.parent.insertBefore(this.cursor,q)}else $.insertBefore(this.cursor,L.start.node);this.cursor.attach()}this.cursor.format(j,T),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(j){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,L=this.scroll.length();j=Math.min(j,L-1),T=Math.min(j+T,L-1)-j;var $=void 0,q=this.scroll.leaf(j),J=a(q,2),ae=J[0],ie=J[1];if(ae==null)return null;var Z=ae.position(ie,!0),te=a(Z,2);$=te[0],ie=te[1];var V=document.createRange();if(T>0){V.setStart($,ie);var B=this.scroll.leaf(j+T),D=a(B,2);if(ae=D[0],ie=D[1],ae==null)return null;var U=ae.position(ie,!0),X=a(U,2);return $=X[0],ie=X[1],V.setEnd($,ie),V.getBoundingClientRect()}else{var ee="left",K=void 0;return $ instanceof Text?(ie<$.data.length?(V.setStart($,ie),V.setEnd($,ie+1)):(V.setStart($,ie-1),V.setEnd($,ie),ee="right"),K=V.getBoundingClientRect()):(K=ae.domNode.getBoundingClientRect(),ie>0&&(ee="right")),{bottom:K.top+K.height,height:K.height,left:K[ee],right:K[ee],top:K.top,width:0}}}},{key:"getNativeRange",value:function(){var j=document.getSelection();if(j==null||j.rangeCount<=0)return null;var T=j.getRangeAt(0);if(T==null)return null;var L=this.normalizeNative(T);return S.info("getNativeRange",L),L}},{key:"getRange",value:function(){var j=this.getNativeRange();if(j==null)return[null,null];var T=this.normalizedToRange(j);return[T,j]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(j){var T=this,L=[[j.start.node,j.start.offset]];j.native.collapsed||L.push([j.end.node,j.end.offset]);var $=L.map(function(ae){var ie=a(ae,2),Z=ie[0],te=ie[1],V=u.default.find(Z,!0),B=V.offset(T.scroll);return te===0?B:V instanceof u.default.Container?B+V.length():B+V.index(Z,te)}),q=Math.min(Math.max.apply(Math,E($)),this.scroll.length()-1),J=Math.min.apply(Math,[q].concat(E($)));return new k(J,q-J)}},{key:"normalizeNative",value:function(j){if(!O(this.root,j.startContainer)||!j.collapsed&&!O(this.root,j.endContainer))return null;var T={start:{node:j.startContainer,offset:j.startOffset},end:{node:j.endContainer,offset:j.endOffset},native:j};return[T.start,T.end].forEach(function(L){for(var $=L.node,q=L.offset;!($ instanceof Text)&&$.childNodes.length>0;)if($.childNodes.length>q)$=$.childNodes[q],q=0;else if($.childNodes.length===q)$=$.lastChild,q=$ instanceof Text?$.data.length:$.childNodes.length+1;else break;L.node=$,L.offset=q}),T}},{key:"rangeToNative",value:function(j){var T=this,L=j.collapsed?[j.index]:[j.index,j.index+j.length],$=[],q=this.scroll.length();return L.forEach(function(J,ae){J=Math.min(q-1,J);var ie=void 0,Z=T.scroll.leaf(J),te=a(Z,2),V=te[0],B=te[1],D=V.position(B,ae!==0),U=a(D,2);ie=U[0],B=U[1],$.push(ie,B)}),$.length<2&&($=$.concat($)),$}},{key:"scrollIntoView",value:function(j){var T=this.lastRange;if(T!=null){var L=this.getBounds(T.index,T.length);if(L!=null){var $=this.scroll.length()-1,q=this.scroll.line(Math.min(T.index,$)),J=a(q,1),ae=J[0],ie=ae;if(T.length>0){var Z=this.scroll.line(Math.min(T.index+T.length,$)),te=a(Z,1);ie=te[0]}if(!(ae==null||ie==null)){var V=j.getBoundingClientRect();L.top<V.top?j.scrollTop-=V.top-L.top:L.bottom>V.bottom&&(j.scrollTop+=L.bottom-V.bottom)}}}}},{key:"setNativeRange",value:function(j,T){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:j,$=arguments.length>3&&arguments[3]!==void 0?arguments[3]:T,q=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(S.info("setNativeRange",j,T,L,$),!(j!=null&&(this.root.parentNode==null||j.parentNode==null||L.parentNode==null))){var J=document.getSelection();if(J!=null)if(j!=null){this.hasFocus()||this.root.focus();var ae=(this.getNativeRange()||{}).native;if(ae==null||q||j!==ae.startContainer||T!==ae.startOffset||L!==ae.endContainer||$!==ae.endOffset){j.tagName=="BR"&&(T=[].indexOf.call(j.parentNode.childNodes,j),j=j.parentNode),L.tagName=="BR"&&($=[].indexOf.call(L.parentNode.childNodes,L),L=L.parentNode);var ie=document.createRange();ie.setStart(j,T),ie.setEnd(L,$),J.removeAllRanges(),J.addRange(ie)}}else J.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(j){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.default.sources.API;if(typeof T=="string"&&(L=T,T=!1),S.info("setRange",j),j!=null){var $=this.rangeToNative(j);this.setNativeRange.apply(this,E($).concat([T]))}else this.setNativeRange(null);this.update(L)}},{key:"update",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y.default.sources.USER,T=this.lastRange,L=this.getRange(),$=a(L,2),q=$[0],J=$[1];if(this.lastRange=q,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,v.default)(T,this.lastRange)){var ae;!this.composing&&J!=null&&J.native.collapsed&&J.start.node!==this.cursor.textNode&&this.cursor.restore();var ie=[y.default.events.SELECTION_CHANGE,(0,f.default)(this.lastRange),(0,f.default)(T),j];if((ae=this.emitter).emit.apply(ae,[y.default.events.EDITOR_CHANGE].concat(ie)),j!==y.default.sources.SILENT){var Z;(Z=this.emitter).emit.apply(Z,ie)}}}}]),M}();function O(M,F){try{F.parentNode}catch{return!1}return F instanceof Text&&(F=F.parentNode),M.contains(F)}n.Range=k,n.default=I},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}}(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var A=Object.getPrototypeOf(_);return A===null?void 0:y(A,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(0),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function g(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function v(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=function(y){v(_,y);function _(){return f(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"insertInto",value:function(b,E){b.children.length===0?o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertInto",this).call(this,b,E):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),_}(u.default.Embed);p.blotName="break",p.tagName="BR",n.default=p},function(r,n,i){var a=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,p){v.__proto__=p}||function(v,p){for(var y in p)p.hasOwnProperty(y)&&(v[y]=p[y])};return function(v,p){g(v,p);function y(){this.constructor=v}v.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(44),s=i(30),u=i(1),h=function(g){a(v,g);function v(p){var y=g.call(this,p)||this;return y.build(),y}return v.prototype.appendChild=function(p){this.insertBefore(p)},v.prototype.attach=function(){g.prototype.attach.call(this),this.children.forEach(function(p){p.attach()})},v.prototype.build=function(){var p=this;this.children=new o.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(y){try{var _=f(y);p.insertBefore(_,p.children.head||void 0)}catch(x){if(x instanceof u.ParchmentError)return;throw x}})},v.prototype.deleteAt=function(p,y){if(p===0&&y===this.length())return this.remove();this.children.forEachAt(p,y,function(_,x,b){_.deleteAt(x,b)})},v.prototype.descendant=function(p,y){var _=this.children.find(y),x=_[0],b=_[1];return p.blotName==null&&p(x)||p.blotName!=null&&x instanceof p?[x,b]:x instanceof v?x.descendant(p,b):[null,-1]},v.prototype.descendants=function(p,y,_){y===void 0&&(y=0),_===void 0&&(_=Number.MAX_VALUE);var x=[],b=_;return this.children.forEachAt(y,_,function(E,A,S){(p.blotName==null&&p(E)||p.blotName!=null&&E instanceof p)&&x.push(E),E instanceof v&&(x=x.concat(E.descendants(p,A,b))),b-=S}),x},v.prototype.detach=function(){this.children.forEach(function(p){p.detach()}),g.prototype.detach.call(this)},v.prototype.formatAt=function(p,y,_,x){this.children.forEachAt(p,y,function(b,E,A){b.formatAt(E,A,_,x)})},v.prototype.insertAt=function(p,y,_){var x=this.children.find(p),b=x[0],E=x[1];if(b)b.insertAt(E,y,_);else{var A=_==null?u.create("text",y):u.create(y,_);this.appendChild(A)}},v.prototype.insertBefore=function(p,y){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(_){return p instanceof _}))throw new u.ParchmentError("Cannot insert "+p.statics.blotName+" into "+this.statics.blotName);p.insertInto(this,y)},v.prototype.length=function(){return this.children.reduce(function(p,y){return p+y.length()},0)},v.prototype.moveChildren=function(p,y){this.children.forEach(function(_){p.insertBefore(_,y)})},v.prototype.optimize=function(p){if(g.prototype.optimize.call(this,p),this.children.length===0)if(this.statics.defaultChild!=null){var y=u.create(this.statics.defaultChild);this.appendChild(y),y.optimize(p)}else this.remove()},v.prototype.path=function(p,y){y===void 0&&(y=!1);var _=this.children.find(p,y),x=_[0],b=_[1],E=[[this,p]];return x instanceof v?E.concat(x.path(b,y)):(x!=null&&E.push([x,b]),E)},v.prototype.removeChild=function(p){this.children.remove(p)},v.prototype.replace=function(p){p instanceof v&&p.moveChildren(this),g.prototype.replace.call(this,p)},v.prototype.split=function(p,y){if(y===void 0&&(y=!1),!y){if(p===0)return this;if(p===this.length())return this.next}var _=this.clone();return this.parent.insertBefore(_,this.next),this.children.forEachAt(p,this.length(),function(x,b,E){x=x.split(b,y),_.appendChild(x)}),_},v.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},v.prototype.update=function(p,y){var _=this,x=[],b=[];p.forEach(function(E){E.target===_.domNode&&E.type==="childList"&&(x.push.apply(x,E.addedNodes),b.push.apply(b,E.removedNodes))}),b.forEach(function(E){if(!(E.parentNode!=null&&E.tagName!=="IFRAME"&&document.body.compareDocumentPosition(E)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var A=u.find(E);A!=null&&(A.domNode.parentNode==null||A.domNode.parentNode===_.domNode)&&A.detach()}}),x.filter(function(E){return E.parentNode==_.domNode}).sort(function(E,A){return E===A?0:E.compareDocumentPosition(A)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(E){var A=null;E.nextSibling!=null&&(A=u.find(E.nextSibling));var S=f(E);(S.next!=A||S.next==null)&&(S.parent!=null&&S.parent.removeChild(_),_.insertBefore(S,A||void 0))})},v}(s.default);function f(g){var v=u.find(g);if(v==null)try{v=u.create(g)}catch{v=u.create(u.Scope.INLINE),[].slice.call(g.childNodes).forEach(function(y){v.domNode.appendChild(y)}),g.parentNode&&g.parentNode.replaceChild(v.domNode,g),v.attach()}return v}n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,p){v.__proto__=p}||function(v,p){for(var y in p)p.hasOwnProperty(y)&&(v[y]=p[y])};return function(v,p){g(v,p);function y(){this.constructor=v}v.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12),s=i(31),u=i(17),h=i(1),f=function(g){a(v,g);function v(p){var y=g.call(this,p)||this;return y.attributes=new s.default(y.domNode),y}return v.formats=function(p){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return p.tagName.toLowerCase()},v.prototype.format=function(p,y){var _=h.query(p);_ instanceof o.default?this.attributes.attribute(_,y):y&&_!=null&&(p!==this.statics.blotName||this.formats()[p]!==y)&&this.replaceWith(p,y)},v.prototype.formats=function(){var p=this.attributes.values(),y=this.statics.formats(this.domNode);return y!=null&&(p[this.statics.blotName]=y),p},v.prototype.replaceWith=function(p,y){var _=g.prototype.replaceWith.call(this,p,y);return this.attributes.copy(_),_},v.prototype.update=function(p,y){var _=this;g.prototype.update.call(this,p,y),p.some(function(x){return x.target===_.domNode&&x.type==="attributes"})&&this.attributes.build()},v.prototype.wrap=function(p,y){var _=g.prototype.wrap.call(this,p,y);return _ instanceof v&&_.statics.scope===this.statics.scope&&this.attributes.move(_),_},v}(u.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var v in g)g.hasOwnProperty(v)&&(f[v]=g[v])};return function(f,g){h(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(30),s=i(1),u=function(h){a(f,h);function f(){return h!==null&&h.apply(this,arguments)||this}return f.value=function(g){return!0},f.prototype.index=function(g,v){return this.domNode===g||this.domNode.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(v,1):-1},f.prototype.position=function(g,v){var p=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return g>0&&(p+=1),[this.parent.domNode,p]},f.prototype.value=function(){var g;return g={},g[this.statics.blotName]=this.statics.value(this.domNode)||!0,g},f.scope=s.Scope.INLINE_BLOT,f}(o.default);n.default=u},function(r,n,i){var a=i(11),o=i(3),s={attributes:{compose:function(h,f,g){typeof h!="object"&&(h={}),typeof f!="object"&&(f={});var v=o(!0,{},f);g||(v=Object.keys(v).reduce(function(y,_){return v[_]!=null&&(y[_]=v[_]),y},{}));for(var p in h)h[p]!==void 0&&f[p]===void 0&&(v[p]=h[p]);return Object.keys(v).length>0?v:void 0},diff:function(h,f){typeof h!="object"&&(h={}),typeof f!="object"&&(f={});var g=Object.keys(h).concat(Object.keys(f)).reduce(function(v,p){return a(h[p],f[p])||(v[p]=f[p]===void 0?null:f[p]),v},{});return Object.keys(g).length>0?g:void 0},transform:function(h,f,g){if(typeof h!="object")return f;if(typeof f=="object"){if(!g)return f;var v=Object.keys(f).reduce(function(p,y){return h[y]===void 0&&(p[y]=f[y]),p},{});return Object.keys(v).length>0?v:void 0}}},iterator:function(h){return new u(h)},length:function(h){return typeof h.delete=="number"?h.delete:typeof h.retain=="number"?h.retain:typeof h.insert=="string"?h.insert.length:1}};function u(h){this.ops=h,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(h){h||(h=1/0);var f=this.ops[this.index];if(f){var g=this.offset,v=s.length(f);if(h>=v-g?(h=v-g,this.index+=1,this.offset=0):this.offset+=h,typeof f.delete=="number")return{delete:h};var p={};return f.attributes&&(p.attributes=f.attributes),typeof f.retain=="number"?p.retain=h:typeof f.insert=="string"?p.insert=f.insert.substr(g,h):p.insert=f.insert,p}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?s.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var h=this.offset,f=this.index,g=this.next(),v=this.ops.slice(this.index);return this.offset=h,this.index=f,[g].concat(v)}else return[]},r.exports=s},function(r,n){var i=function(){function a(_,x){return x!=null&&_ instanceof x}var o;try{o=Map}catch{o=function(){}}var s;try{s=Set}catch{s=function(){}}var u;try{u=Promise}catch{u=function(){}}function h(_,x,b,E,A){typeof x=="object"&&(b=x.depth,E=x.prototype,A=x.includeNonEnumerable,x=x.circular);var S=[],k=[],I=typeof Buffer<"u";typeof x>"u"&&(x=!0),typeof b>"u"&&(b=1/0);function O(M,F){if(M===null)return null;if(F===0)return M;var j,T;if(typeof M!="object")return M;if(a(M,o))j=new o;else if(a(M,s))j=new s;else if(a(M,u))j=new u(function(V,B){M.then(function(D){V(O(D,F-1))},function(D){B(O(D,F-1))})});else if(h.__isArray(M))j=[];else if(h.__isRegExp(M))j=new RegExp(M.source,y(M)),M.lastIndex&&(j.lastIndex=M.lastIndex);else if(h.__isDate(M))j=new Date(M.getTime());else{if(I&&Buffer.isBuffer(M))return Buffer.allocUnsafe?j=Buffer.allocUnsafe(M.length):j=new Buffer(M.length),M.copy(j),j;a(M,Error)?j=Object.create(M):typeof E>"u"?(T=Object.getPrototypeOf(M),j=Object.create(T)):(j=Object.create(E),T=E)}if(x){var L=S.indexOf(M);if(L!=-1)return k[L];S.push(M),k.push(j)}a(M,o)&&M.forEach(function(V,B){var D=O(B,F-1),U=O(V,F-1);j.set(D,U)}),a(M,s)&&M.forEach(function(V){var B=O(V,F-1);j.add(B)});for(var $ in M){var q;T&&(q=Object.getOwnPropertyDescriptor(T,$)),!(q&&q.set==null)&&(j[$]=O(M[$],F-1))}if(Object.getOwnPropertySymbols)for(var J=Object.getOwnPropertySymbols(M),$=0;$<J.length;$++){var ae=J[$],ie=Object.getOwnPropertyDescriptor(M,ae);ie&&!ie.enumerable&&!A||(j[ae]=O(M[ae],F-1),ie.enumerable||Object.defineProperty(j,ae,{enumerable:!1}))}if(A)for(var Z=Object.getOwnPropertyNames(M),$=0;$<Z.length;$++){var te=Z[$],ie=Object.getOwnPropertyDescriptor(M,te);ie&&ie.enumerable||(j[te]=O(M[te],F-1),Object.defineProperty(j,te,{enumerable:!1}))}return j}return O(_,b)}h.clonePrototype=function(x){if(x===null)return null;var b=function(){};return b.prototype=x,new b};function f(_){return Object.prototype.toString.call(_)}h.__objToStr=f;function g(_){return typeof _=="object"&&f(_)==="[object Date]"}h.__isDate=g;function v(_){return typeof _=="object"&&f(_)==="[object Array]"}h.__isArray=v;function p(_){return typeof _=="object"&&f(_)==="[object RegExp]"}h.__isRegExp=p;function y(_){var x="";return _.global&&(x+="g"),_.ignoreCase&&(x+="i"),_.multiline&&(x+="m"),x}return h.__getRegExpFlags=y,h}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function j(T,L){var $=[],q=!0,J=!1,ae=void 0;try{for(var ie=T[Symbol.iterator](),Z;!(q=(Z=ie.next()).done)&&($.push(Z.value),!(L&&$.length===L));q=!0);}catch(te){J=!0,ae=te}finally{try{!q&&ie.return&&ie.return()}finally{if(J)throw ae}}return $}return function(T,L){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return j(T,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function j(T,L){for(var $=0;$<L.length;$++){var q=L[$];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(T,q.key,q)}}return function(T,L,$){return L&&j(T.prototype,L),$&&j(T,$),T}}(),s=function j(T,L,$){T===null&&(T=Function.prototype);var q=Object.getOwnPropertyDescriptor(T,L);if(q===void 0){var J=Object.getPrototypeOf(T);return J===null?void 0:j(J,L,$)}else{if("value"in q)return q.value;var ae=q.get;return ae===void 0?void 0:ae.call($)}},u=i(0),h=S(u),f=i(8),g=S(f),v=i(4),p=S(v),y=i(16),_=S(y),x=i(13),b=S(x),E=i(25),A=S(E);function S(j){return j&&j.__esModule?j:{default:j}}function k(j,T){if(!(j instanceof T))throw new TypeError("Cannot call a class as a function")}function I(j,T){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:j}function O(j,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);j.prototype=Object.create(T&&T.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(j,T):j.__proto__=T)}function M(j){return j instanceof p.default||j instanceof v.BlockEmbed}var F=function(j){O(T,j);function T(L,$){k(this,T);var q=I(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,L));return q.emitter=$.emitter,Array.isArray($.whitelist)&&(q.whitelist=$.whitelist.reduce(function(J,ae){return J[ae]=!0,J},{})),q.domNode.addEventListener("DOMNodeInserted",function(){}),q.optimize(),q.enable(),q}return o(T,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function($,q){var J=this.line($),ae=a(J,2),ie=ae[0],Z=ae[1],te=this.line($+q),V=a(te,1),B=V[0];if(s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"deleteAt",this).call(this,$,q),B!=null&&ie!==B&&Z>0){if(ie instanceof v.BlockEmbed||B instanceof v.BlockEmbed){this.optimize();return}if(ie instanceof b.default){var D=ie.newlineIndex(ie.length(),!0);if(D>-1&&(ie=ie.split(D+1),ie===B)){this.optimize();return}}else if(B instanceof b.default){var U=B.newlineIndex(0);U>-1&&B.split(U+1)}var X=B.children.head instanceof _.default?null:B.children.head;ie.moveChildren(B,X),ie.remove()}this.optimize()}},{key:"enable",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",$)}},{key:"formatAt",value:function($,q,J,ae){this.whitelist!=null&&!this.whitelist[J]||(s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"formatAt",this).call(this,$,q,J,ae),this.optimize())}},{key:"insertAt",value:function($,q,J){if(!(J!=null&&this.whitelist!=null&&!this.whitelist[q])){if($>=this.length())if(J==null||h.default.query(q,h.default.Scope.BLOCK)==null){var ae=h.default.create(this.statics.defaultChild);this.appendChild(ae),J==null&&q.endsWith(`
|
|
139
|
-
`)&&(q=q.slice(0,-1)),ae.insertAt(0,q,J)}else{var ie=h.default.create(q,J);this.appendChild(ie)}else s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertAt",this).call(this,$,q,J);this.optimize()}}},{key:"insertBefore",value:function($,q){if($.statics.scope===h.default.Scope.INLINE_BLOT){var J=h.default.create(this.statics.defaultChild);J.appendChild($),$=J}s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"insertBefore",this).call(this,$,q)}},{key:"leaf",value:function($){return this.path($).pop()||[null,-1]}},{key:"line",value:function($){return $===this.length()?this.line($-1):this.descendant(M,$)}},{key:"lines",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,J=function ae(ie,Z,te){var V=[],B=te;return ie.children.forEachAt(Z,te,function(D,U,X){M(D)?V.push(D):D instanceof h.default.Container&&(V=V.concat(ae(D,U,B))),B-=X}),V};return J(this,$,q)}},{key:"optimize",value:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"optimize",this).call(this,$,q),$.length>0&&this.emitter.emit(g.default.events.SCROLL_OPTIMIZE,$,q))}},{key:"path",value:function($){return s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"path",this).call(this,$).slice(1)}},{key:"update",value:function($){if(this.batch!==!0){var q=g.default.sources.USER;typeof $=="string"&&(q=$),Array.isArray($)||($=this.observer.takeRecords()),$.length>0&&this.emitter.emit(g.default.events.SCROLL_BEFORE_UPDATE,q,$),s(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"update",this).call(this,$.concat([])),$.length>0&&this.emitter.emit(g.default.events.SCROLL_UPDATE,q,$)}}}]),T}(h.default.Scroll);F.blotName="scroll",F.className="ql-editor",F.tagName="DIV",F.defaultChild="block",F.allowedChildren=[p.default,v.BlockEmbed,A.default],n.default=F},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},o=function(){function K(oe,me){var de=[],ye=!0,Te=!1,Ce=void 0;try{for(var Ie=oe[Symbol.iterator](),Ee;!(ye=(Ee=Ie.next()).done)&&(de.push(Ee.value),!(me&&de.length===me));ye=!0);}catch(ge){Te=!0,Ce=ge}finally{try{!ye&&Ie.return&&Ie.return()}finally{if(Te)throw Ce}}return de}return function(oe,me){if(Array.isArray(oe))return oe;if(Symbol.iterator in Object(oe))return K(oe,me);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function K(oe,me){for(var de=0;de<me.length;de++){var ye=me[de];ye.enumerable=ye.enumerable||!1,ye.configurable=!0,"value"in ye&&(ye.writable=!0),Object.defineProperty(oe,ye.key,ye)}}return function(oe,me,de){return me&&K(oe.prototype,me),de&&K(oe,de),oe}}(),u=i(21),h=j(u),f=i(11),g=j(f),v=i(3),p=j(v),y=i(2),_=j(y),x=i(20),b=j(x),E=i(0),A=j(E),S=i(5),k=j(S),I=i(10),O=j(I),M=i(9),F=j(M);function j(K){return K&&K.__esModule?K:{default:K}}function T(K,oe,me){return oe in K?Object.defineProperty(K,oe,{value:me,enumerable:!0,configurable:!0,writable:!0}):K[oe]=me,K}function L(K,oe){if(!(K instanceof oe))throw new TypeError("Cannot call a class as a function")}function $(K,oe){if(!K)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return oe&&(typeof oe=="object"||typeof oe=="function")?oe:K}function q(K,oe){if(typeof oe!="function"&&oe!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof oe);K.prototype=Object.create(oe&&oe.prototype,{constructor:{value:K,enumerable:!1,writable:!0,configurable:!0}}),oe&&(Object.setPrototypeOf?Object.setPrototypeOf(K,oe):K.__proto__=oe)}var J=(0,O.default)("quill:keyboard"),ae=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",ie=function(K){q(oe,K),s(oe,null,[{key:"match",value:function(de,ye){return ye=ee(ye),["altKey","ctrlKey","metaKey","shiftKey"].some(function(Te){return!!ye[Te]!==de[Te]&&ye[Te]!==null})?!1:ye.key===(de.which||de.keyCode)}}]);function oe(me,de){L(this,oe);var ye=$(this,(oe.__proto__||Object.getPrototypeOf(oe)).call(this,me,de));return ye.bindings={},Object.keys(ye.options.bindings).forEach(function(Te){Te==="list autofill"&&me.scroll.whitelist!=null&&!me.scroll.whitelist.list||ye.options.bindings[Te]&&ye.addBinding(ye.options.bindings[Te])}),ye.addBinding({key:oe.keys.ENTER,shiftKey:null},D),ye.addBinding({key:oe.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ye.addBinding({key:oe.keys.BACKSPACE},{collapsed:!0},te),ye.addBinding({key:oe.keys.DELETE},{collapsed:!0},V)):(ye.addBinding({key:oe.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},te),ye.addBinding({key:oe.keys.DELETE},{collapsed:!0,suffix:/^.?$/},V)),ye.addBinding({key:oe.keys.BACKSPACE},{collapsed:!1},B),ye.addBinding({key:oe.keys.DELETE},{collapsed:!1},B),ye.addBinding({key:oe.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},te),ye.listen(),ye}return s(oe,[{key:"addBinding",value:function(de){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Ce=ee(de);if(Ce==null||Ce.key==null)return J.warn("Attempted to add invalid keyboard binding",Ce);typeof ye=="function"&&(ye={handler:ye}),typeof Te=="function"&&(Te={handler:Te}),Ce=(0,p.default)(Ce,ye,Te),this.bindings[Ce.key]=this.bindings[Ce.key]||[],this.bindings[Ce.key].push(Ce)}},{key:"listen",value:function(){var de=this;this.quill.root.addEventListener("keydown",function(ye){if(!ye.defaultPrevented){var Te=ye.which||ye.keyCode,Ce=(de.bindings[Te]||[]).filter(function(bt){return oe.match(ye,bt)});if(Ce.length!==0){var Ie=de.quill.getSelection();if(!(Ie==null||!de.quill.hasFocus())){var Ee=de.quill.getLine(Ie.index),ge=o(Ee,2),Re=ge[0],Be=ge[1],Oe=de.quill.getLeaf(Ie.index),fe=o(Oe,2),Le=fe[0],Ne=fe[1],ue=Ie.length===0?[Le,Ne]:de.quill.getLeaf(Ie.index+Ie.length),Ae=o(ue,2),Pe=Ae[0],Ue=Ae[1],st=Le instanceof A.default.Text?Le.value().slice(0,Ne):"",dt=Pe instanceof A.default.Text?Pe.value().slice(Ue):"",pt={collapsed:Ie.length===0,empty:Ie.length===0&&Re.length()<=1,format:de.quill.getFormat(Ie),offset:Be,prefix:st,suffix:dt},xt=Ce.some(function(bt){if(bt.collapsed!=null&&bt.collapsed!==pt.collapsed||bt.empty!=null&&bt.empty!==pt.empty||bt.offset!=null&&bt.offset!==pt.offset)return!1;if(Array.isArray(bt.format)){if(bt.format.every(function(kt){return pt.format[kt]==null}))return!1}else if(a(bt.format)==="object"&&!Object.keys(bt.format).every(function(kt){return bt.format[kt]===!0?pt.format[kt]!=null:bt.format[kt]===!1?pt.format[kt]==null:(0,g.default)(bt.format[kt],pt.format[kt])}))return!1;return bt.prefix!=null&&!bt.prefix.test(pt.prefix)||bt.suffix!=null&&!bt.suffix.test(pt.suffix)?!1:bt.handler.call(de,Ie,pt)!==!0});xt&&ye.preventDefault()}}}})}}]),oe}(F.default);ie.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},ie.DEFAULTS={bindings:{bold:X("bold"),italic:X("italic"),underline:X("underline"),indent:{key:ie.keys.TAB,format:["blockquote","indent","list"],handler:function(oe,me){if(me.collapsed&&me.offset!==0)return!0;this.quill.format("indent","+1",k.default.sources.USER)}},outdent:{key:ie.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(oe,me){if(me.collapsed&&me.offset!==0)return!0;this.quill.format("indent","-1",k.default.sources.USER)}},"outdent backspace":{key:ie.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(oe,me){me.format.indent!=null?this.quill.format("indent","-1",k.default.sources.USER):me.format.list!=null&&this.quill.format("list",!1,k.default.sources.USER)}},"indent code-block":U(!0),"outdent code-block":U(!1),"remove tab":{key:ie.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(oe){this.quill.deleteText(oe.index-1,1,k.default.sources.USER)}},tab:{key:ie.keys.TAB,handler:function(oe){this.quill.history.cutoff();var me=new _.default().retain(oe.index).delete(oe.length).insert(" ");this.quill.updateContents(me,k.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(oe.index+1,k.default.sources.SILENT)}},"list empty enter":{key:ie.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(oe,me){this.quill.format("list",!1,k.default.sources.USER),me.format.indent&&this.quill.format("indent",!1,k.default.sources.USER)}},"checklist enter":{key:ie.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(oe){var me=this.quill.getLine(oe.index),de=o(me,2),ye=de[0],Te=de[1],Ce=(0,p.default)({},ye.formats(),{list:"checked"}),Ie=new _.default().retain(oe.index).insert(`
|
|
140
|
-
`,Ce).retain(ye.length()-Te-1).retain(1,{list:"unchecked"});this.quill.updateContents(Ie,k.default.sources.USER),this.quill.setSelection(oe.index+1,k.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:ie.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(oe,me){var de=this.quill.getLine(oe.index),ye=o(de,2),Te=ye[0],Ce=ye[1],Ie=new _.default().retain(oe.index).insert(`
|
|
141
|
-
`,me.format).retain(Te.length()-Ce-1).retain(1,{header:null});this.quill.updateContents(Ie,k.default.sources.USER),this.quill.setSelection(oe.index+1,k.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(oe,me){var de=me.prefix.length,ye=this.quill.getLine(oe.index),Te=o(ye,2),Ce=Te[0],Ie=Te[1];if(Ie>de)return!0;var Ee=void 0;switch(me.prefix.trim()){case"[]":case"[ ]":Ee="unchecked";break;case"[x]":Ee="checked";break;case"-":case"*":Ee="bullet";break;default:Ee="ordered"}this.quill.insertText(oe.index," ",k.default.sources.USER),this.quill.history.cutoff();var ge=new _.default().retain(oe.index-Ie).delete(de+1).retain(Ce.length()-2-Ie).retain(1,{list:Ee});this.quill.updateContents(ge,k.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(oe.index-de,k.default.sources.SILENT)}},"code exit":{key:ie.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(oe){var me=this.quill.getLine(oe.index),de=o(me,2),ye=de[0],Te=de[1],Ce=new _.default().retain(oe.index+ye.length()-Te-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(Ce,k.default.sources.USER)}},"embed left":Z(ie.keys.LEFT,!1),"embed left shift":Z(ie.keys.LEFT,!0),"embed right":Z(ie.keys.RIGHT,!1),"embed right shift":Z(ie.keys.RIGHT,!0)}};function Z(K,oe){var me,de=K===ie.keys.LEFT?"prefix":"suffix";return me={key:K,shiftKey:oe,altKey:null},T(me,de,/^$/),T(me,"handler",function(Te){var Ce=Te.index;K===ie.keys.RIGHT&&(Ce+=Te.length+1);var Ie=this.quill.getLeaf(Ce),Ee=o(Ie,1),ge=Ee[0];return ge instanceof A.default.Embed?(K===ie.keys.LEFT?oe?this.quill.setSelection(Te.index-1,Te.length+1,k.default.sources.USER):this.quill.setSelection(Te.index-1,k.default.sources.USER):oe?this.quill.setSelection(Te.index,Te.length+1,k.default.sources.USER):this.quill.setSelection(Te.index+Te.length+1,k.default.sources.USER),!1):!0}),me}function te(K,oe){if(!(K.index===0||this.quill.getLength()<=1)){var me=this.quill.getLine(K.index),de=o(me,1),ye=de[0],Te={};if(oe.offset===0){var Ce=this.quill.getLine(K.index-1),Ie=o(Ce,1),Ee=Ie[0];if(Ee!=null&&Ee.length()>1){var ge=ye.formats(),Re=this.quill.getFormat(K.index-1,1);Te=b.default.attributes.diff(ge,Re)||{}}}var Be=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(oe.prefix)?2:1;this.quill.deleteText(K.index-Be,Be,k.default.sources.USER),Object.keys(Te).length>0&&this.quill.formatLine(K.index-Be,Be,Te,k.default.sources.USER),this.quill.focus()}}function V(K,oe){var me=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(oe.suffix)?2:1;if(!(K.index>=this.quill.getLength()-me)){var de={},ye=0,Te=this.quill.getLine(K.index),Ce=o(Te,1),Ie=Ce[0];if(oe.offset>=Ie.length()-1){var Ee=this.quill.getLine(K.index+1),ge=o(Ee,1),Re=ge[0];if(Re){var Be=Ie.formats(),Oe=this.quill.getFormat(K.index,1);de=b.default.attributes.diff(Be,Oe)||{},ye=Re.length()}}this.quill.deleteText(K.index,me,k.default.sources.USER),Object.keys(de).length>0&&this.quill.formatLine(K.index+ye-1,me,de,k.default.sources.USER)}}function B(K){var oe=this.quill.getLines(K),me={};if(oe.length>1){var de=oe[0].formats(),ye=oe[oe.length-1].formats();me=b.default.attributes.diff(ye,de)||{}}this.quill.deleteText(K,k.default.sources.USER),Object.keys(me).length>0&&this.quill.formatLine(K.index,1,me,k.default.sources.USER),this.quill.setSelection(K.index,k.default.sources.SILENT),this.quill.focus()}function D(K,oe){var me=this;K.length>0&&this.quill.scroll.deleteAt(K.index,K.length);var de=Object.keys(oe.format).reduce(function(ye,Te){return A.default.query(Te,A.default.Scope.BLOCK)&&!Array.isArray(oe.format[Te])&&(ye[Te]=oe.format[Te]),ye},{});this.quill.insertText(K.index,`
|
|
142
|
-
`,de,k.default.sources.USER),this.quill.setSelection(K.index+1,k.default.sources.SILENT),this.quill.focus(),Object.keys(oe.format).forEach(function(ye){de[ye]==null&&(Array.isArray(oe.format[ye])||ye!=="link"&&me.quill.format(ye,oe.format[ye],k.default.sources.USER))})}function U(K){return{key:ie.keys.TAB,shiftKey:!K,format:{"code-block":!0},handler:function(me){var de=A.default.query("code-block"),ye=me.index,Te=me.length,Ce=this.quill.scroll.descendant(de,ye),Ie=o(Ce,2),Ee=Ie[0],ge=Ie[1];if(Ee!=null){var Re=this.quill.getIndex(Ee),Be=Ee.newlineIndex(ge,!0)+1,Oe=Ee.newlineIndex(Re+ge+Te),fe=Ee.domNode.textContent.slice(Be,Oe).split(`
|
|
143
|
-
`);ge=0,fe.forEach(function(Le,Ne){K?(Ee.insertAt(Be+ge,de.TAB),ge+=de.TAB.length,Ne===0?ye+=de.TAB.length:Te+=de.TAB.length):Le.startsWith(de.TAB)&&(Ee.deleteAt(Be+ge,de.TAB.length),ge-=de.TAB.length,Ne===0?ye-=de.TAB.length:Te-=de.TAB.length),ge+=Le.length+1}),this.quill.update(k.default.sources.USER),this.quill.setSelection(ye,Te,k.default.sources.SILENT)}}}}function X(K){return{key:K[0].toUpperCase(),shortKey:!0,handler:function(me,de){this.quill.format(K,!de.format[K],k.default.sources.USER)}}}function ee(K){if(typeof K=="string"||typeof K=="number")return ee({key:K});if((typeof K>"u"?"undefined":a(K))==="object"&&(K=(0,h.default)(K,!1)),typeof K.key=="string")if(ie.keys[K.key.toUpperCase()]!=null)K.key=ie.keys[K.key.toUpperCase()];else if(K.key.length===1)K.key=K.key.toUpperCase().charCodeAt(0);else return null;return K.shortKey&&(K[ae]=K.shortKey,delete K.shortKey),K}n.default=ie,n.SHORTKEY=ae},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function b(E,A){var S=[],k=!0,I=!1,O=void 0;try{for(var M=E[Symbol.iterator](),F;!(k=(F=M.next()).done)&&(S.push(F.value),!(A&&S.length===A));k=!0);}catch(j){I=!0,O=j}finally{try{!k&&M.return&&M.return()}finally{if(I)throw O}}return S}return function(E,A){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return b(E,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function b(E,A,S){E===null&&(E=Function.prototype);var k=Object.getOwnPropertyDescriptor(E,A);if(k===void 0){var I=Object.getPrototypeOf(E);return I===null?void 0:b(I,A,S)}else{if("value"in k)return k.value;var O=k.get;return O===void 0?void 0:O.call(S)}},s=function(){function b(E,A){for(var S=0;S<A.length;S++){var k=A[S];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(E,k.key,k)}}return function(E,A,S){return A&&b(E.prototype,A),S&&b(E,S),E}}(),u=i(0),h=v(u),f=i(7),g=v(f);function v(b){return b&&b.__esModule?b:{default:b}}function p(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}function y(b,E){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:b}function _(b,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);b.prototype=Object.create(E&&E.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(b,E):b.__proto__=E)}var x=function(b){_(E,b),s(E,null,[{key:"value",value:function(){}}]);function E(A,S){p(this,E);var k=y(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,A));return k.selection=S,k.textNode=document.createTextNode(E.CONTENTS),k.domNode.appendChild(k.textNode),k._length=0,k}return s(E,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(S,k){if(this._length!==0)return o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"format",this).call(this,S,k);for(var I=this,O=0;I!=null&&I.statics.scope!==h.default.Scope.BLOCK_BLOT;)O+=I.offset(I.parent),I=I.parent;I!=null&&(this._length=E.CONTENTS.length,I.optimize(),I.formatAt(O,E.CONTENTS.length,S,k),this._length=0)}},{key:"index",value:function(S,k){return S===this.textNode?0:o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"index",this).call(this,S,k)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var S=this.textNode,k=this.selection.getNativeRange(),I=void 0,O=void 0,M=void 0;if(k!=null&&k.start.node===S&&k.end.node===S){var F=[S,k.start.offset,k.end.offset];I=F[0],O=F[1],M=F[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==E.CONTENTS){var j=this.textNode.data.split(E.CONTENTS).join("");this.next instanceof g.default?(I=this.next.domNode,this.next.insertAt(0,j),this.textNode.data=E.CONTENTS):(this.textNode.data=j,this.parent.insertBefore(h.default.create(this.textNode),this),this.textNode=document.createTextNode(E.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),O!=null){var T=[O,M].map(function($){return Math.max(0,Math.min(I.data.length,$-1))}),L=a(T,2);return O=L[0],M=L[1],{startNode:I,startOffset:O,endNode:I,endOffset:M}}}}},{key:"update",value:function(S,k){var I=this;if(S.some(function(M){return M.type==="characterData"&&M.target===I.textNode})){var O=this.restore();O&&(k.range=O)}}},{key:"value",value:function(){return""}}]),E}(h.default.Embed);x.blotName="cursor",x.className="ql-cursor",x.tagName="span",x.CONTENTS="\uFEFF",n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=h(a),s=i(4),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function g(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function v(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=function(y){v(_,y);function _(){return f(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return _}(o.default.Container);p.allowedChildren=[u.default,s.BlockEmbed,p],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=function(){function x(b,E){for(var A=0;A<E.length;A++){var S=E[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,A){return E&&x(b.prototype,E),A&&x(b,A),b}}(),o=function x(b,E,A){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,E);if(S===void 0){var k=Object.getPrototypeOf(b);return k===null?void 0:x(k,E,A)}else{if("value"in S)return S.value;var I=S.get;return I===void 0?void 0:I.call(A)}},s=i(0),u=h(s);function h(x){return x&&x.__esModule?x:{default:x}}function f(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function g(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function v(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var p=function(x){v(b,x);function b(){return f(this,b),g(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"value",value:function(A){var S=o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,A);return S.startsWith("rgb(")?(S=S.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+S.split(",").map(function(k){return("00"+parseInt(k).toString(16)).slice(-2)}).join("")):S}}]),b}(u.default.Attributor.Style),y=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),_=new p("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=p,n.ColorClass=y,n.ColorStyle=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=function(){function _(x,b){for(var E=0;E<b.length;E++){var A=b[E];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(x,A.key,A)}}return function(x,b,E){return b&&_(x.prototype,b),E&&_(x,E),x}}(),o=function _(x,b,E){x===null&&(x=Function.prototype);var A=Object.getOwnPropertyDescriptor(x,b);if(A===void 0){var S=Object.getPrototypeOf(x);return S===null?void 0:_(S,b,E)}else{if("value"in A)return A.value;var k=A.get;return k===void 0?void 0:k.call(E)}},s=i(6),u=h(s);function h(_){return _&&_.__esModule?_:{default:_}}function f(_,x){if(!(_ instanceof x))throw new TypeError("Cannot call a class as a function")}function g(_,x){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:_}function v(_,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);_.prototype=Object.create(x&&x.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(_,x):_.__proto__=x)}var p=function(_){v(x,_);function x(){return f(this,x),g(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"format",value:function(E,A){if(E!==this.statics.blotName||!A)return o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,E,A);A=this.constructor.sanitize(A),this.domNode.setAttribute("href",A)}}],[{key:"create",value:function(E){var A=o(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,E);return E=this.sanitize(E),A.setAttribute("href",E),A.setAttribute("rel","noopener noreferrer"),A.setAttribute("target","_blank"),A}},{key:"formats",value:function(E){return E.getAttribute("href")}},{key:"sanitize",value:function(E){return y(E,this.PROTOCOL_WHITELIST)?E:this.SANITIZED_URL}}]),x}(u.default);p.blotName="link",p.tagName="A",p.SANITIZED_URL="about:blank",p.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function y(_,x){var b=document.createElement("a");b.href=_;var E=b.href.slice(0,b.href.indexOf(":"));return x.indexOf(E)>-1}n.default=p,n.sanitize=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},o=function(){function x(b,E){for(var A=0;A<E.length;A++){var S=E[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,A){return E&&x(b.prototype,E),A&&x(b,A),b}}(),s=i(23),u=g(s),h=i(107),f=g(h);function g(x){return x&&x.__esModule?x:{default:x}}function v(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}var p=0;function y(x,b){x.setAttribute(b,x.getAttribute(b)!=="true")}var _=function(){function x(b){var E=this;v(this,x),this.select=b,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){E.togglePicker()}),this.label.addEventListener("keydown",function(A){switch(A.keyCode){case u.default.keys.ENTER:E.togglePicker();break;case u.default.keys.ESCAPE:E.escape(),A.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return o(x,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),y(this.label,"aria-expanded"),y(this.options,"aria-hidden")}},{key:"buildItem",value:function(E){var A=this,S=document.createElement("span");return S.tabIndex="0",S.setAttribute("role","button"),S.classList.add("ql-picker-item"),E.hasAttribute("value")&&S.setAttribute("data-value",E.getAttribute("value")),E.textContent&&S.setAttribute("data-label",E.textContent),S.addEventListener("click",function(){A.selectItem(S,!0)}),S.addEventListener("keydown",function(k){switch(k.keyCode){case u.default.keys.ENTER:A.selectItem(S,!0),k.preventDefault();break;case u.default.keys.ESCAPE:A.escape(),k.preventDefault();break}}),S}},{key:"buildLabel",value:function(){var E=document.createElement("span");return E.classList.add("ql-picker-label"),E.innerHTML=f.default,E.tabIndex="0",E.setAttribute("role","button"),E.setAttribute("aria-expanded","false"),this.container.appendChild(E),E}},{key:"buildOptions",value:function(){var E=this,A=document.createElement("span");A.classList.add("ql-picker-options"),A.setAttribute("aria-hidden","true"),A.tabIndex="-1",A.id="ql-picker-options-"+p,p+=1,this.label.setAttribute("aria-controls",A.id),this.options=A,[].slice.call(this.select.options).forEach(function(S){var k=E.buildItem(S);A.appendChild(k),S.selected===!0&&E.selectItem(k)}),this.container.appendChild(A)}},{key:"buildPicker",value:function(){var E=this;[].slice.call(this.select.attributes).forEach(function(A){E.container.setAttribute(A.name,A.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var E=this;this.close(),setTimeout(function(){return E.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(E){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,S=this.container.querySelector(".ql-selected");if(E!==S&&(S?.classList.remove("ql-selected"),E!=null&&(E.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(E.parentNode.children,E),E.hasAttribute("data-value")?this.label.setAttribute("data-value",E.getAttribute("data-value")):this.label.removeAttribute("data-value"),E.hasAttribute("data-label")?this.label.setAttribute("data-label",E.getAttribute("data-label")):this.label.removeAttribute("data-label"),A))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":a(Event))==="object"){var k=document.createEvent("Event");k.initEvent("change",!0,!0),this.select.dispatchEvent(k)}this.close()}}},{key:"update",value:function(){var E=void 0;if(this.select.selectedIndex>-1){var A=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];E=this.select.options[this.select.selectedIndex],this.selectItem(A)}else this.selectItem(null);var S=E!=null&&E!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",S)}}]),x}();n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=J(a),s=i(5),u=J(s),h=i(4),f=J(h),g=i(16),v=J(g),p=i(25),y=J(p),_=i(24),x=J(_),b=i(35),E=J(b),A=i(6),S=J(A),k=i(22),I=J(k),O=i(7),M=J(O),F=i(55),j=J(F),T=i(42),L=J(T),$=i(23),q=J($);function J(ae){return ae&&ae.__esModule?ae:{default:ae}}u.default.register({"blots/block":f.default,"blots/block/embed":h.BlockEmbed,"blots/break":v.default,"blots/container":y.default,"blots/cursor":x.default,"blots/embed":E.default,"blots/inline":S.default,"blots/scroll":I.default,"blots/text":M.default,"modules/clipboard":j.default,"modules/history":L.default,"modules/keyboard":q.default}),o.default.register(f.default,v.default,x.default,S.default,I.default,M.default),n.default=u.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),o=function(){function s(u){this.domNode=u,this.domNode[a.DATA_KEY]={blot:this}}return Object.defineProperty(s.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),s.create=function(u){if(this.tagName==null)throw new a.ParchmentError("Blot definition missing tagName");var h;return Array.isArray(this.tagName)?(typeof u=="string"&&(u=u.toUpperCase(),parseInt(u).toString()===u&&(u=parseInt(u))),typeof u=="number"?h=document.createElement(this.tagName[u-1]):this.tagName.indexOf(u)>-1?h=document.createElement(u):h=document.createElement(this.tagName[0])):h=document.createElement(this.tagName),this.className&&h.classList.add(this.className),h},s.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},s.prototype.clone=function(){var u=this.domNode.cloneNode(!1);return a.create(u)},s.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[a.DATA_KEY]},s.prototype.deleteAt=function(u,h){var f=this.isolate(u,h);f.remove()},s.prototype.formatAt=function(u,h,f,g){var v=this.isolate(u,h);if(a.query(f,a.Scope.BLOT)!=null&&g)v.wrap(f,g);else if(a.query(f,a.Scope.ATTRIBUTE)!=null){var p=a.create(this.statics.scope);v.wrap(p),p.format(f,g)}},s.prototype.insertAt=function(u,h,f){var g=f==null?a.create("text",h):a.create(h,f),v=this.split(u);this.parent.insertBefore(g,v)},s.prototype.insertInto=function(u,h){h===void 0&&(h=null),this.parent!=null&&this.parent.children.remove(this);var f=null;u.children.insertBefore(this,h),h!=null&&(f=h.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=f)&&u.domNode.insertBefore(this.domNode,f),this.parent=u,this.attach()},s.prototype.isolate=function(u,h){var f=this.split(u);return f.split(h),f},s.prototype.length=function(){return 1},s.prototype.offset=function(u){return u===void 0&&(u=this.parent),this.parent==null||this==u?0:this.parent.children.offset(this)+this.parent.offset(u)},s.prototype.optimize=function(u){this.domNode[a.DATA_KEY]!=null&&delete this.domNode[a.DATA_KEY].mutations},s.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},s.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},s.prototype.replaceWith=function(u,h){var f=typeof u=="string"?a.create(u,h):u;return f.replace(this),f},s.prototype.split=function(u,h){return u===0?this:this.next},s.prototype.update=function(u,h){},s.prototype.wrap=function(u,h){var f=typeof u=="string"?a.create(u,h):u;return this.parent!=null&&this.parent.insertBefore(f,this.next),f.appendChild(this),f},s.blotName="abstract",s}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(12),o=i(32),s=i(33),u=i(1),h=function(){function f(g){this.attributes={},this.domNode=g,this.build()}return f.prototype.attribute=function(g,v){v?g.add(this.domNode,v)&&(g.value(this.domNode)!=null?this.attributes[g.attrName]=g:delete this.attributes[g.attrName]):(g.remove(this.domNode),delete this.attributes[g.attrName])},f.prototype.build=function(){var g=this;this.attributes={};var v=a.default.keys(this.domNode),p=o.default.keys(this.domNode),y=s.default.keys(this.domNode);v.concat(p).concat(y).forEach(function(_){var x=u.query(_,u.Scope.ATTRIBUTE);x instanceof a.default&&(g.attributes[x.attrName]=x)})},f.prototype.copy=function(g){var v=this;Object.keys(this.attributes).forEach(function(p){var y=v.attributes[p].value(v.domNode);g.format(p,y)})},f.prototype.move=function(g){var v=this;this.copy(g),Object.keys(this.attributes).forEach(function(p){v.attributes[p].remove(v.domNode)}),this.attributes={}},f.prototype.values=function(){var g=this;return Object.keys(this.attributes).reduce(function(v,p){return v[p]=g.attributes[p].value(g.domNode),v},{})},f}();n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var v in g)g.hasOwnProperty(v)&&(f[v]=g[v])};return function(f,g){h(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function s(h,f){var g=h.getAttribute("class")||"";return g.split(/\s+/).filter(function(v){return v.indexOf(f+"-")===0})}var u=function(h){a(f,h);function f(){return h!==null&&h.apply(this,arguments)||this}return f.keys=function(g){return(g.getAttribute("class")||"").split(/\s+/).map(function(v){return v.split("-").slice(0,-1).join("-")})},f.prototype.add=function(g,v){return this.canAdd(g,v)?(this.remove(g),g.classList.add(this.keyName+"-"+v),!0):!1},f.prototype.remove=function(g){var v=s(g,this.keyName);v.forEach(function(p){g.classList.remove(p)}),g.classList.length===0&&g.removeAttribute("class")},f.prototype.value=function(g){var v=s(g,this.keyName)[0]||"",p=v.slice(this.keyName.length+1);return this.canAdd(g,p)?p:""},f}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var v in g)g.hasOwnProperty(v)&&(f[v]=g[v])};return function(f,g){h(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(12);function s(h){var f=h.split("-"),g=f.slice(1).map(function(v){return v[0].toUpperCase()+v.slice(1)}).join("");return f[0]+g}var u=function(h){a(f,h);function f(){return h!==null&&h.apply(this,arguments)||this}return f.keys=function(g){return(g.getAttribute("style")||"").split(";").map(function(v){var p=v.split(":");return p[0].trim()})},f.prototype.add=function(g,v){return this.canAdd(g,v)?(g.style[s(this.keyName)]=v,!0):!1},f.prototype.remove=function(g){g.style[s(this.keyName)]="",g.getAttribute("style")||g.removeAttribute("style")},f.prototype.value=function(g){var v=g.style[s(this.keyName)];return this.canAdd(g,v)?v:""},f}(o.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(h,f){for(var g=0;g<f.length;g++){var v=f[g];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(h,v.key,v)}}return function(h,f,g){return f&&u(h.prototype,f),g&&u(h,g),h}}();function o(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}var s=function(){function u(h,f){o(this,u),this.quill=h,this.options=f,this.modules={}}return a(u,[{key:"init",value:function(){var f=this;Object.keys(this.options.modules).forEach(function(g){f.modules[g]==null&&f.addModule(g)})}},{key:"addModule",value:function(f){var g=this.quill.constructor.import("modules/"+f);return this.modules[f]=new g(this.quill,this.options.modules[f]||{}),this.modules[f]}}]),u}();s.DEFAULTS={modules:{}},s.themes={default:s},n.default=s},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function b(E,A){for(var S=0;S<A.length;S++){var k=A[S];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(E,k.key,k)}}return function(E,A,S){return A&&b(E.prototype,A),S&&b(E,S),E}}(),o=function b(E,A,S){E===null&&(E=Function.prototype);var k=Object.getOwnPropertyDescriptor(E,A);if(k===void 0){var I=Object.getPrototypeOf(E);return I===null?void 0:b(I,A,S)}else{if("value"in k)return k.value;var O=k.get;return O===void 0?void 0:O.call(S)}},s=i(0),u=g(s),h=i(7),f=g(h);function g(b){return b&&b.__esModule?b:{default:b}}function v(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}function p(b,E){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:b}function y(b,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);b.prototype=Object.create(E&&E.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(b,E):b.__proto__=E)}var _="\uFEFF",x=function(b){y(E,b);function E(A){v(this,E);var S=p(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,A));return S.contentNode=document.createElement("span"),S.contentNode.setAttribute("contenteditable",!1),[].slice.call(S.domNode.childNodes).forEach(function(k){S.contentNode.appendChild(k)}),S.leftGuard=document.createTextNode(_),S.rightGuard=document.createTextNode(_),S.domNode.appendChild(S.leftGuard),S.domNode.appendChild(S.contentNode),S.domNode.appendChild(S.rightGuard),S}return a(E,[{key:"index",value:function(S,k){return S===this.leftGuard?0:S===this.rightGuard?1:o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"index",this).call(this,S,k)}},{key:"restore",value:function(S){var k=void 0,I=void 0,O=S.data.split(_).join("");if(S===this.leftGuard)if(this.prev instanceof f.default){var M=this.prev.length();this.prev.insertAt(M,O),k={startNode:this.prev.domNode,startOffset:M+O.length}}else I=document.createTextNode(O),this.parent.insertBefore(u.default.create(I),this),k={startNode:I,startOffset:O.length};else S===this.rightGuard&&(this.next instanceof f.default?(this.next.insertAt(0,O),k={startNode:this.next.domNode,startOffset:O.length}):(I=document.createTextNode(O),this.parent.insertBefore(u.default.create(I),this.next),k={startNode:I,startOffset:O.length}));return S.data=_,k}},{key:"update",value:function(S,k){var I=this;S.forEach(function(O){if(O.type==="characterData"&&(O.target===I.leftGuard||O.target===I.rightGuard)){var M=I.restore(O.target);M&&(k.range=M)}})}}]),E}(u.default.Embed);n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var a=i(0),o=s(a);function s(v){return v&&v.__esModule?v:{default:v}}var u={scope:o.default.Scope.BLOCK,whitelist:["right","center","justify"]},h=new o.default.Attributor.Attribute("align","align",u),f=new o.default.Attributor.Class("align","ql-align",u),g=new o.default.Attributor.Style("align","text-align",u);n.AlignAttribute=h,n.AlignClass=f,n.AlignStyle=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var a=i(0),o=u(a),s=i(26);function u(g){return g&&g.__esModule?g:{default:g}}var h=new o.default.Attributor.Class("background","ql-bg",{scope:o.default.Scope.INLINE}),f=new s.ColorAttributor("background","background-color",{scope:o.default.Scope.INLINE});n.BackgroundClass=h,n.BackgroundStyle=f},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var a=i(0),o=s(a);function s(v){return v&&v.__esModule?v:{default:v}}var u={scope:o.default.Scope.BLOCK,whitelist:["rtl"]},h=new o.default.Attributor.Attribute("direction","dir",u),f=new o.default.Attributor.Class("direction","ql-direction",u),g=new o.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=h,n.DirectionClass=f,n.DirectionStyle=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function b(E,A){for(var S=0;S<A.length;S++){var k=A[S];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(E,k.key,k)}}return function(E,A,S){return A&&b(E.prototype,A),S&&b(E,S),E}}(),o=function b(E,A,S){E===null&&(E=Function.prototype);var k=Object.getOwnPropertyDescriptor(E,A);if(k===void 0){var I=Object.getPrototypeOf(E);return I===null?void 0:b(I,A,S)}else{if("value"in k)return k.value;var O=k.get;return O===void 0?void 0:O.call(S)}},s=i(0),u=h(s);function h(b){return b&&b.__esModule?b:{default:b}}function f(b,E){if(!(b instanceof E))throw new TypeError("Cannot call a class as a function")}function g(b,E){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:b}function v(b,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);b.prototype=Object.create(E&&E.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(b,E):b.__proto__=E)}var p={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},y=new u.default.Attributor.Class("font","ql-font",p),_=function(b){v(E,b);function E(){return f(this,E),g(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,[{key:"value",value:function(S){return o(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"value",this).call(this,S).replace(/["']/g,"")}}]),E}(u.default.Attributor.Style),x=new _("font","font-family",p);n.FontStyle=x,n.FontClass=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var a=i(0),o=s(a);function s(f){return f&&f.__esModule?f:{default:f}}var u=new o.default.Attributor.Class("size","ql-size",{scope:o.default.Scope.INLINE,whitelist:["small","large","huge"]}),h=new o.default.Attributor.Style("size","font-size",{scope:o.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=u,n.SizeStyle=h},function(r,n,i){r.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var a=function(){function A(S,k){for(var I=0;I<k.length;I++){var O=k[I];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(S,O.key,O)}}return function(S,k,I){return k&&A(S.prototype,k),I&&A(S,I),S}}(),o=i(0),s=v(o),u=i(5),h=v(u),f=i(9),g=v(f);function v(A){return A&&A.__esModule?A:{default:A}}function p(A,S){if(!(A instanceof S))throw new TypeError("Cannot call a class as a function")}function y(A,S){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:A}function _(A,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);A.prototype=Object.create(S&&S.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(A,S):A.__proto__=S)}var x=function(A){_(S,A);function S(k,I){p(this,S);var O=y(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,k,I));return O.lastRecorded=0,O.ignoreChange=!1,O.clear(),O.quill.on(h.default.events.EDITOR_CHANGE,function(M,F,j,T){M!==h.default.events.TEXT_CHANGE||O.ignoreChange||(!O.options.userOnly||T===h.default.sources.USER?O.record(F,j):O.transform(F))}),O.quill.keyboard.addBinding({key:"Z",shortKey:!0},O.undo.bind(O)),O.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},O.redo.bind(O)),/Win/i.test(navigator.platform)&&O.quill.keyboard.addBinding({key:"Y",shortKey:!0},O.redo.bind(O)),O}return a(S,[{key:"change",value:function(I,O){if(this.stack[I].length!==0){var M=this.stack[I].pop();this.stack[O].push(M),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(M[I],h.default.sources.USER),this.ignoreChange=!1;var F=E(M[I]);this.quill.setSelection(F)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(I,O){if(I.ops.length!==0){this.stack.redo=[];var M=this.quill.getContents().diff(O),F=Date.now();if(this.lastRecorded+this.options.delay>F&&this.stack.undo.length>0){var j=this.stack.undo.pop();M=M.compose(j.undo),I=j.redo.compose(I)}else this.lastRecorded=F;this.stack.undo.push({redo:I,undo:M}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(I){this.stack.undo.forEach(function(O){O.undo=I.transform(O.undo,!0),O.redo=I.transform(O.redo,!0)}),this.stack.redo.forEach(function(O){O.undo=I.transform(O.undo,!0),O.redo=I.transform(O.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),S}(g.default);x.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function b(A){var S=A.ops[A.ops.length-1];return S==null?!1:S.insert!=null?typeof S.insert=="string"&&S.insert.endsWith(`
|
|
144
|
-
`):S.attributes!=null?Object.keys(S.attributes).some(function(k){return s.default.query(k,s.default.Scope.BLOCK)!=null}):!1}function E(A){var S=A.reduce(function(I,O){return I+=O.delete||0,I},0),k=A.length()-S;return b(A)&&(k-=1),k}n.default=x,n.getLastChangeIndex=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function D(U,X){for(var ee=0;ee<X.length;ee++){var K=X[ee];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(U,K.key,K)}}return function(U,X,ee){return X&&D(U.prototype,X),ee&&D(U,ee),U}}(),o=function D(U,X,ee){U===null&&(U=Function.prototype);var K=Object.getOwnPropertyDescriptor(U,X);if(K===void 0){var oe=Object.getPrototypeOf(U);return oe===null?void 0:D(oe,X,ee)}else{if("value"in K)return K.value;var me=K.get;return me===void 0?void 0:me.call(ee)}},s=i(3),u=F(s),h=i(2),f=F(h),g=i(8),v=F(g),p=i(23),y=F(p),_=i(34),x=F(_),b=i(59),E=F(b),A=i(60),S=F(A),k=i(28),I=F(k),O=i(61),M=F(O);function F(D){return D&&D.__esModule?D:{default:D}}function j(D,U){if(!(D instanceof U))throw new TypeError("Cannot call a class as a function")}function T(D,U){if(!D)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U&&(typeof U=="object"||typeof U=="function")?U:D}function L(D,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);D.prototype=Object.create(U&&U.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(D,U):D.__proto__=U)}var $=[!1,"center","right","justify"],q=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],J=[!1,"serif","monospace"],ae=["1","2","3",!1],ie=["small",!1,"large","huge"],Z=function(D){L(U,D);function U(X,ee){j(this,U);var K=T(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,X,ee)),oe=function me(de){if(!document.body.contains(X.root))return document.body.removeEventListener("click",me);K.tooltip!=null&&!K.tooltip.root.contains(de.target)&&document.activeElement!==K.tooltip.textbox&&!K.quill.hasFocus()&&K.tooltip.hide(),K.pickers!=null&&K.pickers.forEach(function(ye){ye.container.contains(de.target)||ye.close()})};return X.emitter.listenDOM("click",document.body,oe),K}return a(U,[{key:"addModule",value:function(ee){var K=o(U.prototype.__proto__||Object.getPrototypeOf(U.prototype),"addModule",this).call(this,ee);return ee==="toolbar"&&this.extendToolbar(K),K}},{key:"buildButtons",value:function(ee,K){ee.forEach(function(oe){var me=oe.getAttribute("class")||"";me.split(/\s+/).forEach(function(de){if(de.startsWith("ql-")&&(de=de.slice(3),K[de]!=null))if(de==="direction")oe.innerHTML=K[de][""]+K[de].rtl;else if(typeof K[de]=="string")oe.innerHTML=K[de];else{var ye=oe.value||"";ye!=null&&K[de][ye]&&(oe.innerHTML=K[de][ye])}})})}},{key:"buildPickers",value:function(ee,K){var oe=this;this.pickers=ee.map(function(de){if(de.classList.contains("ql-align"))return de.querySelector("option")==null&&B(de,$),new S.default(de,K.align);if(de.classList.contains("ql-background")||de.classList.contains("ql-color")){var ye=de.classList.contains("ql-background")?"background":"color";return de.querySelector("option")==null&&B(de,q,ye==="background"?"#ffffff":"#000000"),new E.default(de,K[ye])}else return de.querySelector("option")==null&&(de.classList.contains("ql-font")?B(de,J):de.classList.contains("ql-header")?B(de,ae):de.classList.contains("ql-size")&&B(de,ie)),new I.default(de)});var me=function(){oe.pickers.forEach(function(ye){ye.update()})};this.quill.on(v.default.events.EDITOR_CHANGE,me)}}]),U}(x.default);Z.DEFAULTS=(0,u.default)(!0,{},x.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var U=this,X=this.container.querySelector("input.ql-image[type=file]");X==null&&(X=document.createElement("input"),X.setAttribute("type","file"),X.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),X.classList.add("ql-image"),X.addEventListener("change",function(){if(X.files!=null&&X.files[0]!=null){var ee=new FileReader;ee.onload=function(K){var oe=U.quill.getSelection(!0);U.quill.updateContents(new f.default().retain(oe.index).delete(oe.length).insert({image:K.target.result}),v.default.sources.USER),U.quill.setSelection(oe.index+1,v.default.sources.SILENT),X.value=""},ee.readAsDataURL(X.files[0])}}),this.container.appendChild(X)),X.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var te=function(D){L(U,D);function U(X,ee){j(this,U);var K=T(this,(U.__proto__||Object.getPrototypeOf(U)).call(this,X,ee));return K.textbox=K.root.querySelector('input[type="text"]'),K.listen(),K}return a(U,[{key:"listen",value:function(){var ee=this;this.textbox.addEventListener("keydown",function(K){y.default.match(K,"enter")?(ee.save(),K.preventDefault()):y.default.match(K,"escape")&&(ee.cancel(),K.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),K!=null?this.textbox.value=K:ee!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+ee)||""),this.root.setAttribute("data-mode",ee)}},{key:"restoreFocus",value:function(){var ee=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=ee}},{key:"save",value:function(){var ee=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var K=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",ee,v.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",ee,v.default.sources.USER)),this.quill.root.scrollTop=K;break}case"video":ee=V(ee);case"formula":{if(!ee)break;var oe=this.quill.getSelection(!0);if(oe!=null){var me=oe.index+oe.length;this.quill.insertEmbed(me,this.root.getAttribute("data-mode"),ee,v.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(me+1," ",v.default.sources.USER),this.quill.setSelection(me+2,v.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),U}(M.default);function V(D){var U=D.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||D.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return U?(U[1]||"https")+"://www.youtube.com/embed/"+U[2]+"?showinfo=0":(U=D.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(U[1]||"https")+"://player.vimeo.com/video/"+U[2]+"/":D}function B(D,U){var X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;U.forEach(function(ee){var K=document.createElement("option");ee===X?K.setAttribute("selected","selected"):K.setAttribute("value",ee),D.appendChild(K)})}n.BaseTooltip=te,n.default=Z},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function o(){this.head=this.tail=null,this.length=0}return o.prototype.append=function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];this.insertBefore(s[0],null),s.length>1&&this.append.apply(this,s.slice(1))},o.prototype.contains=function(s){for(var u,h=this.iterator();u=h();)if(u===s)return!0;return!1},o.prototype.insertBefore=function(s,u){s&&(s.next=u,u!=null?(s.prev=u.prev,u.prev!=null&&(u.prev.next=s),u.prev=s,u===this.head&&(this.head=s)):this.tail!=null?(this.tail.next=s,s.prev=this.tail,this.tail=s):(s.prev=null,this.head=this.tail=s),this.length+=1)},o.prototype.offset=function(s){for(var u=0,h=this.head;h!=null;){if(h===s)return u;u+=h.length(),h=h.next}return-1},o.prototype.remove=function(s){this.contains(s)&&(s.prev!=null&&(s.prev.next=s.next),s.next!=null&&(s.next.prev=s.prev),s===this.head&&(this.head=s.next),s===this.tail&&(this.tail=s.prev),this.length-=1)},o.prototype.iterator=function(s){return s===void 0&&(s=this.head),function(){var u=s;return s!=null&&(s=s.next),u}},o.prototype.find=function(s,u){u===void 0&&(u=!1);for(var h,f=this.iterator();h=f();){var g=h.length();if(s<g||u&&s===g&&(h.next==null||h.next.length()!==0))return[h,s];s-=g}return[null,0]},o.prototype.forEach=function(s){for(var u,h=this.iterator();u=h();)s(u)},o.prototype.forEachAt=function(s,u,h){if(!(u<=0))for(var f=this.find(s),g=f[0],v=f[1],p,y=s-v,_=this.iterator(g);(p=_())&&y<s+u;){var x=p.length();s>y?h(p,s-y,Math.min(u,y+x-s)):h(p,0,Math.min(x,s+u-y)),y+=x}},o.prototype.map=function(s){return this.reduce(function(u,h){return u.push(s(h)),u},[])},o.prototype.reduce=function(s,u){for(var h,f=this.iterator();h=f();)u=s(u,h);return u},o}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,p){v.__proto__=p}||function(v,p){for(var y in p)p.hasOwnProperty(y)&&(v[y]=p[y])};return function(v,p){g(v,p);function y(){this.constructor=v}v.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(17),s=i(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},h=100,f=function(g){a(v,g);function v(p){var y=g.call(this,p)||this;return y.scroll=y,y.observer=new MutationObserver(function(_){y.update(_)}),y.observer.observe(y.domNode,u),y.attach(),y}return v.prototype.detach=function(){g.prototype.detach.call(this),this.observer.disconnect()},v.prototype.deleteAt=function(p,y){this.update(),p===0&&y===this.length()?this.children.forEach(function(_){_.remove()}):g.prototype.deleteAt.call(this,p,y)},v.prototype.formatAt=function(p,y,_,x){this.update(),g.prototype.formatAt.call(this,p,y,_,x)},v.prototype.insertAt=function(p,y,_){this.update(),g.prototype.insertAt.call(this,p,y,_)},v.prototype.optimize=function(p,y){var _=this;p===void 0&&(p=[]),y===void 0&&(y={}),g.prototype.optimize.call(this,y);for(var x=[].slice.call(this.observer.takeRecords());x.length>0;)p.push(x.pop());for(var b=function(k,I){I===void 0&&(I=!0),!(k==null||k===_)&&k.domNode.parentNode!=null&&(k.domNode[s.DATA_KEY].mutations==null&&(k.domNode[s.DATA_KEY].mutations=[]),I&&b(k.parent))},E=function(k){k.domNode[s.DATA_KEY]==null||k.domNode[s.DATA_KEY].mutations==null||(k instanceof o.default&&k.children.forEach(E),k.optimize(y))},A=p,S=0;A.length>0;S+=1){if(S>=h)throw new Error("[Parchment] Maximum optimize iterations reached");for(A.forEach(function(k){var I=s.find(k.target,!0);I!=null&&(I.domNode===k.target&&(k.type==="childList"?(b(s.find(k.previousSibling,!1)),[].forEach.call(k.addedNodes,function(O){var M=s.find(O,!1);b(M,!1),M instanceof o.default&&M.children.forEach(function(F){b(F,!1)})})):k.type==="attributes"&&b(I.prev)),b(I))}),this.children.forEach(E),A=[].slice.call(this.observer.takeRecords()),x=A.slice();x.length>0;)p.push(x.pop())}},v.prototype.update=function(p,y){var _=this;y===void 0&&(y={}),p=p||this.observer.takeRecords(),p.map(function(x){var b=s.find(x.target,!0);return b==null?null:b.domNode[s.DATA_KEY].mutations==null?(b.domNode[s.DATA_KEY].mutations=[x],b):(b.domNode[s.DATA_KEY].mutations.push(x),null)}).forEach(function(x){x==null||x===_||x.domNode[s.DATA_KEY]==null||x.update(x.domNode[s.DATA_KEY].mutations||[],y)}),this.domNode[s.DATA_KEY].mutations!=null&&g.prototype.update.call(this,this.domNode[s.DATA_KEY].mutations,y),this.optimize(p,y)},v.blotName="scroll",v.defaultChild="block",v.scope=s.Scope.BLOCK_BLOT,v.tagName="DIV",v}(o.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,v){g.__proto__=v}||function(g,v){for(var p in v)v.hasOwnProperty(p)&&(g[p]=v[p])};return function(g,v){f(g,v);function p(){this.constructor=g}g.prototype=v===null?Object.create(v):(p.prototype=v.prototype,new p)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),s=i(1);function u(f,g){if(Object.keys(f).length!==Object.keys(g).length)return!1;for(var v in f)if(f[v]!==g[v])return!1;return!0}var h=function(f){a(g,f);function g(){return f!==null&&f.apply(this,arguments)||this}return g.formats=function(v){if(v.tagName!==g.tagName)return f.formats.call(this,v)},g.prototype.format=function(v,p){var y=this;v===this.statics.blotName&&!p?(this.children.forEach(function(_){_ instanceof o.default||(_=_.wrap(g.blotName,!0)),y.attributes.copy(_)}),this.unwrap()):f.prototype.format.call(this,v,p)},g.prototype.formatAt=function(v,p,y,_){if(this.formats()[y]!=null||s.query(y,s.Scope.ATTRIBUTE)){var x=this.isolate(v,p);x.format(y,_)}else f.prototype.formatAt.call(this,v,p,y,_)},g.prototype.optimize=function(v){f.prototype.optimize.call(this,v);var p=this.formats();if(Object.keys(p).length===0)return this.unwrap();var y=this.next;y instanceof g&&y.prev===this&&u(p,y.formats())&&(y.moveChildren(this),y.remove())},g.blotName="inline",g.scope=s.Scope.INLINE_BLOT,g.tagName="SPAN",g}(o.default);n.default=h},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var v in g)g.hasOwnProperty(v)&&(f[v]=g[v])};return function(f,g){h(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(18),s=i(1),u=function(h){a(f,h);function f(){return h!==null&&h.apply(this,arguments)||this}return f.formats=function(g){var v=s.query(f.blotName).tagName;if(g.tagName!==v)return h.formats.call(this,g)},f.prototype.format=function(g,v){s.query(g,s.Scope.BLOCK)!=null&&(g===this.statics.blotName&&!v?this.replaceWith(f.blotName):h.prototype.format.call(this,g,v))},f.prototype.formatAt=function(g,v,p,y){s.query(p,s.Scope.BLOCK)!=null?this.format(p,y):h.prototype.formatAt.call(this,g,v,p,y)},f.prototype.insertAt=function(g,v,p){if(p==null||s.query(v,s.Scope.INLINE)!=null)h.prototype.insertAt.call(this,g,v,p);else{var y=this.split(g),_=s.create(v,p);y.parent.insertBefore(_,y)}},f.prototype.update=function(g,v){navigator.userAgent.match(/Trident/)?this.build():h.prototype.update.call(this,g,v)},f.blotName="block",f.scope=s.Scope.BLOCK_BLOT,f.tagName="P",f}(o.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,f){h.__proto__=f}||function(h,f){for(var g in f)f.hasOwnProperty(g)&&(h[g]=f[g])};return function(h,f){u(h,f);function g(){this.constructor=h}h.prototype=f===null?Object.create(f):(g.prototype=f.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),s=function(u){a(h,u);function h(){return u!==null&&u.apply(this,arguments)||this}return h.formats=function(f){},h.prototype.format=function(f,g){u.prototype.formatAt.call(this,0,this.length(),f,g)},h.prototype.formatAt=function(f,g,v,p){f===0&&g===this.length()?this.format(v,p):u.prototype.formatAt.call(this,f,g,v,p)},h.prototype.formats=function(){return this.statics.formats(this.domNode)},h}(o.default);n.default=s},function(r,n,i){var a=this&&this.__extends||function(){var h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,g){f.__proto__=g}||function(f,g){for(var v in g)g.hasOwnProperty(v)&&(f[v]=g[v])};return function(f,g){h(f,g);function v(){this.constructor=f}f.prototype=g===null?Object.create(g):(v.prototype=g.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var o=i(19),s=i(1),u=function(h){a(f,h);function f(g){var v=h.call(this,g)||this;return v.text=v.statics.value(v.domNode),v}return f.create=function(g){return document.createTextNode(g)},f.value=function(g){var v=g.data;return v.normalize&&(v=v.normalize()),v},f.prototype.deleteAt=function(g,v){this.domNode.data=this.text=this.text.slice(0,g)+this.text.slice(g+v)},f.prototype.index=function(g,v){return this.domNode===g?v:-1},f.prototype.insertAt=function(g,v,p){p==null?(this.text=this.text.slice(0,g)+v+this.text.slice(g),this.domNode.data=this.text):h.prototype.insertAt.call(this,g,v,p)},f.prototype.length=function(){return this.text.length},f.prototype.optimize=function(g){h.prototype.optimize.call(this,g),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof f&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},f.prototype.position=function(g,v){return[this.domNode,g]},f.prototype.split=function(g,v){if(v===void 0&&(v=!1),!v){if(g===0)return this;if(g===this.length())return this.next}var p=s.create(this.domNode.splitText(g));return this.parent.insertBefore(p,this.next),this.text=this.statics.value(this.domNode),p},f.prototype.update=function(g,v){var p=this;g.some(function(y){return y.type==="characterData"&&y.target===p.domNode})&&(this.text=this.statics.value(this.domNode))},f.prototype.value=function(){return this.text},f.blotName="text",f.scope=s.Scope.INLINE_BLOT,f}(o.default);n.default=u},function(r,n,i){var a=document.createElement("div");if(a.classList.toggle("test-class",!1),a.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(s,u){return arguments.length>1&&!this.contains(s)==!u?u:o.call(this,s)}}String.prototype.startsWith||(String.prototype.startsWith=function(s,u){return u=u||0,this.substr(u,s.length)===s}),String.prototype.endsWith||(String.prototype.endsWith=function(s,u){var h=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>h.length)&&(u=h.length),u-=s.length;var f=h.indexOf(s,u);return f!==-1&&f===u}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(u){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof u!="function")throw new TypeError("predicate must be a function");for(var h=Object(this),f=h.length>>>0,g=arguments[1],v,p=0;p<f;p++)if(v=h[p],u.call(g,v,p,h))return v}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var i=-1,a=1,o=0;function s(S,k,I){if(S==k)return S?[[o,S]]:[];(I<0||S.length<I)&&(I=null);var O=g(S,k),M=S.substring(0,O);S=S.substring(O),k=k.substring(O),O=v(S,k);var F=S.substring(S.length-O);S=S.substring(0,S.length-O),k=k.substring(0,k.length-O);var j=u(S,k);return M&&j.unshift([o,M]),F&&j.push([o,F]),y(j),I!=null&&(j=b(j,I)),j=E(j),j}function u(S,k){var I;if(!S)return[[a,k]];if(!k)return[[i,S]];var O=S.length>k.length?S:k,M=S.length>k.length?k:S,F=O.indexOf(M);if(F!=-1)return I=[[a,O.substring(0,F)],[o,M],[a,O.substring(F+M.length)]],S.length>k.length&&(I[0][0]=I[2][0]=i),I;if(M.length==1)return[[i,S],[a,k]];var j=p(S,k);if(j){var T=j[0],L=j[1],$=j[2],q=j[3],J=j[4],ae=s(T,$),ie=s(L,q);return ae.concat([[o,J]],ie)}return h(S,k)}function h(S,k){for(var I=S.length,O=k.length,M=Math.ceil((I+O)/2),F=M,j=2*M,T=new Array(j),L=new Array(j),$=0;$<j;$++)T[$]=-1,L[$]=-1;T[F+1]=0,L[F+1]=0;for(var q=I-O,J=q%2!=0,ae=0,ie=0,Z=0,te=0,V=0;V<M;V++){for(var B=-V+ae;B<=V-ie;B+=2){var D=F+B,U;B==-V||B!=V&&T[D-1]<T[D+1]?U=T[D+1]:U=T[D-1]+1;for(var X=U-B;U<I&&X<O&&S.charAt(U)==k.charAt(X);)U++,X++;if(T[D]=U,U>I)ie+=2;else if(X>O)ae+=2;else if(J){var ee=F+q-B;if(ee>=0&&ee<j&&L[ee]!=-1){var K=I-L[ee];if(U>=K)return f(S,k,U,X)}}}for(var oe=-V+Z;oe<=V-te;oe+=2){var ee=F+oe,K;oe==-V||oe!=V&&L[ee-1]<L[ee+1]?K=L[ee+1]:K=L[ee-1]+1;for(var me=K-oe;K<I&&me<O&&S.charAt(I-K-1)==k.charAt(O-me-1);)K++,me++;if(L[ee]=K,K>I)te+=2;else if(me>O)Z+=2;else if(!J){var D=F+q-oe;if(D>=0&&D<j&&T[D]!=-1){var U=T[D],X=F+U-D;if(K=I-K,U>=K)return f(S,k,U,X)}}}}return[[i,S],[a,k]]}function f(S,k,I,O){var M=S.substring(0,I),F=k.substring(0,O),j=S.substring(I),T=k.substring(O),L=s(M,F),$=s(j,T);return L.concat($)}function g(S,k){if(!S||!k||S.charAt(0)!=k.charAt(0))return 0;for(var I=0,O=Math.min(S.length,k.length),M=O,F=0;I<M;)S.substring(F,M)==k.substring(F,M)?(I=M,F=I):O=M,M=Math.floor((O-I)/2+I);return M}function v(S,k){if(!S||!k||S.charAt(S.length-1)!=k.charAt(k.length-1))return 0;for(var I=0,O=Math.min(S.length,k.length),M=O,F=0;I<M;)S.substring(S.length-M,S.length-F)==k.substring(k.length-M,k.length-F)?(I=M,F=I):O=M,M=Math.floor((O-I)/2+I);return M}function p(S,k){var I=S.length>k.length?S:k,O=S.length>k.length?k:S;if(I.length<4||O.length*2<I.length)return null;function M(ie,Z,te){for(var V=ie.substring(te,te+Math.floor(ie.length/4)),B=-1,D="",U,X,ee,K;(B=Z.indexOf(V,B+1))!=-1;){var oe=g(ie.substring(te),Z.substring(B)),me=v(ie.substring(0,te),Z.substring(0,B));D.length<me+oe&&(D=Z.substring(B-me,B)+Z.substring(B,B+oe),U=ie.substring(0,te-me),X=ie.substring(te+oe),ee=Z.substring(0,B-me),K=Z.substring(B+oe))}return D.length*2>=ie.length?[U,X,ee,K,D]:null}var F=M(I,O,Math.ceil(I.length/4)),j=M(I,O,Math.ceil(I.length/2)),T;if(!F&&!j)return null;j?F?T=F[4].length>j[4].length?F:j:T=j:T=F;var L,$,q,J;S.length>k.length?(L=T[0],$=T[1],q=T[2],J=T[3]):(q=T[0],J=T[1],L=T[2],$=T[3]);var ae=T[4];return[L,$,q,J,ae]}function y(S){S.push([o,""]);for(var k=0,I=0,O=0,M="",F="",j;k<S.length;)switch(S[k][0]){case a:O++,F+=S[k][1],k++;break;case i:I++,M+=S[k][1],k++;break;case o:I+O>1?(I!==0&&O!==0&&(j=g(F,M),j!==0&&(k-I-O>0&&S[k-I-O-1][0]==o?S[k-I-O-1][1]+=F.substring(0,j):(S.splice(0,0,[o,F.substring(0,j)]),k++),F=F.substring(j),M=M.substring(j)),j=v(F,M),j!==0&&(S[k][1]=F.substring(F.length-j)+S[k][1],F=F.substring(0,F.length-j),M=M.substring(0,M.length-j))),I===0?S.splice(k-O,I+O,[a,F]):O===0?S.splice(k-I,I+O,[i,M]):S.splice(k-I-O,I+O,[i,M],[a,F]),k=k-I-O+(I?1:0)+(O?1:0)+1):k!==0&&S[k-1][0]==o?(S[k-1][1]+=S[k][1],S.splice(k,1)):k++,O=0,I=0,M="",F="";break}S[S.length-1][1]===""&&S.pop();var T=!1;for(k=1;k<S.length-1;)S[k-1][0]==o&&S[k+1][0]==o&&(S[k][1].substring(S[k][1].length-S[k-1][1].length)==S[k-1][1]?(S[k][1]=S[k-1][1]+S[k][1].substring(0,S[k][1].length-S[k-1][1].length),S[k+1][1]=S[k-1][1]+S[k+1][1],S.splice(k-1,1),T=!0):S[k][1].substring(0,S[k+1][1].length)==S[k+1][1]&&(S[k-1][1]+=S[k+1][1],S[k][1]=S[k][1].substring(S[k+1][1].length)+S[k+1][1],S.splice(k+1,1),T=!0)),k++;T&&y(S)}var _=s;_.INSERT=a,_.DELETE=i,_.EQUAL=o,r.exports=_;function x(S,k){if(k===0)return[o,S];for(var I=0,O=0;O<S.length;O++){var M=S[O];if(M[0]===i||M[0]===o){var F=I+M[1].length;if(k===F)return[O+1,S];if(k<F){S=S.slice();var j=k-I,T=[M[0],M[1].slice(0,j)],L=[M[0],M[1].slice(j)];return S.splice(O,1,T,L),[O+1,S]}else I=F}}throw new Error("cursor_pos is out of bounds!")}function b(S,k){var I=x(S,k),O=I[1],M=I[0],F=O[M],j=O[M+1];if(F==null)return S;if(F[0]!==o)return S;if(j!=null&&F[1]+j[1]===j[1]+F[1])return O.splice(M,2,j,F),A(O,M,2);if(j!=null&&j[1].indexOf(F[1])===0){O.splice(M,2,[j[0],F[1]],[0,F[1]]);var T=j[1].slice(F[1].length);return T.length>0&&O.splice(M+2,0,[j[0],T]),A(O,M,3)}else return S}function E(S){for(var k=!1,I=function(j){return j.charCodeAt(0)>=56320&&j.charCodeAt(0)<=57343},O=function(j){return j.charCodeAt(j.length-1)>=55296&&j.charCodeAt(j.length-1)<=56319},M=2;M<S.length;M+=1)S[M-2][0]===o&&O(S[M-2][1])&&S[M-1][0]===i&&I(S[M-1][1])&&S[M][0]===a&&I(S[M][1])&&(k=!0,S[M-1][1]=S[M-2][1].slice(-1)+S[M-1][1],S[M][1]=S[M-2][1].slice(-1)+S[M][1],S[M-2][1]=S[M-2][1].slice(0,-1));if(!k)return S;for(var F=[],M=0;M<S.length;M+=1)S[M][1].length>0&&F.push(S[M]);return F}function A(S,k,I){for(var O=k+I-1;O>=0&&O>=k-1;O--)if(O+1<S.length){var M=S[O],F=S[O+1];M[0]===F[1]&&S.splice(O,2,[M[0],M[1]+F[1]])}return S}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(a){var o=[];for(var s in a)o.push(s);return o}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?a:o,n.supported=a;function a(s){return Object.prototype.toString.call(s)=="[object Arguments]"}n.unsupported=o;function o(s){return s&&typeof s=="object"&&typeof s.length=="number"&&Object.prototype.hasOwnProperty.call(s,"callee")&&!Object.prototype.propertyIsEnumerable.call(s,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,a="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(a=!1));function s(h,f,g){this.fn=h,this.context=f,this.once=g||!1}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],g,v;if(this._eventsCount===0)return f;for(v in g=this._events)i.call(g,v)&&f.push(a?v.slice(1):v);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(g)):f},u.prototype.listeners=function(f,g){var v=a?a+f:f,p=this._events[v];if(g)return!!p;if(!p)return[];if(p.fn)return[p.fn];for(var y=0,_=p.length,x=new Array(_);y<_;y++)x[y]=p[y].fn;return x},u.prototype.emit=function(f,g,v,p,y,_){var x=a?a+f:f;if(!this._events[x])return!1;var b=this._events[x],E=arguments.length,A,S;if(b.fn){switch(b.once&&this.removeListener(f,b.fn,void 0,!0),E){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,g),!0;case 3:return b.fn.call(b.context,g,v),!0;case 4:return b.fn.call(b.context,g,v,p),!0;case 5:return b.fn.call(b.context,g,v,p,y),!0;case 6:return b.fn.call(b.context,g,v,p,y,_),!0}for(S=1,A=new Array(E-1);S<E;S++)A[S-1]=arguments[S];b.fn.apply(b.context,A)}else{var k=b.length,I;for(S=0;S<k;S++)switch(b[S].once&&this.removeListener(f,b[S].fn,void 0,!0),E){case 1:b[S].fn.call(b[S].context);break;case 2:b[S].fn.call(b[S].context,g);break;case 3:b[S].fn.call(b[S].context,g,v);break;case 4:b[S].fn.call(b[S].context,g,v,p);break;default:if(!A)for(I=1,A=new Array(E-1);I<E;I++)A[I-1]=arguments[I];b[S].fn.apply(b[S].context,A)}}return!0},u.prototype.on=function(f,g,v){var p=new s(g,v||this),y=a?a+f:f;return this._events[y]?this._events[y].fn?this._events[y]=[this._events[y],p]:this._events[y].push(p):(this._events[y]=p,this._eventsCount++),this},u.prototype.once=function(f,g,v){var p=new s(g,v||this,!0),y=a?a+f:f;return this._events[y]?this._events[y].fn?this._events[y]=[this._events[y],p]:this._events[y].push(p):(this._events[y]=p,this._eventsCount++),this},u.prototype.removeListener=function(f,g,v,p){var y=a?a+f:f;if(!this._events[y])return this;if(!g)return--this._eventsCount===0?this._events=new o:delete this._events[y],this;var _=this._events[y];if(_.fn)_.fn===g&&(!p||_.once)&&(!v||_.context===v)&&(--this._eventsCount===0?this._events=new o:delete this._events[y]);else{for(var x=0,b=[],E=_.length;x<E;x++)(_[x].fn!==g||p&&!_[x].once||v&&_[x].context!==v)&&b.push(_[x]);b.length?this._events[y]=b.length===1?b[0]:b:--this._eventsCount===0?this._events=new o:delete this._events[y]}return this},u.prototype.removeAllListeners=function(f){var g;return f?(g=a?a+f:f,this._events[g]&&(--this._eventsCount===0?this._events=new o:delete this._events[g])):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prototype.setMaxListeners=function(){return this},u.prefixed=a,u.EventEmitter=u,typeof r<"u"&&(r.exports=u)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Oe){return typeof Oe}:function(Oe){return Oe&&typeof Symbol=="function"&&Oe.constructor===Symbol&&Oe!==Symbol.prototype?"symbol":typeof Oe},o=function(){function Oe(fe,Le){var Ne=[],ue=!0,Ae=!1,Pe=void 0;try{for(var Ue=fe[Symbol.iterator](),st;!(ue=(st=Ue.next()).done)&&(Ne.push(st.value),!(Le&&Ne.length===Le));ue=!0);}catch(dt){Ae=!0,Pe=dt}finally{try{!ue&&Ue.return&&Ue.return()}finally{if(Ae)throw Pe}}return Ne}return function(fe,Le){if(Array.isArray(fe))return fe;if(Symbol.iterator in Object(fe))return Oe(fe,Le);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function Oe(fe,Le){for(var Ne=0;Ne<Le.length;Ne++){var ue=Le[Ne];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(fe,ue.key,ue)}}return function(fe,Le,Ne){return Le&&Oe(fe.prototype,Le),Ne&&Oe(fe,Ne),fe}}(),u=i(3),h=L(u),f=i(2),g=L(f),v=i(0),p=L(v),y=i(5),_=L(y),x=i(10),b=L(x),E=i(9),A=L(E),S=i(36),k=i(37),I=i(13),O=L(I),M=i(26),F=i(38),j=i(39),T=i(40);function L(Oe){return Oe&&Oe.__esModule?Oe:{default:Oe}}function $(Oe,fe,Le){return fe in Oe?Object.defineProperty(Oe,fe,{value:Le,enumerable:!0,configurable:!0,writable:!0}):Oe[fe]=Le,Oe}function q(Oe,fe){if(!(Oe instanceof fe))throw new TypeError("Cannot call a class as a function")}function J(Oe,fe){if(!Oe)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return fe&&(typeof fe=="object"||typeof fe=="function")?fe:Oe}function ae(Oe,fe){if(typeof fe!="function"&&fe!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof fe);Oe.prototype=Object.create(fe&&fe.prototype,{constructor:{value:Oe,enumerable:!1,writable:!0,configurable:!0}}),fe&&(Object.setPrototypeOf?Object.setPrototypeOf(Oe,fe):Oe.__proto__=fe)}var ie=(0,b.default)("quill:clipboard"),Z="__ql-matcher",te=[[Node.TEXT_NODE,Be],[Node.TEXT_NODE,Ee],["br",Te],[Node.ELEMENT_NODE,Ee],[Node.ELEMENT_NODE,ye],[Node.ELEMENT_NODE,ge],[Node.ELEMENT_NODE,de],[Node.ELEMENT_NODE,Re],["li",Ie],["b",me.bind(me,"bold")],["i",me.bind(me,"italic")],["style",Ce]],V=[S.AlignAttribute,F.DirectionAttribute].reduce(function(Oe,fe){return Oe[fe.keyName]=fe,Oe},{}),B=[S.AlignStyle,k.BackgroundStyle,M.ColorStyle,F.DirectionStyle,j.FontStyle,T.SizeStyle].reduce(function(Oe,fe){return Oe[fe.keyName]=fe,Oe},{}),D=function(Oe){ae(fe,Oe);function fe(Le,Ne){q(this,fe);var ue=J(this,(fe.__proto__||Object.getPrototypeOf(fe)).call(this,Le,Ne));return ue.quill.root.addEventListener("paste",ue.onPaste.bind(ue)),ue.container=ue.quill.addContainer("ql-clipboard"),ue.container.setAttribute("contenteditable",!0),ue.container.setAttribute("tabindex",-1),ue.matchers=[],te.concat(ue.options.matchers).forEach(function(Ae){var Pe=o(Ae,2),Ue=Pe[0],st=Pe[1];!Ne.matchVisual&&st===ge||ue.addMatcher(Ue,st)}),ue}return s(fe,[{key:"addMatcher",value:function(Ne,ue){this.matchers.push([Ne,ue])}},{key:"convert",value:function(Ne){if(typeof Ne=="string")return this.container.innerHTML=Ne.replace(/\>\r?\n +\</g,"><"),this.convert();var ue=this.quill.getFormat(this.quill.selection.savedRange.index);if(ue[O.default.blotName]){var Ae=this.container.innerText;return this.container.innerHTML="",new g.default().insert(Ae,$({},O.default.blotName,ue[O.default.blotName]))}var Pe=this.prepareMatching(),Ue=o(Pe,2),st=Ue[0],dt=Ue[1],pt=oe(this.container,st,dt);return ee(pt,`
|
|
145
|
-
`)&&pt.ops[pt.ops.length-1].attributes==null&&(pt=pt.compose(new g.default().retain(pt.length()-1).delete(1))),ie.log("convert",this.container.innerHTML,pt),this.container.innerHTML="",pt}},{key:"dangerouslyPasteHTML",value:function(Ne,ue){var Ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_.default.sources.API;if(typeof Ne=="string")this.quill.setContents(this.convert(Ne),ue),this.quill.setSelection(0,_.default.sources.SILENT);else{var Pe=this.convert(ue);this.quill.updateContents(new g.default().retain(Ne).concat(Pe),Ae),this.quill.setSelection(Ne+Pe.length(),_.default.sources.SILENT)}}},{key:"onPaste",value:function(Ne){var ue=this;if(!(Ne.defaultPrevented||!this.quill.isEnabled())){var Ae=this.quill.getSelection(),Pe=new g.default().retain(Ae.index),Ue=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(_.default.sources.SILENT),setTimeout(function(){Pe=Pe.concat(ue.convert()).delete(Ae.length),ue.quill.updateContents(Pe,_.default.sources.USER),ue.quill.setSelection(Pe.length()-Ae.length,_.default.sources.SILENT),ue.quill.scrollingContainer.scrollTop=Ue,ue.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Ne=this,ue=[],Ae=[];return this.matchers.forEach(function(Pe){var Ue=o(Pe,2),st=Ue[0],dt=Ue[1];switch(st){case Node.TEXT_NODE:Ae.push(dt);break;case Node.ELEMENT_NODE:ue.push(dt);break;default:[].forEach.call(Ne.container.querySelectorAll(st),function(pt){pt[Z]=pt[Z]||[],pt[Z].push(dt)});break}}),[ue,Ae]}}]),fe}(A.default);D.DEFAULTS={matchers:[],matchVisual:!0};function U(Oe,fe,Le){return(typeof fe>"u"?"undefined":a(fe))==="object"?Object.keys(fe).reduce(function(Ne,ue){return U(Ne,ue,fe[ue])},Oe):Oe.reduce(function(Ne,ue){return ue.attributes&&ue.attributes[fe]?Ne.push(ue):Ne.insert(ue.insert,(0,h.default)({},$({},fe,Le),ue.attributes))},new g.default)}function X(Oe){if(Oe.nodeType!==Node.ELEMENT_NODE)return{};var fe="__ql-computed-style";return Oe[fe]||(Oe[fe]=window.getComputedStyle(Oe))}function ee(Oe,fe){for(var Le="",Ne=Oe.ops.length-1;Ne>=0&&Le.length<fe.length;--Ne){var ue=Oe.ops[Ne];if(typeof ue.insert!="string")break;Le=ue.insert+Le}return Le.slice(-1*fe.length)===fe}function K(Oe){if(Oe.childNodes.length===0)return!1;var fe=X(Oe);return["block","list-item"].indexOf(fe.display)>-1}function oe(Oe,fe,Le){return Oe.nodeType===Oe.TEXT_NODE?Le.reduce(function(Ne,ue){return ue(Oe,Ne)},new g.default):Oe.nodeType===Oe.ELEMENT_NODE?[].reduce.call(Oe.childNodes||[],function(Ne,ue){var Ae=oe(ue,fe,Le);return ue.nodeType===Oe.ELEMENT_NODE&&(Ae=fe.reduce(function(Pe,Ue){return Ue(ue,Pe)},Ae),Ae=(ue[Z]||[]).reduce(function(Pe,Ue){return Ue(ue,Pe)},Ae)),Ne.concat(Ae)},new g.default):new g.default}function me(Oe,fe,Le){return U(Le,Oe,!0)}function de(Oe,fe){var Le=p.default.Attributor.Attribute.keys(Oe),Ne=p.default.Attributor.Class.keys(Oe),ue=p.default.Attributor.Style.keys(Oe),Ae={};return Le.concat(Ne).concat(ue).forEach(function(Pe){var Ue=p.default.query(Pe,p.default.Scope.ATTRIBUTE);Ue!=null&&(Ae[Ue.attrName]=Ue.value(Oe),Ae[Ue.attrName])||(Ue=V[Pe],Ue!=null&&(Ue.attrName===Pe||Ue.keyName===Pe)&&(Ae[Ue.attrName]=Ue.value(Oe)||void 0),Ue=B[Pe],Ue!=null&&(Ue.attrName===Pe||Ue.keyName===Pe)&&(Ue=B[Pe],Ae[Ue.attrName]=Ue.value(Oe)||void 0))}),Object.keys(Ae).length>0&&(fe=U(fe,Ae)),fe}function ye(Oe,fe){var Le=p.default.query(Oe);if(Le==null)return fe;if(Le.prototype instanceof p.default.Embed){var Ne={},ue=Le.value(Oe);ue!=null&&(Ne[Le.blotName]=ue,fe=new g.default().insert(Ne,Le.formats(Oe)))}else typeof Le.formats=="function"&&(fe=U(fe,Le.blotName,Le.formats(Oe)));return fe}function Te(Oe,fe){return ee(fe,`
|
|
146
|
-
`)||fe.insert(`
|
|
147
|
-
`),fe}function Ce(){return new g.default}function Ie(Oe,fe){var Le=p.default.query(Oe);if(Le==null||Le.blotName!=="list-item"||!ee(fe,`
|
|
148
|
-
`))return fe;for(var Ne=-1,ue=Oe.parentNode;!ue.classList.contains("ql-clipboard");)(p.default.query(ue)||{}).blotName==="list"&&(Ne+=1),ue=ue.parentNode;return Ne<=0?fe:fe.compose(new g.default().retain(fe.length()-1).retain(1,{indent:Ne}))}function Ee(Oe,fe){return ee(fe,`
|
|
149
|
-
`)||(K(Oe)||fe.length()>0&&Oe.nextSibling&&K(Oe.nextSibling))&&fe.insert(`
|
|
150
|
-
`),fe}function ge(Oe,fe){if(K(Oe)&&Oe.nextElementSibling!=null&&!ee(fe,`
|
|
151
|
-
|
|
152
|
-
`)){var Le=Oe.offsetHeight+parseFloat(X(Oe).marginTop)+parseFloat(X(Oe).marginBottom);Oe.nextElementSibling.offsetTop>Oe.offsetTop+Le*1.5&&fe.insert(`
|
|
153
|
-
`)}return fe}function Re(Oe,fe){var Le={},Ne=Oe.style||{};return Ne.fontStyle&&X(Oe).fontStyle==="italic"&&(Le.italic=!0),Ne.fontWeight&&(X(Oe).fontWeight.startsWith("bold")||parseInt(X(Oe).fontWeight)>=700)&&(Le.bold=!0),Object.keys(Le).length>0&&(fe=U(fe,Le)),parseFloat(Ne.textIndent||0)>0&&(fe=new g.default().insert(" ").concat(fe)),fe}function Be(Oe,fe){var Le=Oe.data;if(Oe.parentNode.tagName==="O:P")return fe.insert(Le.trim());if(Le.trim().length===0&&Oe.parentNode.classList.contains("ql-clipboard"))return fe;if(!X(Oe.parentNode).whiteSpace.startsWith("pre")){var Ne=function(Ae,Pe){return Pe=Pe.replace(/[^\u00a0]/g,""),Pe.length<1&&Ae?" ":Pe};Le=Le.replace(/\r\n/g," ").replace(/\n/g," "),Le=Le.replace(/\s\s+/g,Ne.bind(Ne,!0)),(Oe.previousSibling==null&&K(Oe.parentNode)||Oe.previousSibling!=null&&K(Oe.previousSibling))&&(Le=Le.replace(/^\s+/,Ne.bind(Ne,!1))),(Oe.nextSibling==null&&K(Oe.parentNode)||Oe.nextSibling!=null&&K(Oe.nextSibling))&&(Le=Le.replace(/\s+$/,Ne.bind(Ne,!1)))}return fe.insert(Le)}n.default=D,n.matchAttributor=de,n.matchBlot=ye,n.matchNewline=Ee,n.matchSpacing=ge,n.matchText=Be},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}}(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var A=Object.getPrototypeOf(_);return A===null?void 0:y(A,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(6),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function g(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function v(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=function(y){v(_,y);function _(){return f(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"optimize",value:function(b){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,b),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),_}(u.default);p.blotName="bold",p.tagName=["STRONG","B"],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var a=function(){function T(L,$){var q=[],J=!0,ae=!1,ie=void 0;try{for(var Z=L[Symbol.iterator](),te;!(J=(te=Z.next()).done)&&(q.push(te.value),!($&&q.length===$));J=!0);}catch(V){ae=!0,ie=V}finally{try{!J&&Z.return&&Z.return()}finally{if(ae)throw ie}}return q}return function(L,$){if(Array.isArray(L))return L;if(Symbol.iterator in Object(L))return T(L,$);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function T(L,$){for(var q=0;q<$.length;q++){var J=$[q];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(L,J.key,J)}}return function(L,$,q){return $&&T(L.prototype,$),q&&T(L,q),L}}(),s=i(2),u=b(s),h=i(0),f=b(h),g=i(5),v=b(g),p=i(10),y=b(p),_=i(9),x=b(_);function b(T){return T&&T.__esModule?T:{default:T}}function E(T,L,$){return L in T?Object.defineProperty(T,L,{value:$,enumerable:!0,configurable:!0,writable:!0}):T[L]=$,T}function A(T,L){if(!(T instanceof L))throw new TypeError("Cannot call a class as a function")}function S(T,L){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:T}function k(T,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);T.prototype=Object.create(L&&L.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(T,L):T.__proto__=L)}var I=(0,y.default)("quill:toolbar"),O=function(T){k(L,T);function L($,q){A(this,L);var J=S(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,$,q));if(Array.isArray(J.options.container)){var ae=document.createElement("div");F(ae,J.options.container),$.container.parentNode.insertBefore(ae,$.container),J.container=ae}else typeof J.options.container=="string"?J.container=document.querySelector(J.options.container):J.container=J.options.container;if(!(J.container instanceof HTMLElement)){var ie;return ie=I.error("Container required for toolbar",J.options),S(J,ie)}return J.container.classList.add("ql-toolbar"),J.controls=[],J.handlers={},Object.keys(J.options.handlers).forEach(function(Z){J.addHandler(Z,J.options.handlers[Z])}),[].forEach.call(J.container.querySelectorAll("button, select"),function(Z){J.attach(Z)}),J.quill.on(v.default.events.EDITOR_CHANGE,function(Z,te){Z===v.default.events.SELECTION_CHANGE&&J.update(te)}),J.quill.on(v.default.events.SCROLL_OPTIMIZE,function(){var Z=J.quill.selection.getRange(),te=a(Z,1),V=te[0];J.update(V)}),J}return o(L,[{key:"addHandler",value:function(q,J){this.handlers[q]=J}},{key:"attach",value:function(q){var J=this,ae=[].find.call(q.classList,function(Z){return Z.indexOf("ql-")===0});if(ae){if(ae=ae.slice(3),q.tagName==="BUTTON"&&q.setAttribute("type","button"),this.handlers[ae]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[ae]==null){I.warn("ignoring attaching to disabled format",ae,q);return}if(f.default.query(ae)==null){I.warn("ignoring attaching to nonexistent format",ae,q);return}}var ie=q.tagName==="SELECT"?"change":"click";q.addEventListener(ie,function(Z){var te=void 0;if(q.tagName==="SELECT"){if(q.selectedIndex<0)return;var V=q.options[q.selectedIndex];V.hasAttribute("selected")?te=!1:te=V.value||!1}else q.classList.contains("ql-active")?te=!1:te=q.value||!q.hasAttribute("value"),Z.preventDefault();J.quill.focus();var B=J.quill.selection.getRange(),D=a(B,1),U=D[0];if(J.handlers[ae]!=null)J.handlers[ae].call(J,te);else if(f.default.query(ae).prototype instanceof f.default.Embed){if(te=prompt("Enter "+ae),!te)return;J.quill.updateContents(new u.default().retain(U.index).delete(U.length).insert(E({},ae,te)),v.default.sources.USER)}else J.quill.format(ae,te,v.default.sources.USER);J.update(U)}),this.controls.push([ae,q])}}},{key:"update",value:function(q){var J=q==null?{}:this.quill.getFormat(q);this.controls.forEach(function(ae){var ie=a(ae,2),Z=ie[0],te=ie[1];if(te.tagName==="SELECT"){var V=void 0;if(q==null)V=null;else if(J[Z]==null)V=te.querySelector("option[selected]");else if(!Array.isArray(J[Z])){var B=J[Z];typeof B=="string"&&(B=B.replace(/\"/g,'\\"')),V=te.querySelector('option[value="'+B+'"]')}V==null?(te.value="",te.selectedIndex=-1):V.selected=!0}else if(q==null)te.classList.remove("ql-active");else if(te.hasAttribute("value")){var D=J[Z]===te.getAttribute("value")||J[Z]!=null&&J[Z].toString()===te.getAttribute("value")||J[Z]==null&&!te.getAttribute("value");te.classList.toggle("ql-active",D)}else te.classList.toggle("ql-active",J[Z]!=null)})}}]),L}(x.default);O.DEFAULTS={};function M(T,L,$){var q=document.createElement("button");q.setAttribute("type","button"),q.classList.add("ql-"+L),$!=null&&(q.value=$),T.appendChild(q)}function F(T,L){Array.isArray(L[0])||(L=[L]),L.forEach(function($){var q=document.createElement("span");q.classList.add("ql-formats"),$.forEach(function(J){if(typeof J=="string")M(q,J);else{var ae=Object.keys(J)[0],ie=J[ae];Array.isArray(ie)?j(q,ae,ie):M(q,ae,ie)}}),T.appendChild(q)})}function j(T,L,$){var q=document.createElement("select");q.classList.add("ql-"+L),$.forEach(function(J){var ae=document.createElement("option");J!==!1?ae.setAttribute("value",J):ae.setAttribute("selected","selected"),q.appendChild(ae)}),T.appendChild(q)}O.DEFAULTS={container:null,handlers:{clean:function(){var L=this,$=this.quill.getSelection();if($!=null)if($.length==0){var q=this.quill.getFormat();Object.keys(q).forEach(function(J){f.default.query(J,f.default.Scope.INLINE)!=null&&L.quill.format(J,!1)})}else this.quill.removeFormat($,v.default.sources.USER)},direction:function(L){var $=this.quill.getFormat().align;L==="rtl"&&$==null?this.quill.format("align","right",v.default.sources.USER):!L&&$==="right"&&this.quill.format("align",!1,v.default.sources.USER),this.quill.format("direction",L,v.default.sources.USER)},indent:function(L){var $=this.quill.getSelection(),q=this.quill.getFormat($),J=parseInt(q.indent||0);if(L==="+1"||L==="-1"){var ae=L==="+1"?1:-1;q.direction==="rtl"&&(ae*=-1),this.quill.format("indent",J+ae,v.default.sources.USER)}},link:function(L){L===!0&&(L=prompt("Enter link URL:")),this.quill.format("link",L,v.default.sources.USER)},list:function(L){var $=this.quill.getSelection(),q=this.quill.getFormat($);L==="check"?q.list==="checked"||q.list==="unchecked"?this.quill.format("list",!1,v.default.sources.USER):this.quill.format("list","unchecked",v.default.sources.USER):this.quill.format("list",L,v.default.sources.USER)}}},n.default=O,n.addControls=F},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}}(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var A=Object.getPrototypeOf(_);return A===null?void 0:y(A,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(28),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function g(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function v(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=function(y){v(_,y);function _(x,b){f(this,_);var E=g(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,x));return E.label.innerHTML=b,E.container.classList.add("ql-color-picker"),[].slice.call(E.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(A){A.classList.add("ql-primary")}),E}return a(_,[{key:"buildItem",value:function(b){var E=o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"buildItem",this).call(this,b);return E.style.backgroundColor=b.getAttribute("value")||"",E}},{key:"selectItem",value:function(b,E){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"selectItem",this).call(this,b,E);var A=this.label.querySelector(".ql-color-label"),S=b&&b.getAttribute("data-value")||"";A&&(A.tagName==="line"?A.style.stroke=S:A.style.fill=S)}}]),_}(u.default);n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}}(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var A=Object.getPrototypeOf(_);return A===null?void 0:y(A,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(28),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function g(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function v(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=function(y){v(_,y);function _(x,b){f(this,_);var E=g(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,x));return E.container.classList.add("ql-icon-picker"),[].forEach.call(E.container.querySelectorAll(".ql-picker-item"),function(A){A.innerHTML=b[A.getAttribute("data-value")||""]}),E.defaultItem=E.container.querySelector(".ql-selected"),E.selectItem(E.defaultItem),E}return a(_,[{key:"selectItem",value:function(b,E){o(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"selectItem",this).call(this,b,E),b=b||this.defaultItem,this.label.innerHTML=b.innerHTML}}]),_}(u.default);n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(h,f){for(var g=0;g<f.length;g++){var v=f[g];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(h,v.key,v)}}return function(h,f,g){return f&&u(h.prototype,f),g&&u(h,g),h}}();function o(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}var s=function(){function u(h,f){var g=this;o(this,u),this.quill=h,this.boundsContainer=f||document.body,this.root=h.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){g.root.style.marginTop=-1*g.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(f){var g=f.left+f.width/2-this.root.offsetWidth/2,v=f.bottom+this.quill.root.scrollTop;this.root.style.left=g+"px",this.root.style.top=v+"px",this.root.classList.remove("ql-flip");var p=this.boundsContainer.getBoundingClientRect(),y=this.root.getBoundingClientRect(),_=0;if(y.right>p.right&&(_=p.right-y.right,this.root.style.left=g+_+"px"),y.left<p.left&&(_=p.left-y.left,this.root.style.left=g+_+"px"),y.bottom>p.bottom){var x=y.bottom-y.top,b=f.bottom-f.top+x;this.root.style.top=v-b+"px",this.root.classList.add("ql-flip")}return _}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();n.default=s},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function j(T,L){var $=[],q=!0,J=!1,ae=void 0;try{for(var ie=T[Symbol.iterator](),Z;!(q=(Z=ie.next()).done)&&($.push(Z.value),!(L&&$.length===L));q=!0);}catch(te){J=!0,ae=te}finally{try{!q&&ie.return&&ie.return()}finally{if(J)throw ae}}return $}return function(T,L){if(Array.isArray(T))return T;if(Symbol.iterator in Object(T))return j(T,L);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function j(T,L,$){T===null&&(T=Function.prototype);var q=Object.getOwnPropertyDescriptor(T,L);if(q===void 0){var J=Object.getPrototypeOf(T);return J===null?void 0:j(J,L,$)}else{if("value"in q)return q.value;var ae=q.get;return ae===void 0?void 0:ae.call($)}},s=function(){function j(T,L){for(var $=0;$<L.length;$++){var q=L[$];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(T,q.key,q)}}return function(T,L,$){return L&&j(T.prototype,L),$&&j(T,$),T}}(),u=i(3),h=A(u),f=i(8),g=A(f),v=i(43),p=A(v),y=i(27),_=A(y),x=i(15),b=i(41),E=A(b);function A(j){return j&&j.__esModule?j:{default:j}}function S(j,T){if(!(j instanceof T))throw new TypeError("Cannot call a class as a function")}function k(j,T){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:j}function I(j,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);j.prototype=Object.create(T&&T.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(j,T):j.__proto__=T)}var O=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],M=function(j){I(T,j);function T(L,$){S(this,T),$.modules.toolbar!=null&&$.modules.toolbar.container==null&&($.modules.toolbar.container=O);var q=k(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,L,$));return q.quill.container.classList.add("ql-snow"),q}return s(T,[{key:"extendToolbar",value:function($){$.container.classList.add("ql-snow"),this.buildButtons([].slice.call($.container.querySelectorAll("button")),E.default),this.buildPickers([].slice.call($.container.querySelectorAll("select")),E.default),this.tooltip=new F(this.quill,this.options.bounds),$.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(q,J){$.handlers.link.call($,!J.format.link)})}}]),T}(p.default);M.DEFAULTS=(0,h.default)(!0,{},p.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(T){if(T){var L=this.quill.getSelection();if(L==null||L.length==0)return;var $=this.quill.getText(L);/^\S+@\S+\.\S+$/.test($)&&$.indexOf("mailto:")!==0&&($="mailto:"+$);var q=this.quill.theme.tooltip;q.edit("link",$)}else this.quill.format("link",!1)}}}}});var F=function(j){I(T,j);function T(L,$){S(this,T);var q=k(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,L,$));return q.preview=q.root.querySelector("a.ql-preview"),q}return s(T,[{key:"listen",value:function(){var $=this;o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(q){$.root.classList.contains("ql-editing")?$.save():$.edit("link",$.preview.textContent),q.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(q){if($.linkRange!=null){var J=$.linkRange;$.restoreFocus(),$.quill.formatText(J,"link",!1,g.default.sources.USER),delete $.linkRange}q.preventDefault(),$.hide()}),this.quill.on(g.default.events.SELECTION_CHANGE,function(q,J,ae){if(q!=null){if(q.length===0&&ae===g.default.sources.USER){var ie=$.quill.scroll.descendant(_.default,q.index),Z=a(ie,2),te=Z[0],V=Z[1];if(te!=null){$.linkRange=new x.Range(q.index-V,te.length());var B=_.default.formats(te.domNode);$.preview.textContent=B,$.preview.setAttribute("href",B),$.show(),$.position($.quill.getBounds($.linkRange));return}}else delete $.linkRange;$.hide()}})}},{key:"show",value:function(){o(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),T}(v.BaseTooltip);F.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),n.default=M},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(29),o=ue(a),s=i(36),u=i(38),h=i(64),f=i(65),g=ue(f),v=i(66),p=ue(v),y=i(67),_=ue(y),x=i(37),b=i(26),E=i(39),A=i(40),S=i(56),k=ue(S),I=i(68),O=ue(I),M=i(27),F=ue(M),j=i(69),T=ue(j),L=i(70),$=ue(L),q=i(71),J=ue(q),ae=i(72),ie=ue(ae),Z=i(73),te=ue(Z),V=i(13),B=ue(V),D=i(74),U=ue(D),X=i(75),ee=ue(X),K=i(57),oe=ue(K),me=i(41),de=ue(me),ye=i(28),Te=ue(ye),Ce=i(59),Ie=ue(Ce),Ee=i(60),ge=ue(Ee),Re=i(61),Be=ue(Re),Oe=i(108),fe=ue(Oe),Le=i(62),Ne=ue(Le);function ue(Ae){return Ae&&Ae.__esModule?Ae:{default:Ae}}o.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":s.AlignClass,"attributors/class/background":x.BackgroundClass,"attributors/class/color":b.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":E.FontClass,"attributors/class/size":A.SizeClass,"attributors/style/align":s.AlignStyle,"attributors/style/background":x.BackgroundStyle,"attributors/style/color":b.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":E.FontStyle,"attributors/style/size":A.SizeStyle},!0),o.default.register({"formats/align":s.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":h.IndentClass,"formats/background":x.BackgroundStyle,"formats/color":b.ColorStyle,"formats/font":E.FontClass,"formats/size":A.SizeClass,"formats/blockquote":g.default,"formats/code-block":B.default,"formats/header":p.default,"formats/list":_.default,"formats/bold":k.default,"formats/code":V.Code,"formats/italic":O.default,"formats/link":F.default,"formats/script":T.default,"formats/strike":$.default,"formats/underline":J.default,"formats/image":ie.default,"formats/video":te.default,"formats/list/item":y.ListItem,"modules/formula":U.default,"modules/syntax":ee.default,"modules/toolbar":oe.default,"themes/bubble":fe.default,"themes/snow":Ne.default,"ui/icons":de.default,"ui/picker":Te.default,"ui/icon-picker":ge.default,"ui/color-picker":Ie.default,"ui/tooltip":Be.default},!0),n.default=o.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var a=function(){function _(x,b){for(var E=0;E<b.length;E++){var A=b[E];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(x,A.key,A)}}return function(x,b,E){return b&&_(x.prototype,b),E&&_(x,E),x}}(),o=function _(x,b,E){x===null&&(x=Function.prototype);var A=Object.getOwnPropertyDescriptor(x,b);if(A===void 0){var S=Object.getPrototypeOf(x);return S===null?void 0:_(S,b,E)}else{if("value"in A)return A.value;var k=A.get;return k===void 0?void 0:k.call(E)}},s=i(0),u=h(s);function h(_){return _&&_.__esModule?_:{default:_}}function f(_,x){if(!(_ instanceof x))throw new TypeError("Cannot call a class as a function")}function g(_,x){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:_}function v(_,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);_.prototype=Object.create(x&&x.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(_,x):_.__proto__=x)}var p=function(_){v(x,_);function x(){return f(this,x),g(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"add",value:function(E,A){if(A==="+1"||A==="-1"){var S=this.value(E)||0;A=A==="+1"?S+1:S-1}return A===0?(this.remove(E),!0):o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"add",this).call(this,E,A)}},{key:"canAdd",value:function(E,A){return o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"canAdd",this).call(this,E,A)||o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"canAdd",this).call(this,E,parseInt(A))}},{key:"value",value:function(E){return parseInt(o(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"value",this).call(this,E))||void 0}}]),x}(u.default.Attributor.Class),y=new p("indent","ql-indent",{scope:u.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(4),o=s(a);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,p){if(!(v instanceof p))throw new TypeError("Cannot call a class as a function")}function h(v,p){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:v}function f(v,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);v.prototype=Object.create(p&&p.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(v,p):v.__proto__=p)}var g=function(v){f(p,v);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);g.blotName="blockquote",g.tagName="blockquote",n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function p(y,_){for(var x=0;x<_.length;x++){var b=_[x];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,_,x){return _&&p(y.prototype,_),x&&p(y,x),y}}(),o=i(4),s=u(o);function u(p){return p&&p.__esModule?p:{default:p}}function h(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function f(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function g(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var v=function(p){g(y,p);function y(){return h(this,y),f(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,null,[{key:"formats",value:function(x){return this.tagName.indexOf(x.tagName)+1}}]),y}(s.default);v.blotName="header",v.tagName=["H1","H2","H3","H4","H5","H6"],n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function S(k,I){for(var O=0;O<I.length;O++){var M=I[O];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(k,M.key,M)}}return function(k,I,O){return I&&S(k.prototype,I),O&&S(k,O),k}}(),o=function S(k,I,O){k===null&&(k=Function.prototype);var M=Object.getOwnPropertyDescriptor(k,I);if(M===void 0){var F=Object.getPrototypeOf(k);return F===null?void 0:S(F,I,O)}else{if("value"in M)return M.value;var j=M.get;return j===void 0?void 0:j.call(O)}},s=i(0),u=p(s),h=i(4),f=p(h),g=i(25),v=p(g);function p(S){return S&&S.__esModule?S:{default:S}}function y(S,k,I){return k in S?Object.defineProperty(S,k,{value:I,enumerable:!0,configurable:!0,writable:!0}):S[k]=I,S}function _(S,k){if(!(S instanceof k))throw new TypeError("Cannot call a class as a function")}function x(S,k){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:S}function b(S,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);S.prototype=Object.create(k&&k.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(S,k):S.__proto__=k)}var E=function(S){b(k,S);function k(){return _(this,k),x(this,(k.__proto__||Object.getPrototypeOf(k)).apply(this,arguments))}return a(k,[{key:"format",value:function(O,M){O===A.blotName&&!M?this.replaceWith(u.default.create(this.statics.scope)):o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"format",this).call(this,O,M)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(O,M){return this.parent.isolate(this.offset(this.parent),this.length()),O===this.parent.statics.blotName?(this.parent.replaceWith(O,M),this):(this.parent.unwrap(),o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"replaceWith",this).call(this,O,M))}}],[{key:"formats",value:function(O){return O.tagName===this.tagName?void 0:o(k.__proto__||Object.getPrototypeOf(k),"formats",this).call(this,O)}}]),k}(f.default);E.blotName="list-item",E.tagName="LI";var A=function(S){b(k,S),a(k,null,[{key:"create",value:function(O){var M=O==="ordered"?"OL":"UL",F=o(k.__proto__||Object.getPrototypeOf(k),"create",this).call(this,M);return(O==="checked"||O==="unchecked")&&F.setAttribute("data-checked",O==="checked"),F}},{key:"formats",value:function(O){if(O.tagName==="OL")return"ordered";if(O.tagName==="UL")return O.hasAttribute("data-checked")?O.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function k(I){_(this,k);var O=x(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,I)),M=function(j){if(j.target.parentNode===I){var T=O.statics.formats(I),L=u.default.find(j.target);T==="checked"?L.format("list","unchecked"):T==="unchecked"&&L.format("list","checked")}};return I.addEventListener("touchstart",M),I.addEventListener("mousedown",M),O}return a(k,[{key:"format",value:function(O,M){this.children.length>0&&this.children.tail.format(O,M)}},{key:"formats",value:function(){return y({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(O,M){if(O instanceof E)o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertBefore",this).call(this,O,M);else{var F=M==null?this.length():M.offset(this),j=this.split(F);j.parent.insertBefore(O,j)}}},{key:"optimize",value:function(O){o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"optimize",this).call(this,O);var M=this.next;M!=null&&M.prev===this&&M.statics.blotName===this.statics.blotName&&M.domNode.tagName===this.domNode.tagName&&M.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(M.moveChildren(this),M.remove())}},{key:"replace",value:function(O){if(O.statics.blotName!==this.statics.blotName){var M=u.default.create(this.statics.defaultChild);O.moveChildren(M),this.appendChild(M)}o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"replace",this).call(this,O)}}]),k}(v.default);A.blotName="list",A.scope=u.default.Scope.BLOCK_BLOT,A.tagName=["OL","UL"],A.defaultChild="list-item",A.allowedChildren=[E],n.ListItem=E,n.default=A},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(56),o=s(a);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,p){if(!(v instanceof p))throw new TypeError("Cannot call a class as a function")}function h(v,p){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:v}function f(v,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);v.prototype=Object.create(p&&p.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(v,p):v.__proto__=p)}var g=function(v){f(p,v);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);g.blotName="italic",g.tagName=["EM","I"],n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(_,x){for(var b=0;b<x.length;b++){var E=x[b];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}return function(_,x,b){return x&&y(_.prototype,x),b&&y(_,b),_}}(),o=function y(_,x,b){_===null&&(_=Function.prototype);var E=Object.getOwnPropertyDescriptor(_,x);if(E===void 0){var A=Object.getPrototypeOf(_);return A===null?void 0:y(A,x,b)}else{if("value"in E)return E.value;var S=E.get;return S===void 0?void 0:S.call(b)}},s=i(6),u=h(s);function h(y){return y&&y.__esModule?y:{default:y}}function f(y,_){if(!(y instanceof _))throw new TypeError("Cannot call a class as a function")}function g(y,_){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:y}function v(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);y.prototype=Object.create(_&&_.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(y,_):y.__proto__=_)}var p=function(y){v(_,y);function _(){return f(this,_),g(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,null,[{key:"create",value:function(b){return b==="super"?document.createElement("sup"):b==="sub"?document.createElement("sub"):o(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,b)}},{key:"formats",value:function(b){if(b.tagName==="SUB")return"sub";if(b.tagName==="SUP")return"super"}}]),_}(u.default);p.blotName="script",p.tagName=["SUB","SUP"],n.default=p},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=s(a);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,p){if(!(v instanceof p))throw new TypeError("Cannot call a class as a function")}function h(v,p){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:v}function f(v,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);v.prototype=Object.create(p&&p.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(v,p):v.__proto__=p)}var g=function(v){f(p,v);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);g.blotName="strike",g.tagName="S",n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),o=s(a);function s(v){return v&&v.__esModule?v:{default:v}}function u(v,p){if(!(v instanceof p))throw new TypeError("Cannot call a class as a function")}function h(v,p){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:v}function f(v,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);v.prototype=Object.create(p&&p.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(v,p):v.__proto__=p)}var g=function(v){f(p,v);function p(){return u(this,p),h(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p}(o.default);g.blotName="underline",g.tagName="U",n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(b,E){for(var A=0;A<E.length;A++){var S=E[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,A){return E&&x(b.prototype,E),A&&x(b,A),b}}(),o=function x(b,E,A){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,E);if(S===void 0){var k=Object.getPrototypeOf(b);return k===null?void 0:x(k,E,A)}else{if("value"in S)return S.value;var I=S.get;return I===void 0?void 0:I.call(A)}},s=i(0),u=f(s),h=i(27);function f(x){return x&&x.__esModule?x:{default:x}}function g(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function v(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function p(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var y=["alt","height","width"],_=function(x){p(b,x);function b(){return g(this,b),v(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"format",value:function(A,S){y.indexOf(A)>-1?S?this.domNode.setAttribute(A,S):this.domNode.removeAttribute(A):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,A,S)}}],[{key:"create",value:function(A){var S=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,A);return typeof A=="string"&&S.setAttribute("src",this.sanitize(A)),S}},{key:"formats",value:function(A){return y.reduce(function(S,k){return A.hasAttribute(k)&&(S[k]=A.getAttribute(k)),S},{})}},{key:"match",value:function(A){return/\.(jpe?g|gif|png)$/.test(A)||/^data:image\/.+;base64/.test(A)}},{key:"sanitize",value:function(A){return(0,h.sanitize)(A,["http","https","data"])?A:"//:0"}},{key:"value",value:function(A){return A.getAttribute("src")}}]),b}(u.default.Embed);_.blotName="image",_.tagName="IMG",n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function x(b,E){for(var A=0;A<E.length;A++){var S=E[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,E,A){return E&&x(b.prototype,E),A&&x(b,A),b}}(),o=function x(b,E,A){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,E);if(S===void 0){var k=Object.getPrototypeOf(b);return k===null?void 0:x(k,E,A)}else{if("value"in S)return S.value;var I=S.get;return I===void 0?void 0:I.call(A)}},s=i(4),u=i(27),h=f(u);function f(x){return x&&x.__esModule?x:{default:x}}function g(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function v(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function p(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var y=["height","width"],_=function(x){p(b,x);function b(){return g(this,b),v(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"format",value:function(A,S){y.indexOf(A)>-1?S?this.domNode.setAttribute(A,S):this.domNode.removeAttribute(A):o(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,A,S)}}],[{key:"create",value:function(A){var S=o(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,A);return S.setAttribute("frameborder","0"),S.setAttribute("allowfullscreen",!0),S.setAttribute("src",this.sanitize(A)),S}},{key:"formats",value:function(A){return y.reduce(function(S,k){return A.hasAttribute(k)&&(S[k]=A.getAttribute(k)),S},{})}},{key:"sanitize",value:function(A){return h.default.sanitize(A)}},{key:"value",value:function(A){return A.getAttribute("src")}}]),b}(s.BlockEmbed);_.blotName="video",_.className="ql-video",_.tagName="IFRAME",n.default=_},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var a=function(){function A(S,k){for(var I=0;I<k.length;I++){var O=k[I];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(S,O.key,O)}}return function(S,k,I){return k&&A(S.prototype,k),I&&A(S,I),S}}(),o=function A(S,k,I){S===null&&(S=Function.prototype);var O=Object.getOwnPropertyDescriptor(S,k);if(O===void 0){var M=Object.getPrototypeOf(S);return M===null?void 0:A(M,k,I)}else{if("value"in O)return O.value;var F=O.get;return F===void 0?void 0:F.call(I)}},s=i(35),u=p(s),h=i(5),f=p(h),g=i(9),v=p(g);function p(A){return A&&A.__esModule?A:{default:A}}function y(A,S){if(!(A instanceof S))throw new TypeError("Cannot call a class as a function")}function _(A,S){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:A}function x(A,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);A.prototype=Object.create(S&&S.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(A,S):A.__proto__=S)}var b=function(A){x(S,A);function S(){return y(this,S),_(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,null,[{key:"create",value:function(I){var O=o(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,I);return typeof I=="string"&&(window.katex.render(I,O,{throwOnError:!1,errorColor:"#f00"}),O.setAttribute("data-value",I)),O}},{key:"value",value:function(I){return I.getAttribute("data-value")}}]),S}(u.default);b.blotName="formula",b.className="ql-formula",b.tagName="SPAN";var E=function(A){x(S,A),a(S,null,[{key:"register",value:function(){f.default.register(b,!0)}}]);function S(){y(this,S);var k=_(this,(S.__proto__||Object.getPrototypeOf(S)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return k}return S}(v.default);n.FormulaBlot=b,n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function I(O,M){for(var F=0;F<M.length;F++){var j=M[F];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(O,j.key,j)}}return function(O,M,F){return M&&I(O.prototype,M),F&&I(O,F),O}}(),o=function I(O,M,F){O===null&&(O=Function.prototype);var j=Object.getOwnPropertyDescriptor(O,M);if(j===void 0){var T=Object.getPrototypeOf(O);return T===null?void 0:I(T,M,F)}else{if("value"in j)return j.value;var L=j.get;return L===void 0?void 0:L.call(F)}},s=i(0),u=_(s),h=i(5),f=_(h),g=i(9),v=_(g),p=i(13),y=_(p);function _(I){return I&&I.__esModule?I:{default:I}}function x(I,O){if(!(I instanceof O))throw new TypeError("Cannot call a class as a function")}function b(I,O){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:I}function E(I,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);I.prototype=Object.create(O&&O.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(I,O):I.__proto__=O)}var A=function(I){E(O,I);function O(){return x(this,O),b(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return a(O,[{key:"replaceWith",value:function(F){this.domNode.textContent=this.domNode.textContent,this.attach(),o(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replaceWith",this).call(this,F)}},{key:"highlight",value:function(F){var j=this.domNode.textContent;this.cachedText!==j&&((j.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=F(j),this.domNode.normalize(),this.attach()),this.cachedText=j)}}]),O}(y.default);A.className="ql-syntax";var S=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),k=function(I){E(O,I),a(O,null,[{key:"register",value:function(){f.default.register(S,!0),f.default.register(A,!0)}}]);function O(M,F){x(this,O);var j=b(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,M,F));if(typeof j.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var T=null;return j.quill.on(f.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(T),T=setTimeout(function(){j.highlight(),T=null},j.options.interval)}),j.highlight(),j}return a(O,[{key:"highlight",value:function(){var F=this;if(!this.quill.selection.composing){this.quill.update(f.default.sources.USER);var j=this.quill.getSelection();this.quill.scroll.descendants(A).forEach(function(T){T.highlight(F.options.highlight)}),this.quill.update(f.default.sources.SILENT),j!=null&&this.quill.setSelection(j,f.default.sources.SILENT)}}}]),O}(v.default);k.DEFAULTS={highlight:function(){return window.hljs==null?null:function(I){var O=window.hljs.highlightAuto(I);return O.value}}(),interval:1e3},n.CodeBlock=A,n.CodeToken=S,n.default=k},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 O(M,F,j){M===null&&(M=Function.prototype);var T=Object.getOwnPropertyDescriptor(M,F);if(T===void 0){var L=Object.getPrototypeOf(M);return L===null?void 0:O(L,F,j)}else{if("value"in T)return T.value;var $=T.get;return $===void 0?void 0:$.call(j)}},o=function(){function O(M,F){for(var j=0;j<F.length;j++){var T=F[j];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(M,T.key,T)}}return function(M,F,j){return F&&O(M.prototype,F),j&&O(M,j),M}}(),s=i(3),u=x(s),h=i(8),f=x(h),g=i(43),v=x(g),p=i(15),y=i(41),_=x(y);function x(O){return O&&O.__esModule?O:{default:O}}function b(O,M){if(!(O instanceof M))throw new TypeError("Cannot call a class as a function")}function E(O,M){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return M&&(typeof M=="object"||typeof M=="function")?M:O}function A(O,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof M);O.prototype=Object.create(M&&M.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),M&&(Object.setPrototypeOf?Object.setPrototypeOf(O,M):O.__proto__=M)}var S=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],k=function(O){A(M,O);function M(F,j){b(this,M),j.modules.toolbar!=null&&j.modules.toolbar.container==null&&(j.modules.toolbar.container=S);var T=E(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,F,j));return T.quill.container.classList.add("ql-bubble"),T}return o(M,[{key:"extendToolbar",value:function(j){this.tooltip=new I(this.quill,this.options.bounds),this.tooltip.root.appendChild(j.container),this.buildButtons([].slice.call(j.container.querySelectorAll("button")),_.default),this.buildPickers([].slice.call(j.container.querySelectorAll("select")),_.default)}}]),M}(v.default);k.DEFAULTS=(0,u.default)(!0,{},v.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(M){M?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var I=function(O){A(M,O);function M(F,j){b(this,M);var T=E(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,F,j));return T.quill.on(f.default.events.EDITOR_CHANGE,function(L,$,q,J){if(L===f.default.events.SELECTION_CHANGE)if($!=null&&$.length>0&&J===f.default.sources.USER){T.show(),T.root.style.left="0px",T.root.style.width="",T.root.style.width=T.root.offsetWidth+"px";var ae=T.quill.getLines($.index,$.length);if(ae.length===1)T.position(T.quill.getBounds($));else{var ie=ae[ae.length-1],Z=T.quill.getIndex(ie),te=Math.min(ie.length()-1,$.index+$.length-Z),V=T.quill.getBounds(new p.Range(Z,te));T.position(V)}}else document.activeElement!==T.textbox&&T.quill.hasFocus()&&T.hide()}),T}return o(M,[{key:"listen",value:function(){var j=this;a(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){j.root.classList.remove("ql-editing")}),this.quill.on(f.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!j.root.classList.contains("ql-hidden")){var T=j.quill.getSelection();T!=null&&j.position(j.quill.getBounds(T))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(j){var T=a(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"position",this).call(this,j),L=this.root.querySelector(".ql-tooltip-arrow");if(L.style.marginLeft="",T===0)return T;L.style.marginLeft=-1*T-L.offsetWidth/2+"px"}}]),M}(g.BaseTooltip);I.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=I,n.default=k},function(r,n,i){r.exports=i(63)}]).default})}(Y1)),Y1.exports}var vL=gL();const N7=hh(vL);var X1={exports:{}},Wf={},Qd={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var mL=Qd.exports,K3;function yL(){return K3||(K3=1,function(t,e){(function(r){var n=e&&!e.nodeType&&e,i=t&&!t.nodeType&&t,a=typeof i0=="object"&&i0;(a.global===a||a.window===a||a.self===a)&&(r=a);var o,s=2147483647,u=36,h=1,f=26,g=38,v=700,p=72,y=128,_="-",x=/^xn--/,b=/[^\x20-\x7E]/,E=/[\x2E\u3002\uFF0E\uFF61]/g,A={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=u-h,k=Math.floor,I=String.fromCharCode,O;function M(V){throw new RangeError(A[V])}function F(V,B){for(var D=V.length,U=[];D--;)U[D]=B(V[D]);return U}function j(V,B){var D=V.split("@"),U="";D.length>1&&(U=D[0]+"@",V=D[1]),V=V.replace(E,".");var X=V.split("."),ee=F(X,B).join(".");return U+ee}function T(V){for(var B=[],D=0,U=V.length,X,ee;D<U;)X=V.charCodeAt(D++),X>=55296&&X<=56319&&D<U?(ee=V.charCodeAt(D++),(ee&64512)==56320?B.push(((X&1023)<<10)+(ee&1023)+65536):(B.push(X),D--)):B.push(X);return B}function L(V){return F(V,function(B){var D="";return B>65535&&(B-=65536,D+=I(B>>>10&1023|55296),B=56320|B&1023),D+=I(B),D}).join("")}function $(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:u}function q(V,B){return V+22+75*(V<26)-((B!=0)<<5)}function J(V,B,D){var U=0;for(V=D?k(V/v):V>>1,V+=k(V/B);V>S*f>>1;U+=u)V=k(V/S);return k(U+(S+1)*V/(V+g))}function ae(V){var B=[],D=V.length,U,X=0,ee=y,K=p,oe,me,de,ye,Te,Ce,Ie,Ee,ge;for(oe=V.lastIndexOf(_),oe<0&&(oe=0),me=0;me<oe;++me)V.charCodeAt(me)>=128&&M("not-basic"),B.push(V.charCodeAt(me));for(de=oe>0?oe+1:0;de<D;){for(ye=X,Te=1,Ce=u;de>=D&&M("invalid-input"),Ie=$(V.charCodeAt(de++)),(Ie>=u||Ie>k((s-X)/Te))&&M("overflow"),X+=Ie*Te,Ee=Ce<=K?h:Ce>=K+f?f:Ce-K,!(Ie<Ee);Ce+=u)ge=u-Ee,Te>k(s/ge)&&M("overflow"),Te*=ge;U=B.length+1,K=J(X-ye,U,ye==0),k(X/U)>s-ee&&M("overflow"),ee+=k(X/U),X%=U,B.splice(X++,0,ee)}return L(B)}function ie(V){var B,D,U,X,ee,K,oe,me,de,ye,Te,Ce=[],Ie,Ee,ge,Re;for(V=T(V),Ie=V.length,B=y,D=0,ee=p,K=0;K<Ie;++K)Te=V[K],Te<128&&Ce.push(I(Te));for(U=X=Ce.length,X&&Ce.push(_);U<Ie;){for(oe=s,K=0;K<Ie;++K)Te=V[K],Te>=B&&Te<oe&&(oe=Te);for(Ee=U+1,oe-B>k((s-D)/Ee)&&M("overflow"),D+=(oe-B)*Ee,B=oe,K=0;K<Ie;++K)if(Te=V[K],Te<B&&++D>s&&M("overflow"),Te==B){for(me=D,de=u;ye=de<=ee?h:de>=ee+f?f:de-ee,!(me<ye);de+=u)Re=me-ye,ge=u-ye,Ce.push(I(q(ye+Re%ge,0))),me=k(Re/ge);Ce.push(I(q(me,0))),ee=J(D,Ee,U==X),D=0,++U}++D,++B}return Ce.join("")}function Z(V){return j(V,function(B){return x.test(B)?ae(B.slice(4).toLowerCase()):B})}function te(V){return j(V,function(B){return b.test(B)?"xn--"+ie(B):B})}if(o={version:"1.4.1",ucs2:{decode:T,encode:L},decode:ae,encode:ie,toASCII:te,toUnicode:Z},n&&i)if(t.exports==n)i.exports=o;else for(O in o)o.hasOwnProperty(O)&&(n[O]=o[O]);else r.punycode=o})(mL)}(Qd,Qd.exports)),Qd.exports}var c2,Z3;function Sd(){return Z3||(Z3=1,c2=TypeError),c2}const bL={},wL=Object.freeze(Object.defineProperty({__proto__:null,default:bL},Symbol.toStringTag,{value:"Module"})),_L=jx(wL);var f2,Q3;function V0(){if(Q3)return f2;Q3=1;var t=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&t?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=t&&e&&typeof e.get=="function"?e.get:null,n=t&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,o=i&&a&&typeof a.get=="function"?a.get:null,s=i&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,h=u?WeakMap.prototype.has:null,f=typeof WeakSet=="function"&&WeakSet.prototype,g=f?WeakSet.prototype.has:null,v=typeof WeakRef=="function"&&WeakRef.prototype,p=v?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,_=Object.prototype.toString,x=Function.prototype.toString,b=String.prototype.match,E=String.prototype.slice,A=String.prototype.replace,S=String.prototype.toUpperCase,k=String.prototype.toLowerCase,I=RegExp.prototype.test,O=Array.prototype.concat,M=Array.prototype.join,F=Array.prototype.slice,j=Math.floor,T=typeof BigInt=="function"?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,q=typeof Symbol=="function"&&typeof Symbol.iterator=="object",J=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===q||!0)?Symbol.toStringTag:null,ae=Object.prototype.propertyIsEnumerable,ie=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(Ve){return Ve.__proto__}:null);function Z(Ve,qe){if(Ve===1/0||Ve===-1/0||Ve!==Ve||Ve&&Ve>-1e3&&Ve<1e3||I.call(/e/,qe))return qe;var Nt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof Ve=="number"){var Ct=Ve<0?-j(-Ve):j(Ve);if(Ct!==Ve){var ir=String(Ct),Ut=E.call(qe,ir.length+1);return A.call(ir,Nt,"$&_")+"."+A.call(A.call(Ut,/([0-9]{3})/g,"$&_"),/_$/,"")}}return A.call(qe,Nt,"$&_")}var te=_L,V=te.custom,B=Ee(V)?V:null,D={__proto__:null,double:'"',single:"'"},U={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};f2=function Ve(qe,Nt,Ct,ir){var Ut=Nt||{};if(Be(Ut,"quoteStyle")&&!Be(D,Ut.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Be(Ut,"maxStringLength")&&(typeof Ut.maxStringLength=="number"?Ut.maxStringLength<0&&Ut.maxStringLength!==1/0:Ut.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var xr=Be(Ut,"customInspect")?Ut.customInspect:!0;if(typeof xr!="boolean"&&xr!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Be(Ut,"indent")&&Ut.indent!==null&&Ut.indent!==" "&&!(parseInt(Ut.indent,10)===Ut.indent&&Ut.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Be(Ut,"numericSeparator")&&typeof Ut.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var er=Ut.numericSeparator;if(typeof qe>"u")return"undefined";if(qe===null)return"null";if(typeof qe=="boolean")return qe?"true":"false";if(typeof qe=="string")return dt(qe,Ut);if(typeof qe=="number"){if(qe===0)return 1/0/qe>0?"0":"-0";var pr=String(qe);return er?Z(qe,pr):pr}if(typeof qe=="bigint"){var Bi=String(qe)+"n";return er?Z(qe,Bi):Bi}var oi=typeof Ut.depth>"u"?5:Ut.depth;if(typeof Ct>"u"&&(Ct=0),Ct>=oi&&oi>0&&typeof qe=="object")return oe(qe)?"[Array]":"[Object]";var Ei=_r(Ut,Ct);if(typeof ir>"u")ir=[];else if(Le(ir,qe)>=0)return"[Circular]";function Sn(zi,to,Bs){if(to&&(ir=F.call(ir),ir.push(to)),Bs){var is={depth:Ut.depth};return Be(Ut,"quoteStyle")&&(is.quoteStyle=Ut.quoteStyle),Ve(zi,is,Ct+1,ir)}return Ve(zi,Ut,Ct+1,ir)}if(typeof qe=="function"&&!de(qe)){var Qt=fe(qe),ca=Jt(qe,Sn);return"[Function"+(Qt?": "+Qt:" (anonymous)")+"]"+(ca.length>0?" { "+M.call(ca,", ")+" }":"")}if(Ee(qe)){var Fa=q?A.call(String(qe),/^(Symbol\(.*\))_[^)]*$/,"$1"):$.call(qe);return typeof qe=="object"&&!q?xt(Fa):Fa}if(st(qe)){for(var Kn="<"+k.call(String(qe.nodeName)),Yi=qe.attributes||[],qr=0;qr<Yi.length;qr++)Kn+=" "+Yi[qr].name+"="+X(ee(Yi[qr].value),"double",Ut);return Kn+=">",qe.childNodes&&qe.childNodes.length&&(Kn+="..."),Kn+="</"+k.call(String(qe.nodeName))+">",Kn}if(oe(qe)){if(qe.length===0)return"[]";var En=Jt(qe,Sn);return Ei&&!zr(En)?"["+It(En,Ei)+"]":"[ "+M.call(En,", ")+" ]"}if(ye(qe)){var Rn=Jt(qe,Sn);return!("cause"in Error.prototype)&&"cause"in qe&&!ae.call(qe,"cause")?"{ ["+String(qe)+"] "+M.call(O.call("[cause]: "+Sn(qe.cause),Rn),", ")+" }":Rn.length===0?"["+String(qe)+"]":"{ ["+String(qe)+"] "+M.call(Rn,", ")+" }"}if(typeof qe=="object"&&xr){if(B&&typeof qe[B]=="function"&&te)return te(qe,{depth:oi-Ct});if(xr!=="symbol"&&typeof qe.inspect=="function")return qe.inspect()}if(Ne(qe)){var Sa=[];return n&&n.call(qe,function(zi,to){Sa.push(Sn(to,qe,!0)+" => "+Sn(zi,qe))}),kt("Map",r.call(qe),Sa,Ei)}if(Pe(qe)){var Ho=[];return s&&s.call(qe,function(zi){Ho.push(Sn(zi,qe))}),kt("Set",o.call(qe),Ho,Ei)}if(ue(qe))return bt("WeakMap");if(Ue(qe))return bt("WeakSet");if(Ae(qe))return bt("WeakRef");if(Ce(qe))return xt(Sn(Number(qe)));if(ge(qe))return xt(Sn(T.call(qe)));if(Ie(qe))return xt(y.call(qe));if(Te(qe))return xt(Sn(String(qe)));if(typeof window<"u"&&qe===window)return"{ [object Window] }";if(typeof globalThis<"u"&&qe===globalThis||typeof i0<"u"&&qe===i0)return"{ [object globalThis] }";if(!me(qe)&&!de(qe)){var Ea=Jt(qe,Sn),eo=ie?ie(qe)===Object.prototype:qe instanceof Object||qe.constructor===Object,si=qe instanceof Object?"":"null prototype",ka=!eo&&J&&Object(qe)===qe&&J in qe?E.call(Oe(qe),8,-1):si?"Object":"",Aa=eo||typeof qe.constructor!="function"?"":qe.constructor.name?qe.constructor.name+" ":"",$o=Aa+(ka||si?"["+M.call(O.call([],ka||[],si||[]),": ")+"] ":"");return Ea.length===0?$o+"{}":Ei?$o+"{"+It(Ea,Ei)+"}":$o+"{ "+M.call(Ea,", ")+" }"}return String(qe)};function X(Ve,qe,Nt){var Ct=Nt.quoteStyle||qe,ir=D[Ct];return ir+Ve+ir}function ee(Ve){return A.call(String(Ve),/"/g,""")}function K(Ve){return!J||!(typeof Ve=="object"&&(J in Ve||typeof Ve[J]<"u"))}function oe(Ve){return Oe(Ve)==="[object Array]"&&K(Ve)}function me(Ve){return Oe(Ve)==="[object Date]"&&K(Ve)}function de(Ve){return Oe(Ve)==="[object RegExp]"&&K(Ve)}function ye(Ve){return Oe(Ve)==="[object Error]"&&K(Ve)}function Te(Ve){return Oe(Ve)==="[object String]"&&K(Ve)}function Ce(Ve){return Oe(Ve)==="[object Number]"&&K(Ve)}function Ie(Ve){return Oe(Ve)==="[object Boolean]"&&K(Ve)}function Ee(Ve){if(q)return Ve&&typeof Ve=="object"&&Ve instanceof Symbol;if(typeof Ve=="symbol")return!0;if(!Ve||typeof Ve!="object"||!$)return!1;try{return $.call(Ve),!0}catch{}return!1}function ge(Ve){if(!Ve||typeof Ve!="object"||!T)return!1;try{return T.call(Ve),!0}catch{}return!1}var Re=Object.prototype.hasOwnProperty||function(Ve){return Ve in this};function Be(Ve,qe){return Re.call(Ve,qe)}function Oe(Ve){return _.call(Ve)}function fe(Ve){if(Ve.name)return Ve.name;var qe=b.call(x.call(Ve),/^function\s*([\w$]+)/);return qe?qe[1]:null}function Le(Ve,qe){if(Ve.indexOf)return Ve.indexOf(qe);for(var Nt=0,Ct=Ve.length;Nt<Ct;Nt++)if(Ve[Nt]===qe)return Nt;return-1}function Ne(Ve){if(!r||!Ve||typeof Ve!="object")return!1;try{r.call(Ve);try{o.call(Ve)}catch{return!0}return Ve instanceof Map}catch{}return!1}function ue(Ve){if(!h||!Ve||typeof Ve!="object")return!1;try{h.call(Ve,h);try{g.call(Ve,g)}catch{return!0}return Ve instanceof WeakMap}catch{}return!1}function Ae(Ve){if(!p||!Ve||typeof Ve!="object")return!1;try{return p.call(Ve),!0}catch{}return!1}function Pe(Ve){if(!o||!Ve||typeof Ve!="object")return!1;try{o.call(Ve);try{r.call(Ve)}catch{return!0}return Ve instanceof Set}catch{}return!1}function Ue(Ve){if(!g||!Ve||typeof Ve!="object")return!1;try{g.call(Ve,g);try{h.call(Ve,h)}catch{return!0}return Ve instanceof WeakSet}catch{}return!1}function st(Ve){return!Ve||typeof Ve!="object"?!1:typeof HTMLElement<"u"&&Ve instanceof HTMLElement?!0:typeof Ve.nodeName=="string"&&typeof Ve.getAttribute=="function"}function dt(Ve,qe){if(Ve.length>qe.maxStringLength){var Nt=Ve.length-qe.maxStringLength,Ct="... "+Nt+" more character"+(Nt>1?"s":"");return dt(E.call(Ve,0,qe.maxStringLength),qe)+Ct}var ir=U[qe.quoteStyle||"single"];ir.lastIndex=0;var Ut=A.call(A.call(Ve,ir,"\\$1"),/[\x00-\x1f]/g,pt);return X(Ut,"single",qe)}function pt(Ve){var qe=Ve.charCodeAt(0),Nt={8:"b",9:"t",10:"n",12:"f",13:"r"}[qe];return Nt?"\\"+Nt:"\\x"+(qe<16?"0":"")+S.call(qe.toString(16))}function xt(Ve){return"Object("+Ve+")"}function bt(Ve){return Ve+" { ? }"}function kt(Ve,qe,Nt,Ct){var ir=Ct?It(Nt,Ct):M.call(Nt,", ");return Ve+" ("+qe+") {"+ir+"}"}function zr(Ve){for(var qe=0;qe<Ve.length;qe++)if(Le(Ve[qe],`
|
|
154
|
-
`)>=0)return!1;return!0}function _r(Ve,qe){var Nt;if(Ve.indent===" ")Nt=" ";else if(typeof Ve.indent=="number"&&Ve.indent>0)Nt=M.call(Array(Ve.indent+1)," ");else return null;return{base:Nt,prev:M.call(Array(qe+1),Nt)}}function It(Ve,qe){if(Ve.length===0)return"";var Nt=`
|
|
155
|
-
`+qe.prev+qe.base;return Nt+M.call(Ve,","+Nt)+`
|
|
156
|
-
`+qe.prev}function Jt(Ve,qe){var Nt=oe(Ve),Ct=[];if(Nt){Ct.length=Ve.length;for(var ir=0;ir<Ve.length;ir++)Ct[ir]=Be(Ve,ir)?qe(Ve[ir],Ve):""}var Ut=typeof L=="function"?L(Ve):[],xr;if(q){xr={};for(var er=0;er<Ut.length;er++)xr["$"+Ut[er]]=Ut[er]}for(var pr in Ve)Be(Ve,pr)&&(Nt&&String(Number(pr))===pr&&pr<Ve.length||q&&xr["$"+pr]instanceof Symbol||(I.call(/[^\w$]/,pr)?Ct.push(qe(pr,Ve)+": "+qe(Ve[pr],Ve)):Ct.push(pr+": "+qe(Ve[pr],Ve))));if(typeof L=="function")for(var Bi=0;Bi<Ut.length;Bi++)ae.call(Ve,Ut[Bi])&&Ct.push("["+qe(Ut[Bi])+"]: "+qe(Ve[Ut[Bi]],Ve));return Ct}return f2}var h2,J3;function xL(){if(J3)return h2;J3=1;var t=V0(),e=Sd(),r=function(s,u,h){for(var f=s,g;(g=f.next)!=null;f=g)if(g.key===u)return f.next=g.next,h||(g.next=s.next,s.next=g),g},n=function(s,u){if(s){var h=r(s,u);return h&&h.value}},i=function(s,u,h){var f=r(s,u);f?f.value=h:s.next={key:u,next:s.next,value:h}},a=function(s,u){return s?!!r(s,u):!1},o=function(s,u){if(s)return r(s,u,!0)};return h2=function(){var u,h={assert:function(f){if(!h.has(f))throw new e("Side channel does not contain "+t(f))},delete:function(f){var g=u&&u.next,v=o(u,f);return v&&g&&g===v&&(u=void 0),!!v},get:function(f){return n(u,f)},has:function(f){return a(u,f)},set:function(f,g){u||(u={next:void 0}),i(u,f,g)}};return h},h2}var d2,eb;function T7(){return eb||(eb=1,d2=Object),d2}var p2,tb;function SL(){return tb||(tb=1,p2=Error),p2}var g2,rb;function EL(){return rb||(rb=1,g2=EvalError),g2}var v2,nb;function kL(){return nb||(nb=1,v2=RangeError),v2}var m2,ib;function AL(){return ib||(ib=1,m2=ReferenceError),m2}var y2,ab;function PL(){return ab||(ab=1,y2=SyntaxError),y2}var b2,ob;function OL(){return ob||(ob=1,b2=URIError),b2}var w2,sb;function CL(){return sb||(sb=1,w2=Math.abs),w2}var _2,lb;function LL(){return lb||(lb=1,_2=Math.floor),_2}var x2,ub;function NL(){return ub||(ub=1,x2=Math.max),x2}var S2,cb;function TL(){return cb||(cb=1,S2=Math.min),S2}var E2,fb;function RL(){return fb||(fb=1,E2=Math.pow),E2}var k2,hb;function ML(){return hb||(hb=1,k2=Math.round),k2}var A2,db;function IL(){return db||(db=1,A2=Number.isNaN||function(e){return e!==e}),A2}var P2,pb;function jL(){if(pb)return P2;pb=1;var t=IL();return P2=function(r){return t(r)||r===0?r:r<0?-1:1},P2}var O2,gb;function DL(){return gb||(gb=1,O2=Object.getOwnPropertyDescriptor),O2}var C2,vb;function R7(){if(vb)return C2;vb=1;var t=DL();if(t)try{t([],"length")}catch{t=null}return C2=t,C2}var L2,mb;function FL(){if(mb)return L2;mb=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return L2=t,L2}var N2,yb;function BL(){return yb||(yb=1,N2=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}),N2}var T2,bb;function zL(){if(bb)return T2;bb=1;var t=typeof Symbol<"u"&&Symbol,e=BL();return T2=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},T2}var R2,wb;function M7(){return wb||(wb=1,R2=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),R2}var M2,_b;function I7(){if(_b)return M2;_b=1;var t=T7();return M2=t.getPrototypeOf||null,M2}var I2,xb;function qL(){if(xb)return I2;xb=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(u,h){for(var f=[],g=0;g<u.length;g+=1)f[g]=u[g];for(var v=0;v<h.length;v+=1)f[v+u.length]=h[v];return f},a=function(u,h){for(var f=[],g=h,v=0;g<u.length;g+=1,v+=1)f[v]=u[g];return f},o=function(s,u){for(var h="",f=0;f<s.length;f+=1)h+=s[f],f+1<s.length&&(h+=u);return h};return I2=function(u){var h=this;if(typeof h!="function"||e.apply(h)!==n)throw new TypeError(t+h);for(var f=a(arguments,1),g,v=function(){if(this instanceof g){var b=h.apply(this,i(f,arguments));return Object(b)===b?b:this}return h.apply(u,i(f,arguments))},p=r(0,h.length-f.length),y=[],_=0;_<p;_++)y[_]="$"+_;if(g=Function("binder","return function ("+o(y,",")+"){ return binder.apply(this,arguments); }")(v),h.prototype){var x=function(){};x.prototype=h.prototype,g.prototype=new x,x.prototype=null}return g},I2}var j2,Sb;function Y0(){if(Sb)return j2;Sb=1;var t=qL();return j2=Function.prototype.bind||t,j2}var D2,Eb;function fy(){return Eb||(Eb=1,D2=Function.prototype.call),D2}var F2,kb;function j7(){return kb||(kb=1,F2=Function.prototype.apply),F2}var B2,Ab;function UL(){return Ab||(Ab=1,B2=typeof Reflect<"u"&&Reflect&&Reflect.apply),B2}var z2,Pb;function HL(){if(Pb)return z2;Pb=1;var t=Y0(),e=j7(),r=fy(),n=UL();return z2=n||t.call(r,e),z2}var q2,Ob;function D7(){if(Ob)return q2;Ob=1;var t=Y0(),e=Sd(),r=fy(),n=HL();return q2=function(a){if(a.length<1||typeof a[0]!="function")throw new e("a function is required");return n(t,r,a)},q2}var U2,Cb;function $L(){if(Cb)return U2;Cb=1;var t=D7(),e=R7(),r;try{r=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var n=!!r&&e&&e(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return U2=n&&typeof n.get=="function"?t([n.get]):typeof a=="function"?function(s){return a(s==null?s:i(s))}:!1,U2}var H2,Lb;function GL(){if(Lb)return H2;Lb=1;var t=M7(),e=I7(),r=$L();return H2=t?function(i){return t(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:r?function(i){return r(i)}:null,H2}var $2,Nb;function WL(){if(Nb)return $2;Nb=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,r=Y0();return $2=r.call(t,e),$2}var G2,Tb;function hy(){if(Tb)return G2;Tb=1;var t,e=T7(),r=SL(),n=EL(),i=kL(),a=AL(),o=PL(),s=Sd(),u=OL(),h=CL(),f=LL(),g=NL(),v=TL(),p=RL(),y=ML(),_=jL(),x=Function,b=function(de){try{return x('"use strict"; return ('+de+").constructor;")()}catch{}},E=R7(),A=FL(),S=function(){throw new s},k=E?function(){try{return arguments.callee,S}catch{try{return E(arguments,"callee").get}catch{return S}}}():S,I=zL()(),O=GL(),M=I7(),F=M7(),j=j7(),T=fy(),L={},$=typeof Uint8Array>"u"||!O?t:O(Uint8Array),q={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":I&&O?O([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":L,"%AsyncGenerator%":L,"%AsyncGeneratorFunction%":L,"%AsyncIteratorPrototype%":L,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":x,"%GeneratorFunction%":L,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":I&&O?O(O([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!I||!O?t:O(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":E,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!I||!O?t:O(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":I&&O?O(""[Symbol.iterator]()):t,"%Symbol%":I?Symbol:t,"%SyntaxError%":o,"%ThrowTypeError%":k,"%TypedArray%":$,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":T,"%Function.prototype.apply%":j,"%Object.defineProperty%":A,"%Object.getPrototypeOf%":M,"%Math.abs%":h,"%Math.floor%":f,"%Math.max%":g,"%Math.min%":v,"%Math.pow%":p,"%Math.round%":y,"%Math.sign%":_,"%Reflect.getPrototypeOf%":F};if(O)try{null.error}catch(de){var J=O(O(de));q["%Error.prototype%"]=J}var ae=function de(ye){var Te;if(ye==="%AsyncFunction%")Te=b("async function () {}");else if(ye==="%GeneratorFunction%")Te=b("function* () {}");else if(ye==="%AsyncGeneratorFunction%")Te=b("async function* () {}");else if(ye==="%AsyncGenerator%"){var Ce=de("%AsyncGeneratorFunction%");Ce&&(Te=Ce.prototype)}else if(ye==="%AsyncIteratorPrototype%"){var Ie=de("%AsyncGenerator%");Ie&&O&&(Te=O(Ie.prototype))}return q[ye]=Te,Te},ie={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Z=Y0(),te=WL(),V=Z.call(T,Array.prototype.concat),B=Z.call(j,Array.prototype.splice),D=Z.call(T,String.prototype.replace),U=Z.call(T,String.prototype.slice),X=Z.call(T,RegExp.prototype.exec),ee=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,oe=function(ye){var Te=U(ye,0,1),Ce=U(ye,-1);if(Te==="%"&&Ce!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(Ce==="%"&&Te!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var Ie=[];return D(ye,ee,function(Ee,ge,Re,Be){Ie[Ie.length]=Re?D(Be,K,"$1"):ge||Ee}),Ie},me=function(ye,Te){var Ce=ye,Ie;if(te(ie,Ce)&&(Ie=ie[Ce],Ce="%"+Ie[0]+"%"),te(q,Ce)){var Ee=q[Ce];if(Ee===L&&(Ee=ae(Ce)),typeof Ee>"u"&&!Te)throw new s("intrinsic "+ye+" exists, but is not available. Please file an issue!");return{alias:Ie,name:Ce,value:Ee}}throw new o("intrinsic "+ye+" does not exist!")};return G2=function(ye,Te){if(typeof ye!="string"||ye.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Te!="boolean")throw new s('"allowMissing" argument must be a boolean');if(X(/^%?[^%]*%?$/,ye)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Ce=oe(ye),Ie=Ce.length>0?Ce[0]:"",Ee=me("%"+Ie+"%",Te),ge=Ee.name,Re=Ee.value,Be=!1,Oe=Ee.alias;Oe&&(Ie=Oe[0],B(Ce,V([0,1],Oe)));for(var fe=1,Le=!0;fe<Ce.length;fe+=1){var Ne=Ce[fe],ue=U(Ne,0,1),Ae=U(Ne,-1);if((ue==='"'||ue==="'"||ue==="`"||Ae==='"'||Ae==="'"||Ae==="`")&&ue!==Ae)throw new o("property names with quotes must have matching quotes");if((Ne==="constructor"||!Le)&&(Be=!0),Ie+="."+Ne,ge="%"+Ie+"%",te(q,ge))Re=q[ge];else if(Re!=null){if(!(Ne in Re)){if(!Te)throw new s("base intrinsic for "+ye+" exists, but the property is not available.");return}if(E&&fe+1>=Ce.length){var Pe=E(Re,Ne);Le=!!Pe,Le&&"get"in Pe&&!("originalValue"in Pe.get)?Re=Pe.get:Re=Re[Ne]}else Le=te(Re,Ne),Re=Re[Ne];Le&&!Be&&(q[ge]=Re)}}return Re},G2}var W2,Rb;function F7(){if(Rb)return W2;Rb=1;var t=hy(),e=D7(),r=e([t("%String.prototype.indexOf%")]);return W2=function(i,a){var o=t(i,!!a);return typeof o=="function"&&r(i,".prototype.")>-1?e([o]):o},W2}var V2,Mb;function B7(){if(Mb)return V2;Mb=1;var t=hy(),e=F7(),r=V0(),n=Sd(),i=t("%Map%",!0),a=e("Map.prototype.get",!0),o=e("Map.prototype.set",!0),s=e("Map.prototype.has",!0),u=e("Map.prototype.delete",!0),h=e("Map.prototype.size",!0);return V2=!!i&&function(){var g,v={assert:function(p){if(!v.has(p))throw new n("Side channel does not contain "+r(p))},delete:function(p){if(g){var y=u(g,p);return h(g)===0&&(g=void 0),y}return!1},get:function(p){if(g)return a(g,p)},has:function(p){return g?s(g,p):!1},set:function(p,y){g||(g=new i),o(g,p,y)}};return v},V2}var Y2,Ib;function VL(){if(Ib)return Y2;Ib=1;var t=hy(),e=F7(),r=V0(),n=B7(),i=Sd(),a=t("%WeakMap%",!0),o=e("WeakMap.prototype.get",!0),s=e("WeakMap.prototype.set",!0),u=e("WeakMap.prototype.has",!0),h=e("WeakMap.prototype.delete",!0);return Y2=a?function(){var g,v,p={assert:function(y){if(!p.has(y))throw new i("Side channel does not contain "+r(y))},delete:function(y){if(a&&y&&(typeof y=="object"||typeof y=="function")){if(g)return h(g,y)}else if(n&&v)return v.delete(y);return!1},get:function(y){return a&&y&&(typeof y=="object"||typeof y=="function")&&g?o(g,y):v&&v.get(y)},has:function(y){return a&&y&&(typeof y=="object"||typeof y=="function")&&g?u(g,y):!!v&&v.has(y)},set:function(y,_){a&&y&&(typeof y=="object"||typeof y=="function")?(g||(g=new a),s(g,y,_)):n&&(v||(v=n()),v.set(y,_))}};return p}:n,Y2}var X2,jb;function YL(){if(jb)return X2;jb=1;var t=Sd(),e=V0(),r=xL(),n=B7(),i=VL(),a=i||n||r;return X2=function(){var s,u={assert:function(h){if(!u.has(h))throw new t("Side channel does not contain "+e(h))},delete:function(h){return!!s&&s.delete(h)},get:function(h){return s&&s.get(h)},has:function(h){return!!s&&s.has(h)},set:function(h,f){s||(s=a()),s.set(h,f)}};return u},X2}var K2,Db;function dy(){if(Db)return K2;Db=1;var t=String.prototype.replace,e=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return K2={default:r.RFC3986,formatters:{RFC1738:function(n){return t.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},K2}var Z2,Fb;function z7(){if(Fb)return Z2;Fb=1;var t=dy(),e=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var x=[],b=0;b<256;++b)x.push("%"+((b<16?"0":"")+b.toString(16)).toUpperCase());return x}(),i=function(b){for(;b.length>1;){var E=b.pop(),A=E.obj[E.prop];if(r(A)){for(var S=[],k=0;k<A.length;++k)typeof A[k]<"u"&&S.push(A[k]);E.obj[E.prop]=S}}},a=function(b,E){for(var A=E&&E.plainObjects?{__proto__:null}:{},S=0;S<b.length;++S)typeof b[S]<"u"&&(A[S]=b[S]);return A},o=function x(b,E,A){if(!E)return b;if(typeof E!="object"&&typeof E!="function"){if(r(b))b.push(E);else if(b&&typeof b=="object")(A&&(A.plainObjects||A.allowPrototypes)||!e.call(Object.prototype,E))&&(b[E]=!0);else return[b,E];return b}if(!b||typeof b!="object")return[b].concat(E);var S=b;return r(b)&&!r(E)&&(S=a(b,A)),r(b)&&r(E)?(E.forEach(function(k,I){if(e.call(b,I)){var O=b[I];O&&typeof O=="object"&&k&&typeof k=="object"?b[I]=x(O,k,A):b.push(k)}else b[I]=k}),b):Object.keys(E).reduce(function(k,I){var O=E[I];return e.call(k,I)?k[I]=x(k[I],O,A):k[I]=O,k},S)},s=function(b,E){return Object.keys(E).reduce(function(A,S){return A[S]=E[S],A},b)},u=function(x,b,E){var A=x.replace(/\+/g," ");if(E==="iso-8859-1")return A.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(A)}catch{return A}},h=1024,f=function(b,E,A,S,k){if(b.length===0)return b;var I=b;if(typeof b=="symbol"?I=Symbol.prototype.toString.call(b):typeof b!="string"&&(I=String(b)),A==="iso-8859-1")return escape(I).replace(/%u[0-9a-f]{4}/gi,function($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var O="",M=0;M<I.length;M+=h){for(var F=I.length>=h?I.slice(M,M+h):I,j=[],T=0;T<F.length;++T){var L=F.charCodeAt(T);if(L===45||L===46||L===95||L===126||L>=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||k===t.RFC1738&&(L===40||L===41)){j[j.length]=F.charAt(T);continue}if(L<128){j[j.length]=n[L];continue}if(L<2048){j[j.length]=n[192|L>>6]+n[128|L&63];continue}if(L<55296||L>=57344){j[j.length]=n[224|L>>12]+n[128|L>>6&63]+n[128|L&63];continue}T+=1,L=65536+((L&1023)<<10|F.charCodeAt(T)&1023),j[j.length]=n[240|L>>18]+n[128|L>>12&63]+n[128|L>>6&63]+n[128|L&63]}O+=j.join("")}return O},g=function(b){for(var E=[{obj:{o:b},prop:"o"}],A=[],S=0;S<E.length;++S)for(var k=E[S],I=k.obj[k.prop],O=Object.keys(I),M=0;M<O.length;++M){var F=O[M],j=I[F];typeof j=="object"&&j!==null&&A.indexOf(j)===-1&&(E.push({obj:I,prop:F}),A.push(j))}return i(E),b},v=function(b){return Object.prototype.toString.call(b)==="[object RegExp]"},p=function(b){return!b||typeof b!="object"?!1:!!(b.constructor&&b.constructor.isBuffer&&b.constructor.isBuffer(b))},y=function(b,E){return[].concat(b,E)},_=function(b,E){if(r(b)){for(var A=[],S=0;S<b.length;S+=1)A.push(E(b[S]));return A}return E(b)};return Z2={arrayToObject:a,assign:s,combine:y,compact:g,decode:u,encode:f,isBuffer:p,isRegExp:v,maybeMap:_,merge:o},Z2}var Q2,Bb;function XL(){if(Bb)return Q2;Bb=1;var t=YL(),e=z7(),r=dy(),n=Object.prototype.hasOwnProperty,i={brackets:function(x){return x+"[]"},comma:"comma",indices:function(x,b){return x+"["+b+"]"},repeat:function(x){return x}},a=Array.isArray,o=Array.prototype.push,s=function(_,x){o.apply(_,a(x)?x:[x])},u=Date.prototype.toISOString,h=r.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,filter:void 0,format:h,formatter:r.formatters[h],indices:!1,serializeDate:function(x){return u.call(x)},skipNulls:!1,strictNullHandling:!1},g=function(x){return typeof x=="string"||typeof x=="number"||typeof x=="boolean"||typeof x=="symbol"||typeof x=="bigint"},v={},p=function _(x,b,E,A,S,k,I,O,M,F,j,T,L,$,q,J,ae,ie){for(var Z=x,te=ie,V=0,B=!1;(te=te.get(v))!==void 0&&!B;){var D=te.get(x);if(V+=1,typeof D<"u"){if(D===V)throw new RangeError("Cyclic object value");B=!0}typeof te.get(v)>"u"&&(V=0)}if(typeof F=="function"?Z=F(b,Z):Z instanceof Date?Z=L(Z):E==="comma"&&a(Z)&&(Z=e.maybeMap(Z,function(ge){return ge instanceof Date?L(ge):ge})),Z===null){if(k)return M&&!J?M(b,f.encoder,ae,"key",$):b;Z=""}if(g(Z)||e.isBuffer(Z)){if(M){var U=J?b:M(b,f.encoder,ae,"key",$);return[q(U)+"="+q(M(Z,f.encoder,ae,"value",$))]}return[q(b)+"="+q(String(Z))]}var X=[];if(typeof Z>"u")return X;var ee;if(E==="comma"&&a(Z))J&&M&&(Z=e.maybeMap(Z,M)),ee=[{value:Z.length>0?Z.join(",")||null:void 0}];else if(a(F))ee=F;else{var K=Object.keys(Z);ee=j?K.sort(j):K}var oe=O?String(b).replace(/\./g,"%2E"):String(b),me=A&&a(Z)&&Z.length===1?oe+"[]":oe;if(S&&a(Z)&&Z.length===0)return me+"[]";for(var de=0;de<ee.length;++de){var ye=ee[de],Te=typeof ye=="object"&&ye&&typeof ye.value<"u"?ye.value:Z[ye];if(!(I&&Te===null)){var Ce=T&&O?String(ye).replace(/\./g,"%2E"):String(ye),Ie=a(Z)?typeof E=="function"?E(me,Ce):me:me+(T?"."+Ce:"["+Ce+"]");ie.set(x,V);var Ee=t();Ee.set(v,ie),s(X,_(Te,Ie,E,A,S,k,I,O,E==="comma"&&J&&a(Z)?null:M,F,j,T,L,$,q,J,ae,Ee))}}return X},y=function(x){if(!x)return f;if(typeof x.allowEmptyArrays<"u"&&typeof x.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof x.encodeDotInKeys<"u"&&typeof x.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(x.encoder!==null&&typeof x.encoder<"u"&&typeof x.encoder!="function")throw new TypeError("Encoder has to be a function.");var b=x.charset||f.charset;if(typeof x.charset<"u"&&x.charset!=="utf-8"&&x.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var E=r.default;if(typeof x.format<"u"){if(!n.call(r.formatters,x.format))throw new TypeError("Unknown format option provided.");E=x.format}var A=r.formatters[E],S=f.filter;(typeof x.filter=="function"||a(x.filter))&&(S=x.filter);var k;if(x.arrayFormat in i?k=x.arrayFormat:"indices"in x?k=x.indices?"indices":"repeat":k=f.arrayFormat,"commaRoundTrip"in x&&typeof x.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var I=typeof x.allowDots>"u"?x.encodeDotInKeys===!0?!0:f.allowDots:!!x.allowDots;return{addQueryPrefix:typeof x.addQueryPrefix=="boolean"?x.addQueryPrefix:f.addQueryPrefix,allowDots:I,allowEmptyArrays:typeof x.allowEmptyArrays=="boolean"?!!x.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:k,charset:b,charsetSentinel:typeof x.charsetSentinel=="boolean"?x.charsetSentinel:f.charsetSentinel,commaRoundTrip:!!x.commaRoundTrip,delimiter:typeof x.delimiter>"u"?f.delimiter:x.delimiter,encode:typeof x.encode=="boolean"?x.encode:f.encode,encodeDotInKeys:typeof x.encodeDotInKeys=="boolean"?x.encodeDotInKeys:f.encodeDotInKeys,encoder:typeof x.encoder=="function"?x.encoder:f.encoder,encodeValuesOnly:typeof x.encodeValuesOnly=="boolean"?x.encodeValuesOnly:f.encodeValuesOnly,filter:S,format:E,formatter:A,serializeDate:typeof x.serializeDate=="function"?x.serializeDate:f.serializeDate,skipNulls:typeof x.skipNulls=="boolean"?x.skipNulls:f.skipNulls,sort:typeof x.sort=="function"?x.sort:null,strictNullHandling:typeof x.strictNullHandling=="boolean"?x.strictNullHandling:f.strictNullHandling}};return Q2=function(_,x){var b=_,E=y(x),A,S;typeof E.filter=="function"?(S=E.filter,b=S("",b)):a(E.filter)&&(S=E.filter,A=S);var k=[];if(typeof b!="object"||b===null)return"";var I=i[E.arrayFormat],O=I==="comma"&&E.commaRoundTrip;A||(A=Object.keys(b)),E.sort&&A.sort(E.sort);for(var M=t(),F=0;F<A.length;++F){var j=A[F],T=b[j];E.skipNulls&&T===null||s(k,p(T,j,I,O,E.allowEmptyArrays,E.strictNullHandling,E.skipNulls,E.encodeDotInKeys,E.encode?E.encoder:null,E.filter,E.sort,E.allowDots,E.serializeDate,E.format,E.formatter,E.encodeValuesOnly,E.charset,M))}var L=k.join(E.delimiter),$=E.addQueryPrefix===!0?"?":"";return E.charsetSentinel&&(E.charset==="iso-8859-1"?$+="utf8=%26%2310003%3B&":$+="utf8=%E2%9C%93&"),L.length>0?$+L:""},Q2}var J2,zb;function KL(){if(zb)return J2;zb=1;var t=z7(),e=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:t.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},i=function(v){return v.replace(/&#(\d+);/g,function(p,y){return String.fromCharCode(parseInt(y,10))})},a=function(v,p,y){if(v&&typeof v=="string"&&p.comma&&v.indexOf(",")>-1)return v.split(",");if(p.throwOnLimitExceeded&&y>=p.arrayLimit)throw new RangeError("Array limit exceeded. Only "+p.arrayLimit+" element"+(p.arrayLimit===1?"":"s")+" allowed in an array.");return v},o="utf8=%26%2310003%3B",s="utf8=%E2%9C%93",u=function(p,y){var _={__proto__:null},x=y.ignoreQueryPrefix?p.replace(/^\?/,""):p;x=x.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var b=y.parameterLimit===1/0?void 0:y.parameterLimit,E=x.split(y.delimiter,y.throwOnLimitExceeded?b+1:b);if(y.throwOnLimitExceeded&&E.length>b)throw new RangeError("Parameter limit exceeded. Only "+b+" parameter"+(b===1?"":"s")+" allowed.");var A=-1,S,k=y.charset;if(y.charsetSentinel)for(S=0;S<E.length;++S)E[S].indexOf("utf8=")===0&&(E[S]===s?k="utf-8":E[S]===o&&(k="iso-8859-1"),A=S,S=E.length);for(S=0;S<E.length;++S)if(S!==A){var I=E[S],O=I.indexOf("]="),M=O===-1?I.indexOf("="):O+1,F,j;M===-1?(F=y.decoder(I,n.decoder,k,"key"),j=y.strictNullHandling?null:""):(F=y.decoder(I.slice(0,M),n.decoder,k,"key"),j=t.maybeMap(a(I.slice(M+1),y,r(_[F])?_[F].length:0),function(L){return y.decoder(L,n.decoder,k,"value")})),j&&y.interpretNumericEntities&&k==="iso-8859-1"&&(j=i(String(j))),I.indexOf("[]=")>-1&&(j=r(j)?[j]:j);var T=e.call(_,F);T&&y.duplicates==="combine"?_[F]=t.combine(_[F],j):(!T||y.duplicates==="last")&&(_[F]=j)}return _},h=function(v,p,y,_){var x=0;if(v.length>0&&v[v.length-1]==="[]"){var b=v.slice(0,-1).join("");x=Array.isArray(p)&&p[b]?p[b].length:0}for(var E=_?p:a(p,y,x),A=v.length-1;A>=0;--A){var S,k=v[A];if(k==="[]"&&y.parseArrays)S=y.allowEmptyArrays&&(E===""||y.strictNullHandling&&E===null)?[]:t.combine([],E);else{S=y.plainObjects?{__proto__:null}:{};var I=k.charAt(0)==="["&&k.charAt(k.length-1)==="]"?k.slice(1,-1):k,O=y.decodeDotInKeys?I.replace(/%2E/g,"."):I,M=parseInt(O,10);!y.parseArrays&&O===""?S={0:E}:!isNaN(M)&&k!==O&&String(M)===O&&M>=0&&y.parseArrays&&M<=y.arrayLimit?(S=[],S[M]=E):O!=="__proto__"&&(S[O]=E)}E=S}return E},f=function(p,y,_,x){if(p){var b=_.allowDots?p.replace(/\.([^.[]+)/g,"[$1]"):p,E=/(\[[^[\]]*])/,A=/(\[[^[\]]*])/g,S=_.depth>0&&E.exec(b),k=S?b.slice(0,S.index):b,I=[];if(k){if(!_.plainObjects&&e.call(Object.prototype,k)&&!_.allowPrototypes)return;I.push(k)}for(var O=0;_.depth>0&&(S=A.exec(b))!==null&&O<_.depth;){if(O+=1,!_.plainObjects&&e.call(Object.prototype,S[1].slice(1,-1))&&!_.allowPrototypes)return;I.push(S[1])}if(S){if(_.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+_.depth+" and strictDepth is true");I.push("["+b.slice(S.index)+"]")}return h(I,y,_,x)}},g=function(p){if(!p)return n;if(typeof p.allowEmptyArrays<"u"&&typeof p.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof p.decodeDotInKeys<"u"&&typeof p.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(p.decoder!==null&&typeof p.decoder<"u"&&typeof p.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof p.charset<"u"&&p.charset!=="utf-8"&&p.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof p.throwOnLimitExceeded<"u"&&typeof p.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var y=typeof p.charset>"u"?n.charset:p.charset,_=typeof p.duplicates>"u"?n.duplicates:p.duplicates;if(_!=="combine"&&_!=="first"&&_!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var x=typeof p.allowDots>"u"?p.decodeDotInKeys===!0?!0:n.allowDots:!!p.allowDots;return{allowDots:x,allowEmptyArrays:typeof p.allowEmptyArrays=="boolean"?!!p.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof p.allowPrototypes=="boolean"?p.allowPrototypes:n.allowPrototypes,allowSparse:typeof p.allowSparse=="boolean"?p.allowSparse:n.allowSparse,arrayLimit:typeof p.arrayLimit=="number"?p.arrayLimit:n.arrayLimit,charset:y,charsetSentinel:typeof p.charsetSentinel=="boolean"?p.charsetSentinel:n.charsetSentinel,comma:typeof p.comma=="boolean"?p.comma:n.comma,decodeDotInKeys:typeof p.decodeDotInKeys=="boolean"?p.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof p.decoder=="function"?p.decoder:n.decoder,delimiter:typeof p.delimiter=="string"||t.isRegExp(p.delimiter)?p.delimiter:n.delimiter,depth:typeof p.depth=="number"||p.depth===!1?+p.depth:n.depth,duplicates:_,ignoreQueryPrefix:p.ignoreQueryPrefix===!0,interpretNumericEntities:typeof p.interpretNumericEntities=="boolean"?p.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof p.parameterLimit=="number"?p.parameterLimit:n.parameterLimit,parseArrays:p.parseArrays!==!1,plainObjects:typeof p.plainObjects=="boolean"?p.plainObjects:n.plainObjects,strictDepth:typeof p.strictDepth=="boolean"?!!p.strictDepth:n.strictDepth,strictNullHandling:typeof p.strictNullHandling=="boolean"?p.strictNullHandling:n.strictNullHandling,throwOnLimitExceeded:typeof p.throwOnLimitExceeded=="boolean"?p.throwOnLimitExceeded:!1}};return J2=function(v,p){var y=g(p);if(v===""||v===null||typeof v>"u")return y.plainObjects?{__proto__:null}:{};for(var _=typeof v=="string"?u(v,y):v,x=y.plainObjects?{__proto__:null}:{},b=Object.keys(_),E=0;E<b.length;++E){var A=b[E],S=f(A,_[A],y,typeof v=="string");x=t.merge(x,S,y)}return y.allowSparse===!0?x:t.compact(x)},J2}var ev,qb;function ZL(){if(qb)return ev;qb=1;var t=XL(),e=KL(),r=dy();return ev={formats:r,parse:e,stringify:t},ev}var Ub;function q7(){if(Ub)return Wf;Ub=1;var t=yL();function e(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r",`
|
|
157
|
-
`," "],o=["{","}","|","\\","^","`"].concat(a),s=["'"].concat(o),u=["%","/","?",";","#"].concat(s),h=["/","?","#"],f=255,g=/^[+a-z0-9A-Z_-]{0,63}$/,v=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=ZL();function b(k,I,O){if(k&&typeof k=="object"&&k instanceof e)return k;var M=new e;return M.parse(k,I,O),M}e.prototype.parse=function(k,I,O){if(typeof k!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof k);var M=k.indexOf("?"),F=M!==-1&&M<k.indexOf("#")?"?":"#",j=k.split(F),T=/\\/g;j[0]=j[0].replace(T,"/"),k=j.join(F);var L=k;if(L=L.trim(),!O&&k.split("#").length===1){var $=i.exec(L);if($)return this.path=L,this.href=L,this.pathname=$[1],$[2]?(this.search=$[2],I?this.query=x.parse(this.search.substr(1)):this.query=this.search.substr(1)):I&&(this.search="",this.query={}),this}var q=r.exec(L);if(q){q=q[0];var J=q.toLowerCase();this.protocol=J,L=L.substr(q.length)}if(O||q||L.match(/^\/\/[^@/]+@[^@/]+/)){var ae=L.substr(0,2)==="//";ae&&!(q&&y[q])&&(L=L.substr(2),this.slashes=!0)}if(!y[q]&&(ae||q&&!_[q])){for(var ie=-1,Z=0;Z<h.length;Z++){var te=L.indexOf(h[Z]);te!==-1&&(ie===-1||te<ie)&&(ie=te)}var V,B;ie===-1?B=L.lastIndexOf("@"):B=L.lastIndexOf("@",ie),B!==-1&&(V=L.slice(0,B),L=L.slice(B+1),this.auth=decodeURIComponent(V)),ie=-1;for(var Z=0;Z<u.length;Z++){var te=L.indexOf(u[Z]);te!==-1&&(ie===-1||te<ie)&&(ie=te)}ie===-1&&(ie=L.length),this.host=L.slice(0,ie),L=L.slice(ie),this.parseHost(),this.hostname=this.hostname||"";var D=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!D)for(var U=this.hostname.split(/\./),Z=0,X=U.length;Z<X;Z++){var ee=U[Z];if(ee&&!ee.match(g)){for(var K="",oe=0,me=ee.length;oe<me;oe++)ee.charCodeAt(oe)>127?K+="x":K+=ee[oe];if(!K.match(g)){var de=U.slice(0,Z),ye=U.slice(Z+1),Te=ee.match(v);Te&&(de.push(Te[1]),ye.unshift(Te[2])),ye.length&&(L="/"+ye.join(".")+L),this.hostname=de.join(".");break}}}this.hostname.length>f?this.hostname="":this.hostname=this.hostname.toLowerCase(),D||(this.hostname=t.toASCII(this.hostname));var Ce=this.port?":"+this.port:"",Ie=this.hostname||"";this.host=Ie+Ce,this.href+=this.host,D&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),L[0]!=="/"&&(L="/"+L))}if(!p[J])for(var Z=0,X=s.length;Z<X;Z++){var Ee=s[Z];if(L.indexOf(Ee)!==-1){var ge=encodeURIComponent(Ee);ge===Ee&&(ge=escape(Ee)),L=L.split(Ee).join(ge)}}var Re=L.indexOf("#");Re!==-1&&(this.hash=L.substr(Re),L=L.slice(0,Re));var Be=L.indexOf("?");if(Be!==-1?(this.search=L.substr(Be),this.query=L.substr(Be+1),I&&(this.query=x.parse(this.query)),L=L.slice(0,Be)):I&&(this.search="",this.query={}),L&&(this.pathname=L),_[J]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var Ce=this.pathname||"",Oe=this.search||"";this.path=Ce+Oe}return this.href=this.format(),this};function E(k){return typeof k=="string"&&(k=b(k)),k instanceof e?k.format():e.prototype.format.call(k)}e.prototype.format=function(){var k=this.auth||"";k&&(k=encodeURIComponent(k),k=k.replace(/%3A/i,":"),k+="@");var I=this.protocol||"",O=this.pathname||"",M=this.hash||"",F=!1,j="";this.host?F=k+this.host:this.hostname&&(F=k+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(F+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(j=x.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var T=this.search||j&&"?"+j||"";return I&&I.substr(-1)!==":"&&(I+=":"),this.slashes||(!I||_[I])&&F!==!1?(F="//"+(F||""),O&&O.charAt(0)!=="/"&&(O="/"+O)):F||(F=""),M&&M.charAt(0)!=="#"&&(M="#"+M),T&&T.charAt(0)!=="?"&&(T="?"+T),O=O.replace(/[?#]/g,function(L){return encodeURIComponent(L)}),T=T.replace("#","%23"),I+F+O+T+M};function A(k,I){return b(k,!1,!0).resolve(I)}e.prototype.resolve=function(k){return this.resolveObject(b(k,!1,!0)).format()};function S(k,I){return k?b(k,!1,!0).resolveObject(I):I}return e.prototype.resolveObject=function(k){if(typeof k=="string"){var I=new e;I.parse(k,!1,!0),k=I}for(var O=new e,M=Object.keys(this),F=0;F<M.length;F++){var j=M[F];O[j]=this[j]}if(O.hash=k.hash,k.href==="")return O.href=O.format(),O;if(k.slashes&&!k.protocol){for(var T=Object.keys(k),L=0;L<T.length;L++){var $=T[L];$!=="protocol"&&(O[$]=k[$])}return _[O.protocol]&&O.hostname&&!O.pathname&&(O.pathname="/",O.path=O.pathname),O.href=O.format(),O}if(k.protocol&&k.protocol!==O.protocol){if(!_[k.protocol]){for(var q=Object.keys(k),J=0;J<q.length;J++){var ae=q[J];O[ae]=k[ae]}return O.href=O.format(),O}if(O.protocol=k.protocol,!k.host&&!y[k.protocol]){for(var X=(k.pathname||"").split("/");X.length&&!(k.host=X.shift()););k.host||(k.host=""),k.hostname||(k.hostname=""),X[0]!==""&&X.unshift(""),X.length<2&&X.unshift(""),O.pathname=X.join("/")}else O.pathname=k.pathname;if(O.search=k.search,O.query=k.query,O.host=k.host||"",O.auth=k.auth,O.hostname=k.hostname||k.host,O.port=k.port,O.pathname||O.search){var ie=O.pathname||"",Z=O.search||"";O.path=ie+Z}return O.slashes=O.slashes||k.slashes,O.href=O.format(),O}var te=O.pathname&&O.pathname.charAt(0)==="/",V=k.host||k.pathname&&k.pathname.charAt(0)==="/",B=V||te||O.host&&k.pathname,D=B,U=O.pathname&&O.pathname.split("/")||[],X=k.pathname&&k.pathname.split("/")||[],ee=O.protocol&&!_[O.protocol];if(ee&&(O.hostname="",O.port=null,O.host&&(U[0]===""?U[0]=O.host:U.unshift(O.host)),O.host="",k.protocol&&(k.hostname=null,k.port=null,k.host&&(X[0]===""?X[0]=k.host:X.unshift(k.host)),k.host=null),B=B&&(X[0]===""||U[0]==="")),V)O.host=k.host||k.host===""?k.host:O.host,O.hostname=k.hostname||k.hostname===""?k.hostname:O.hostname,O.search=k.search,O.query=k.query,U=X;else if(X.length)U||(U=[]),U.pop(),U=U.concat(X),O.search=k.search,O.query=k.query;else if(k.search!=null){if(ee){O.host=U.shift(),O.hostname=O.host;var K=O.host&&O.host.indexOf("@")>0?O.host.split("@"):!1;K&&(O.auth=K.shift(),O.hostname=K.shift(),O.host=O.hostname)}return O.search=k.search,O.query=k.query,(O.pathname!==null||O.search!==null)&&(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.href=O.format(),O}if(!U.length)return O.pathname=null,O.search?O.path="/"+O.search:O.path=null,O.href=O.format(),O;for(var oe=U.slice(-1)[0],me=(O.host||k.host||U.length>1)&&(oe==="."||oe==="..")||oe==="",de=0,ye=U.length;ye>=0;ye--)oe=U[ye],oe==="."?U.splice(ye,1):oe===".."?(U.splice(ye,1),de++):de&&(U.splice(ye,1),de--);if(!B&&!D)for(;de--;de)U.unshift("..");B&&U[0]!==""&&(!U[0]||U[0].charAt(0)!=="/")&&U.unshift(""),me&&U.join("/").substr(-1)!=="/"&&U.push("");var Te=U[0]===""||U[0]&&U[0].charAt(0)==="/";if(ee){O.hostname=Te?"":U.length?U.shift():"",O.host=O.hostname;var K=O.host&&O.host.indexOf("@")>0?O.host.split("@"):!1;K&&(O.auth=K.shift(),O.hostname=K.shift(),O.host=O.hostname)}return B=B||O.host&&U.length,B&&!Te&&U.unshift(""),U.length>0?O.pathname=U.join("/"):(O.pathname=null,O.path=null),(O.pathname!==null||O.search!==null)&&(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.auth=k.auth||O.auth,O.slashes=O.slashes||k.slashes,O.href=O.format(),O},e.prototype.parseHost=function(){var k=this.host,I=n.exec(k);I&&(I=I[0],I!==":"&&(this.port=I.substr(1)),k=k.substr(0,k.length-I.length)),k&&(this.hostname=k)},Wf.parse=b,Wf.resolve=A,Wf.resolveObject=S,Wf.format=E,Wf.Url=e,Wf}var K1={exports:{}},QL=K1.exports,Hb;function JL(){return Hb||(Hb=1,function(t){(function(e,r){t.exports?t.exports=r():e.xmlserializer=r()})(QL,function(){var e=function(p){return p.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(p){return p.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},n=function(p){return p.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},i=function(p){var y=p.value;return" "+p.name+'="'+r(y)+'"'},a=function(p){var y=p.tagName;return p.namespaceURI==="http://www.w3.org/1999/xhtml"&&(y=y.toLowerCase()),y},o=function(p,y){var _=Array.prototype.map.call(p.attributes||p.attrs,function(x){return x.name}).indexOf("xmlns")>=0;return!_&&(y||p.namespaceURI!==p.parentNode.namespaceURI)?' xmlns="'+p.namespaceURI+'"':""},s=function(p){return Array.prototype.map.call(p.childNodes,function(y){return v(y)}).join("")},u=function(p,y){var _="<"+a(p);return _+=o(p,y),Array.prototype.forEach.call(p.attributes||p.attrs,function(x){_+=i(x)}),p.childNodes.length>0?(_+=">",_+=s(p),_+="</"+a(p)+">"):_+="/>",_},h=function(p){var y=p.nodeValue||p.value||"";return n(y)},f=function(p){return"<!--"+p.data.replace(/-/g,"-")+"-->"},g=function(p){return"<![CDATA["+p.nodeValue+"]]>"},v=function(p,y){var _=y&&y.rootNode;if(p.nodeName==="#document"||p.nodeName==="#document-fragment")return s(p);if(p.tagName)return u(p,_);if(p.nodeName==="#text")return h(p);if(p.nodeName==="#comment")return f(p);if(p.nodeName==="#cdata-section")return g(p)};return{serializeToString:function(p){return e(v(p,{rootNode:!0}))}}})}(K1)),K1.exports}var tv={},$b;function eN(){if($b)return tv;$b=1;var t=function(a){var o=new XMLSerializer;return Array.prototype.map.call(a.childNodes,function(s){return o.serializeToString(s)}).join("")},e=function(a){if(a.documentElement.tagName==="parsererror"&&a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return a.documentElement;if((a.documentElement.tagName==="xml"||a.documentElement.tagName==="html")&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0];if(a.documentElement.tagName==="html"&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="body"&&a.documentElement.childNodes[0].childNodes&&a.documentElement.childNodes[0].childNodes.length&&a.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0].childNodes[0]},r=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
|
|
158
|
-
?</div>`),new RegExp(`^(.+)
|
|
159
|
-
`)],n=function(a){var o=t(a),s,u;for(s=0;s<r.length;s++)if(u=r[s].exec(o),u)return u[1]},i=function(a){var o;if(a===null)throw new Error("Parse error");var s=e(a);if(s!==void 0)throw o=n(s)||"Parse error",new Error(o)};return tv.failOnParseError=function(a){return i(a),a},tv}var rv={},nv={},Gb;function X0(){return Gb||(Gb=1,function(t){var e=q7();t.getDocumentBaseUrl=function(s){return s.baseURI!=="about:blank"?s.baseURI:null},t.clone=function(s){var u={},h;for(h in s)s.hasOwnProperty(h)&&(u[h]=s[h]);return u},t.cloneArray=function(s){return Array.prototype.slice.apply(s,[0])},t.joinUrl=function(s,u){return s?e.resolve(s,u):u},t.isDataUri=function(s){return/^data:/.test(s)},t.collectAndReportErrors=function(s){var u=[];return Promise.all(s.map(function(h){return h.catch(function(f){u.push(f)})})).then(function(){return u})};var r=null,n=function(s,u){return u===!1||u==="none"||u==="repeated"?((r===null||u!=="repeated")&&(r=Date.now()),s+"?_="+r):s};t.ajax=function(s,u){return new Promise(function(h,f){var g=new window.XMLHttpRequest,v=t.joinUrl(u.baseUrl,s),p,y=function(){f({msg:"Unable to load url",url:v})};p=n(v,u.cache),g.addEventListener("load",function(){g.status===200||g.status===0?h(g.response):y()},!1),g.addEventListener("error",y,!1);try{g.open("GET",p,!0),g.overrideMimeType(u.mimeType),g.send(null)}catch{y()}})},t.binaryAjax=function(s,u){var h=t.clone(u);return h.mimeType="text/plain; charset=x-user-defined",t.ajax(s,h).then(function(f){for(var g="",v=0;v<f.length;v++)g+=String.fromCharCode(f.charCodeAt(v)&255);return g})};var i=function(s){var u=function(h,f){return h.substring(0,f.length)===f};return u(s,"<?xml")||u(s,"<svg")?"image/svg+xml":"image/png"};t.getDataURIForImageURL=function(s,u){return t.binaryAjax(s,u).then(function(h){var f=btoa(h),g=i(h);return"data:"+g+";base64,"+f})};var a=[],o=function(s){return a.indexOf(s)<0&&a.push(s),a.indexOf(s)};t.memoize=function(s,u,h){if(typeof h!="object")throw new Error("cacheBucket is not an object");return function(){var f=Array.prototype.slice.call(arguments),g=u(f),v=o(s),p;return h[v]&&h[v][g]?h[v][g]:(p=s.apply(null,f),h[v]=h[v]||{},h[v][g]=p,p)}}}(nv)),nv}var iv={},Wb;function tN(){if(Wb)return iv;Wb=1;var t=X0(),e=function(a,o){var s=null;a.hasAttribute("src")?s=a.getAttribute("src"):a.hasAttributeNS("http://www.w3.org/1999/xlink","href")?s=a.getAttributeNS("http://www.w3.org/1999/xlink","href"):a.hasAttribute("href")&&(s=a.getAttribute("href"));var u=t.getDocumentBaseUrl(a.ownerDocument),h=t.clone(o);return!h.baseUrl&&u&&(h.baseUrl=u),t.getDataURIForImageURL(s,h).then(function(f){return f},function(f){throw{resourceType:"image",url:f.url,msg:"Unable to load image "+f.url}})},r=function(a){return a.filter(function(o){var s=null;return o.hasAttribute("src")?s=o.getAttribute("src"):o.hasAttributeNS("http://www.w3.org/1999/xlink","href")?s=o.getAttributeNS("http://www.w3.org/1999/xlink","href"):o.hasAttribute("href")&&(s=o.getAttribute("href")),s!==null&&!t.isDataUri(s)})},n=function(a){return Array.prototype.filter.call(a,function(o){return o.type==="image"})},i=function(a){return Array.prototype.slice.call(a)};return iv.inline=function(a,o){var s=i(a.getElementsByTagName("img")),u=i(a.getElementsByTagName("image")),h=n(a.getElementsByTagName("input"));s=s.concat(u),s=s.concat(h);var f=r(s);return t.collectAndReportErrors(f.map(function(g){return e(g,o).then(function(v){g.attributes.src?g.attributes.src.value=v:g.attributes["xlink:href"]?g.attributes["xlink:href"].value=v:g.attributes.href&&(g.attributes.href.value=v)})}))},iv}var av={},Vb;function rN(){if(Vb)return av;Vb=1;var t=X0(),e=function(a,o){var s=a.attributes.src.value,u=t.getDocumentBaseUrl(a.ownerDocument),h=t.clone(o);return!h.baseUrl&&u&&(h.baseUrl=u),t.ajax(s,h).catch(function(f){throw{resourceType:"script",url:f.url,msg:"Unable to load script "+f.url}})},r=function(a){return a.replace(/<\//g,"<\\/")},n=function(a,o){a.attributes.removeNamedItem("src"),a.textContent=r(o)},i=function(a){var o=a.getElementsByTagName("script");return Array.prototype.filter.call(o,function(s){return!!s.attributes.src})};return av.inline=function(a,o){var s=i(a);return t.collectAndReportErrors(s.map(function(u){return e(u,o).then(function(h){n(u,h)})}))},av}var ov={},sv={},Yb;function py(){return Yb||(Yb=1,function(t){t.unquoteString=function(e){var r=/^"(.*)"$/,n=/^'(.*)'$/;return r.test(e)?e.replace(r,"$1"):n.test(e)?e.replace(n,"$1"):e},t.rulesForCssText=function(e){var r=document.implementation.createHTMLDocument(""),n=document.createElement("style"),i;return n.textContent=e,r.body.appendChild(n),i=n.sheet.cssRules,Array.prototype.slice.call(i)},t.cssRulesToText=function(e){return e.reduce(function(r,n){return r+n.cssText},"")},t.exchangeRule=function(e,r,n){var i=e.indexOf(r);e[i]=t.rulesForCssText(n)[0]},t.changeFontFaceRuleSrc=function(e,r,n){var i="@font-face { font-family: "+r.style.getPropertyValue("font-family")+"; ";r.style.getPropertyValue("font-style")&&(i+="font-style: "+r.style.getPropertyValue("font-style")+"; "),r.style.getPropertyValue("font-weight")&&(i+="font-weight: "+r.style.getPropertyValue("font-weight")+"; "),r.style.getPropertyValue("unicode-range")&&(i+="unicode-range: "+r.style.getPropertyValue("unicode-range")+"; "),i+="src: "+n+"}",t.exchangeRule(e,r,i)}}(sv)),sv}var lv={},Xb;function nN(){return Xb||(Xb=1,function(t){var e=py(),r=function(a){var o=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return a.replace(o,"$1")};t.extractCssUrl=function(a){var o=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,s;if(!o.test(a))throw new Error("Invalid url");return s=o.exec(a)[1],e.unquoteString(r(s))};var n=function(a){var o=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,s="(url\\("+o+"\\)|[^,\\s]+)",u="(?:\\s*"+s+")+",h="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",f=new RegExp(u,"g"),g,v=[],p=function(y){var _=new RegExp(s,"g"),x=[],b;for(b=_.exec(y);b;)x.push(b[1]),b=_.exec(y);return x};if(a.match(new RegExp(h))){for(g=f.exec(a);g;)v.push(p(g[0])),g=f.exec(a);return v}return[]},i=function(a){var o,s;for(o=0;o<a.length;o++)try{return s=t.extractCssUrl(a[o]),{url:s,idx:o}}catch{}};t.parse=function(a){var o=n(a);return o.map(function(s){var u=i(s);return u?{preUrl:s.slice(0,u.idx),url:u.url,postUrl:s.slice(u.idx+1)}:{preUrl:s}})},t.serialize=function(a){var o=a.map(function(s){var u=[].concat(s.preUrl);return s.url&&u.push('url("'+s.url+'")'),s.postUrl&&(u=u.concat(s.postUrl)),u.join(" ")});return o.join(", ")}}(lv)),lv}function C1(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var uv={exports:{}},Kb;function iN(){return Kb||(Kb=1,function(t,e){(function(r){t.exports=r()})(function(){return function r(n,i,a){function o(h,f){if(!i[h]){if(!n[h]){var g=typeof C1=="function"&&C1;if(!f&&g)return g(h,!0);if(s)return s(h,!0);var v=new Error("Cannot find module '"+h+"'");throw v.code="MODULE_NOT_FOUND",v}var p=i[h]={exports:{}};n[h][0].call(p.exports,function(y){var _=n[h][1][y];return o(_||y)},p,p.exports,r,n,i,a)}return i[h].exports}for(var s=typeof C1=="function"&&C1,u=0;u<a.length;u++)o(a[u]);return o}({1:[function(r,n,i){function a(u,h){function f(){this.constructor=u}f.prototype=h.prototype,u.prototype=new f}function o(u,h,f,g){this.message=u,this.expected=h,this.found=f,this.location=g,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,o)}a(o,Error),o.buildMessage=function(u,h){var f={literal:function(b){return'"'+v(b.text)+'"'},class:function(b){var E="",A;for(A=0;A<b.parts.length;A++)E+=b.parts[A]instanceof Array?p(b.parts[A][0])+"-"+p(b.parts[A][1]):p(b.parts[A]);return"["+(b.inverted?"^":"")+E+"]"},any:function(b){return"any character"},end:function(b){return"end of input"},other:function(b){return b.description}};function g(b){return b.charCodeAt(0).toString(16).toUpperCase()}function v(b){return b.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+g(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+g(E)})}function p(b){return b.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+g(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+g(E)})}function y(b){return f[b.type](b)}function _(b){var E=new Array(b.length),A,S;for(A=0;A<b.length;A++)E[A]=y(b[A]);if(E.sort(),E.length>0){for(A=1,S=1;A<E.length;A++)E[A-1]!==E[A]&&(E[S]=E[A],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+" or "+E[1];default:return E.slice(0,-1).join(", ")+", or "+E[E.length-1]}}function x(b){return b?'"'+v(b)+'"':"end of input"}return"Expected "+_(u)+" but "+x(h)+" found."};function s(u,h){h=h!==void 0?h:{};var f={},g={start:Ce},v=Ce,p="",y=function(){return[]},_=",",x=ee(",",!1),b=function(ue,Ae){return[ue].concat(Ae)},E=function(ue){return[ue]},A=function(ue,Ae){return{url:ue,format:Ae}},S=function(ue){return{url:ue}},k="url(",I=ee("url(",!1),O=")",M=ee(")",!1),F=function(ue){return ue},j="format(",T=ee("format(",!1),L="local(",$=ee("local(",!1),q=function(ue){return{local:ue}},J=/^[^)]/,ae=K([")"],!0,!1),ie=function(ue){return Ne.extractValue(ue.join(""))},Z=/^[ \t\r\n\f]/,te=K([" "," ","\r",`
|
|
160
|
-
`,"\f"],!1,!1),V=0,B=[{line:1,column:1}],D=0,U=[],X;if("startRule"in h){if(!(h.startRule in g))throw new Error(`Can't start parsing from rule "`+h.startRule+'".');v=g[h.startRule]}function ee(ue,Ae){return{type:"literal",text:ue,ignoreCase:Ae}}function K(ue,Ae,Pe){return{type:"class",parts:ue,inverted:Ae,ignoreCase:Pe}}function oe(){return{type:"end"}}function me(ue){var Ae=B[ue],Pe;if(Ae)return Ae;for(Pe=ue-1;!B[Pe];)Pe--;for(Ae=B[Pe],Ae={line:Ae.line,column:Ae.column};Pe<ue;)u.charCodeAt(Pe)===10?(Ae.line++,Ae.column=1):Ae.column++,Pe++;return B[ue]=Ae,Ae}function de(ue,Ae){var Pe=me(ue),Ue=me(Ae);return{start:{offset:ue,line:Pe.line,column:Pe.column},end:{offset:Ae,line:Ue.line,column:Ue.column}}}function ye(ue){V<D||(V>D&&(D=V,U=[]),U.push(ue))}function Te(ue,Ae,Pe){return new o(o.buildMessage(ue,Ae),ue,Ae,Pe)}function Ce(){var ue,Ae;return ue=Ie(),ue===f&&(ue=V,Ae=p,Ae!==f&&(Ae=y()),ue=Ae),ue}function Ie(){var ue,Ae,Pe,Ue,st,dt;if(ue=V,Ae=Ee(),Ae!==f){for(Pe=[],Ue=Le();Ue!==f;)Pe.push(Ue),Ue=Le();if(Pe!==f)if(u.charCodeAt(V)===44?(Ue=_,V++):(Ue=f,ye(x)),Ue!==f){for(st=[],dt=Le();dt!==f;)st.push(dt),dt=Le();st!==f?(dt=Ie(),dt!==f?(Ae=b(Ae,dt),ue=Ae):(V=ue,ue=f)):(V=ue,ue=f)}else V=ue,ue=f;else V=ue,ue=f}else V=ue,ue=f;return ue===f&&(ue=V,Ae=Ee(),Ae!==f&&(Ae=E(Ae)),ue=Ae),ue}function Ee(){var ue;return ue=ge(),ue===f&&(ue=Oe()),ue}function ge(){var ue,Ae,Pe,Ue;if(ue=V,Ae=Re(),Ae!==f){if(Pe=[],Ue=Le(),Ue!==f)for(;Ue!==f;)Pe.push(Ue),Ue=Le();else Pe=f;Pe!==f?(Ue=Be(),Ue!==f?(Ae=A(Ae,Ue),ue=Ae):(V=ue,ue=f)):(V=ue,ue=f)}else V=ue,ue=f;return ue===f&&(ue=V,Ae=Re(),Ae!==f&&(Ae=S(Ae)),ue=Ae),ue}function Re(){var ue,Ae,Pe,Ue;return ue=V,u.substr(V,4)===k?(Ae=k,V+=4):(Ae=f,ye(I)),Ae!==f?(Pe=fe(),Pe!==f?(u.charCodeAt(V)===41?(Ue=O,V++):(Ue=f,ye(M)),Ue!==f?(Ae=F(Pe),ue=Ae):(V=ue,ue=f)):(V=ue,ue=f)):(V=ue,ue=f),ue}function Be(){var ue,Ae,Pe,Ue;return ue=V,u.substr(V,7)===j?(Ae=j,V+=7):(Ae=f,ye(T)),Ae!==f?(Pe=fe(),Pe!==f?(u.charCodeAt(V)===41?(Ue=O,V++):(Ue=f,ye(M)),Ue!==f?(Ae=F(Pe),ue=Ae):(V=ue,ue=f)):(V=ue,ue=f)):(V=ue,ue=f),ue}function Oe(){var ue,Ae,Pe,Ue;return ue=V,u.substr(V,6)===L?(Ae=L,V+=6):(Ae=f,ye($)),Ae!==f?(Pe=fe(),Pe!==f?(u.charCodeAt(V)===41?(Ue=O,V++):(Ue=f,ye(M)),Ue!==f?(Ae=q(Pe),ue=Ae):(V=ue,ue=f)):(V=ue,ue=f)):(V=ue,ue=f),ue}function fe(){var ue,Ae,Pe;if(ue=V,Ae=[],J.test(u.charAt(V))?(Pe=u.charAt(V),V++):(Pe=f,ye(ae)),Pe!==f)for(;Pe!==f;)Ae.push(Pe),J.test(u.charAt(V))?(Pe=u.charAt(V),V++):(Pe=f,ye(ae));else Ae=f;return Ae!==f&&(Ae=ie(Ae)),ue=Ae,ue}function Le(){var ue;return Z.test(u.charAt(V))?(ue=u.charAt(V),V++):(ue=f,ye(te)),ue}var Ne=r("../util");if(X=v(),X!==f&&V===u.length)return X;throw X!==f&&V<u.length&&ye(oe()),Te(U,D<u.length?u.charAt(D):null,D<u.length?de(D,D+1):de(D,D))}n.exports={SyntaxError:o,parse:s}},{"../util":3}],2:[function(r,n,i){var a=r("./grammar");i.SyntaxError=function(o,s){this.message=o,this.offset=s},i.parse=function(o){try{return a.parse(o)}catch(s){throw new i.SyntaxError(s.message,s.offset)}},i.serialize=function(o){return o.map(function(s){var u;return s.url?(u='url("'+s.url+'")',s.format&&(u+=' format("'+s.format+'")')):u='local("'+s.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(r,n,i){var a=function(s){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return s.replace(u,"$1")},o=function(s){var u=/^"(.*)"$/,h=/^'(.*)'$/;return u.test(s)?s.replace(u,"$1"):h.test(s)?s.replace(h,"$1"):s};i.extractValue=function(s){return o(a(s))}},{}]},{},[2])(2)})}(uv)),uv.exports}var Zb;function aN(){return Zb||(Zb=1,function(t){var e=X0(),r=py(),n=nN(),i=iN(),a=function(E,A,S){E.style.setProperty(A,S,E.style.getPropertyPriority(A))},o=function(E){return E.filter(function(A){return A.type===window.CSSRule.STYLE_RULE&&(A.style.getPropertyValue("background-image")||A.style.getPropertyValue("background"))})},s=function(E){var A=[];return E.forEach(function(S){S.style.getPropertyValue("background-image")?A.push({property:"background-image",value:S.style.getPropertyValue("background-image"),rule:S}):S.style.getPropertyValue("background")&&A.push({property:"background",value:S.style.getPropertyValue("background"),rule:S})}),A},u=function(E){return E.filter(function(A){return A.type===window.CSSRule.FONT_FACE_RULE&&A.style.getPropertyValue("src")})},h=function(E){return E.filter(function(A){return A.type===window.CSSRule.IMPORT_RULE&&A.href})},f=function(E){var A=[];return E.forEach(function(S,k){S.url&&!e.isDataUri(S.url)&&A.push(k)}),A},g=function(E){var A=[];return E.forEach(function(S,k){S.url&&!e.isDataUri(S.url)&&A.push(k)}),A};t.adjustPathsOfCssResources=function(E,A){var S=o(A),k=s(S),I=!1;return k.forEach(function(O){var M=n.parse(O.value),F=f(M),j;F.length>0&&(F.forEach(function(T){var L=M[T].url,$=e.joinUrl(E,L);M[T].url=$}),j=n.serialize(M),a(O.rule,O.property,j),I=!0)}),u(A).forEach(function(O){var M=O.style.getPropertyValue("src"),F,j;try{F=i.parse(M)}catch{return}j=g(F),j.length>0&&(j.forEach(function(T){var L=F[T].url,$=e.joinUrl(E,L);F[T].url=$}),r.changeFontFaceRuleSrc(A,O,i.serialize(F)),I=!0)}),h(A).forEach(function(O){var M=O.href,F=e.joinUrl(E,M);r.exchangeRule(A,O,"@import url("+F+");"),I=!0}),I};var v=function(E,A,S){var k=E.indexOf(A);E.splice(k,1),S.forEach(function(I,O){E.splice(k+O,0,I)})},p=function(E,A,S,k){var I=A.href,O;return I=r.unquoteString(I),O=e.joinUrl(k.baseUrl,I),S.indexOf(O)>=0?(v(E,A,[]),Promise.resolve([])):(S.push(O),e.ajax(I,k).then(function(M){var F=r.rulesForCssText(M);return t.loadCSSImportsForRules(F,S,k).then(function(j){return t.adjustPathsOfCssResources(I,F),v(E,A,F),j.errors})},function(M){throw{resourceType:"stylesheet",url:M.url,msg:"Unable to load stylesheet "+M.url}}))};t.loadCSSImportsForRules=function(E,A,S){var k=h(E),I=[],O=!1;return Promise.all(k.map(function(M){return p(E,M,A,S).then(function(F){I=I.concat(F),O=!0},function(F){I.push(F)})})).then(function(){return{hasChanges:O,errors:I}})};var y=function(E,A){var S=n.parse(E),k=f(S),I=!1;return e.collectAndReportErrors(k.map(function(O){var M=S[O].url;return e.getDataURIForImageURL(M,A).then(function(F){S[O].url=F,I=!0},function(F){throw{resourceType:"backgroundImage",url:F.url,msg:"Unable to load background-image "+F.url}})})).then(function(O){return{backgroundValue:n.serialize(S),hasChanges:I,errors:O}})},_=function(E,A){var S=o(E),k=s(S),I=[],O=!1;return Promise.all(k.map(function(M){return y(M.value,A).then(function(F){F.hasChanges&&(a(M.rule,M.property,F.backgroundValue),O=!0),I=I.concat(F.errors)})})).then(function(){return{hasChanges:O,errors:I}})},x=function(E,A){var S=!1,k,I;try{k=i.parse(E)}catch{k=[]}return I=g(k),e.collectAndReportErrors(I.map(function(O){var M=k[O],F=M.format||"woff";return e.binaryAjax(M.url,A).then(function(j){var T=btoa(j);M.url="data:font/"+F+";base64,"+T,S=!0},function(j){throw{resourceType:"fontFace",url:j.url,msg:"Unable to load font-face "+j.url}})})).then(function(O){return{srcDeclarationValue:i.serialize(k),hasChanges:S,errors:O}})},b=function(E,A){var S=u(E),k=[],I=!1;return Promise.all(S.map(function(O){var M=O.style.getPropertyValue("src");return x(M,A).then(function(F){F.hasChanges&&(r.changeFontFaceRuleSrc(E,O,F.srcDeclarationValue),I=!0),k=k.concat(F.errors)})})).then(function(){return{hasChanges:I,errors:k}})};t.loadAndInlineCSSResourcesForRules=function(E,A){var S=!1,k=[];return Promise.all([_,b].map(function(I){return I(E,A).then(function(O){S=S||O.hasChanges,k=k.concat(O.errors)})})).then(function(){return{hasChanges:S,errors:k}})}}(ov)),ov}var Qb;function oN(){return Qb||(Qb=1,function(t){var e=X0(),r=tN(),n=rN(),i=aN(),a=py(),o=function(x){return e.joinUrl(x,".")},s=function(x){var b=x.map(function(E,A){return A===x.length-1&&(E={baseUrl:o(E.baseUrl)}),JSON.stringify(E)});return b},u=function(x,b){return b.cache!==!1&&b.cache!=="none"&&b.cacheBucket?e.memoize(x,s,b.cacheBucket):x},h=function(x,b,E){var A=a.rulesForCssText(x);return i.loadCSSImportsForRules(A,b,E).then(function(S){return i.loadAndInlineCSSResourcesForRules(A,E).then(function(k){var I=S.errors.concat(k.errors),O=S.hasChanges||k.hasChanges;return O&&(x=a.cssRulesToText(A)),{hasChanges:O,content:x,errors:I}})})},f=function(x,b,E){var A=x.textContent,S=u(h,b);return S(A,E,b).then(function(k){return k.hasChanges&&(x.childNodes[0].nodeValue=k.content),e.cloneArray(k.errors)})},g=function(x){var b=x.getElementsByTagName("style");return Array.prototype.filter.call(b,function(E){return!E.attributes.type||E.attributes.type.value==="text/css"})};t.loadAndInlineStyles=function(x,b){var E=g(x),A=[],S=[],k;return k=e.clone(b),k.baseUrl=k.baseUrl||e.getDocumentBaseUrl(x),Promise.all(E.map(function(I){return f(I,k,S).then(function(O){A=A.concat(O)})})).then(function(){return A})};var v=function(x,b){var E=x.parentNode,A;b=b.trim(),b&&(A=x.ownerDocument.createElement("style"),A.type="text/css",A.appendChild(x.ownerDocument.createTextNode(b)),E.insertBefore(A,x)),E.removeChild(x)},p=function(x,b){return e.ajax(x,b).then(function(E){var A=a.rulesForCssText(E);return{content:E,cssRules:A}}).then(function(E){var A=i.adjustPathsOfCssResources(x,E.cssRules);return{content:E.content,cssRules:E.cssRules,hasChanges:A}}).then(function(E){return i.loadCSSImportsForRules(E.cssRules,[],b).then(function(A){return{content:E.content,cssRules:E.cssRules,hasChanges:E.hasChanges||A.hasChanges,errors:A.errors}})}).then(function(E){return i.loadAndInlineCSSResourcesForRules(E.cssRules,b).then(function(A){return{content:E.content,cssRules:E.cssRules,hasChanges:E.hasChanges||A.hasChanges,errors:E.errors.concat(A.errors)}})}).then(function(E){var A=E.content;return E.hasChanges&&(A=a.cssRulesToText(E.cssRules)),{content:A,errors:E.errors}})},y=function(x,b){var E=x.attributes.href.value,A=e.getDocumentBaseUrl(x.ownerDocument),S=e.clone(b);!S.baseUrl&&A&&(S.baseUrl=A);var k=u(p,b);return k(E,S).then(function(I){return{content:I.content,errors:e.cloneArray(I.errors)}})},_=function(x){var b=x.getElementsByTagName("link");return Array.prototype.filter.call(b,function(E){return E.attributes.rel&&E.attributes.rel.value==="stylesheet"&&(!E.attributes.type||E.attributes.type.value==="text/css")})};t.loadAndInlineCssLinks=function(x,b){var E=_(x),A=[];return Promise.all(E.map(function(S){return y(S,b).then(function(k){v(S,k.content+`
|
|
161
|
-
`),A=A.concat(k.errors)},function(k){A.push({resourceType:"stylesheet",url:k.url,msg:"Unable to load stylesheet "+k.url})})})).then(function(){return A})},t.loadAndInlineImages=r.inline,t.loadAndInlineScript=n.inline,t.inlineReferences=function(x,b){var E=[],A=[t.loadAndInlineImages,t.loadAndInlineStyles,t.loadAndInlineCssLinks];return b.inlineScripts!==!1&&A.push(t.loadAndInlineScript),Promise.all(A.map(function(S){return S(x,b).then(function(k){E=E.concat(k)})})).then(function(){return E})}}(rv)),rv}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
|
|
162
|
-
* http://www.github.com/cburgmer/rasterizeHTML.js
|
|
163
|
-
* Copyright (c) 2022 Christoph Burgmer; Licensed MIT */var sN=X1.exports,Jb;function lN(){return Jb||(Jb=1,function(t){(function(e,r){e===void 0&&window!==void 0&&(e=window),t.exports?t.exports=r(q7(),JL(),eN(),oN()):e.rasterizeHTML=r(e.url,e.xmlserializer,e.sanedomparsererror,e.inlineresources)})(sN,function(e,r,n,i){var a=function(y){var _={},x=[];_.joinUrl=function(A,S){return A?y.resolve(A,S):S},_.getConstantUniqueIdFor=function(A){return x.indexOf(A)<0&&x.push(A),x.indexOf(A)},_.clone=function(A){var S={},k;for(k in A)A.hasOwnProperty(k)&&(S[k]=A[k]);return S};var b=function(A){return typeof A=="object"&&A!==null},E=function(A){return b(A)&&Object.prototype.toString.apply(A).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return _.parseOptionalParameters=function(A){var S={canvas:null,options:{}};return A[0]==null||E(A[0])?(S.canvas=A[0]||null,S.options=_.clone(A[1])):S.options=_.clone(A[0]),S},_}(e),o=function(y){var _={},x=function(b,E,A){var S=b[E];return b[E]=function(){var k=Array.prototype.slice.call(arguments);return A.apply(this,[k,S])},S};return _.baseUrlRespectingXhr=function(b,E){var A=function(){var S=new b;return x(S,"open",function(k,I){var O=k.shift(),M=k.shift(),F=y.joinUrl(E,M);return I.apply(this,[O,F].concat(k))}),S};return A},_.finishNotifyingXhr=function(b){var E=0,A=0,S=!1,k,I=new Promise(function(M){k=function(){var F=E-A;F<=0&&S&&M({totalCount:E})}}),O=function(){var M=new b;return x(M,"send",function(F,j){return E+=1,j.apply(this,arguments)}),M.addEventListener("load",function(){A+=1,k()}),M};return O.waitForRequestsToFinish=function(){return S=!0,k(),I},O},_}(a),s=function(){var y={},_=function(O){return Array.prototype.slice.call(O)};y.addClassName=function(O,M){O.className+=" "+M},y.addClassNameRecursively=function(O,M){y.addClassName(O,M),O.parentNode!==O.ownerDocument&&y.addClassNameRecursively(O.parentNode,M)};var x=function(O,M){var F=O.parentStyleSheet,j=_(F.cssRules).indexOf(O);F.insertRule(M,j+1),F.deleteRule(j)},b=function(O,M){var F=O.cssText.replace(/^[^\{]+/,""),j=M+" "+F;x(O,j)},E=function(O){return _(O).reduce(function(M,F){return M+F.cssText},"")},A=function(O){O.textContent=E(O.sheet.cssRules)},S=function(O){var M=document.implementation.createHTMLDocument(""),F=document.createElement("style");F.textContent=O.textContent,M.body.appendChild(F),O.sheet=F.sheet},k=function(O){return"((?:^|[^.#:\\w])|(?=\\W))("+O.join("|")+")(?=\\W|$)"},I=function(O,M,F){var j=k(M);_(O.querySelectorAll("style")).forEach(function(T){typeof T.sheet>"u"&&S(T);var L=_(T.sheet.cssRules).filter(function($){return $.selectorText&&new RegExp(j,"i").test($.selectorText)});L.length&&(L.forEach(function($){var q=$.selectorText.replace(new RegExp(j,"gi"),function(J,ae,ie){return ae+F(ie)});q!==$.selectorText&&b($,q)}),A(T))})};return y.rewriteCssSelectorWith=function(O,M,F){I(O,[M],function(){return F})},y.lowercaseCssTypeSelectors=function(O,M){I(O,M,function(F){return F.toLowerCase()})},y.findHtmlOnlyNodeNames=function(O){var M=O.ownerDocument.createTreeWalker(O,NodeFilter.SHOW_ELEMENT),F={},j={},T;do T=M.currentNode.tagName.toLowerCase(),M.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?F[T]=!0:j[T]=!0;while(M.nextNode());return Object.keys(F).filter(function(L){return!j[L]})},y}(),u=function(y){var _={},x=function(E){return Array.prototype.slice.call(E)},b={active:!0,hover:!0,focus:!1,target:!1};return _.fakeUserAction=function(E,A,S){var k=E.querySelector(A),I=":"+S,O="rasterizehtml"+S;k&&(b[S]?y.addClassNameRecursively(k,O):y.addClassName(k,O),y.rewriteCssSelectorWith(E,I,"."+O))},_.persistInputValues=function(E){var A=E.querySelectorAll("input"),S=E.querySelectorAll("textarea"),k=function(I){return I.type==="checkbox"||I.type==="radio"};x(A).filter(k).forEach(function(I){I.checked?I.setAttribute("checked",""):I.removeAttribute("checked")}),x(A).filter(function(I){return!k(I)}).forEach(function(I){I.setAttribute("value",I.value)}),x(S).forEach(function(I){I.textContent=I.value})},_.rewriteTagNameSelectorsToLowerCase=function(E){y.lowercaseCssTypeSelectors(E,y.findHtmlOnlyNodeNames(E))},_}(s),h=function(y,_,x,b){var E={},A=function(ie,Z,te,V){var B=ie.createElement(Z);return B.style.visibility="hidden",B.style.width=te+"px",B.style.height=V+"px",B.style.position="absolute",B.style.top=-1e4-V+"px",B.style.left=-1e4-te+"px",ie.getElementsByTagName("body")[0].appendChild(B),B},S=function(ie){return ie>0?new Promise(function(Z){setTimeout(Z,ie)}):Promise.resolve()};E.executeJavascript=function(ie,Z){return new Promise(function(te){var V=A(b.document,"iframe",Z.width,Z.height),B=ie.outerHTML,D=[],U=Z.executeJsTimeout||0,X=function(){b.document.getElementsByTagName("body")[0].removeChild(V)},ee=function(){var de=V.contentDocument;te({document:de,errors:D,cleanUp:X})},K=V.contentWindow.XMLHttpRequest,oe=_.finishNotifyingXhr(K),me=_.baseUrlRespectingXhr(oe,Z.baseUrl);V.onload=function(){S(U).then(oe.waitForRequestsToFinish).then(ee)},V.contentDocument.open(),V.contentWindow.XMLHttpRequest=me,V.contentWindow.onerror=function(de){D.push({resourceType:"scriptExecution",msg:de})},V.contentDocument.write("<!DOCTYPE html>"),V.contentDocument.write(B),V.contentDocument.close()})};var k=function(ie,Z,te){var V=ie.createElement("iframe");return V.style.width=Z+"px",V.style.height=te+"px",V.style.visibility="hidden",V.style.position="absolute",V.style.top=-1e4-te+"px",V.style.left=-1e4-Z+"px",V.style.borderWidth=0,V.sandbox="allow-same-origin",V.scrolling="no",V},I=function(ie,Z,te){var V=Math.floor(ie/te),B=Math.floor(Z/te);return k(b.document,V,B)},O=function(ie,Z,te,V){return{width:Math.max(ie.width*V,Z),height:Math.max(ie.height*V,te)}},M=function(ie,Z){var te=ie.querySelector(Z);if(te)return te;if(ie.ownerDocument.querySelector(Z)===ie)return ie;throw{message:"Clipping selector not found"}},F=function(ie,Z,te,V,B){var D=Math.max(ie.scrollWidth,ie.clientWidth),U=Math.max(ie.scrollHeight,ie.clientHeight),X,ee,K,oe,me,de,ye,Te;return Z?(de=M(ie,Z),ye=de.getBoundingClientRect(),X=ye.top,ee=ye.left,K=ye.width,oe=ye.height):(X=0,ee=0,K=D,oe=U),Te=O({width:K,height:oe},te,V,B),me=b.getComputedStyle(ie.ownerDocument.documentElement).fontSize,{left:ee,top:X,width:Te.width,height:Te.height,viewportWidth:D,viewportHeight:U,rootFontSize:me}},j=function(ie,Z){var te=ie.tagName;return Z.querySelector(te)},T=function(ie){var Z=ie.tagName.toLowerCase();return Z==="html"||Z==="body"?ie.outerHTML:'<body style="margin: 0;">'+ie.outerHTML+"</body>"};E.calculateDocumentContentSize=function(ie,Z){return new Promise(function(te,V){var B=Z.zoom||1,D;D=I(Z.width,Z.height,B),b.document.getElementsByTagName("body")[0].appendChild(D),D.onload=function(){var U=D.contentDocument,X;try{X=F(j(ie,U),Z.clip,Z.width,Z.height,B),te(X)}catch(ee){V(ee)}finally{b.document.getElementsByTagName("body")[0].removeChild(D)}},D.contentDocument.open(),D.contentDocument.write("<!DOCTYPE html>"),D.contentDocument.write(T(ie)),D.contentDocument.close()})},E.parseHtmlFragment=function(ie){var Z=b.document.implementation.createHTMLDocument("");Z.documentElement.innerHTML=ie;var te=Z.querySelector("body").firstChild;if(!te)throw"Invalid source";return te};var L=function(ie,Z){var te=/<html((?:\s+[^>]*)?)>/im.exec(Z),V=b.document.implementation.createHTMLDocument(""),B,D,U,X;if(te)for(B="<div"+te[1]+"></div>",V.documentElement.innerHTML=B,U=V.querySelector("div"),D=0;D<U.attributes.length;D++)X=U.attributes[D],ie.documentElement.setAttribute(X.name,X.value)};E.parseHTML=function(ie){var Z=b.document.implementation.createHTMLDocument("");return Z.documentElement.innerHTML=ie,L(Z,ie),Z};var $=function(ie){try{return x.failOnParseError(ie)}catch(Z){throw{message:"Invalid source",originalError:Z}}};E.validateXHTML=function(ie){var Z=new DOMParser,te=Z.parseFromString(ie,"application/xml");$(te)};var q=null,J=function(ie,Z){return Z==="none"||Z==="repeated"?((q===null||Z!=="repeated")&&(q=Date.now()),ie+"?_="+q):ie},ae=function(ie,Z){return new Promise(function(te,V){var B=new window.XMLHttpRequest,D=y.joinUrl(Z.baseUrl,ie),U=J(D,Z.cache),X=function(ee){V({message:"Unable to load page",originalError:ee})};B.addEventListener("load",function(){B.status===200||B.status===0?te(B.responseXML):X(B.statusText)},!1),B.addEventListener("error",function(ee){X(ee)},!1);try{B.open("GET",U,!0),B.responseType="document",B.send(null)}catch(ee){X(ee)}})};return E.loadDocument=function(ie,Z){return ae(ie,Z).then(function(te){return $(te)})},E}(a,o,n,window),f=function(y){var _={},x=function(j,T){return T?URL.createObjectURL(new Blob([j],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(j)},b=function(j){j instanceof Blob&&URL.revokeObjectURL(j)},E='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',A=function(j){return new Promise(function(T,L){var $=document.createElement("canvas"),q=new Image;q.onload=function(){var J=$.getContext("2d");try{J.drawImage(q,0,0),$.toDataURL("image/png"),T(!0)}catch{T(!1)}},q.onerror=L,q.src=j})},S=function(){var j=x(E,!0);return A(j).then(function(T){return b(j),T?!1:A(x(E,!1)).then(function(L){return L})},function(){return!1})},k=function(){if(y.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},I=function(){return new Promise(function(j,T){k()&&y.URL?S().then(function(L){j(!L)},function(){T()}):j(!1)})},O,M=function(){return O===void 0&&(O=I()),O},F=function(j){return M().then(function(T){return x(j,T)})};return _.renderSvg=function(j){return new Promise(function(T,L){var $,q,J=function(){q.onload=null,q.onerror=null},ae=function(){$&&b($)};q=new Image,q.onload=function(){J(),ae(),T(q)},q.onerror=function(){ae(),L()},F(j).then(function(ie){$=ie,q.src=$},L)})},_}(window),g=function(y,_,x,b){var E={},A=function(j,T){var L=T||1,$={width:j.width,height:j.height,"font-size":j.rootFontSize};return L!==1&&($.style="transform:scale("+L+"); transform-origin: 0 0;"),$},S=function(j){var T,L,$,q;T=Math.round(j.viewportWidth),L=Math.round(j.viewportHeight),$=-j.left,q=-j.top;var J={x:$,y:q,width:T,height:L};return J},k=function(j){var T=j.style||"";j.style=T+"float: left;"},I=function(j){j.externalResourcesRequired=!0},O=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},M=function(j){var T=Object.keys(j);return T.length?" "+T.map(function(L){return L+'="'+j[L]+'"'}).join(" "):""},F=function(j,T,L){var $=b.serializeToString(j);_.validateXHTML($);var q=S(T);return k(q),I(q),'<svg xmlns="http://www.w3.org/2000/svg"'+M(A(T,L))+">"+O()+"<foreignObject"+M(q)+">"+$+"</foreignObject></svg>"};return E.getSvgForDocument=function(j,T,L){return x.rewriteTagNameSelectorsToLowerCase(j),F(j,T,L)},E.drawDocumentAsSvg=function(j,T){return["hover","active","focus","target"].forEach(function(L){T[L]&&x.fakeUserAction(j,T[L],L)}),_.calculateDocumentContentSize(j,T).then(function(L){return E.getSvgForDocument(j,L,T.zoom)})},E}(a,h,u,r),v=function(y,_,x,b,E,A){var S={},k=function(j){return{message:"Error rendering page",originalError:j}},I=function(j){return E.renderSvg(j).then(function(T){return{image:T,svg:j}},function(T){throw k(T)})},O=function(j,T){try{T.getContext("2d").drawImage(j,0,0)}catch(L){throw k(L)}},M=function(j,T,L){return b.drawDocumentAsSvg(j,L).then(I).then(function($){return T&&O($.image,T),$})},F=function(j,T){return _.executeJavascript(j,T).then(function(L){var $=L.document;return x.persistInputValues($),{document:$,errors:L.errors,cleanUp:L.cleanUp}})};return S.rasterize=function(j,T,L){var $;return $=y.clone(L),$.inlineScripts=L.executeJs===!0,A.inlineReferences(j,$).then(function(q){return L.executeJs?F(j,L).then(function(J){return{element:J.document.documentElement,errors:q.concat(J.errors),cleanUp:J.cleanUp}}):{element:j,errors:q,cleanUp:function(){}}}).then(function(q){return M(q.element,T,L).then(function(J){return q.cleanUp(),{image:J.image,svg:J.svg,errors:q.errors}})})},S}(a,h,u,g,f,i),p=function(y,_,x){var b={},E=function(O,M){var F=300,j=200,T=O?O.width:F,L=O?O.height:j,$=M.width!==void 0?M.width:T,q=M.height!==void 0?M.height:L;return{width:$,height:q}},A=function(O){var M=E(O.canvas,O.options),F;return F=y.clone(O.options),F.width=M.width,F.height=M.height,F};b.drawDocument=function(){var O=arguments[0],M=Array.prototype.slice.call(arguments,1),F=y.parseOptionalParameters(M),j=O.documentElement?O.documentElement:O;return x.rasterize(j,F.canvas,A(F))};var S=function(O,M,F){var j=_.parseHTML(O);return b.drawDocument(j,M,F)};b.drawHTML=function(){var O=arguments[0],M=Array.prototype.slice.call(arguments,1),F=y.parseOptionalParameters(M);return S(O,F.canvas,F.options)};var k=function(O,M,F){var j=document.implementation.createHTMLDocument("");j.replaceChild(O.documentElement,j.documentElement);var T=F?y.clone(F):{};return F.baseUrl||(T.baseUrl=M),{document:j,options:T}},I=function(O,M,F){return _.loadDocument(O,F).then(function(j){var T=k(j,O,F);return b.drawDocument(T.document,M,T.options)})};return b.drawURL=function(){var O=arguments[0],M=Array.prototype.slice.call(arguments,1),F=y.parseOptionalParameters(M);return I(O,F.canvas,F.options)},b}(a,h,v);return p})}(X1)),X1.exports}var uN=lN();function cN(t,e){if(!t.includes("@font-face"))return"";const r=new Set,n=new Set;e&&((e.match(/font-weight:\s*(\d+|bold|normal)/gi)||[]).forEach(h=>{const f=h.split(":")[1].trim();f==="bold"?r.add("700"):f==="normal"?r.add("400"):/^\d+$/.test(f)&&r.add(f)}),(e.match(/font-style:\s*(italic|normal)/gi)||[]).forEach(h=>{h.split(":")[1].trim().toLowerCase()==="italic"&&n.add("italic")}),/<(b|strong)\b/i.test(e)&&r.add("700"),/<(i|em)\b/i.test(e)&&n.add("italic"));const i=ns(e);i&&i.trim()&&r.add("400"),r.size===0&&r.add("400");const a=r,o=n.has("italic"),s=Array.from(new Set(i)).map(h=>h.codePointAt(0)).filter(h=>h!==void 0),u=t.split(/}\s*/).map(h=>h&&h+"}").filter(h=>/@font-face/.test(h)&&(f=>{const g=(f.match(/font-weight:\s*(\d+)/)||[])[1];if(g&&!a.has(g)||/font-style:\s*italic/.test(f)&&!o)return!1;const v=f.match(/unicode-range:\s*([^;]+);/);if(!v)return!0;const p=v[1].split(",").map(y=>{const[_,x=_]=y.replace("U+","").split("-").map(b=>parseInt(b,16));return[_,x]});return s.some(y=>p.some(([_,x])=>y>=_&&y<=x))})(h)).join(`
|
|
164
|
-
`);return u?`<style>${u}</style>`:""}const K0=`
|
|
165
|
-
p {
|
|
166
|
-
margin: 0;
|
|
167
|
-
padding: 0;
|
|
168
|
-
word-wrap: break-word; /* Required for Firefox */
|
|
169
|
-
/* a text may have several spaces, we need to preserve them */
|
|
170
|
-
white-space: pre-wrap;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/* Reset default list styles and setup counters */
|
|
174
|
-
ul, ol {
|
|
175
|
-
list-style: none; /* Remove default markers */
|
|
176
|
-
padding-inline-start: 0; /* Reset padding */
|
|
177
|
-
margin: 0;
|
|
178
|
-
display: block; /* Use block instead of inline-block for better text wrapping */
|
|
179
|
-
width: 100%;
|
|
180
|
-
text-decoration: inherit;
|
|
181
|
-
counter-reset: ol-counter; /* Initialize counter for ol */
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
li {
|
|
185
|
-
position: relative; /* Needed for absolute positioning of ::before */
|
|
186
|
-
padding-inline-start: 2.1em; /* Space for the marker (start side) */
|
|
187
|
-
margin: 0; /* Reset default li margins */
|
|
188
|
-
word-wrap: break-word; /* Required for Firefox text wrapping */
|
|
189
|
-
white-space: pre-wrap; /* Preserve spaces and allow wrapping */
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
li::before {
|
|
193
|
-
content: ''; /* Base content */
|
|
194
|
-
position: absolute;
|
|
195
|
-
/* Use logical properties for positioning */
|
|
196
|
-
inset-inline-start: 0; /* Position marker at the start edge (left in LTR, right in RTL) */
|
|
197
|
-
top: 0; /* Adjust vertical alignment */
|
|
198
|
-
/* Prevent letter-spacing from affecting the marker */
|
|
199
|
-
letter-spacing: normal;
|
|
200
|
-
/* Define width to ensure consistent spacing and alignment */
|
|
201
|
-
display: inline-block;
|
|
202
|
-
width: 2em; /* Width for the marker container */
|
|
203
|
-
/* Align multi-digit numbers to the end (right in LTR, left in RTL) */
|
|
204
|
-
text-align: end;
|
|
205
|
-
/* Space between marker and text (using logical property) */
|
|
206
|
-
margin-inline-end: 0.8em; /* Pushes text away from marker (2.5em total = 1.7em width + 0.8em margin)*/
|
|
207
|
-
/* Prevent marker style from inheriting list item styles */
|
|
208
|
-
font-weight: normal;
|
|
209
|
-
font-style: normal;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/* Style for bullet points */
|
|
213
|
-
ul > li::before {
|
|
214
|
-
content: '•'; /* Literal bullet character */
|
|
215
|
-
/* Center the bullet within its allocated width */
|
|
216
|
-
text-align: center; /* Override text-align: end for bullets */
|
|
217
|
-
font-size: 1.2em;
|
|
218
|
-
top: 0em; /* Re-adjust vertical alignment for bullet */
|
|
219
|
-
/* Bullets don't need number alignment, width can be tighter */
|
|
220
|
-
width: 2em;
|
|
221
|
-
/* Adjust margin to maintain overall padding */
|
|
222
|
-
margin-inline-end: 1.5em; /* 2.5em total padding = 1em width + 1.5em margin */
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/* Style for numbers using counter */
|
|
226
|
-
ol > li {
|
|
227
|
-
counter-increment: ol-counter; /* Increment counter for each li in ol */
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
ol > li::before {
|
|
231
|
-
content: counter(ol-counter) "."; /* Display counter value + dot */
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.ql-indent-1 {
|
|
235
|
-
margin-inline-start: 0.5em;
|
|
236
|
-
}
|
|
237
|
-
.ql-indent-2 {
|
|
238
|
-
margin-inline-start: 1em;
|
|
239
|
-
}
|
|
240
|
-
.ql-indent-3 {
|
|
241
|
-
margin-inline-start: 1.5em;
|
|
242
|
-
}
|
|
243
|
-
`,fN=`
|
|
244
|
-
<style>
|
|
245
|
-
html, body {
|
|
246
|
-
padding: 0;
|
|
247
|
-
margin: 0;
|
|
248
|
-
}
|
|
249
|
-
${K0}
|
|
250
|
-
</style>
|
|
251
|
-
`;let rf;const U7=()=>(rf||(rf=document.createElement("div"),rf.id="polotno-hidden-do-not-touch",rf.style.overflow="hidden",rf.style.position="relative",document.body.appendChild(rf),rf.innerHTML=`<style>#polotno-hidden-do-not-touch {${K0}}</style>`),rf);navigator.userAgent.includes("Firefox");function hN({html:t}){const e=document.createElement("div");e.innerHTML=t,e.style.display="inline-block",e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.zIndex="1000",e.style.whiteSpace="nowrap",e.style.visibility="hidden";const r=U7();r.appendChild(e);const n=e.innerText,i=e.childNodes[0];i.style.whiteSpace="nowrap";const a=n?.split(/\s+/)||[];let o=!1;for(let s=0;s<a.length;s++){const u=a[s];if(i&&(i.textContent=u,o=i.scrollWidth>e.clientWidth,o))break}return r.removeChild(e),o}function e4(t){const e=document.createElement("div");e.innerHTML=t,e.style.display="inline-block",e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.zIndex="1000";const r=U7();r.appendChild(e);const n=e.getBoundingClientRect();return r.removeChild(e),{width:n.width,height:n.height}}const dN={},cv={},fv=new Map;async function t4({html:t,width:e,height:r,fontFamily:n,padding:i,font:a,pixelRatio:o}){let s="";if(n!=="Arial"&&!a){const y=iO();s=await async function(_,x){const b=`${_}|${x}`;if(fv.has(b))return fv.get(b);const E=`https://fonts.googleapis.com/css?family=${_}:${x}&display=swap`,A=await(await fetch(E)).text();return fv.set(b,A),A}(n,y)}if(a){const y=a.styles||(a.url?[{src:`url("${a.url}")`}]:(_=>{if(cv[_])return cv[_];const x=function(E){const A=[];for(let S=0;S<document.styleSheets.length;S++){const k=document.styleSheets[S];try{const I=k.cssRules;if(I)for(let O=0;O<I.length;O++){const M=I[O];M instanceof CSSFontFaceRule&&M.style.fontFamily.replace(/['"]/g,"")===E&&A.push(M)}}catch(I){console.warn(`Could not access stylesheet: ${k.href}`,I)}}return A}(_),b=x.filter(E=>E.style.fontFamily.replace(/['"]/g,"")===_).map(E=>({src:E.style.getPropertyValue("src"),fontStyle:E.style.getPropertyValue("font-style")||"normal",fontWeight:E.style.getPropertyValue("font-weight")||"normal"}));return cv[_]=b,b})(n));s="",y.forEach(_=>{s+=`
|
|
252
|
-
@font-face {
|
|
253
|
-
font-family: '${n}';
|
|
254
|
-
src: ${_.src};
|
|
255
|
-
font-style: ${_.fontStyle||"normal"};
|
|
256
|
-
font-weight: ${_.fontWeight||"normal"};
|
|
257
|
-
}
|
|
258
|
-
`})}let u="";s&&(u=cN(s,t)),t+=u+fN;const h=e+2*i,f=r+2*i,g=document.createElement("canvas"),v=await uN.drawHTML(`<div style="padding: ${i}px;" dir="auto">${t}</div>`,g,{width:h,height:f,cacheBucket:dN});cy(g,h*o,f*o);const p=g.getContext("2d");return p?.drawImage(v.image,0,0,h,f,0,0,g.width,g.height),g}let pN={data:""},gN=t=>typeof window=="object"?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||pN,vN=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,mN=/\/\*[^]*?\*\/|\s\s+|\n/g,cf=(t,e)=>{let r="",n="",i="";for(let a in t){let o=t[a];a[0]=="@"?a[1]=="i"?r=a+" "+o+";":n+=a[1]=="f"?cf(o,a):a+"{"+cf(o,a[1]=="k"?"":e)+"}":typeof o=="object"?n+=cf(o,e?e.replace(/([^,])+/g,s=>a.replace(/(^:.*)|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,s):s?s+" "+u:u)):a):o!=null&&(a=a.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=cf.p?cf.p(a,o):a+":"+o+";")}return r+(e&&i?e+"{"+i+"}":i)+n},zd={},H7=t=>{if(typeof t=="object"){let e="";for(let r in t)e+=r+H7(t[r]);return e}return t},yN=(t,e,r,n,i)=>{let a=H7(t),o=zd[a]||(zd[a]=(s=>{let u=0,h=11;for(;u<s.length;)h=101*h+s.charCodeAt(u++)>>>0;return"go"+h})(a));if(!zd[o]){let s=a!==t?t:(u=>{let h,f=[{}];for(;h=vN.exec(u.replace(mN,""));)h[4]?f.shift():h[3]?f.unshift(f[0][h[3]]=f[0][h[3]]||{}):f[0][h[1]]=h[2];return f[0]})(t);zd[o]=cf(i?{["@keyframes "+o]:s}:s,r?"":"."+o)}return((s,u,h)=>{u.data.indexOf(s)==-1&&(u.data=h?s+u.data:u.data+s)})(zd[o],e,n),o};function gy(t){let e=this||{},r=t.call?t(e.p):t;return yN(r.unshift?r.raw?((n,i,a)=>n.reduce((o,s,u)=>{let h=i[u];if(h&&h.call){let f=h(a),g=f&&f.props&&f.props.className||/^go/.test(f)&&f;h=g?"."+g:f&&typeof f=="object"?f.props?"":cf(f,""):f===!1?"":f}return o+s+(h??"")},""))(r,[].slice.call(arguments,1),e.p):r.reduce((n,i)=>Object.assign(n,i&&i.call?i(e.p):i),{}):r,gN(e.target),e.g,e.o,e.k)}let $7,bm,wm;gy.bind({g:1});gy.bind({k:1});function bN(t,e,r,n){cf.p=e,$7=t,bm=r,wm=n}function Ed(t,e){let r=this||{};return function(){let n=arguments;function i(a,o){let s=Object.assign({},a),u=s.className||i.className;r.p=Object.assign({theme:bm&&bm()},s),r.o=/ *go\d+/.test(u),s.className=gy.apply(r,n)+(u?" "+u:""),e&&(s.ref=o);let h=t;return t[0]&&(h=s.as||t,delete s.as),wm&&h[0]&&wm(s),$7(h,s)}return e?e(i):i}}bN(se.createElement);function r4(t){const e=(t||"").trim();if(e==="<p><br></p>"||e==="<p></p>")return"";if(e.startsWith("<p>")&&e.endsWith("</p>")){const r=e.slice(3,-4);if(!/(<\/?(p|div|h[1-6]|ul|ol|li|table|thead|tbody|tr|td|blockquote)\b)/i.test(r))return r}return t}const Vf=Xr({enabled:!1,currentFormat:{},editor:Xr.object({instance:null},{},{deep:!1})}),G7=Ed("div",se.forwardRef)`
|
|
259
|
-
.ql-editor {
|
|
260
|
-
outline: none;
|
|
261
|
-
}
|
|
262
|
-
.ql-clipboard {
|
|
263
|
-
pointer-events: none;
|
|
264
|
-
}
|
|
265
|
-
${K0}
|
|
266
|
-
strong {
|
|
267
|
-
font-weight: 700;
|
|
268
|
-
}
|
|
269
|
-
.ql-direction-rtl {
|
|
270
|
-
direction: rtl;
|
|
271
|
-
}
|
|
272
|
-
`;let wN=["bold","color","font","italic","size","strike","underline","indent","list","direction"];const n4=(t,e)=>{var r=t.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+e+"<p><br></p></div>");t.setContents(r),t.history.clear()},_N=({html:t,onBlur:e,onChange:r,element:n,clickCoords:i})=>{const a=se.useRef(null);se.useEffect(()=>{if(!a.current)return;const u=(h=a.current,new N7(h,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:wN}));var h;return dc(()=>{Vf.editor.instance=u}),window.__polotnoQuill=u,u.on("text-change",()=>{u.getSelection()&&dc(()=>{Vf.currentFormat=u.getFormat(u.getSelection())}),setTimeout(()=>{var f;const g=(f=a.current)===null||f===void 0?void 0:f.childNodes[0];if(!g)return;const v=g.innerHTML;r(r4(v))},10)}),n4(u,t),i?EN(u,i):u.setSelection(0,0,"api"),u.on("selection-change",(f,g,v)=>{f&&dc(()=>{Vf.currentFormat=u.getFormat(u.getSelection())})}),a.current.childNodes[0].addEventListener("blur",f=>{var g;if(!((g=f.relatedTarget)===null||g===void 0)&&g.classList.contains("ql-clipboard"))return;(function(p){return!!p&&!!p.closest(".sketch-picker")})(f.relatedTarget)||e()}),()=>{dc(()=>{Vf.editor.instance=null,Vf.currentFormat={}}),delete window.__polotnoQuill}},[]),se.useEffect(()=>C6(()=>n.text,()=>{var u;const h=Vf.editor.instance;if(!h)return;const f=h.getSelection();r4((u=a.current)===null||u===void 0?void 0:u.childNodes[0].innerHTML)===n.text||(n4(h,t),f&&(h.setSelection(f.index,f.length),dc(()=>{Vf.currentFormat=h.getFormat(h.getSelection())})))},{fireImmediately:!0}),[]),se.useEffect(()=>{window.addEventListener("blur",e);const u=h=>{var f;!((f=a.current)===null||f===void 0)&&f.contains(h.target)||e()};return window.addEventListener("touchstart",u),()=>{window.removeEventListener("blur",e),window.removeEventListener("touchstart",u)}},[]);const o={color:n.fill};n.fill.indexOf("gradient")>=0&&(o.backgroundColor=n.fill,o.backgroundImage=n.fill,o.backgroundSize="100% 100%",o.backgroundRepeat="repeat",o.webkitBackgroundClip="text",o.MozBackgroundClip="text",o.WebkitTextFillColor="transparent",o.MozTextFillColor="transparent");const s=E7(n);return se.createElement(G7,{ref:a,style:Object.assign(Object.assign({},o),{fontSize:n.fontSize,fontWeight:n.fontWeight,textTransform:n.textTransform,width:n.a.width,fontFamily:'"'+n.fontFamily+'"',lineHeight:n.lineHeight,letterSpacing:n.letterSpacing*n.fontSize+"px",textAlign:n.align,opacity:Math.max(n.a.opacity,.2),textShadow:n.shadowEnabled?`${n.shadowOffsetX}px ${n.shadowOffsetY}px ${n.shadowBlur}px ${n.shadowColor}`:void 0,caretColor:s}),dir:W0(ns(n.text))})};function xN(t){return!function(e){const r=e.getContext("2d").getImageData(0,0,e.width,e.height).data;for(let n=0;n<r.length;n+=4)if(r[n+3]!==0)return!0;return!1}(t)}function i4(t,{fontFamily:e="",color:r="black"}={}){let n=`color: ${r||t.fill}`;t.fill.indexOf("gradient")>=0&&(n=`
|
|
273
|
-
background-color: ${r};
|
|
274
|
-
background-image: ${t.fill};
|
|
275
|
-
background-size: 100% 100%;
|
|
276
|
-
background-repeat: repeat;
|
|
277
|
-
-webkit-background-clip: text;
|
|
278
|
-
-moz-background-clip: text;
|
|
279
|
-
-webkit-text-fill-color: transparent;
|
|
280
|
-
-moz-text-fill-color: transparent;
|
|
281
|
-
`);const i=["white-space: pre-wrap","word-break: break-word",`width: ${Math.round(t.width||100)}px`,n,`font-size: ${t.fontSize}px`,`font-family: '${e}'`,`text-align: ${t.align}`,`text-transform: ${t.textTransform}`,t.textDecoration?`text-decoration: ${t.textDecoration}; text-decoration-color: ${r||t.fill}; text-decoration-layer: over`:"",t.lineHeight?`line-height: ${t.lineHeight}`:"",t.letterSpacing?`letter-spacing: ${t.letterSpacing*t.fontSize}px`:"",t.fontStyle?`font-style: ${t.fontStyle}`:"",t.fontWeight?`font-weight: ${t.fontWeight}`:"",t.strokeWidth?`-webkit-text-stroke: ${t.strokeWidth}px ${t.stroke}`:"",t.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ");if(t.curveEnabled){const a=function(s){const u=s.a?s.a:s,h=new or.TextPath({data:uh(u.width,u.height,s.curvePower,u.fontSize),align:"center",textBaseline:"middle",text:ns(s.text),fontSize:u.fontSize,fontFamily:s.fontFamily,fontWeight:s.fontWeight,fontStyle:s.fontStyle,letterSpacing:s.letterSpacing*u.fontSize,fill:s.fill}),f=h.getSelfRect().height;return h.destroy(),f}(t),o=Math.round(t.width||100);return`
|
|
282
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${a}">
|
|
283
|
-
<defs><path id="curve" d="${uh(o,a,t.curvePower,t.fontSize)}" fill="none" /></defs>
|
|
284
|
-
<text
|
|
285
|
-
font-family="'${e}'"
|
|
286
|
-
font-size="${t.fontSize}"
|
|
287
|
-
font-weight="${t.fontWeight}"
|
|
288
|
-
font-style="${t.fontStyle}"
|
|
289
|
-
fill="${r}"
|
|
290
|
-
text-anchor="middle"
|
|
291
|
-
dominant-baseline="central"${t.strokeWidth?` stroke="${t.stroke}" stroke-width="${t.strokeWidth}" paint-order="stroke fill"`:""}>
|
|
292
|
-
<textPath href="#curve" startOffset="50%">
|
|
293
|
-
${ns(t.text).replace(/\\n/g," ")}
|
|
294
|
-
</textPath>
|
|
295
|
-
</text>
|
|
296
|
-
</svg>`}return`<div style="${i}" contentEditable dir="${W0(ns(t.text))}">${cO(t.text).replace(/\n/g,"</br>")}</div>`}const a4=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),SN=ni(({element:t,store:e})=>{const r=se.useRef(null),[n,i]=se.useState(),[a,o]=se.useState(!1),[s,u]=se.useState(!1),h=se.useRef(t.height),f=e.selectedShapes.indexOf(t)>=0&&t.selectable,g=t.fontSize/3,{textVerticalResizeEnabled:v}=Si,p=P7(t.fontFamily),[y]=k7(e,t.fontFamily),_=t._editModeEnabled;Rp(r);const x=y?t.fontFamily:p!==t.fontFamily?p:"Arial",b=bf(t).fill,E=i4(t,{fontFamily:x,color:b});let{width:A,height:S}=function(te,V,B){return se.useMemo(()=>e4(te),[te,V.width,B])}(E,t,y);se.useEffect(()=>{if(!y)return;if(!t.height)return void e.history.ignore(()=>{t.set({height:S})});const{textOverflow:te}=Si;if(te!=="change-font-size"||a)te==="resize"&&(v&&t.height<S&&!a&&e.history.ignore(()=>{t.set({height:S})}),v||t.height===S||e.history.ignore(()=>{t.set({height:S})}));else{const V=(B=>{let D=B.fontSize;for(let U=1;U<50;U++){const X=i4(Object.assign(Object.assign({},B.toJSON()),{fontSize:D}),{fontFamily:B.fontFamily}),{height:ee}=e4(X);if(!(B.height&&ee>B.height||!Si.textSplitAllowed&&!B.curveEnabled&&hN({html:X})))break;D-=.5}return D})(t);V!==t.fontSize?e.history.ignore(()=>{t.set({fontSize:V})}):t.height!==S&&(v&&t.height<S?e.history.ignore(()=>{t.set({height:S})}):v||e.history.ignore(()=>{t.set({height:S})}))}});const k=se.useMemo(()=>{const te={lastArgs:null,lastResult:null};return async function(V){return te.lastArgs&&te.lastResult&&(B=te.lastArgs,D=V,JSON.stringify(B)===JSON.stringify(D))||(te.lastResult=await t4(V),te.lastArgs=Object.assign({},V)),te.lastResult;var B,D}},[]),I=se.useRef(0),O=se.useRef(null);se.useEffect(()=>{a||_||(async()=>{I.current++;const te=I.current;let V=pd(`text ${t.id} ${te}`);O.current&&O.current(),O.current=V,u(!0);let B=null;const D=a4?5:1;for(let U=0;U<D;U++){const X=U>0?k:t4;try{if(B=await X({skipCache:U>0,html:E,width:t.width||1,height:t.height||S||1,fontFamily:x,padding:g,pixelRatio:e._elementsPixelRatio,font:e.fonts.find(ee=>ee.fontFamily===x)||ny.find(ee=>ee.fontFamily===x)}),te!==I.current)return;if(a4&&xN(B)){await new Promise(ee=>setTimeout(ee,50*(U+1)));continue}break}catch(ee){console.error(ee),Mp(`Error rendering rich text with id ${t.id}`);break}}B?i(B):V?(V(),V=null):console.error("Finish function is called twice!"),u(!1)})()},[E,a,S,_,x,t.height,e._elementsPixelRatio,y]);const[M,F]=ym(s,300),[j]=ym(a,300,!0),T=j||M;se.useEffect(()=>{var te;if(!T)return zu(()=>{const V=r.current;Ms(V,t)});(te=r.current)===null||te===void 0||te.clearCache()},[n,T,t.shadowColor,t.shadowOffsetX,t.shadowOffsetY,t.shadowOpacity]),se.useEffect(()=>{n&&!s&&O.current&&(O.current(),O.current=null)},[n,s]),se.useLayoutEffect(()=>{if(!y||!t.curveEnabled)return;const te=new or.TextPath({data:uh(t.a.width,t.a.height,t.curvePower,t.a.fontSize),text:ns(t.text),letterSpacing:t.letterSpacing*t.a.fontSize,fontSize:t.a.fontSize,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontStyle:t.fontStyle,align:"center",textBaseline:"middle",fill:t.fill}),V=te.getSelfRect().width;if(V){const B=V-t.a.width,D=t.a.rotation*Math.PI/180,U=-B/2*Math.cos(D),X=-B/2*Math.sin(D);t.set({width:V,x:t.a.x+U,y:t.a.y+X})}te.destroy()},[y,t.curveEnabled,t.curvePower,t.text,t.fontSize,t.fontFamily,t.fontWeight,t.fontStyle,t.letterSpacing]),se.useEffect(()=>()=>{O.current&&O.current()},[]),se.useEffect(()=>{f||ns(t.text)!==""||!t.removable||t.placeholder||e.deleteElements([t.id])},[f]);let L=0;t.verticalAlign==="middle"&&(L=(t.height-S)/2),t.verticalAlign==="bottom"&&(L=t.height-S);const $=A7({fontLoaded:y,fontFamily:t.fontFamily,fontSize:t.fontSize,lineHeight:t.lineHeight}),q=Cf(),J=uh(t.a.width,S,t.curvePower,t.fontSize),ae=se.useRef(null),ie=se.useRef(null),Z=_&&t.strokeWidth>0&&!t.curveEnabled;return se.createElement(se.Fragment,null,se.createElement(Tn,{x:t.a.x,y:t.a.y,offsetX:t.backgroundPadding*(t.fontSize*$*.5),offsetY:t.backgroundPadding*(t.fontSize*$*.5),rotation:t.a.rotation,hideInExport:!t.showInExport,listening:!1,visible:t.backgroundEnabled,opacity:t.backgroundOpacity*t.a.opacity,fill:t.backgroundColor,width:t.a.width+t.backgroundPadding*(t.fontSize*$),height:t.a.height+t.backgroundPadding*(t.fontSize*$),cornerRadius:t.backgroundCornerRadius*(t.fontSize*$*.5)}),se.createElement(mp,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,data:J,stroke:"red",strokeWidth:1,visible:!1}),se.createElement(Tn,{ref:r,name:"element",x:t.a.x,y:t.a.y,listening:t.selectable,rotation:t.a.rotation,width:t.a.width,height:t.a.height,visible:!T,draggable:q?t.draggable&&f:t.draggable,preventDefault:!q||f,opacity:_?0:t.a.opacity,hideInExport:!t.showInExport,onDragMove:te=>{t.set({x:te.target.x(),y:te.target.y()})},onDragEnd:te=>{t.set({x:te.target.x(),y:te.target.y()})},id:t.id,onDblClick:te=>{t.contentEditable&&(ie.current={x:te.evt.clientX,y:te.evt.clientY},t.toggleEditMode(!0))},onDblTap:te=>{var V;if(t.contentEditable){const B=(V=te.evt.changedTouches)===null||V===void 0?void 0:V[0];ie.current=B?{x:B.clientX,y:B.clientY}:null,t.toggleEditMode(!0)}},onTransformStart:te=>{o(!0),h.current=t.height},onTransform:te=>{var V;const B=te.target,D=((V=B.getStage())===null||V===void 0?void 0:V.findOne("Transformer")).getActiveAnchor(),U=D==="middle-left"||D==="middle-right",X=D==="top-center"||D==="bottom-center",ee=B.scaleX();if(U){const K=B.scaleX(),oe=B.width()*K,me=t.fontSize;let de=oe;if(oe<me&&(de=me,ae.current&&B.position(ae.current)),B.width(de),B.scaleX(1),Si.textVerticalResizeEnabled){const ye=Math.max(S,h.current);t.set({height:ye})}t.set({width:B.width(),x:B.x(),y:B.y()})}else if(X){let K=Si.textOverflow==="resize"?S:t.lineHeight*t.fontSize;const oe=Math.max(K,te.target.height()*te.target.scaleY());B.scaleY(1),t.set({x:B.x(),y:B.y(),height:oe,rotation:B.rotation()})}else B.scaleX(1),B.scaleY(1),t.set({fontSize:t.fontSize*ee,letterSpacing:t.letterSpacing,width:B.width()*ee,x:B.x(),y:B.y(),rotation:B.rotation(),height:B.height()*ee});ae.current=te.target.position()},onTransformEnd:te=>{o(!1),u(!0);const V=te.target.scaleX();te.target.scaleX(1),te.target.scaleY(1),t.set({fontSize:t.fontSize*V,width:te.target.width()*V,x:te.target.x(),y:te.target.y(),rotation:te.target.rotation(),shadowBlur:t.shadowBlur*V,shadowOffsetX:t.shadowOffsetX*V,shadowOffsetY:t.shadowOffsetY*V,strokeWidth:t.strokeWidth*V})}}),se.createElement(Tu,{ref:r,image:n,x:t.a.x,y:t.a.y,offsetX:g,offsetY:g-L,listening:!1,rotation:t.a.rotation,width:t.a.width+2*g,height:(t.a.width+2*g)*(n?.height/n?.width||1),visible:!T&&!_,opacity:t.a.opacity,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,hideInExport:!t.showInExport,editModeEnabled:t._editModeEnabled||a||T}),(T||Z)&&se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,offsetY:-L},se.createElement(m0,{divProps:{style:{pointerEvents:"none"}}},se.createElement(G7,{dangerouslySetInnerHTML:{__html:E},style:{pointerEvents:"none",opacity:t.a.opacity,textShadow:t.shadowEnabled?`${t.shadowOffsetX}px ${t.shadowOffsetY}px ${t.shadowBlur}px ${t.shadowColor}`:void 0}}))),_&&se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,offsetY:-L},se.createElement(m0,null,se.createElement(_N,{html:E,element:t,onChange:te=>{const V=S7({oldText:ns(t.text),newText:ns(te),element:t});t.set({text:te,fontSize:V})},onBlur:te=>{t.toggleEditMode(!1),F(!0)},clickCoords:ie.current}))))});function EN(t,e){if(!t||!e)return;const{x:r,y:n}=e;try{let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(r,n);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r,n);a&&(i=document.createRange(),i.setStart(a.offsetNode,a.offset))}if(i){const a=N7.find(i.startContainer,!0);if(a){const o=a.offset(t.scroll)+i.startOffset;return void t.setSelection(o,0,"api")}}}catch{}t.setSelection(0,0,"api")}function vy(t){return t/180*Math.PI}function L1(t,e,r,n,i){const a=Math.sqrt(r*r+n*n);return i+=Math.atan2(n,r),{x:t+a*Math.cos(i),y:e+a*Math.sin(i)}}function kd(t){const{x:e,y:r,width:n,height:i}=t,a=vy(t.rotation),o=L1(e,r,0,0,a),s=L1(e,r,n,0,a),u=L1(e,r,n,i,a),h=L1(e,r,0,i,a),f=Math.min(o.x,s.x,u.x,h.x),g=Math.min(o.y,s.y,u.y,h.y),v=Math.max(o.x,s.x,u.x,h.x),p=Math.max(o.y,s.y,u.y,h.y);return{x:f,y:g,width:v-f,height:p-g,minX:f,minY:g,maxX:v,maxY:p}}function Z0(t){const e=t.map(o=>kd(o)),r=Math.min(...e.map(o=>o.minX)),n=Math.min(...e.map(o=>o.minY)),i=Math.max(...e.map(o=>o.maxX)),a=Math.max(...e.map(o=>o.maxY));return{x:r,y:n,width:i-r,height:a-n,minX:r,minY:n,maxX:i,maxY:a}}function kN(t){const e=vy(t.rotation||0);return{x:t.x+t.width/2*Math.cos(e)+t.height/2*Math.sin(-e),y:t.y+t.height/2*Math.cos(e)+t.width/2*Math.sin(e)}}function AN(t,e,r){const n=vy(e),i=r.x+(t.x-r.x)*Math.cos(n)-(t.y-r.y)*Math.sin(n),a=r.y+(t.x-r.x)*Math.sin(n)+(t.y-r.y)*Math.cos(n);return Object.assign(Object.assign({},t),{rotation:t.rotation+e,x:i,y:a})}function PN(t,e){return AN(t,e,kN(t))}const ts={stroke:"rgb(0, 161, 255)",strokeWidth:1,dash:[4,6]},ON=({stroke:t,strokeWidth:e,dash:r})=>{t!==void 0&&(ts.stroke=t),e!==void 0&&(ts.strokeWidth=e),r!==void 0&&(ts.dash=r)};let o4=({targetKonvaNodes:t,guideKonvaNode:e,distance:r,snapDirection:n})=>r<5;function _m(t,e){var r=[],n=[];t.vertical.forEach(h=>{e.vertical.forEach(f=>{var g=Math.abs(h.offset-f.guide);o4({targetKonvaNodes:f.nodes,guideKonvaNode:h.node,distance:g,snapDirection:h.snap})&&r.push({lineGuide:h.offset,diff:g,snap:f.snap,offset:f.offset})})}),t.horizontal.forEach(h=>{e.horizontal.forEach(f=>{var g=Math.abs(h.offset-f.guide);o4({targetKonvaNodes:f.nodes,guideKonvaNode:h.node,distance:g,snapDirection:h.snap})&&n.push({lineGuide:h.offset,diff:g,snap:f.snap,offset:f.offset})})});var i=[];const a=r.sort((h,f)=>h.diff-f.diff),o=n.sort((h,f)=>h.diff-f.diff);var s=a[0],u=o[0];return s&&a.filter(h=>Math.abs(h.diff-s.diff)<.1).forEach(h=>{i.push(Object.assign({orientation:"V"},h))}),u&&o.filter(h=>Math.abs(h.diff-u.diff)<.1).forEach(h=>{i.push(Object.assign({orientation:"H"},h))}),i}const W7=()=>{if(or.DD._dragElements.size===0)return;const t=[...or.DD._dragElements.entries()],e=t.find(([r,n])=>n.node instanceof or.Transformer);e&&(t.splice(t.indexOf(e),1),t.unshift(e),or.DD._dragElements.clear(),t.forEach(([r,n])=>{or.DD._dragElements.set(r,n)}))};function CN(t,e,r){const n=se.useRef(null);ON(r);const i=f=>f.hasName("element")||f.hasName("page-background")||!n.current&&f.hasName("elements-area");function a(f){var g;const v=(g=t.current)===null||g===void 0?void 0:g.getStage(),p=[],y=[];return v.find(i).forEach(_=>{if(!(f.indexOf(_)>=0)){var x=_.getClientRect({skipShadow:!0,skipStroke:!0});p.push({offset:x.x,node:_,snap:"start"},{offset:x.x+x.width,node:_,snap:"end"},{offset:x.x+x.width/2,node:_,snap:"center"}),y.push({offset:x.y,node:_,snap:"start"},{offset:x.y+x.height,node:_,snap:"end"},{offset:x.y+x.height/2,node:_,snap:"center"})}}),{vertical:p,horizontal:y}}function o(f){var g;const v=(g=t.current)===null||g===void 0?void 0:g.getLayer(),p=v?.children.find(y=>y.name()==="line-guides");f.forEach(y=>{if(y.orientation==="H"){var _=new or.Line({x:-v.getStage().x(),y:-v.getStage().y(),points:[-6e3,y.lineGuide,6e3,y.lineGuide],stroke:ts.stroke,strokeWidth:ts.strokeWidth,name:"guid-line",dash:ts.dash});p?.add(_),v.batchDraw()}else y.orientation==="V"&&(_=new or.Line({x:-v.getStage().x(),y:-v.getStage().y(),points:[y.lineGuide,-6e3,y.lineGuide,6e3],stroke:ts.stroke,strokeWidth:ts.strokeWidth,name:"guid-line",dash:ts.dash}),p?.add(_))})}const s=f=>{const g=f.target.getLayer().children.find(A=>A.name()==="line-guides");g?.destroyChildren();var v=a(f.target.nodes()),p=function(A){const S=A.__getNodeRect(),k=kd(Object.assign(Object.assign({},S),{rotation:or.Util.radToDeg(S.rotation)})),I=A.getAbsolutePosition();return{vertical:[{guide:k.x,offset:I.x-k.x,snap:"start",nodes:A.nodes()},{guide:k.x+k.width/2,offset:I.x-k.x-k.width/2,snap:"center",nodes:A.nodes()},{guide:k.x+k.width,offset:I.x-k.x-k.width,snap:"end",nodes:A.nodes()}],horizontal:[{guide:k.y,offset:I.y-k.y,snap:"start",nodes:A.nodes()},{guide:k.y+k.height/2,offset:I.y-k.y-k.height/2,snap:"center",nodes:A.nodes()},{guide:k.y+k.height,offset:I.y-k.y-k.height,snap:"end",nodes:A.nodes()}]}}(f.target),y=_m(v,p);if(!y.length)return;o(y);const _=f.target.getAbsolutePosition(),x=(f.target.nodes().map(A=>A.getAbsolutePosition()),Object.assign({},_));y.forEach(A=>{switch(A.snap){case"start":case"center":case"end":switch(A.orientation){case"V":x.x=A.lineGuide+A.offset;break;case"H":x.y=A.lineGuide+A.offset}}});const b=x.x-_.x,E=x.y-_.y;f.evt.ctrlKey||f.evt.metaKey||f.target.nodes().forEach(A=>{const S=A.getAbsolutePosition();A.setAbsolutePosition({x:S.x+b,y:S.y+E})})},u=(f,g,v)=>{var p;const y=t.current,_=y.getLayer().children.find(M=>M.name()==="line-guides");if(_?.destroyChildren(),y.getActiveAnchor()==="rotater")return g;const x=y.getActiveAnchor(),b=LN[x],E=(p=y.findOne(`.${b}`))===null||p===void 0?void 0:p.getAbsolutePosition();if(!E)return g;const A={x:f.x-E.x,y:f.y-E.y},S=function(M,F){const j=l4(M,F)/l4(F,F);return{x:j*F.x,y:j*F.y}}({x:g.x-f.x,y:g.y-f.y},A),k={x:f.x+S.x,y:f.y+S.y};var I=_m(a(y.nodes()),{vertical:[{guide:k.x,offset:0,snap:"start",nodes:y.nodes()}],horizontal:[{guide:k.y,offset:0,snap:"start",nodes:y.nodes()}]});if(!I.length||(o(I),v.ctrlKey||v.metaKey))return g;const O=[];if(I.forEach(M=>{const F=function(j,T,L){if(L.orientation==="V"){const $=L.lineGuide;if(Math.abs(T.x-j.x)<1e-4)return null;const q=(T.y-j.y)/(T.x-j.x);return{x:$,y:q*$+(j.y-q*j.x)}}{const $=L.lineGuide;if(Math.abs(T.y-j.y)<1e-4)return null;const q=(T.y-j.y)/(T.x-j.x);return{x:($-j.y)/q+j.x,y:$}}}(k,E,{orientation:M.orientation,lineGuide:M.lineGuide});F&&O.push(F)}),O.length>0){let M=O[0],F=Math.sqrt(Math.pow(k.x-M.x,2)+Math.pow(k.y-M.y,2));if(O.forEach(j=>{const T=Math.sqrt(Math.pow(k.x-j.x,2)+Math.pow(k.y-j.y,2));T<F&&(F=T,M=j)}),F<10)return M}return k},h=f=>{if(!f.target)return;const g=f.target.getLayer(),v=g.children.find(p=>p.name()==="line-guides");v?.destroyChildren(),g.batchDraw()};se.useEffect(()=>{t.current&&(t.current.anchorDragBoundFunc(u),t.current.on("dragstart",f=>{setTimeout(()=>{W7()})}),t.current.on("dragmove",s),t.current.on("dragend",h),t.current.on("transformend",h),t.current.on("transform",f=>{var g,v;f.evt.ctrlKey||f.evt.metaKey?(g=t.current)===null||g===void 0||g.rotationSnapTolerance(0):(v=t.current)===null||v===void 0||v.rotationSnapTolerance(5)}))},[])}function s4(t,e,r){const n=o=>o.hasName("element")||o.hasName("line-anchor")||o.hasName("page-background")||o.hasName("elements-area"),i=o=>{const s=o.target.getLayer().children.find(y=>y.name()==="line-guides");s?.destroyChildren();var u,h=_m(function(y){var _;const x=(_=t.current)===null||_===void 0?void 0:_.getStage();var b=[],E=[];return x.find(n).forEach(A=>{if(!(y.indexOf(A)>=0)){var S=A.getClientRect({skipShadow:!0,skipStroke:!0});A.hasName("line-anchor")&&(S={x:A.absolutePosition().x,y:A.absolutePosition().y,width:0,height:0}),b.push({offset:S.x,node:A,snap:"start"},{offset:S.x+S.width,node:A,snap:"end"},{offset:S.x+S.width/2,node:A,snap:"center"}),E.push({offset:S.y,node:A,snap:"start"},{offset:S.y+S.height,node:A,snap:"end"},{offset:S.y+S.height/2,node:A,snap:"center"})}}),{vertical:b,horizontal:E}}([o.target,...e.map(y=>y.current)]),{vertical:[{guide:(u=o.target).absolutePosition().x,offset:0,snap:"center",nodes:[u]}],horizontal:[{guide:u.absolutePosition().y,offset:0,snap:"center",nodes:[u]}]});if(!h.length)return;(function(y){var _;const x=(_=t.current)===null||_===void 0?void 0:_.getLayer(),b=x?.children.find(E=>E.name()==="line-guides");y.forEach(E=>{if(E.orientation==="H"){var A=new or.Line({points:[-6e3,E.lineGuide,6e3,E.lineGuide],stroke:ts.stroke,strokeWidth:ts.strokeWidth,name:"guid-line",dash:ts.dash});b?.add(A),x.batchDraw()}else E.orientation==="V"&&(A=new or.Line({points:[E.lineGuide,-6e3,E.lineGuide,6e3],stroke:ts.stroke,strokeWidth:ts.strokeWidth,name:"guid-line",dash:ts.dash}),b?.add(A))})})(h);const f=o.target.getAbsolutePosition(),g=Object.assign({},f);h.forEach(y=>{switch(y.snap){case"start":case"center":case"end":switch(y.orientation){case"V":g.x=y.lineGuide+y.offset;break;case"H":g.y=y.lineGuide+y.offset}}});const v=g.x-f.x,p=g.y-f.y;if(!o.evt.ctrlKey&&!o.evt.metaKey){const y=o.target.getAbsolutePosition();o.target.absolutePosition({x:y.x+v,y:y.y+p})}},a=o=>{if(!o.target)return;const s=o.target.getLayer(),u=s.children.find(h=>h.name()==="line-guides");u?.destroyChildren(),s.batchDraw()};se.useEffect(()=>{t.current&&(t.current.on("dragmove",i),t.current.on("dragend",a))},r)}function l4(t,e){return t.x*e.x+t.y*e.y}const LN={"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 NN(t){const{x:e,y:r,width:n,height:i,rotation:a}=t.a,o=a*Math.PI/180,s={x:e+i/2*Math.cos(o+Math.PI/2),y:r+i/2*Math.sin(o+Math.PI/2)};return{middleLeft:s,middleRight:{x:s.x+n*Math.cos(o),y:s.y+n*Math.sin(o)}}}function u4(t,e,r){const n=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),i=Math.atan2(e.y-t.y,e.x-t.x),a=180*i/Math.PI;return{x:t.x+Math.cos(i-Math.PI/2)*r/2,y:t.y+Math.sin(i-Math.PI/2)*r/2,width:n,height:r,rotation:a}}const c4=(t,e)=>({offsetX:5/t,offsetY:5/t,width:10/t,height:10/t,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:r=>{r.target.getStage().container().style.cursor="crosshair"},onMouseLeave:r=>{r.target.getStage().container().style.cursor=""},onDragStart:r=>{e.history.startTransaction()},onDragEnd:r=>{e.history.endTransaction()}}),f4=ni(({element:t,type:e})=>{const r=bf(t,t.a.color,"fill"),n=bf(t,t.a.color,"stroke"),i=Object.assign(Object.assign(Object.assign({strokeWidth:t.height,lineCap:"round",lineJoin:"round"},n),r),{opacity:t.a.opacity,hideInExport:!t.showInExport});return se.createElement(se.Fragment,null,e==="arrow"&&se.createElement(hf,Object.assign({points:[3*t.height,2*-t.height,0,0,3*t.height,2*t.height]},i)),e==="triangle"&&se.createElement(hf,Object.assign({points:[3*t.height,2*-t.height,0,0,3*t.height,2*t.height],closed:!0},i)),e==="bar"&&se.createElement(hf,Object.assign({points:[0,2*-t.height,0,2*t.height],closed:!0},i)),e==="square"&&se.createElement(hf,Object.assign({points:[0,2*-t.height,4*t.height,2*-t.height,4*t.height,2*t.height,0,2*t.height],closed:!0},i)),e==="circle"&&se.createElement(OP,Object.assign({x:2*t.height,y:0,radius:2*t.height},i)))}),TN=ni(({element:t,store:e})=>{const r=se.useRef(null),n=se.useRef(null),i=se.useRef(null),a=t.selectable||e.role==="admin",o=Cf(),s=e.selectedElements.indexOf(t)>=0&&e.selectedElements.length===1,u=e.selectedShapes.indexOf(t)>=0&&t.selectable,{middleLeft:h,middleRight:f}=NN(t);s4(n,[r],[s]),s4(i,[r],[s]);const g=bf(t,t.a.color,"stroke");return se.createElement(se.Fragment,null,se.createElement(hf,Object.assign({ref:r,name:"element",id:t.id,x:t.a.x,y:t.a.y,points:[0,0,t.a.width,0],offsetY:-t.a.height/2,strokeWidth:t.a.height,hitStrokeWidth:Math.max(t.a.height,20),dash:t.dash.map(v=>v*t.a.height)},g,{rotation:t.a.rotation,opacity:t.animated("opacity"),shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,listening:a,draggable:o?t.draggable&&u:t.draggable,preventDefault:!o||u,hideInExport:!t.showInExport,onDragMove:v=>{t.set({x:v.target.x(),y:v.target.y()})},onDragEnd:v=>{t.set({x:v.target.x(),y:v.target.y()})},onTransform:v=>{const p=v.target.scaleX();v.target.scaleX(1),v.target.scaleY(1),t.set({height:t.height*p,width:t.width*p,x:v.target.x(),y:v.target.y(),rotation:v.target.rotation()})}})),se.createElement(bn,{x:h.x,y:h.y,rotation:t.rotation,hideInExport:!t.showInExport},se.createElement(f4,{element:t,type:t.startHead})),se.createElement(bn,{x:f.x,y:f.y,rotation:t.rotation+180},se.createElement(f4,{element:t,type:t.endHead})),s&&t.resizable&&se.createElement(ry,{selector:".page-abs-container",enabled:!0},se.createElement(bn,{visible:s},se.createElement(Tn,Object.assign({x:h.x,y:h.y,ref:n,name:"line-anchor"},c4(e.scale,e),{onDragMove:v=>{const p=u4(v.target.position(),f,t.height);t.set({x:p.x,y:p.y,width:p.width,rotation:p.rotation})}})),se.createElement(Tn,Object.assign({x:f.x,y:f.y,ref:i,name:"line-anchor"},c4(e.scale,e),{onDragMove:v=>{const p=u4(h,v.target.position(),t.height);t.set({x:p.x,y:p.y,width:p.width,rotation:p.rotation})}})))))});function Sp(){return document.createElement("canvas")}const V7=new window.Image;V7.src=xh(`
|
|
297
|
-
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
298
|
-
<path opacity="0.6" d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" fill="white"/>
|
|
299
|
-
<path d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
300
|
-
</svg>
|
|
301
|
-
`);const Y7=new window.Image;Y7.src=xh(`
|
|
302
|
-
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
303
|
-
<path opacity="0.6" d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" fill="white"/>
|
|
304
|
-
<path opacity="0.6" d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" fill="white"/>
|
|
305
|
-
<path d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
306
|
-
<path d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
307
|
-
</svg>
|
|
308
|
-
`);const X7=(t,e,r,n,i=0,a=!1)=>{const o=Math.floor(Math.max(t.width*n,1)),s=Math.floor(Math.max(t.height*n,1)),u=Math.min(i*n,o/2,s/2),h=Math.max(t.width/r.width,t.height/r.height)*n,f=t.page._exportingOrRendering&&Si.imageDownScalingEnabled&&h<1&&!a,g=r.x===0&&r.y===0&&r.width===e?.width&&r.height===e?.height,v=se.useMemo(()=>{if(e&&e.width&&e.height)return g&&u===0&&!f?void 0:Sp()},[e,u,f,g]),p=()=>{if(!v||!e)return;v.width=o,v.height=s;const y=v.getContext("2d");if(!y)return;u&&(y.beginPath(),y.moveTo(u,0),y.lineTo(o-u,0),y.arc(o-u,u,u,3*Math.PI/2,0,!1),y.lineTo(o,s-u),y.arc(o-u,s-u,u,0,Math.PI/2,!1),y.lineTo(u,s),y.arc(u,s-u,u,Math.PI/2,Math.PI,!1),y.lineTo(0,u),y.arc(u,u,u,Math.PI,3*Math.PI/2,!1),y.clip());const _=f?function(b,E){var A,S;const k=Sp();k.width=b.width,k.height=b.height,(A=k.getContext("2d"))===null||A===void 0||A.drawImage(b,0,0,k.width,k.height);const I=function(O,M,F,j,T,L,$){for(var q=new ImageData(M,F),J=new Int32Array(O.data.buffer),ae=O.width,ie=new Int32Array(q.data.buffer),Z=q.width,te=M/L,V=F/$,B=Math.round(1/te),D=Math.round(1/V),U=B*D,X=0;X<q.height;X++)for(var ee=0;ee<Z;ee++){for(var K=0+Math.round(ee/te)+(0+Math.round(X/V))*ae,oe=0,me=0,de=0,ye=0,Te=0;Te<D;Te++)for(var Ce=0;Ce<B;Ce++){var Ie=J[K+Ce+Te*ae];oe+=Ie<<24>>>24,me+=Ie<<16>>>24,de+=Ie<<8>>>24,ye+=Ie>>>24}oe=Math.round(oe/U),me=Math.round(me/U),de=Math.round(de/U),ye=Math.round(ye/U),ie[ee+X*Z]=ye<<24|de<<16|me<<8|oe}return q}(k.getContext("2d").getImageData(0,0,k.width,k.height),Math.floor(k.width*E),Math.floor(k.height*E),0,0,k.width,k.height);return k.width=Math.floor(k.width*E),k.height=Math.floor(k.height*E),(S=k.getContext("2d"))===null||S===void 0||S.putImageData(I,0,0),k}(e,h):e,x=f?{x:Math.floor(r.x*h),y:Math.floor(r.y*h),width:Math.floor(r.width*h),height:Math.floor(r.height*h)}:r;y.drawImage(_,x.x,x.y,x.width,x.height,0,0,v.width,v.height)};return se.useLayoutEffect(()=>{p()},[v,t.width,t.height,r.x,r.y,r.width,r.height,i,n,a,t.page._exportingOrRendering,f]),se.useEffect(()=>()=>{v&&v.nodeName==="CANVAS"&&or.Util.releaseCanvas(v)},[v]),[v||e,p]},RN=Sp(),MN=ni(({element:t})=>{const e=Math.min(30,t.width/4,t.height/4),r=se.useRef(null);return se.useEffect(()=>{const n=r.current;if(!n)return;const i=new or.Animation(a=>{n.rotate((a?.timeDiff||0)/2)},n.getLayer());return i.start(),()=>{i.stop()}}),se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tn,{width:t.width,height:t.height,fill:"rgba(124, 173, 212, 0.8)"}),se.createElement(ey,{ref:r,x:t.width/2,y:t.height/2,fill:"white",outerRadius:Math.abs(e),innerRadius:Math.max(1,e-5),angle:270}))}),IN=ni(({element:t})=>{const e=Math.max(10,Math.min(30,t.width/25));return se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tn,{width:t.width,height:t.height,fill:"rgba(223, 102, 102, 0.8)"}),se.createElement(Fu,{text:"Can not load the video...",fontSize:e,width:t.width,height:t.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let jN=function(t,e,r){const n=se.useRef("loading"),i=se.useRef(null),[a,o]=se.useState(0),s=se.useRef(),u=se.useRef(),h=se.useRef();return s.current===t&&u.current===e&&h.current===r||(n.current="loading",i.current=void 0,s.current=t,u.current=e,h.current=r),se.useLayoutEffect(function(){if(t){var f=document.createElement("video");return f.addEventListener("canplay",g),f.addEventListener("error",v),f.crossOrigin=e,f.src=t,f.load(),function(){f.removeEventListener("canplay",g),f.removeEventListener("error",v)}}function g(){n.current="loaded",i.current=f,i.current.currentTime=0,o(Math.random()),i.current.removeEventListener("canplay",g)}function v(p){var y;const _=f.readyState===4,x=f.buffered&&f.buffered.length>0&&f.buffered.end(f.buffered.length-1)/f.duration*100>=100;if(_&&x)return;const b=p.message||((y=f.error)===null||y===void 0?void 0:y.message)||"Unknown error",E=new Error("Video failed to load: "+b);console.error(E),n.current="failed",i.current=void 0,o(Math.random())}},[t,e,r]),[i.current,n.current]};function h4(t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA}const d4=(t,e,r)=>{const n=se.useRef(),i=()=>{var a;(a=n.current)===null||a===void 0||a.call(n),n.current=void 0};se.useEffect(()=>i,[]),se.useLayoutEffect(()=>{const a=e.slice(0,200),o=`video with id ${r} url: ${a}`;t!=="loading"||n.current||(n.current=pd(o)),t!=="loading"&&i(),t==="failed"&&Mp(o)},[t])},DN=ni(({element:t,store:e})=>{var r;const[n,i]=se.useState(!1),a=se.useRef(null),o=se.useRef(null),s=e.selectedShapes.indexOf(t)>=0&&t.selectable,[u,h]=se.useState(!1),[f,g]=jN(t.src,"anonymous"),[v,p]=se.useState(!1),y=e.activePage===t.page;d4(g,t.src,t.id),f&&(f.width=f.videoWidth,f.height=f.videoHeight,f.playsInline=!0);const _=f||RN;se.useEffect(()=>{f&&e.history.ignore(()=>{t.set({duration:1e3*f.duration})})},[f]),se.useEffect(()=>{var Ce;if(!f)return;const Ie=e.animatedElementsIds,Ee=(!Ie.length||Ie.includes(t.id))&&e.isPlaying,ge=y&&(Ee||u);if(!ge)return void f.pause();ge&&(f.currentTime=t.startTime*f.duration,f.play());const Re=new or.Animation(()=>{Z()},(Ce=a.current)===null||Ce===void 0?void 0:Ce.getLayer());Re.start();const Be=()=>{h(!1),f.currentTime=t.startTime*f.duration},Oe=()=>{f.currentTime>=t.endTime*f.duration&&(f.pause(),f.currentTime=t.startTime*f.duration,h(!1))};return f.addEventListener("ended",Be),f.addEventListener("timeupdate",Oe),()=>{f.pause(),Re.stop(),f.removeEventListener("ended",Be),f.removeEventListener("timeupdate",Oe)}},[f,u,e.isPlaying,y]),se.useEffect(()=>{f&&(f.volume=t.volume)},[f,t.volume]);const x=se.useRef();se.useEffect(()=>{const Ce=zu(()=>{var Ie,Ee;if(f){const ge=e.animatedElementsIds;if(ge.length&&!ge.includes(t.id))return;const Re=t.startTime*f.duration*1e3,Be=f.duration*(t.endTime-t.startTime)*1e3,Oe=((e.currentTime||t.page.startTime)-t.page.startTime)%Be+Re;if(Math.abs(1e3*f.currentTime-Oe)>500||!e.isPlaying){const fe=Oe/1e3;fe!==f.currentTime&&(f.currentTime=fe),!h4(f)&&!e.isPlaying&&!x.current&&(x.current=pd(`video ${t.id}`))}Z(),(Ee=(Ie=a.current)===null||Ie===void 0?void 0:Ie.getLayer())===null||Ee===void 0||Ee.batchDraw()}});return()=>{Ce(),x.current&&(x.current(),x.current=null)}},[e,f]),se.useEffect(()=>{if(!f)return;const Ce=()=>{var Ee,ge;!h4(f)&&t.page._exportingOrRendering||x.current&&(Z(),(ge=(Ee=a.current)===null||Ee===void 0?void 0:Ee.getLayer())===null||ge===void 0||ge.batchDraw(),x.current(),x.current=null)};let Ie;return t.page._exportingOrRendering&&(Ie=setInterval(Ce,20)),f.addEventListener("timeupdate",Ce),f.addEventListener("canplay",Ce),()=>{clearInterval(Ie),f.removeEventListener("timeupdate",Ce),f.removeEventListener("canplay",Ce)}},[t.page._exportingOrRendering,f,t.id,pd]);let{cropX:b,cropY:E,cropWidth:A,cropHeight:S}=t;g!=="loaded"&&(b=E=0,A=S=1);const k=_.width*A,I=_.height*S,O=t.width/t.height;let M,F;const j=k/I,T=t.type==="svg";T?(M=k,F=I):O>=j?(M=k,F=k/O):(M=I*O,F=I);const L={x:_.width*b,y:_.height*E,width:M,height:F},$=(r=t.cornerRadius)!==null&&r!==void 0?r:0,[q,J]=X7(t,_,L,e._elementsPixelRatio,$,n||t._cropModeEnabled||t.type==="svg");let[ae,ie]=((Ce,Ie,Ee,ge)=>{const Re=(ue=>{const[Ae,Pe]=se.useState(ue);return se.useEffect(()=>{(async()=>{const Ue=await async function(st){if(!(st.indexOf("data:image/svg+xml")>=0||st.indexOf(".svg")>=0))return st;const dt=await jp(st),pt=ly(dt);return xh(pt)}(ue);Ue!==Ae&&Pe(Ue)})()},[ue]),Ae})(Ce.clipSrc||""),[Be,Oe]=ty(Re,"anonymous"),fe=Ce.clipSrc?Oe:"loaded";d4(fe,Ce.clipSrc,Ce.id);const Le=se.useMemo(()=>{if(Ie&&Be)return Sp()},[Ie,Be]);function Ne(){var ue;if(!Be||!Ie||!Ie.width||!Ie.height||!Be||!Be.width||!Be.height||!Le)return;const Ae=Sp(),Pe=Math.max(Ce.width/Be.width*Ee,Ce.height/Be.height*Ee);Ae.width=Be.width*Pe,Ae.height=Be.height*Pe,(ue=Ae.getContext("2d"))===null||ue===void 0||ue.drawImage(Be,0,0,Ae.width,Ae.height),Le.width=Math.max(Ie.width,1),Le.height=Math.max(Ie.height,1);const Ue=Le.getContext("2d");Ue&&(Ue.save(),Ue.drawImage(Ae,0,0,Ie.width,Ie.height),or.Util.releaseCanvas(Ae),Ue.globalCompositeOperation="source-in",Ue.drawImage(Ie,0,0,Le.width,Le.height),Ue.restore())}return se.useLayoutEffect(()=>{Ne()},[Le,Ie,Be,Ce.width,Ce.height,Ee,...ge]),[Ce.clipSrc&&Be?Le:Ie,Ne]})(t,q,e._elementsPixelRatio,[L,$,e._elementsPixelRatio]);function Z(){J(),ie()}const te=Math.max(t.width/M,t.height/F);se.useEffect(()=>{var Ce;if(!t._cropModeEnabled)return;const Ie=(Ce=a.current)===null||Ce===void 0?void 0:Ce.getStage();function Ee(Re){t._cropModeEnabled&&Re.target!==o.current&&t.toggleCropMode(!1)}function ge(Re){t._cropModeEnabled&&Re.target.parentNode!==Ie.content&&t.toggleCropMode(!1)}return document.body.addEventListener("click",ge),Ie?.on("click",Ee),Ie?.on("tap",Ee),()=>{document.body.removeEventListener("click",ge),document.body.removeEventListener("touchstart",ge),Ie?.off("click",Ee),Ie?.off("click",Ee)}},[t._cropModeEnabled]),se.useLayoutEffect(()=>{if(!n&&!t._cropModeEnabled)return Ms(a.current,t),zu(()=>{Ms(a.current,t)},{delay:100})},[_,n,A,S,t._cropModeEnabled]),se.useLayoutEffect(()=>{var Ce;n||t._cropModeEnabled?(Ce=a.current)===null||Ce===void 0||Ce.clearCache():Ms(a.current,t)},[n,t.width,t.height,t._cropModeEnabled]),se.useEffect(()=>{Ms(a.current,t)},[t.shadowEnabled,t.shadowBlur,t.cornerRadius,t.shadowColor,t.shadowOffsetX,t.shadowOffsetY,t.shadowOpacity]);const V=se.useRef(null),B=se.useRef(null),D=se.useRef(null);se.useLayoutEffect(()=>{t._cropModeEnabled&&(B.current.nodes([V.current]),D.current.nodes([o.current]))},[t._cropModeEnabled]);const U=Ce=>{Math.round(Ce.target.x())>0&&(Ce.target.x(0),Ce.target.scaleX(1)),Math.round(Ce.target.y())>0&&(Ce.target.y(0),Ce.target.scaleY(1));const Ie=Ce.target.width()*Ce.target.scaleX(),Ee=Ce.target.height()*Ce.target.scaleY(),ge=Math.min(1,M/Ie),Re=Math.min(1,F/Ee),Be=1-ge,Oe=Math.min(Be,Math.max(0,Math.round(-Ce.target.x())/Ie)),fe=1-Re,Le=Math.min(fe,Math.max(0,Math.round(-Ce.target.y())/Ee));Ce.target.setAttrs({x:-Oe*_.width,y:-Le*_.height,scaleX:1,scaleY:1}),t.set({cropX:Oe,cropY:Le,cropWidth:ge,cropHeight:Re})},X=()=>{t.type!=="svg"&&t.contentEditable&&setTimeout(()=>{t.toggleCropMode(!0)})},ee=g==="loading",K=g==="failed",oe=!ee&&!K,me=se.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),de=oe?t.a.opacity:0;Rp(a,de);const ye=t.selectable||e.role==="admin",Te=Cf();return se.createElement(se.Fragment,null,se.createElement(bn,{onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1)},ee&&se.createElement(MN,{element:t}),K&&se.createElement(IN,{element:t}),se.createElement(Tu,{ref:a,name:"element",id:t.id,image:ae,x:t.a.x,y:t.a.y,width:t.a.width||1,height:t.a.height||1,rotation:t.a.rotation,opacity:de,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,customCrop:L,listening:ye,draggable:Te?t.draggable&&s:t.draggable,preventDefault:!Te||s,hideInExport:!t.showInExport,onDragMove:Ce=>{t.set({x:Ce.target.x(),y:Ce.target.y()})},onDragEnd:Ce=>{t.set({x:Ce.target.x(),y:Ce.target.y()})},onDblClick:X,onDblTap:X,onTransformStart:()=>{i(!0),me.current={cropX:t.cropX,cropY:t.cropY,cropWidth:t.cropWidth,cropHeight:t.cropHeight}},onTransform:Ce=>{var Ie;const Ee=Ce.currentTarget,ge=Math.abs(Ee.scaleX()-1)<1e-7?1:Ee.scaleX(),Re=Math.abs(Ee.scaleY()-1)<1e-7?1:Ee.scaleY();Ee.scaleX(1),Ee.scaleY(1);const Be=(Ie=Ce.target.getStage())===null||Ie===void 0?void 0:Ie.findOne("Transformer"),Oe=1-M/_.width,fe=Math.min(Oe,Math.max(0,t.cropX)),Le=1-F/_.height,Ne=Math.min(Le,Math.max(0,t.cropY)),ue=Be.getActiveAnchor(),Ae=!(ue.indexOf("middle")>=0||ue.indexOf("center")>=0),Pe=!Ae&&ge<1&&me.current.cropHeight>F/_.height;let Ue=Ae?t.cropWidth:t.cropWidth*ge;Pe&&(Ue=t.cropWidth);const st=!Ae&&Re<1&&me.current.cropWidth>M/_.width;let dt=Ae?t.cropHeight:t.cropHeight*Re;st&&(dt=t.cropHeight),T&&(Ue=t.cropWidth,dt=t.cropHeight),t.set({cropX:fe,cropY:Ne,x:Ee.x(),y:Ee.y(),width:Ee.width()*ge,height:Ee.height()*Re,rotation:Ce.target.rotation(),cropWidth:Math.min(Ue,1-fe),cropHeight:Math.min(dt,1-Ne)})},onTransformEnd:Ce=>{const Ie=Ce.currentTarget;t.set({width:Ie.width(),height:Ie.height(),x:Ie.x(),y:Ie.y(),rotation:Ce.target.rotation(),cropWidth:M/_.width,cropHeight:F/_.height}),i(!1)}}),se.createElement(Tn,{x:t.a.x,y:t.a.y,width:Math.max(t.a.width-t.borderSize,0),height:Math.max(t.a.height-t.borderSize,0),opacity:de,offsetX:-t.borderSize/2,offsetY:-t.borderSize/2,stroke:t.borderColor,strokeWidth:t.borderSize,listening:!1,visible:!!t.borderSize,rotation:t.rotation,cornerRadius:Math.max(0,$-t.borderSize),hideInExport:!t.showInExport}),!e.isPlaying&&se.createElement(Tu,{image:u?(v||Te)&&Y7:V7,x:t.a.x,y:t.a.y,offsetX:-t.a.width/2+15/e.scale,offsetY:-t.a.height/2+15/e.scale,rotation:t.a.rotation,width:30/e.scale,height:30/e.scale,hideInExport:!0,onClick:()=>h(!u),onTap:()=>h(!u)}),t._cropModeEnabled&&se.createElement(ry,{selector:".page-abs-container",enabled:!0},se.createElement(Tn,{x:-window.innerWidth/e.scale,y:-window.innerWidth/e.scale,width:window.innerWidth/e.scale*3,height:window.innerWidth/e.scale*3,fill:"rgba(0,0,0,0.3)"}),se.createElement(Tu,{listening:!1,image:ae,x:t.a.x,y:t.a.y,width:t.a.width,height:t.a.height,rotation:t.a.rotation,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur}),se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,scaleX:te,scaleY:te},se.createElement(Tu,{image:_,ref:o,opacity:.4,draggable:!0,x:-t.cropX*_.width,y:-t.cropY*_.height,onDragMove:U,onTransform:U}),se.createElement(yp,{ref:D,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ce,Ie)=>Ie.width<5||Ie.height<5?Ce:Ie,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),se.createElement(Tn,{width:M,height:F,ref:V,listening:!1,onTransform:Ce=>{Ce.target.x()<-t.cropX*_.width-1e-9&&(Ce.target.x(-t.cropX*_.width),Ce.target.scaleX(1)),Ce.target.y()<-t.cropY*_.height-1e-9&&(Ce.target.y(-t.cropY*_.height),Ce.target.scaleY(1));const Ie=Math.min(1,Math.max(0,t.cropX+Ce.target.x()/_.width)),Ee=Math.min(1,Math.max(0,Ce.target.y()/_.height+t.cropY)),ge=Ce.target.width()*Ce.target.scaleX(),Re=Ce.target.height()*Ce.target.scaleY(),Be=Math.min(1-Ie,ge/_.width),Oe=Math.min(1-Ee,Re/_.height),fe=Ce.target.getAbsolutePosition(Ce.target.getParent().getParent());Ce.target.scale({x:1,y:1}),Ce.target.position({x:0,y:0}),t.set({x:fe.x,y:fe.y,cropX:Ie,cropY:Ee,cropWidth:Be,cropHeight:Oe,width:Math.min(ge*te,_.width*(1-Ie)*te),height:Math.min(Re*te,_.height*(1-Ee)*te)})}}),se.createElement(yp,{ref:B,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(Ce,Ie)=>Ie.width<5||Ie.height<5?Ce:Ie,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:t.resizable})))))}),my=({width:t,height:e,cornerRadius:r})=>{if(r>0){const n=Math.min(r,t/2,e/2);return`M 0 ${n} A ${n} ${n} 0 0 1 ${n} 0 L ${t-n} 0 A ${n} ${n} 0 0 1 ${t} ${n} L ${t} ${e-n} A ${n} ${n} 0 0 1 ${t-n} ${e} L ${n} ${e} A ${n} ${n} 0 0 1 0 ${e-n} Z`}return`M 0 0 L ${t} 0 L ${t} ${e} L 0 ${e} Z`},FN=({width:t,height:e})=>`M ${t/2} 0 L ${t} ${e} L 0 ${e} Z`,BN=({width:t,height:e})=>`M 0 0 L ${t} 0 L 0 ${e} Z`,zN=({width:t,height:e})=>`M ${t/2} ${e/2} m -${t/2}, 0 a ${t/2},${e/2} 0 1,0 ${t},0 a ${t/2},${e/2} 0 1,0 -${t},0`;function qN({width:t,height:e}){const r=t/2,n=e/2,i=t/2,a=e/2,o=i/2,s=a/2;let u="",h=Math.PI/5;for(let f=0;f<10;f++){const g=f%2==0?a:s,v=r+(f%2==0?i:o)*Math.sin(f*h),p=n-g*Math.cos(f*h);f===0?u=`M ${v} ${p}`:u+=` L ${v} ${p}`}return u+" Z"}function UN({width:t,height:e}){const r=t/2,n=e/2;return`M ${r} 0 L ${t} ${n} L ${r} ${e} L 0 ${n} Z`}function HN({width:t,height:e}){const r=t/2,n=e/2,i=t/2,a=e/2;let o="",s=2*Math.PI/5;for(let u=0;u<5;u++){const h=a,f=r+i*Math.sin(u*s),g=n-h*Math.cos(u*s);u===0?o=`M ${f} ${g}`:o+=` L ${f} ${g}`}return o+" Z"}function $N({width:t,height:e}){const r=t/2,n=e/2,i=t/2,a=e/2;let o="",s=2*Math.PI/6;for(let u=0;u<6;u++){const h=a,f=r+i*Math.sin(u*s),g=n-h*Math.cos(u*s);u===0?o=`M ${f} ${g}`:o+=` L ${f} ${g}`}return o+" Z"}function Mt({path:t,aspectRatio:e,width:r,height:n}){return{path:t,scaleX:r/e.width,scaleY:n/e.height}}function GN({width:t,height:e}){const r=.1*Math.min(t,e),n=.2*t,i=.2*e,a=.5*t;let o=`M ${r},0`;return o+=" H "+(t-r),o+=` A ${r},${r} 0 0 1 ${t},${r}`,o+=" V "+(e-r-i),o+=` A ${r},${r} 0 0 1 ${t-r},${e-i}`,o+=` H ${a+n/2}`,o+=` L ${a},${e}`,o+=` L ${a-n/2},${e-i}`,o+=` H ${r}`,o+=` A ${r},${r} 0 0 1 0,${e-r-i}`,o+=` V ${r}`,o+=` A ${r},${r} 0 0 1 ${r},0`,o+=" Z",o}function WN({width:t,height:e}){const r=.3*t,n=.3*e,i=t/2,a=e/2,o=i-r/2,s=i+r/2,u=a-n/2,h=a+n/2;let f=`M ${o},0 `;return f+=`H ${s} `,f+=`V ${u} `,f+=`H ${t} `,f+=`V ${h} `,f+=`H ${s} `,f+=`V ${e} `,f+=`H ${o} `,f+=`V ${h} `,f+="H 0 ",f+=`V ${u} `,f+=`H ${o} `,f+="V 0 ",f+="Z",f}const VN={rect:my,circle:zN,star:qN,triangle:FN,rightTriangle:BN,diamond:UN,pentagon:HN,hexagon:$N,speechBubble:GN,cross:WN,arc:({width:t,height:e})=>Mt({path:"M234 117C234 85.97 221.673 56.21 199.731 34.269C177.79 12.327 148.03 0 117 0C85.97 0 56.2103 12.327 34.2685 34.268C12.3268 56.21 0 85.97 0 117H117H234Z",aspectRatio:{width:234,height:117},width:t,height:e}),cloud:({width:t,height:e})=>Mt({path:"M216.41 57.006C216.961 54.084 217.249 51.069 217.249 47.986C217.249 21.4841 195.972 0 169.725 0C153.666 0 139.467 8.043 130.865 20.3575C122.606 13.3566 111.954 9.1402 100.327 9.1402C74.3322 9.1402 53.2123 30.2136 52.8094 56.364H52.8035C23.6407 56.364 0 80.235 0 109.682C0 139.129 23.6407 163 52.8035 163H208.197C237.359 163 261 139.129 261 109.682C261 83.056 241.672 60.99 216.41 57.006Z",aspectRatio:{width:261,height:163},width:t,height:e}),rightArrow:({width:t,height:e})=>{const r=.6*t;return`M 0 ${e/4} L ${r} ${e/4} L ${r} 0 L ${t} ${e/2} L ${r} ${e} L ${r} ${.75*e} L 0 ${.75*e} Z`},leftArrow:({width:t,height:e})=>{const r=.4*t;return`M ${t} ${e/4} L ${r} ${e/4} L ${r} 0 L 0 ${e/2} L ${r} ${e} L ${r} ${.75*e} L ${t} ${.75*e} Z`},downArrow:({width:t,height:e})=>{const r=.6*e;return`M ${t/4} 0 L ${t/4} ${r} L 0 ${r} L ${t/2} ${e} L ${t} ${r} L ${.75*t} ${r} L ${.75*t} 0 Z`},upArrow:({width:t,height:e})=>{const r=.4*e;return`M ${t/4} ${e} L ${t/4} ${r} L 0 ${r} L ${t/2} 0 L ${t} ${r} L ${.75*t} ${r} L ${.75*t} ${e} Z`},asterisk1:({width:t,height:e})=>Mt({path:"M45.5265 218.498C51.5466 222.87 58.5359 224.98 65.4742 224.98C75.916 224.98 86.221 220.2 92.853 211.217C92.872 211.198 92.89 211.178 92.907 211.157C92.923 211.136 92.939 211.115 92.954 211.094L92.977 211.061C92.993 211.039 93.008 211.017 93.023 210.996L116.491 178.725L139.959 210.996C139.982 211.031 140.006 211.058 140.029 211.088C140.04 211.102 140.05 211.116 140.061 211.132C151.115 226.188 172.355 229.505 187.473 218.515C202.608 207.526 205.992 186.278 195.074 171.104L195.05 171.066C195.03 171.034 195.014 171.01 194.989 170.985L171.572 138.696L209.512 126.346C227.334 120.545 237.129 101.305 231.33 83.476C225.532 65.648 206.315 55.8493 188.476 61.6334L150.537 73.933L150.52 34.0064C150.502 15.2594 135.248 0 116.508 0C97.768 0 82.514 15.2594 82.497 34.0234L82.463 73.916L44.5233 61.6163C44.5083 61.6163 44.49 61.613 44.4716 61.6078C44.4477 61.6014 44.4232 61.5918 44.4041 61.5823C26.5992 55.8664 7.45076 65.665 1.66886 83.46C-4.11314 101.254 5.61427 120.426 23.3511 126.278C23.3675 126.283 23.3822 126.289 23.3963 126.295L23.4588 126.319L23.4873 126.329L61.4098 138.679L37.9929 170.968C37.9844 170.985 37.9718 171.002 37.9591 171.019C37.9462 171.036 37.9336 171.053 37.9251 171.07C26.9903 186.244 30.3915 207.509 45.5265 218.498Z",aspectRatio:{width:233,height:225},width:t,height:e}),asterisk2:({width:t,height:e})=>Mt({path:"M46.0556 112L0 85.388L33.9456 26.6121L80.028 53.1781L80.054 0H147.946L147.972 53.1781L194.054 26.6121L228 85.388L181.944 112L228 138.612L194.054 197.388L147.972 170.822L147.946 224H80.054L80.028 170.822L33.9456 197.388L0 138.612L46.0556 112Z",aspectRatio:{width:228,height:224},width:t,height:e}),bookmark:({width:t,height:e})=>Mt({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:t,height:e}),butterfly:({width:t,height:e})=>Mt({path:"M94.5 100.713C91.935 150.916 50.703 190.909 0 191.493V0C50.703 0.5845 91.935 40.5767 94.5 90.78C97.031 41.2385 137.217 1.6407 187 0.0438004V191.45C137.217 189.853 97.031 150.255 94.5 100.713Z",aspectRatio:{width:187,height:192},width:t,height:e}),cylinder:({width:t,height:e})=>Mt({path:"M169 36.8497V218.15C169 238.502 131.168 255 84.5 255C37.832 255 0 238.502 0 218.15V36.8497C0 16.4982 37.832 0 84.5 0C131.168 0 169 16.4982 169 36.8497Z",aspectRatio:{width:169,height:255},width:t,height:e}),diamond2:({width:t,height:e})=>Mt({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:t,height:e}),door:({width:t,height:e})=>Mt({path:"M140 69.697C140 31.2044 108.66 0 70 0C31.34 0 0 31.2044 0 69.697V207H140V69.697Z",aspectRatio:{width:140,height:207},width:t,height:e}),drop1:({width:t,height:e})=>Mt({path:"M167 150.687C167 196.328 129.407 234 83.139 234C37.593 234 0 196.328 0 150.687C0 100.7 51.329 36.9474 83.139 0C114.948 39.1207 167 98.526 167 150.687Z",aspectRatio:{width:167,height:234},width:t,height:e}),drop2:({width:t,height:e})=>Mt({path:"M73 239C53.64 239 35.071 231.315 21.3812 217.634C7.691 203.954 0 185.4 0 166.054C0 136.091 13.8696 113.633 30.768 86.27C43.912 64.9877 58.888 40.7377 70.597 7.6816C71.281 5.7496 72.989 0 72.989 0C72.989 0 72.993 0.0124998 73 0.0363998C73.007 0.0124998 73.011 0 73.011 0C73.011 0 74.719 5.7496 75.403 7.6816C87.112 40.7377 102.088 64.9877 115.232 86.27C132.13 113.633 146 136.091 146 166.054C146 185.4 138.309 203.954 124.619 217.634C111.025 231.218 92.225 239 73 239Z",aspectRatio:{width:146,height:239},width:t,height:e}),explosion:({width:t,height:e})=>Mt({path:"M165.802 184.465L118.997 260L125.343 182.079L34.9058 219.45L99.164 159.817L0 163.792L78.538 134.373L0 74.7401L86.471 89.052V0L118.997 89.052L165.802 10.3364L149.143 97.798L217.368 29.419L165.802 112.905L245.927 81.101L165.802 143.914H261L165.802 184.465Z",aspectRatio:{width:261,height:260},width:t,height:e}),flag:({width:t,height:e})=>Mt({path:"M0 142.161C0 142.161 51.9956 118.626 103 137.469C159.992 158.525 206 141.31 206 141.31V11.1373C206 11.1373 160 28.3218 103.016 7.28273C52 -11.553 0 12.0974 0 12.0974V142.161Z",aspectRatio:{width:206,height:148},width:t,height:e}),flower:({width:t,height:e})=>Mt({path:"M135.351 66.1893C196.683 -5.00591 256.536 100.304 164.908 117.361C256.536 135.16 195.944 239.728 135.351 168.532C166.386 257.526 45.9394 256.785 76.975 168.532C15.643 239.728 -44.2109 135.16 47.4173 117.361C-44.9498 100.304 15.643 -4.26431 76.975 66.1893C45.2005 -22.0631 166.386 -22.0631 135.351 66.1893ZM105.793 104.012C113.183 104.012 119.833 109.945 119.833 117.361C119.833 124.777 113.183 131.452 105.793 131.452C98.404 131.452 92.492 124.777 92.492 117.361C92.492 109.945 98.404 104.012 105.793 104.012Z",aspectRatio:{width:212,height:235},width:t,height:e}),frame:({width:t,height:e})=>Mt({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:t,height:e}),heart1:({width:t,height:e})=>Mt({path:"M215.886 56.157C215.886 24.729 191.112 0 160.584 0C135.933 0 115.08 16.983 107.937 39.93C100.788 16.986 79.935 0.591 55.284 0.591C24.75 0.591 0 24.615 0 56.055C0 71.919 6.321 83.127 16.494 95.121L107.988 189.447L199.377 95.121C209.559 83.127 215.886 72.009 215.886 56.157Z",aspectRatio:{width:216,height:190},width:t,height:e}),home:({width:t,height:e})=>Mt({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:t,height:e}),home2:({width:t,height:e})=>Mt({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:t,height:e}),hourglass:({width:t,height:e})=>Mt({path:"M0.392782 0H187.607C193.014 43.3688 140.804 53.797 140.804 97.5C140.804 141.203 193.014 151.631 187.607 195H0.392782C-5.01452 151.631 47.196 141.203 47.196 97.5C47.196 53.797 -5.01452 43.3688 0.392782 0Z",aspectRatio:{width:188,height:195},width:t,height:e}),house:({width:t,height:e})=>Mt({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:t,height:e}),keyhole:({width:t,height:e})=>Mt({path:"M115 57.0494C115 25.5387 89.416 0 57.863 0C26.311 0 0.726898 25.5414 0.726898 57.0494C0.726898 78.652 12.759 97.451 30.505 107.136L0 219H114.845L84.448 107.524C102.608 97.962 115 78.959 115 57.0494Z",aspectRatio:{width:115,height:219},width:t,height:e}),kiss:({width:t,height:e})=>Mt({path:"M124.5 17.1468C80.036 -36.5162 0 52.9218 0 52.9218C0 52.9218 44.4643 120 124.5 120C204.536 120 249 52.9218 249 52.9218C249 52.9218 168.964 -36.5162 124.5 17.1468Z",aspectRatio:{width:249,height:120},width:t,height:e}),leaf:({width:t,height:e})=>Mt({path:"M204.414 0.0151567C204.414 0.0151567 206.837 93.9509 150.394 150.394C93.9507 206.837 0.0151569 204.413 0.0151569 204.413C0.0151569 204.413 -2.40835 110.478 54.0347 54.0349C110.478 -2.40834 204.414 0.0151567 204.414 0.0151567Z",aspectRatio:{width:205,height:205},width:t,height:e}),lightning1:({width:t,height:e})=>Mt({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:t,height:e}),lightning2:({width:t,height:e})=>Mt({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:t,height:e}),magnet:({width:t,height:e})=>Mt({path:"M88.402 0H0V67.669H88.402C105.271 67.669 118.957 81.308 118.957 98C118.957 114.689 105.271 128.331 88.402 128.331H0V196H88.402C142.747 196 187 152.072 187 98C187 43.9279 142.747 0 88.402 0Z",aspectRatio:{width:187,height:196},width:t,height:e}),mithosis:({width:t,height:e})=>Mt({path:"M150.996 136.45C137.141 128.926 117.559 128.7 103.532 135.896C93.843 140.867 82.875 143.67 71.2577 143.67C31.9033 143.67 0 111.508 0 71.835C0 32.161 31.9033 0 71.2577 0C83.467 0 94.959 3.0955 105.004 8.5504C118.859 16.0745 138.441 16.3 152.467 9.1038C162.157 4.1328 173.125 1.3303 184.742 1.3303C224.097 1.3303 256 33.492 256 73.165C256 112.839 224.097 145 184.742 145C172.533 145 161.041 141.905 150.996 136.45Z",aspectRatio:{width:256,height:145},width:t,height:e}),orangeRicky:({width:t,height:e})=>Mt({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:t,height:e}),party:({width:t,height:e})=>Mt({path:"M134.622 0L144.682 68.2539L174.415 5.9977L163.91 74.1846L210.671 23.4578L180.535 85.519L240.169 50.8289L193.079 101.25L260.29 85.679L200.43 119.98L269.245 124.911L201.934 140.044L266.237 165.04L197.456 159.661L251.535 202.5L187.396 177.086L226.445 233.962L172.646 190.771L193.197 256.631L154.518 199.501L154.743 268.492L134.622 202.5L114.501 268.492L114.727 199.501L76.0482 256.631L96.5985 190.771L42.7992 233.962L81.8489 177.086L17.7091 202.5L71.7885 159.661L3.0072 165.04L67.3112 140.044L0 124.911L68.8149 119.98L8.9545 85.679L76.1658 101.25L29.0753 50.8289L88.7105 85.519L58.5743 23.4578L105.335 74.1846L94.8305 5.9977L124.562 68.2539L134.622 0Z",aspectRatio:{width:270,height:269},width:t,height:e}),pillow:({width:t,height:e})=>Mt({path:"M176 0.00169945C157.812 16.9062 125.203 28.174 88.001 28.174C50.798 28.174 18.1881 16.9054 0 0V258.421C18.1882 241.516 50.798 230.248 88 230.248C125.202 230.248 157.812 241.516 176 258.421V0.00169945Z",aspectRatio:{width:176,height:259},width:t,height:e}),polygon:({width:t,height:e})=>Mt({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:t,height:e}),rainbow:({width:t,height:e})=>Mt({path:"M186.907 141H282C282 63.128 218.872 0 141 0C63.1278 0 0 63.128 0 141H95.093C95.093 115.646 115.646 95.093 141 95.093C166.354 95.093 186.907 115.646 186.907 141Z",aspectRatio:{width:282,height:141},width:t,height:e}),rhodeIsland:({width:t,height:e})=>Mt({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:t,height:e}),shell:({width:t,height:e})=>Mt({path:"M109 0C169.199 0 218 48.743 218 108.87C185.392 108.87 158.958 135.273 158.958 167.842C158.958 179.736 158.958 191 158.958 191H59.042C59.042 191 59.042 179.736 59.042 167.842C59.042 135.273 32.6077 108.87 0 108.87C0 48.743 48.8007 0 109 0Z",aspectRatio:{width:218,height:191},width:t,height:e}),shield1:({width:t,height:e})=>Mt({path:"M203.184 30.7277C142.457 30.7277 102.853 0 102.853 0C102.853 0 63.249 30.7277 3.05098 30.7277C3.05098 30.7277 -3.81372 128.209 3.05098 162.115C9.38758 193.902 102.853 249 102.853 249C102.853 249 196.319 193.902 203.184 162.115C209.52 128.738 203.184 30.7277 203.184 30.7277Z",aspectRatio:{width:206,height:249},width:t,height:e}),shield2:({width:t,height:e})=>Mt({path:"M0 12.9585C64.624 -4.3195 136.376 -4.3195 201 12.9585C201 51.0564 201 89.154 201 127.252C201 184.396 100.498 240 100.498 240C100.498 240 0 184.406 0 127.252C0 89.154 0 51.0564 0 12.9585Z",aspectRatio:{width:201,height:240},width:t,height:e}),skewedRectangle:({width:t,height:e})=>Mt({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:t,height:e}),softFlower:({width:t,height:e})=>Mt({path:"M109 0C80.073 0 56.6234 23.4498 56.6234 52.3766C56.6234 54.722 54.722 56.6234 52.3766 56.6234C23.4498 56.6234 0 80.073 0 109C0 137.927 23.4498 161.377 52.3766 161.377C54.722 161.377 56.6234 163.278 56.6234 165.623C56.6234 194.55 80.073 218 109 218C137.927 218 161.377 194.55 161.377 165.623C161.377 163.278 163.278 161.377 165.623 161.377C194.55 161.377 218 137.927 218 109C218 80.073 194.55 56.6234 165.623 56.6234C163.278 56.6234 161.377 54.722 161.377 52.3766C161.377 23.4498 137.927 0 109 0Z",aspectRatio:{width:218,height:218},width:t,height:e}),softStar:({width:t,height:e})=>Mt({path:"M130.424 3.17662C130.927 -1.05888 137.073 -1.05888 137.576 3.17662L141.792 38.7086C147.236 84.59 183.41 120.764 229.291 126.208L264.823 130.424C269.059 130.927 269.059 137.073 264.823 137.576L229.291 141.792C183.41 147.236 147.236 183.41 141.792 229.291L137.576 264.823C137.073 269.059 130.927 269.059 130.424 264.823L126.208 229.291C120.764 183.41 84.59 147.236 38.7086 141.792L3.17662 137.576C-1.05888 137.073 -1.05888 130.927 3.17662 130.424L38.7086 126.208C84.59 120.764 120.764 84.59 126.208 38.7086L130.424 3.17662Z",aspectRatio:{width:268,height:268},width:t,height:e}),stairs1:({width:t,height:e})=>Mt({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:t,height:e}),stairs2:({width:t,height:e})=>Mt({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:t,height:e}),teewee:({width:t,height:e})=>Mt({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:t,height:e}),blob1:({width:t,height:e})=>Mt({path:"M172.979 19.611C191.285 33.0858 204.505 54.442 210.861 78.5949C217.471 103.002 217.471 130.46 205.776 151.816C194.335 173.427 171.454 189.444 147.047 196.054C122.639 202.919 96.7069 200.631 75.3506 190.715C54.2486 180.546 37.7229 163.003 23.4855 142.155C9.5022 121.307 -2.19289 97.4087 0.349524 74.7813C3.14617 52.1538 19.9261 30.7976 40.2654 17.8313C60.6046 4.61077 84.5033 -0.474048 108.148 0.0344341C131.538 0.542916 154.928 6.13621 172.979 19.611Z",aspectRatio:{width:216,height:200},width:t,height:e}),blob10:({width:t,height:e})=>Mt({path:"M188.684 8.95173C205.601 24.3309 200.988 63.0866 191.453 99.3816C182.225 135.677 168.076 169.511 146.238 175.355C124.399 181.507 94.871 159.668 66.5733 143.059C37.9679 126.449 10.5929 115.068 2.59569 95.0754C-5.4015 75.0824 5.97912 46.1694 24.4342 30.4826C42.8893 14.7958 68.4188 12.0276 100.715 6.79864C132.704 1.5697 171.767 -6.42749 188.684 8.95173Z",aspectRatio:{width:200,height:177},width:t,height:e}),blob11:({width:t,height:e})=>Mt({path:"M137.368 29.4923C148.97 46.7605 146.542 72.1231 148.161 99.1046C149.779 126.086 155.715 154.956 144.113 174.383C132.781 193.81 103.911 203.793 80.4369 198.666C56.963 193.27 38.6156 173.034 28.3626 153.607C17.8398 134.181 15.4115 115.833 9.47555 91.5498C3.53961 67.2664 -5.63411 37.3169 4.61887 20.0488C15.1417 2.51078 45.0911 -1.80626 72.8821 0.622074C100.673 2.78059 126.036 12.2241 137.368 29.4923Z",aspectRatio:{width:152,height:200},width:t,height:e}),blob12:({width:t,height:e})=>Mt({path:"M158.391 17.923C172.491 28.5703 180.261 48.1384 187.743 70.5842C194.937 93.3177 202.419 118.641 194.649 138.785C187.167 158.928 164.146 173.317 138.535 184.54C112.923 196.05 84.4347 204.108 58.8235 197.777C33.2123 191.446 10.191 170.439 2.99688 146.267C-4.48504 121.807 3.57241 94.181 10.4788 68.282C17.0974 42.0953 22.565 17.6352 37.8166 7.27563C53.0682 -3.37171 78.1038 0.081487 100.837 2.67138C123.859 5.26127 144.29 7.27563 158.391 17.923Z",aspectRatio:{width:198,height:200},width:t,height:e}),blob13:({width:t,height:e})=>Mt({path:"M149.668 1.37595C170.663 5.22017 193.728 17.3442 198.755 34.7911C204.078 52.2379 191.363 75.3032 178.943 93.9329C166.819 112.563 154.99 126.757 140.501 145.386C126.011 164.312 108.86 187.673 92.5957 186.194C76.3317 185.011 60.9549 159.285 45.8737 140.655C30.4968 122.321 15.7114 110.788 7.43151 95.1157C-0.848339 79.4432 -2.32688 59.0392 3.5873 41.5924C9.50148 23.8498 23.1041 8.76868 38.7767 3.44592C54.745 -1.87685 73.3746 2.55879 91.7086 2.26308C110.338 2.26308 128.968 -2.17256 149.668 1.37595Z",aspectRatio:{width:200,height:187},width:t,height:e}),blob14:({width:t,height:e})=>Mt({path:"M137.838 28.6426C150.711 40.5617 165.014 46.5213 178.363 58.2021C191.474 69.8828 203.87 87.0464 198.864 99.6807C193.858 112.315 171.689 120.42 157.862 135.676C144.275 151.171 139.269 173.579 126.873 182.161C114.477 190.505 94.9294 185.022 76.8123 178.109C58.4568 171.196 41.5316 163.091 28.1822 150.456C14.5943 137.822 4.58225 120.42 1.24488 101.826C-2.09248 83.2322 1.00651 62.9697 13.8792 52.4809C26.7519 41.992 49.1598 41.0385 65.6083 30.788C82.0567 20.5376 92.0688 0.990158 103.034 0.0366268C113.762 -0.916905 125.204 16.9618 137.838 28.6426Z",aspectRatio:{width:200,height:187},width:t,height:e}),blob15:({width:t,height:e})=>Mt({path:"M185.203 1.52939C197.679 7.62217 200 32.2835 200 51.7223C200 71.1612 197.389 85.3777 197.679 100.175C198.259 114.681 201.741 129.768 198.259 143.114C194.778 156.46 184.623 168.356 171.567 173.868C158.801 179.671 143.134 179.091 130.368 174.739C117.312 170.387 106.867 162.263 86.8482 160.812C66.539 159.362 36.9454 164.294 18.9572 155.3C0.968966 146.306 -5.41395 123.095 5.03083 105.977C15.4756 88.5692 42.4579 77.5442 55.5139 59.5559C68.2798 41.8578 67.1192 17.4867 76.9837 9.6531C86.5581 2.10965 107.158 11.3939 128.627 9.6531C150.097 8.20244 172.728 -4.27327 185.203 1.52939Z",aspectRatio:{width:200,height:179},width:t,height:e}),blob16:({width:t,height:e})=>Mt({path:"M158.441 55.3221C167.253 80.2399 160.264 105.462 147.501 134.938C134.738 164.717 116.81 199.055 97.0576 199.967C77.3057 201.182 55.7305 168.668 34.4592 133.722C13.1879 99.0802 -7.77953 62.3112 2.85612 36.4818C13.4918 10.6523 56.0344 -3.93369 90.0685 0.928322C123.799 6.09421 149.324 30.7081 158.441 55.3221Z",aspectRatio:{width:163,height:200},width:t,height:e}),blob17:({width:t,height:e})=>Mt({path:"M168.917 36.7587C178.871 53.2457 175.138 76.5764 172.961 106.129C170.472 135.37 169.85 170.832 150.563 187.63C131.276 204.739 93.3252 203.495 65.0173 187.63C36.7095 172.077 18.0449 142.213 7.77943 107.373C-2.79714 72.2213 -4.35252 32.7147 14.312 14.0502C32.9765 -4.3033 72.1721 -1.50361 103.591 4.7179C135.32 10.6283 158.962 20.2717 168.917 36.7587Z",aspectRatio:{width:176,height:200},width:t,height:e}),blob18:({width:t,height:e})=>Mt({path:"M178.188 21.1464C193.012 36.3069 196.381 62.9219 198.739 88.1893C200.76 113.12 201.771 136.366 190.316 149.168C178.862 162.307 155.279 164.665 135.065 167.697C115.188 170.73 99.0168 174.098 72.4018 177.131C46.1237 180.163 9.40176 182.521 1.65309 168.371C-6.09559 154.221 15.4659 123.564 23.5515 92.9059C31.6371 62.2481 26.2467 31.2534 38.3751 15.4192C50.1665 -0.0781831 79.8136 -1.08888 107.776 0.595609C136.076 1.9432 163.028 5.64909 178.188 21.1464Z",aspectRatio:{width:200,height:180},width:t,height:e}),blob19:({width:t,height:e})=>Mt({path:"M148.621 13.3857C171.945 24.3818 194.937 41.3756 192.938 60.702C190.605 80.3615 163.282 101.687 149.953 123.346C136.958 145.005 137.958 166.664 128.295 174.661C118.631 182.325 98.3054 175.994 73.6476 181.991C48.9899 187.989 20.0004 205.983 11.0036 197.986C1.67366 189.989 12.6697 156.001 12.3365 131.343C12.0033 106.685 0.340809 91.0243 0.00759636 75.0301C-0.325616 59.0359 10.3372 42.3753 25.3318 28.7135C39.9931 15.0518 58.9863 4.05578 80.3119 1.05687C101.638 -2.27526 124.962 2.38972 148.621 13.3857Z",aspectRatio:{width:194,height:200},width:t,height:e}),blob2:({width:t,height:e})=>Mt({path:"M140.464 18.6393C156.081 28.3718 169.887 39.9149 178.714 54.853C187.541 69.5649 191.389 87.6717 189.578 104.421C187.768 121.396 180.525 137.239 172.377 153.535C164.455 169.832 155.854 186.58 142.048 194.276C128.241 201.971 109.456 200.613 92.4804 197.671C75.2789 194.502 60.1144 189.749 45.1762 182.733C30.4644 175.716 16.2052 166.21 8.28346 153.083C0.361703 139.729 -1.44898 122.527 1.04072 106.91C3.30408 91.2931 9.64147 76.8076 15.9789 60.5114C22.0899 44.2153 28.201 26.1084 40.6495 14.7916C53.0979 3.24849 71.8838 -1.27823 89.7643 0.306124C107.871 1.66414 124.846 9.13322 140.464 18.6393Z",aspectRatio:{width:191,height:200},width:t,height:e}),blob20:({width:t,height:e})=>Mt({path:"M150.035 13.2464C157.376 24.9386 153.026 48.323 157.92 65.7254C163.087 83.1277 177.498 94.2761 182.392 108.415C187.287 122.555 182.392 139.957 173.147 156.272C163.63 172.587 149.763 187.814 132.089 195.155C114.414 202.225 93.2053 201.137 73.6276 194.611C54.3219 188.357 36.9196 176.937 25.7712 161.438C14.8947 145.667 10.5441 126.09 5.92163 105.696C1.57105 85.0311 -3.05145 63.5501 2.65869 45.0601C8.64075 26.5701 24.6835 11.0711 43.1735 4.54524C61.6635 -1.98064 82.6007 0.194657 102.722 1.01039C122.844 1.82613 142.421 1.55421 150.035 13.2464Z",aspectRatio:{width:185,height:200},width:t,height:e}),blob21:({width:t,height:e})=>Mt({path:"M152.611 0.184799C172.596 -0.723643 197.73 1.39606 199.85 13.8114C201.969 26.2268 181.075 48.9379 174.716 68.0151C168.357 87.0924 176.533 102.536 174.11 114.649C171.991 127.064 159.575 136.148 146.252 139.782C132.928 143.719 118.696 141.902 105.977 139.176C93.562 136.451 82.6606 132.212 63.2805 131.909C43.9004 131.606 16.0416 135.24 5.44306 125.853C-5.15543 116.465 1.50648 94.0572 10.2881 76.4939C18.7669 59.2335 29.6682 46.8182 38.7526 35.3112C48.1398 23.5015 56.3158 12.903 66.9143 8.36078C77.5128 4.12138 91.1394 6.24108 104.766 5.63546C118.696 4.72701 132.928 1.09324 152.611 0.184799Z",aspectRatio:{width:200,height:143},width:t,height:e}),blob22:({width:t,height:e})=>Mt({path:"M195.507 15.5715C206.818 33.1668 193.622 69.3001 190.166 101.663C186.71 134.34 193.308 163.561 181.996 178.014C170.685 192.153 141.464 191.525 114.443 189.326C87.1072 187.44 62.2852 183.67 40.6052 169.531C19.2395 155.077 1.6441 130.255 0.0730908 103.862C-1.18372 77.4694 13.898 49.5054 35.2638 31.91C56.6296 14.0004 84.5936 6.45958 116.328 2.37494C148.063 -1.70969 184.196 -2.3381 195.507 15.5715Z",aspectRatio:{width:200,height:191},width:t,height:e}),blob23:({width:t,height:e})=>Mt({path:"M135.742 9.14189C157.815 19.2326 179.258 38.4681 176.105 56.7576C172.951 74.7317 145.202 92.0751 127.858 109.734C110.83 127.077 104.523 145.052 87.4953 164.918C70.4672 184.468 42.7177 206.227 27.5816 198.343C12.4455 190.46 9.60747 153.566 6.45411 126.762C2.98542 100.274 -0.798607 84.1917 0.147399 67.1636C0.77807 50.4508 6.76944 32.4767 19.0675 20.8093C31.0503 9.14189 49.6551 3.78119 70.4672 1.2585C90.964 -1.26418 113.668 -0.633508 135.742 9.14189Z",aspectRatio:{width:177,height:200},width:t,height:e}),blob24:({width:t,height:e})=>Mt({path:"M165.663 24.3715C171.555 44.4059 158.003 76.2254 151.816 96.2598C145.923 116.294 147.691 124.544 148.28 135.445C148.575 146.346 147.396 159.309 140.62 170.8C133.549 181.996 120.88 191.424 104.381 196.432C87.8821 201.441 67.553 202.03 54.8841 192.602C41.9207 183.469 36.6174 164.023 25.1271 143.105C13.3421 122.187 -4.33535 99.7953 0.967891 85.0641C6.27113 70.6275 34.2604 63.8511 56.0626 48.5307C77.5702 33.5048 92.8907 9.93489 113.22 2.56928C133.843 -4.79633 159.77 4.04241 165.663 24.3715Z",aspectRatio:{width:168,height:200},width:t,height:e}),blob25:({width:t,height:e})=>Mt({path:"M180.115 1.256C192.651 2.1962 189.83 34.163 190.771 58.2947C191.711 82.4265 196.098 98.4099 198.606 117.214C201.113 136.018 201.426 157.642 189.204 165.791C177.294 173.626 153.163 167.671 135.299 163.91C117.749 159.836 106.466 157.956 85.7818 162.97C65.0974 168.298 35.3244 180.521 18.7143 174.253C1.79068 167.985 -1.97012 142.913 0.850478 120.975C3.67107 99.0367 13.0731 79.6059 18.4009 54.8473C23.7287 30.0888 24.9823 -0.310996 40.0254 0.00240332C54.7552 0.00240332 82.9612 31.029 111.167 31.029C139.373 31.029 167.579 0.315802 180.115 1.256Z",aspectRatio:{width:200,height:176},width:t,height:e}),blob26:({width:t,height:e})=>Mt({path:"M142.571 0.586925C159.976 3.39414 176.258 15.1844 184.96 30.9048C193.662 46.6253 194.224 66.8372 189.171 83.6805C183.837 100.805 172.327 114.56 163.064 129.157C153.8 143.755 146.501 158.914 134.43 173.231C122.359 187.828 105.516 201.303 89.5146 199.899C73.2327 198.776 58.0738 182.775 42.9148 169.862C28.0366 157.23 13.7198 147.685 6.42103 134.491C-0.877729 121.297 -1.15845 103.892 1.64876 88.4528C4.45598 72.7324 10.0704 58.6963 18.4921 47.4674C27.1944 36.2386 38.4233 27.8169 50.4943 22.2025C62.846 16.3073 75.7592 13.5001 91.1989 8.72785C106.919 4.23631 125.166 -1.93957 142.571 0.586925Z",aspectRatio:{width:193,height:200},width:t,height:e}),blob27:({width:t,height:e})=>Mt({path:"M112.602 54.9337C129.225 71.8646 155.391 78.9448 158.777 89.719C162.471 100.493 143.693 114.654 127.07 135.586C110.447 156.519 96.2866 184.224 71.0442 194.998C46.1096 205.465 10.4008 199.308 2.0893 178.375C-6.22223 157.443 12.5557 121.734 18.4045 92.1817C24.5612 62.6296 17.7889 38.9263 26.4082 21.9954C34.7197 5.06454 58.423 -5.40183 73.5069 2.9097C88.8986 10.9134 95.9788 38.0028 112.602 54.9337Z",aspectRatio:{width:160,height:200},width:t,height:e}),blob28:({width:t,height:e})=>Mt({path:"M125.281 68.5835C142.15 82.9923 165.344 90.021 181.862 108.998C198.028 127.624 207.516 158.902 192.405 166.634C177.293 174.716 137.581 159.605 112.629 156.442C87.326 152.928 77.1344 161.713 59.9142 165.579C43.0453 169.445 19.1478 168.391 11.7677 157.496C4.73907 146.25 14.2278 124.813 11.4163 94.2382C8.2534 63.6634 -6.85825 23.9514 3.68476 8.48836C14.2278 -7.32615 50.4254 1.10826 73.9715 16.2199C97.5175 31.683 108.412 54.1747 125.281 68.5835Z",aspectRatio:{width:200,height:169},width:t,height:e}),blob29:({width:t,height:e})=>Mt({path:"M162.987 10.2348C169.16 25.1809 154.864 58.6471 147.066 79.4417C139.268 100.236 138.293 108.359 134.719 114.532C131.47 120.706 125.297 124.93 119.448 143.45C113.6 161.97 107.426 194.461 98.004 199.335C88.5814 204.209 75.5849 181.14 55.7651 167.494C35.6203 153.522 8.65241 148.648 1.8292 135.327C-4.994 122.33 8.65241 100.561 20.0244 82.041C31.3964 63.5208 40.1691 48.2498 53.4906 35.5782C66.8122 22.9065 84.0326 13.159 106.452 6.33584C128.871 -0.812285 156.489 -4.71127 162.987 10.2348Z",aspectRatio:{width:165,height:200},width:t,height:e}),blob3:({width:t,height:e})=>Mt({path:"M158.095 64.2637C176.543 95.19 192.277 129.1 181.697 155.686C171.117 182.001 133.951 201.533 99.4982 199.905C64.7739 198.549 33.0338 176.032 15.4004 145.377C-2.23296 114.994 -5.75963 76.2002 10.2461 46.6303C26.2518 17.0605 61.5185 -3.557 89.732 0.512241C118.217 4.58149 139.377 33.0662 158.095 64.2637Z",aspectRatio:{width:186,height:200},width:t,height:e}),blob30:({width:t,height:e})=>Mt({path:"M146.076 34.4585C157.052 54.582 155.833 80.1936 164.675 100.622C173.212 121.355 191.201 136.905 189.372 149.711C187.542 162.212 165.285 171.969 146.99 175.018C129.001 178.372 114.671 174.713 103.39 175.018C92.1083 175.018 83.876 178.982 66.8015 186.299C49.7271 193.617 23.8105 204.288 14.3586 198.19C4.90665 191.787 11.6145 168.615 10.3949 147.882C8.87037 127.148 -0.581561 108.549 0.0282404 89.3407C0.638042 70.1319 11.6145 50.6182 28.384 32.934C44.8487 15.5546 67.4113 0.309578 89.974 0.00467694C112.537 -0.300224 135.099 14.335 146.076 34.4585Z",aspectRatio:{width:190,height:200},width:t,height:e}),blob31:({width:t,height:e})=>Mt({path:"M134.218 44.0392C153.568 36.4264 184.97 26.9105 195.755 33.2544C206.222 39.9156 195.755 62.1194 181.481 76.3933C166.89 90.35 148.175 96.0596 145.638 116.36C143.1 136.661 156.74 171.235 151.664 183.923C146.589 196.928 123.434 187.413 105.036 178.531C86.6388 169.967 73.3165 161.72 52.0643 158.548C30.812 155.058 1.62986 156.644 0.0438693 145.225C-1.22492 133.806 25.4197 109.382 29.2261 86.8609C32.7152 64.3398 13.6834 44.0392 11.7802 26.9105C9.877 9.46461 24.7853 -4.80928 42.5484 1.53467C59.9942 7.87863 79.9777 34.5232 93.6172 45.308C107.257 56.4099 114.869 51.3347 134.218 44.0392Z",aspectRatio:{width:200,height:191},width:t,height:e}),blob32:({width:t,height:e})=>Mt({path:"M200 100.339C200 149.831 145.763 197.966 95.5932 197.966C45.7627 197.966 0 149.831 0 100.339C0 50.8475 45.7627 0 95.5932 0C145.763 0 200 50.8475 200 100.339Z",aspectRatio:{width:200,height:198},width:t,height:e}),blob4:({width:t,height:e})=>Mt({path:"M183.427 38.712C198.21 63.2519 196.141 95.1833 189.341 126.523C182.836 157.863 171.305 188.908 150.609 197.482C130.208 205.76 100.642 192.16 69.8936 177.968C39.4405 164.072 7.80478 150.176 1.30024 128.593C-5.2043 107.01 13.718 77.7393 35.3012 51.7211C56.5888 25.9986 81.1287 3.23272 108.921 0.276112C137.009 -2.38484 168.349 14.4678 183.427 38.712Z",aspectRatio:{width:195,height:200},width:t,height:e}),blob5:({width:t,height:e})=>Mt({path:"M166.251 30.6913C183.816 48.5185 195.875 71.8512 199.021 98.8542C202.429 125.595 197.186 155.744 179.359 169.115C161.794 182.223 131.645 178.815 103.331 176.979C75.0171 175.144 48.8006 174.882 29.6625 161.512C10.7866 148.141 -0.748681 121.925 0.0378149 96.2326C0.824311 70.8025 14.1947 46.159 33.0706 28.3318C52.2087 10.5045 76.8522 -0.5064 100.971 0.0179307C125.091 0.804426 148.423 12.864 166.251 30.6913Z",aspectRatio:{width:200,height:179},width:t,height:e}),blob6:({width:t,height:e})=>Mt({path:"M149.146 50.5452C161.911 68.0278 171.901 81.9028 176.619 97.9979C181.336 114.37 180.781 133.241 173.011 149.891C165.519 166.541 151.366 180.693 133.051 189.851C114.736 199.008 92.2586 202.893 71.446 197.621C50.6334 192.348 30.9308 177.918 18.1658 158.216C5.12323 138.791 -0.981801 113.815 0.128204 87.7304C1.51571 61.6453 10.6733 34.1726 29.2658 17.5226C48.1359 1.14999 76.996 -4.40004 98.9186 3.6475C120.841 11.695 136.381 32.7851 149.146 50.5452Z",aspectRatio:{width:180,height:200},width:t,height:e}),blob7:({width:t,height:e})=>Mt({path:"M158.662 41.8295C178.593 57.8305 204.138 64.5677 213.402 79.7266C222.666 94.6047 215.367 118.466 203.015 135.028C190.383 151.871 172.698 161.977 156.416 168.434C140.134 174.89 124.975 177.697 104.483 185.277C83.9903 192.856 58.1642 205.208 44.9704 197.629C31.4959 190.33 31.2152 163.1 21.9514 138.116C12.9684 112.851 -4.71688 90.1132 1.17822 75.5158C7.35404 61.1991 36.8295 55.5847 58.7256 40.1452C80.9024 24.7056 95.4998 -0.278374 109.816 0.00234533C124.414 0.283064 138.45 25.8285 158.662 41.8295Z",aspectRatio:{width:218,height:200},width:t,height:e}),blob8:({width:t,height:e})=>Mt({path:"M153.53 11.0108C168.179 18.1858 181.931 29.5461 192.993 44.4939C203.755 59.4417 212.425 78.2759 210.631 96.5122C209.136 114.748 197.477 132.088 182.529 142.252C167.581 152.716 148.747 156.004 128.717 168.262C108.687 180.22 87.1622 201.147 69.8228 199.951C52.7823 198.456 39.6283 174.54 32.4533 153.015C25.2784 131.49 24.0826 112.357 16.6087 91.131C9.13477 70.2041 -4.31825 46.8855 1.36191 31.9377C7.04207 16.691 31.8554 9.51607 52.7823 5.33069C73.4103 0.846349 90.4507 -0.648433 106.594 0.248435C123.037 1.1453 138.882 4.13486 153.53 11.0108Z",aspectRatio:{width:211,height:200},width:t,height:e}),blob9:({width:t,height:e})=>Mt({path:"M140.289 20.2182C156.96 27.7956 176.661 32.0895 189.29 43.9608C201.667 55.5796 206.718 75.0283 202.424 91.6987C198.131 108.622 184.491 122.766 175.651 140.952C166.81 158.885 162.769 180.607 150.393 191.216C138.016 201.824 117.052 201.572 98.866 197.025C80.6802 192.479 65.2727 183.891 48.3497 175.808C31.4268 167.726 13.2409 160.148 5.1583 146.761C-2.67172 133.122 -0.398493 113.673 4.14797 96.7504C8.69444 80.08 15.5141 65.6828 23.3442 52.296C31.4268 38.6566 40.5197 25.775 52.6436 15.6717C65.0201 5.82101 80.6802 -1.50385 95.3299 0.264221C109.98 1.77971 123.619 12.6407 140.289 20.2182Z",aspectRatio:{width:204,height:200},width:t,height:e})};function K7(t){return VN[t]||my}function Z7(t){const{subType:e}=t,r=K7(e);return r?function(n,i){const{width:a,height:o,fill:s,stroke:u,strokeWidth:h,dash:f}=n,g=(f||[]).map(x=>x*h);let v=i(n),p=1,y=1;typeof v!="string"&&(p=v.scaleX,y=v.scaleY,v=v.path);const _=`clip-${n.id||Math.random()}`;return`
|
|
309
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${o}">
|
|
310
|
-
<defs>
|
|
311
|
-
<clipPath id="${_}">
|
|
312
|
-
<path d="${v}" />
|
|
313
|
-
</clipPath>
|
|
314
|
-
</defs>
|
|
315
|
-
|
|
316
|
-
<!-- Path for the fill -->
|
|
317
|
-
<path d="${v}" fill="${s}" transform="scale(${p}, ${y})"/>
|
|
318
|
-
|
|
319
|
-
<!-- Path for the stroke, clipped by the star path -->
|
|
320
|
-
<path d="${v}" fill="none" stroke="${u}" stroke-width="${2*h}" clip-path="url(#${_})" transform="scale(${p}, ${y})" stroke-dasharray="${g.join(" ")}"/>
|
|
321
|
-
</svg>
|
|
322
|
-
`}(t,r):(console.error(`Polotno error: Can not convert ${t.subType} figure to svg.`),my(t))}const hv={},YN=ni(({element:t,store:e})=>{const r=t.selectable||e.role==="admin",n=Cf(),i=e.selectedShapes.indexOf(t)>=0&&t.selectable,a=Math.min(t.strokeWidth,t.width/2,t.height/2),o=Math.max(0,Math.min(t.width/2,t.height/2,t.cornerRadius)),s=bf(t,t.a.fill,"fill"),u=Object.assign(Object.assign({width:t.a.width,height:t.a.height},s),{cornerRadius:o,opacity:t.animated("opacity"),shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,preventDefault:!n||i,hideInExport:!t.showInExport}),h=bf(t,t.stroke,"stroke"),f=Object.assign(Object.assign({visible:a>0,x:a/2,y:a/2,width:t.a.width-a,height:t.a.height-a},h),{strokeWidth:a,cornerRadius:Math.max(0,o-a),dash:t.dash.map(y=>y*a),opacity:t.animated("opacity"),hideInExport:!t.showInExport,listening:!1}),g=(v=t.subType,hv[v]||(hv[v]=(p=K7(v),ni(({element:y,fillProps:_,strokeProps:x})=>{let b=p({width:y.a.width,height:y.a.height,cornerRadius:y.cornerRadius}),E=1,A=1;typeof b!="string"&&(E=b.scaleX,A=b.scaleY,b=b.path);const S=se.useRef(null);return se.createElement(se.Fragment,null,se.createElement(Tn,{width:y.width,height:y.height,fill:"transparent"}),se.createElement(mp,Object.assign({},_,{ref:S,data:b,scaleX:E,scaleY:A})),se.createElement(bn,{clipFunc:k=>{const I=S.current;if(I){var O=I.dataArray;k.beginPath();for(var M=0;M<O.length;M++){var F=O[M].command,j=O[M].points;switch(F){case"L":k.lineTo(j[0],j[1]);break;case"M":k.moveTo(j[0],j[1]);break;case"C":k.bezierCurveTo(j[0],j[1],j[2],j[3],j[4],j[5]);break;case"Q":k.quadraticCurveTo(j[0],j[1],j[2],j[3]);break;case"A":var T=j[0],L=j[1],$=j[2],q=j[3],J=j[4],ae=j[5],ie=j[6],Z=j[7],te=$>q?$:q,V=$>q?1:$/q,B=$>q?q/$:1;k.translate(T,L),k.rotate(ie),k.scale(V,B),k.arc(0,0,te,J,J+ae,1-Z),k.scale(1/V,1/B),k.rotate(-ie),k.translate(-T,-L);break;case"z":k.closePath()}}}},scaleX:E,scaleY:A},se.createElement(mp,Object.assign({},x,{x:0,y:0,data:b,strokeWidth:2*x.strokeWidth,dash:x.dash.map(k=>k)}))))}))),hv[v]||bn);var v,p;return se.createElement(se.Fragment,null,se.createElement(bn,{id:t.id,x:t.a.x,y:t.a.y,rotation:t.a.rotation,opacity:t.a.opacity,listening:r,draggable:n?t.draggable&&i:t.draggable,name:"element",onDragMove:y=>{t.set({x:y.target.x(),y:y.target.y()})},onDragEnd:y=>{t.set({x:y.target.x(),y:y.target.y()})},onTransform:y=>{const _=y.target.scale();y.target.scaleX(1),y.target.scaleY(1),t.set({width:t.width*_.x,height:t.height*_.y,x:y.target.x(),y:y.target.y(),rotation:y.target.rotation()})}},se.createElement(g,{element:t,fillProps:u,strokeProps:f})))});var oc={},dv={},sc={},p4;function Q7(){if(p4)return sc;p4=1,Object.defineProperty(sc,"__esModule",{value:!0}),sc.loop=sc.conditional=sc.parse=void 0;var t=function n(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o;if(Array.isArray(a))a.forEach(function(h){return n(i,h,o,s)});else if(typeof a=="function")a(i,o,s,n);else{var u=Object.keys(a)[0];Array.isArray(a[u])?(s[u]={},n(i,a[u],o,s[u])):s[u]=a[u](i,o,s,n)}return o};sc.parse=t;var e=function(i,a){return function(o,s,u,h){a(o,s,u)&&h(o,i,s,u)}};sc.conditional=e;var r=function(i,a){return function(o,s,u,h){for(var f=[],g=o.pos;a(o,s,u);){var v={};if(h(o,i,s,v),o.pos===g)break;g=o.pos,f.push(v)}return f}};return sc.loop=r,sc}var oa={},g4;function J7(){if(g4)return oa;g4=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.readBits=oa.readArray=oa.readUnsigned=oa.readString=oa.peekBytes=oa.readBytes=oa.peekByte=oa.readByte=oa.buildStream=void 0;var t=function(g){return{data:g,pos:0}};oa.buildStream=t;var e=function(){return function(g){return g.data[g.pos++]}};oa.readByte=e;var r=function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(v){return v.data[v.pos+g]}};oa.peekByte=r;var n=function(g){return function(v){return v.data.subarray(v.pos,v.pos+=g)}};oa.readBytes=n;var i=function(g){return function(v){return v.data.subarray(v.pos,v.pos+g)}};oa.peekBytes=i;var a=function(g){return function(v){return Array.from(n(g)(v)).map(function(p){return String.fromCharCode(p)}).join("")}};oa.readString=a;var o=function(g){return function(v){var p=n(2)(v);return g?(p[1]<<8)+p[0]:(p[0]<<8)+p[1]}};oa.readUnsigned=o;var s=function(g,v){return function(p,y,_){for(var x=typeof v=="function"?v(p,y,_):v,b=n(g),E=new Array(x),A=0;A<x;A++)E[A]=b(p);return E}};oa.readArray=s;var u=function(g,v,p){for(var y=0,_=0;_<p;_++)y+=g[v+_]&&Math.pow(2,p-_-1);return y},h=function(g){return function(v){for(var p=e()(v),y=new Array(8),_=0;_<8;_++)y[7-_]=!!(p&1<<_);return Object.keys(g).reduce(function(x,b){var E=g[b];return E.length?x[b]=u(y,E.index,E.length):x[b]=y[E.index],x},{})}};return oa.readBits=h,oa}var v4;function XN(){return v4||(v4=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=Q7(),r=J7(),n={blocks:function(v){for(var p=0,y=[],_=v.data.length,x=0,b=(0,r.readByte)()(v);b!==p&&b;b=(0,r.readByte)()(v)){if(v.pos+b>=_){var E=_-v.pos;y.push((0,r.readBytes)(E)(v)),x+=E;break}y.push((0,r.readBytes)(b)(v)),x+=b}for(var A=new Uint8Array(x),S=0,k=0;k<y.length;k++)A.set(y[k],S),S+=y[k].length;return A}},i=(0,e.conditional)({gce:[{codes:(0,r.readBytes)(2)},{byteSize:(0,r.readByte)()},{extras:(0,r.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,r.readUnsigned)(!0)},{transparentColorIndex:(0,r.readByte)()},{terminator:(0,r.readByte)()}]},function(g){var v=(0,r.peekBytes)(2)(g);return v[0]===33&&v[1]===249}),a=(0,e.conditional)({image:[{code:(0,r.readByte)()},{descriptor:[{left:(0,r.readUnsigned)(!0)},{top:(0,r.readUnsigned)(!0)},{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{lct:(0,r.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,r.readArray)(3,function(g,v,p){return Math.pow(2,p.descriptor.lct.size+1)})},function(g,v,p){return p.descriptor.lct.exists}),{data:[{minCodeSize:(0,r.readByte)()},n]}]},function(g){return(0,r.peekByte)()(g)===44}),o=(0,e.conditional)({text:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{preData:function(v,p,y){return(0,r.readBytes)(y.text.blockSize)(v)}},n]},function(g){var v=(0,r.peekBytes)(2)(g);return v[0]===33&&v[1]===1}),s=(0,e.conditional)({application:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{id:function(v,p,y){return(0,r.readString)(y.blockSize)(v)}},n]},function(g){var v=(0,r.peekBytes)(2)(g);return v[0]===33&&v[1]===255}),u=(0,e.conditional)({comment:[{codes:(0,r.readBytes)(2)},n]},function(g){var v=(0,r.peekBytes)(2)(g);return v[0]===33&&v[1]===254}),h=[{header:[{signature:(0,r.readString)(3)},{version:(0,r.readString)(3)}]},{lsd:[{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{gct:(0,r.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,r.readByte)()},{pixelAspectRatio:(0,r.readByte)()}]},(0,e.conditional)({gct:(0,r.readArray)(3,function(g,v){return Math.pow(2,v.lsd.gct.size+1)})},function(g,v){return v.lsd.gct.exists}),{frames:(0,e.loop)([i,s,u,a,o],function(g){var v=(0,r.peekByte)()(g);return v===33||v===44})}],f=h;t.default=f}(dv)),dv}var qd={},m4;function KN(){if(m4)return qd;m4=1,Object.defineProperty(qd,"__esModule",{value:!0}),qd.deinterlace=void 0;var t=function(r,n){for(var i=new Array(r.length),a=r.length/n,o=function(p,y){var _=r.slice(y*n,(y+1)*n);i.splice.apply(i,[p*n,n].concat(_))},s=[0,4,2,1],u=[8,8,4,2],h=0,f=0;f<4;f++)for(var g=s[f];g<a;g+=u[f])o(g,h),h++;return i};return qd.deinterlace=t,qd}var Ud={},y4;function ZN(){if(y4)return Ud;y4=1,Object.defineProperty(Ud,"__esModule",{value:!0}),Ud.lzw=void 0;var t=function(r,n,i){var a=4096,o=-1,s=i,u,h,f,g,v,p,y,O,_,x,I,b,M,F,T,j,E=new Array(i),A=new Array(a),S=new Array(a),k=new Array(a+1);for(b=r,h=1<<b,v=h+1,u=h+2,y=o,g=b+1,f=(1<<g)-1,_=0;_<h;_++)A[_]=0,S[_]=_;var I,O,M,F,j,T;for(I=O=M=F=j=T=0,x=0;x<s;){if(F===0){if(O<g){I+=n[T]<<O,O+=8,T++;continue}if(_=I&f,I>>=g,O-=g,_>u||_==v)break;if(_==h){g=b+1,f=(1<<g)-1,u=h+2,y=o;continue}if(y==o){k[F++]=S[_],y=_,M=_;continue}for(p=_,_==u&&(k[F++]=M,_=y);_>h;)k[F++]=S[_],_=A[_];M=S[_]&255,k[F++]=M,u<a&&(A[u]=y,S[u]=M,u++,(u&f)===0&&u<a&&(g++,f+=u)),y=p}F--,E[j++]=k[F],x++}for(x=j;x<s;x++)E[x]=0;return E};return Ud.lzw=t,Ud}var b4;function QN(){if(b4)return oc;b4=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.decompressFrames=oc.decompressFrame=oc.parseGIF=void 0;var t=a(XN()),e=Q7(),r=J7(),n=KN(),i=ZN();function a(f){return f&&f.__esModule?f:{default:f}}var o=function(g){var v=new Uint8Array(g);return(0,e.parse)((0,r.buildStream)(v),t.default)};oc.parseGIF=o;var s=function(g){for(var v=g.pixels.length,p=new Uint8ClampedArray(v*4),y=0;y<v;y++){var _=y*4,x=g.pixels[y],b=g.colorTable[x]||[0,0,0];p[_]=b[0],p[_+1]=b[1],p[_+2]=b[2],p[_+3]=x!==g.transparentIndex?255:0}return p},u=function(g,v,p){if(!g.image){console.warn("gif frame does not have associated image.");return}var y=g.image,_=y.descriptor.width*y.descriptor.height,x=(0,i.lzw)(y.data.minCodeSize,y.data.blocks,_);y.descriptor.lct.interlaced&&(x=(0,n.deinterlace)(x,y.descriptor.width));var b={pixels:x,dims:{top:g.image.descriptor.top,left:g.image.descriptor.left,width:g.image.descriptor.width,height:g.image.descriptor.height}};return y.descriptor.lct&&y.descriptor.lct.exists?b.colorTable=y.lct:b.colorTable=v,g.gce&&(b.delay=(g.gce.delay||10)*10,b.disposalType=g.gce.extras.disposal,g.gce.extras.transparentColorGiven&&(b.transparentIndex=g.gce.transparentColorIndex)),p&&(b.patch=s(b)),b};oc.decompressFrame=u;var h=function(g,v){return g.frames.filter(function(p){return p.image}).map(function(p){return u(p,g.gct,v)})};return oc.decompressFrames=h,oc}var w4=QN();function pv(t,e,r){const n=e.getContext("2d"),i=r.getContext("2d");if(!n||!i)return;t.disposalType===2&&n.clearRect(0,0,e.width,e.height),r.width=t.width,r.height=t.height;const a=i.createImageData(t.width,t.height);a.data.set(t.patch),i.putImageData(a,0,0),n.drawImage(r,t.left,t.top)}const JN=ni(({element:t})=>{const e=Math.min(30,t.width/4,t.height/4),r=se.useRef(null);return se.useEffect(()=>{const n=r.current;if(!n)return;const i=new or.Animation(a=>{n.rotate((a?.timeDiff||0)/2)},n.getLayer());return i.start(),()=>{i.stop()}},[]),se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tn,{width:t.width,height:t.height,fill:"rgba(124, 173, 212, 0.8)"}),se.createElement(ey,{ref:r,x:t.width/2,y:t.height/2,fill:"white",outerRadius:Math.abs(e),innerRadius:Math.max(1,e-5),angle:270}))}),eT=ni(({element:t})=>{const e=Math.max(10,Math.min(30,t.width/22));return se.createElement(bn,{x:t.a.x,y:t.a.y,rotation:t.a.rotation,listening:!1,opacity:t.a.opacity,hideInExport:!t.showInExport},se.createElement(Tn,{width:t.width,height:t.height,fill:"rgba(223, 102, 102, 0.8)"}),se.createElement(Fu,{text:"Cannot load the GIF...",fontSize:e,width:t.width,height:t.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))}),tT=ni(({element:t,store:e})=>{var r;const[n,i]=se.useState(!1),a=e.selectedShapes.indexOf(t)>=0&&t.selectable,o=se.useRef(null),s=se.useRef(),[u,h,f,g]=function(F){const[j,T]=se.useState([]),[L,$]=se.useState(0),[q,J]=se.useState("loading"),[ae,ie]=se.useState({width:0,height:0});return se.useEffect(()=>{(async()=>{try{const Z=await fetch(F),te=await Z.arrayBuffer(),V=w4.parseGIF(te),B=w4.decompressFrames(V,!0),D=V.lsd.width,U=V.lsd.height;ie({width:D,height:U});const X=B.map(K=>({patch:new Uint8ClampedArray(K.patch),delay:K.delay,width:K.dims.width,height:K.dims.height,left:K.dims.left,top:K.dims.top,disposalType:K.disposalType})),ee=X.reduce((K,oe)=>K+oe.delay,0);T(X),$(ee),J("loaded")}catch(Z){console.error("Failed to load GIF:",Z),J("failed")}})()},[F]),[j,L,ae,q]}(t.src);lp(g,t.src,t.id),se.useEffect(()=>(s.current=document.createElement("canvas"),()=>{s.current&&or.Util.releaseCanvas(s.current)}),[]),se.useEffect(()=>{if(g==="loaded"&&s.current&&(s.current.width=f.width,s.current.height=f.height,u.length>0)){const F=s.current.getContext("2d");if(F){F.clearRect(0,0,f.width,f.height);const j=document.createElement("canvas");pv(u[0],s.current,j)}}},[f,g,u]),se.useEffect(()=>{if(!u.length||!s.current)return;const F=s.current;F.width=f.width,F.height=f.height;const j=document.createElement("canvas"),T=F.getContext("2d");T&&T.clearRect(0,0,F.width,F.height);let L=-1;pv(u[0],F,j),A(),L=0;const $=q=>{const J=(ae=>{const ie=ae%h;let Z=0;for(let te=0;te<u.length;te++)if(Z+=u[te].delay,Z>ie)return te;return 0})(q);J!==L&&(pv(u[J],F,j),A(),o.current.getLayer().draw(),L=J)};if(e.isPlaying||t.page._exportingOrRendering)return zu(()=>{$(e.currentTime-t.page.startTime)});{const q=window.setInterval(()=>{$(e.currentTime||performance.now())},16);return()=>{clearInterval(q)}}},[e.isPlaying,u,h,t.page._exportingOrRendering]),se.useEffect(()=>{h&&e.history.ignore(()=>{t.set({duration:h})})},[h]);let{cropX:v,cropY:p,cropWidth:y,cropHeight:_}=t;g!=="loaded"&&(v=p=0,y=_=1);const x={x:f.width*v,y:f.height*p,width:f.width*y,height:f.height*_},b=(r=t.cornerRadius)!==null&&r!==void 0?r:0,[E,A]=X7(t,s.current,x,e._elementsPixelRatio,b,n||t._cropModeEnabled);se.useLayoutEffect(()=>{if(!n&&!t._cropModeEnabled&&o.current)return Ms(o.current,t),zu(()=>{Ms(o.current,t)},{delay:100})},[s.current,n,y,_,t._cropModeEnabled,f.width,f.height]);const S=g==="loading",k=g==="failed",I=S||k?0:t.a.opacity;Rp(o,I);const O=t.selectable||e.role==="admin",M=Cf();return se.createElement(se.Fragment,null,S&&se.createElement(JN,{element:t}),k&&se.createElement(eT,{element:t}),se.createElement(Tu,{ref:o,name:"element",id:t.id,image:E,x:t.a.x,y:t.a.y,width:t.a.width||1,height:t.a.height||1,rotation:t.a.rotation,opacity:I,shadowEnabled:t.shadowEnabled,shadowBlur:t.shadowBlur,shadowOffsetX:t.shadowOffsetX,shadowOffsetY:t.shadowOffsetY,shadowColor:t.shadowColor,shadowOpacity:t.shadowOpacity,customCrop:x,listening:O,draggable:M?t.draggable&&a:t.draggable,preventDefault:!M||a,hideInExport:!t.showInExport,onDragMove:F=>{t.set({x:F.target.x(),y:F.target.y()})},onDragEnd:F=>{t.set({x:F.target.x(),y:F.target.y()})},onTransformStart:()=>i(!0),onTransform:F=>{const j=F.currentTarget,T=Math.abs(j.scaleX()-1)<1e-7?1:j.scaleX(),L=Math.abs(j.scaleY()-1)<1e-7?1:j.scaleY();j.scaleX(1),j.scaleY(1),t.set({x:j.x(),y:j.y(),width:j.width()*T,height:j.height()*L,rotation:j.rotation()})},onTransformEnd:()=>i(!1)}),se.createElement(Tn,{x:t.a.x,y:t.a.y,width:Math.max(t.a.width-t.borderSize,0),height:Math.max(t.a.height-t.borderSize,0),opacity:I,offsetX:-t.borderSize/2,offsetY:-t.borderSize/2,stroke:t.borderColor,strokeWidth:t.borderSize,listening:!1,visible:!!t.borderSize,rotation:t.rotation,cornerRadius:Math.max(0,b-t.borderSize),hideInExport:!t.showInExport}))}),rT={stroke:"rgb(0, 161, 255)",strokeWidth:2},nT=ni(({element:t})=>se.createElement(Tn,Object.assign({name:"highlighter",x:t.a.x,y:t.a.y,rotation:t.a.rotation,width:t.a.width,height:t.a.height,listening:!1,strokeScaleEnabled:!1},rT)));let Cl=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),"");const up=function(t,e){if(t===e)return!0;if(typeof t=="object"&&t!=null&&typeof e=="object"&&e!=null){if(Object.keys(t).length!=Object.keys(e).length)return!1;for(var r in t)if(!e.hasOwnProperty(r)||!up(t[r],e[r]))return!1;return!0}return!1};Object.assign(Zt);const iT=Zt.model("UndoManager",{history:Zt.array(Zt.frozen()),undoIdx:-1,targetPath:""}).views(t=>({get canUndo(){return t.undoIdx>0},get canRedo(){return t.undoIdx<t.history.length-1}})).actions(t=>{let e,r,n=!1,i=null,a=0,o=0;const s=()=>o>0;function u(){const f=Ru(e);return{pages:f.pages,width:f.width,height:f.height,custom:f.custom,audios:f.audios}}function h(f){const g=e.pages.map(_=>_.id),v=f.pages.map(_=>_.id),p=!up(g,v),y=!up(e.custom,f.custom);p?mm(e.pages,f.pages):e.pages.forEach((_,x)=>{mm(_,f.pages[x])}),y&&e.set({custom:f.custom}),e.setSize(f.width,f.height)}return{startTransaction(){o++},endTransaction(f){o--,f||this.requestAddState(u())},async ignore(f,g=!1,v=!1){v&&await new Promise(b=>setTimeout(b,10)),a&&t.addUndoState();let p=s();t.startTransaction();let y=o;try{await f()}catch(b){setTimeout(()=>{throw b})}const _=y!==o,x=!_;t.endTransaction(x),g||p||t.replaceState(),_||(clearTimeout(a),a=0)},async transaction(f){await t.ignore(f,!0),this.addUndoState()},requestAddState(f){i=f,a||s()||(n?n=!1:a=setTimeout(()=>{a=0,clearTimeout(a),s()||this.addUndoState()},100))},addUndoState(){if(n)return void(n=!1);const f=t.history[t.undoIdx];!up(i,f)&&(clearTimeout(a),a=0,t.history.splice(t.undoIdx+1),t.history.push(i),t.undoIdx=t.history.length-1)},afterCreate(){if(e=mO(t,".."),!e)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");r=X8(e,()=>{this.requestAddState(u())}),t.history.length===0&&this.requestAddState(u())},clear(){clearTimeout(a),a=0,t.history.splice(0,t.history.length),t.undoIdx=-1,t.addUndoState(u())},beforeDestroy(){r()},undo(){a&&this.addUndoState(),s()?h(t.history[t.undoIdx]):t.canUndo?(t.undoIdx--,n=!0,h(t.history[t.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){a&&this.addUndoState(),t.canRedo?(t.undoIdx++,n=!0,h(t.history[t.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){t.history[t.undoIdx]=u()}}});async function N1(t,e){const r=await(await fetch(t)).blob(),n=document.createElement("a"),i=URL.createObjectURL(r);n.href=i,n.download=e,document.body.appendChild(n),n.click(),setTimeout(function(){document.body.removeChild(n),window.URL.revokeObjectURL(i)},0)}let gv=null;function aT(){var t;return!((t=window.jspdf)===null||t===void 0)&&t.jsPDF?Promise.resolve(window.jspdf.jsPDF):gv||(gv=new Promise(e=>{var r=document.createElement("script");r.onload=function(){e(window.jspdf.jsPDF)},r.src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/3.0.1/jspdf.umd.min.js",document.head.appendChild(r)}),gv)}function oT(){return window.GIF?Promise.resolve(window.GIF):new Promise(t=>{var e=document.createElement("script");e.onload=function(){t(window.GIF)},e.src="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js",document.head.appendChild(e)})}async function sT({width:t,height:e}){return new(await oT())({workers:4,width:t,height:e,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
|
|
323
|
-
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.pageSize;i++){rv+=ByteArray.charMap[this.pages[p][i]]}}return rv};ByteArray.prototype.writeByte=function(val){if(this.cursor>=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i<l;i++)this.writeByte(string.charCodeAt(i))};ByteArray.prototype.writeBytes=function(array,offset,length){for(var l=length||array.length,i=offset||0;i<l;i++)this.writeByte(array[i])};function GIFEncoder(width,height){this.width=~~width;this.height=~~height;this.transparent=null;this.transIndex=0;this.repeat=-1;this.delay=0;this.image=null;this.pixels=null;this.indexedPixels=null;this.colorDepth=null;this.colorTab=null;this.neuQuant=null;this.usedEntry=new Array;this.palSize=7;this.dispose=-1;this.firstFrame=true;this.sample=10;this.dither=false;this.globalPalette=false;this.out=new ByteArray}GIFEncoder.prototype.setDelay=function(milliseconds){this.delay=Math.round(milliseconds/10)};GIFEncoder.prototype.setFrameRate=function(fps){this.delay=Math.round(100/fps)};GIFEncoder.prototype.setDispose=function(disposalCode){if(disposalCode>=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j<nPix;j++){var index=this.findClosestRGB(this.pixels[k++]&255,this.pixels[k++]&255,this.pixels[k++]&255);this.usedEntry[index]=true;this.indexedPixels[j]=index}};GIFEncoder.prototype.ditherPixels=function(kernel,serpentine){var kernels={FalseFloydSteinberg:[[3/8,1,0],[3/8,0,1],[2/8,1,1]],FloydSteinberg:[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]],Stucki:[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]],Atkinson:[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]]};if(!kernel||!kernels[kernel]){throw"Unknown dithering kernel: "+kernel}var ds=kernels[kernel];var index=0,height=this.height,width=this.width,data=this.pixels;var direction=serpentine?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var y=0;y<height;y++){if(serpentine)direction=direction*-1;for(var x=direction==1?0:width-1,xend=direction==1?width:0;x!==xend;x+=direction){index=y*width+x;var idx=index*3;var r1=data[idx];var g1=data[idx+1];var b1=data[idx+2];idx=this.findClosestRGB(r1,g1,b1);this.usedEntry[idx]=true;this.indexedPixels[index]=idx;idx*=3;var r2=this.colorTab[idx];var g2=this.colorTab[idx+1];var b2=this.colorTab[idx+2];var er=r1-r2;var eg=g1-g2;var eb=b1-b2;for(var i=direction==1?0:ds.length-1,end=direction==1?ds.length:0;i!==end;i+=direction){var x1=ds[i][1];var y1=ds[i][2];if(x1+x>=0&&x1+x<width&&y1+y>=0&&y1+y<height){var d=ds[i][0];idx=index+x1+y1*width;idx*=3;data[idx]=Math.max(0,Math.min(255,data[idx]+er*d));data[idx+1]=Math.max(0,Math.min(255,data[idx+1]+eg*d));data[idx+2]=Math.max(0,Math.min(255,data[idx+2]+eb*d))}}}}};GIFEncoder.prototype.findClosest=function(c,used){return this.findClosestRGB((c&16711680)>>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i<len;index++){var dr=r-(this.colorTab[i++]&255);var dg=g-(this.colorTab[i++]&255);var db=b-(this.colorTab[i++]&255);var d=dr*dr+dg*dg+db*db;if((!used||this.usedEntry[index])&&d<dmin){dmin=d;minpos=index}}return minpos};GIFEncoder.prototype.getImagePixels=function(){var w=this.width;var h=this.height;this.pixels=new Uint8Array(w*h*3);var data=this.image;var srcPos=0;var count=0;for(var i=0;i<h;i++){for(var j=0;j<w;j++){this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];srcPos++}}};GIFEncoder.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33);this.out.writeByte(249);this.out.writeByte(4);var transp,disp;if(this.transparent===null){transp=0;disp=0}else{transp=1;disp=2}if(this.dispose>=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i<n;i++)this.out.writeByte(0)};GIFEncoder.prototype.writeShort=function(pValue){this.out.writeByte(pValue&255);this.out.writeByte(pValue>>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i<hsize;++i)htab[i]=-1}function compress(init_bits,outs){var fcode,c,i,ent,disp,hsize_reg,hshift;g_init_bits=init_bits;clear_flg=false;n_bits=g_init_bits;maxcode=MAXCODE(n_bits);ClearCode=1<<init_bits-1;EOFCode=ClearCode+1;free_ent=ClearCode+2;a_count=0;ent=nextPixel();hshift=0;for(fcode=HSIZE;fcode<65536;fcode*=2)++hshift;hshift=8-hshift;hsize_reg=HSIZE;cl_hash(hsize_reg);output(ClearCode,outs);outer_loop:while((c=nextPixel())!=EOF){fcode=(c<<BITS)+ent;i=c<<hshift^ent;if(htab[i]===fcode){ent=codetab[i];continue}else if(htab[i]>=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<<BITS){codetab[i]=free_ent++;htab[i]=fcode}else{cl_block(outs)}}output(ent,outs);output(EOFCode,outs)}function encode(outs){outs.writeByte(initCodeSize);remaining=width*height;curPixel=0;compress(initCodeSize+1,outs);outs.writeByte(0)}function flush_char(outs){if(a_count>0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<<n_bits)-1}function nextPixel(){if(remaining===0)return EOF;--remaining;var pix=pixels[curPixel++];return pix&255}function output(code,outs){cur_accum&=masks[cur_bits];if(cur_bits>0)cur_accum|=code<<cur_bits;else cur_accum=code;cur_bits+=n_bits;while(cur_bits>=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<<BITS;else maxcode=MAXCODE(n_bits)}}if(code==EOFCode){while(cur_bits>0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<<intbiasshift;var gammashift=10;var gamma=1<<gammashift;var betashift=10;var beta=intbias>>betashift;var betagamma=intbias<<gammashift-betashift;var initrad=netsize>>3;var radiusbiasshift=6;var radiusbias=1<<radiusbiasshift;var initradius=initrad*radiusbias;var radiusdec=30;var alphabiasshift=10;var initalpha=1<<alphabiasshift;var alphadec;var radbiasshift=8;var radbias=1<<radbiasshift;var alpharadbshift=alphabiasshift+radbiasshift;var alpharadbias=1<<alpharadbshift;var prime1=499;var prime2=491;var prime3=487;var prime4=503;var minpicturebytes=3*prime4;function NeuQuant(pixels,samplefac){var network;var netindex;var bias;var freq;var radpower;function init(){network=[];netindex=new Int32Array(256);bias=new Int32Array(netsize);freq=new Int32Array(netsize);radpower=new Int32Array(netsize>>3);var i,v;for(i=0;i<netsize;i++){v=(i<<netbiasshift+8)/netsize;network[i]=new Float64Array([v,v,v,0]);freq[i]=intbias/netsize;bias[i]=0}}function unbiasnet(){for(var i=0;i<netsize;i++){network[i][0]>>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(j<hi||k>lo){a=radpower[m++];if(j<hi){p=network[j++];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}if(k>lo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i<netsize;i++){n=network[i];dist=Math.abs(n[0]-b)+Math.abs(n[1]-g)+Math.abs(n[2]-r);if(dist<bestd){bestd=dist;bestpos=i}biasdist=dist-(bias[i]>>intbiasshift-netbiasshift);if(biasdist<bestbiasd){bestbiasd=biasdist;bestbiaspos=i}betafreq=freq[i]>>betashift;freq[i]-=betafreq;bias[i]+=betafreq<<gammashift}freq[bestpos]+=beta;bias[bestpos]-=betagamma;return bestbiaspos}function inxbuild(){var i,j,p,q,smallpos,smallval,previouscol=0,startpos=0;for(i=0;i<netsize;i++){p=network[i];smallpos=i;smallval=p[1];for(j=i+1;j<netsize;j++){q=network[j];if(q[1]<smallval){smallpos=j;smallval=q[1]}}q=network[smallpos];if(i!=smallpos){j=q[0];q[0]=p[0];p[0]=j;j=q[1];q[1]=p[1];p[1]=j;j=q[2];q[2]=p[2];p[2]=j;j=q[3];q[3]=p[3];p[3]=j}if(smallval!=previouscol){netindex[previouscol]=startpos+i>>1;for(j=previouscol+1;j<smallval;j++)netindex[j]=i;previouscol=smallval;startpos=i}}netindex[previouscol]=startpos+maxnetpos>>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i<netsize||j>=0){if(i<netsize){p=network[i];dist=p[1]-g;if(dist>=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}if(j>=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}}return best}function learn(){var i;var lengthcount=pixels.length;var alphadec=30+(samplefac-1)/3;var samplepixels=lengthcount/(3*samplefac);var delta=~~(samplepixels/ncycles);var alpha=initalpha;var radius=initradius;var rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i<rad;i++)radpower[i]=alpha*((rad*rad-i*i)*radbias/(rad*rad));var step;if(lengthcount<minpicturebytes){samplefac=1;step=3}else if(lengthcount%prime1!==0){step=3*prime1}else if(lengthcount%prime2!==0){step=3*prime2}else if(lengthcount%prime3!==0){step=3*prime3}else{step=3*prime4}var b,g,r,j;var pix=0;i=0;while(i<samplepixels){b=(pixels[pix]&255)<<netbiasshift;g=(pixels[pix+1]&255)<<netbiasshift;r=(pixels[pix+2]&255)<<netbiasshift;j=contest(b,g,r);altersingle(alpha,j,b,g,r);if(rad!==0)alterneigh(rad,j,b,g,r);pix+=step;if(pix>=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j<rad;j++)radpower[j]=alpha*((rad*rad-j*j)*radbias/(rad*rad))}}}function buildColormap(){init();learn();unbiasnet();inxbuild()}this.buildColormap=buildColormap;function getColormap(){var map=[];var index=[];for(var i=0;i<netsize;i++)index[network[i][3]]=i;var k=0;for(var l=0;l<netsize;l++){var j=index[l];map[k++]=network[j][0];map[k++]=network[j][1];map[k++]=network[j][2]}return map}this.getColormap=getColormap;this.lookupRGB=inxsearch}module.exports=NeuQuant},{}],4:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i<len;i++){page=ref[i];results.push(page.buffer)}return results}();return self.postMessage(frame,transfer)}else{return self.postMessage(frame)}};self.onmessage=function(event){return renderFrame(event.data)}},{"./GIFEncoder.js":1}]},{},[4]);
|
|
324
|
-
`],{type:"application/javascript"}))})}const lT="https://api.polotno.com",uT=()=>lT+"/api",e_=Xr({value:!1}),t_=Xr({value:"v1"}),cT=()=>t_.value,fT=()=>e_.value,hT=Qr(()=>{e_.value=!0});let Jd=typeof window<"u"?window.location.origin:"";const dT=typeof navigator<"u"&&navigator.userAgent.indexOf("Headless")>-1,pT=typeof navigator<"u"&&navigator.userAgent.indexOf("Electron")>-1;Jd==="file://"&&dT&&(Jd="headless"),Jd==="file://"&&pT&&(Jd="electron");const gT=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${Jd}" here: https://polotno.com/cabinet`;let vT=fetch;async function mT(t){for(let e=0;e<5;e++)try{const r=await vT(uT()+"/validate-key",{method:"POST",body:JSON.stringify({key:t,site:location.host,skdVersion:"2.29.1"})});if(dc(()=>{t_.value=r.headers.get("x-api-version")}),!t)return console.warn("Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet"),!1;if(r.status!==200){await new Promise(i=>setTimeout(i,3e3));continue}const n=await r.json();return n.is_valid||console.warn("Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet"),n.is_paid||console.log("%cPolotno Free Version. For development usage only. https://polotno.com/","background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),n.is_domain_valid||console.log(gT,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),oO(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 yT(t,e){await mT(t)&&!e||hT()}const Q0=({px:t,unit:e="px",dpi:r})=>{switch(e){case"pt":default:return t;case"mm":return t/(r/25.4);case"cm":return t/(r/2.54);case"in":return t/r}},_4=({px:t,precious:e=2,dpi:r=72,unit:n="px"})=>parseFloat(Q0({px:t,dpi:r,unit:n}).toFixed(e)),x4=({unitVal:t,dpi:e,unit:r})=>t/Q0({px:1,unit:r,dpi:e}),bT=t=>{const e=parseFloat(Q0(t).toFixed(1));switch(t.unit){case"pt":return`${Math.round(e)}pt`;case"mm":return`${e}mm`;case"cm":return`${e}cm`;case"in":return`${e}in`;default:return`${Math.round(e)}px`}};async function wT(t){for(let e=0;e<30;e++){const r=await t();if(r)return r;await new Promise(n=>setTimeout(n,50))}}function Dp(t){return new Promise((e,r)=>{const n=document.createElement("img");n.onload=()=>{e(n)},n.onerror=i=>{r(i)},n.crossOrigin="anonymous",n.src=t})}async function _T(t,e){const r=await Dp(t),n=document.createElement("canvas");n.width=2*r.width,n.height=2*r.height,n.getContext("2d").drawImage(r,0,0,n.width,n.height);const i=document.createElement("canvas");i.width=e.width,i.height=e.height;const a=i.getContext("2d");let{cropX:o,cropY:s}=e;const u=n.width*e.cropWidth,h=n.height*e.cropHeight,f=e.width/e.height;let g,v;const p=u/h;return e.type==="svg"?(g=u,v=h):f>=p?(g=u,v=u/f):(g=h*f,v=h),a.drawImage(n,o*n.width,s*n.height,g,v,0,0,i.width,i.height),i.toDataURL("image/png")}function r_(t,e){const{width:r,height:n}=t,i=r/n;let a,o;i>=e.width/e.height?(a=e.width,o=e.width/i):(a=e.height*i,o=e.height);const s=(e.width-a)/2,u=(e.height-o)/2;return{cropX:s/e.width,cropY:u/e.height,cropWidth:a/e.width,cropHeight:o/e.height}}var el;(function(t){t.sepia="sepia",t.grayscale="grayscale",t.natural="natural",t.warm="warm",t.cold="cold",t.temperature="temperature",t.contrast="contrast",t.shadows="shadows",t.white="white",t.black="black",t.vibrance="vibrance",t.saturation="saturation"})(el||(el={}));function n_(t,e){let r={filter:"",html:void 0};switch(t){case el.warm:{const n=Math.max(0,Math.min(1,e??.5)),i=1+.3*n,a=1+.15*n,o=1;return r.filter="url(#warm-filter)",r.html=`
|
|
325
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
326
|
-
<filter id="warm-filter" color-interpolation-filters="sRGB">
|
|
327
|
-
<feColorMatrix type="matrix" values="
|
|
328
|
-
${i} 0 0 0 0
|
|
329
|
-
0 ${a} 0 0 0
|
|
330
|
-
0 0 ${o} 0 0
|
|
331
|
-
0 0 0 1 0" />
|
|
332
|
-
</filter>
|
|
333
|
-
</svg>`,r}case el.cold:{const n=Math.max(0,Math.min(1,e??.5)),i=1-.15*n,a=1-.1*n,o=1+.15*n;return r.filter="url(#cold-filter)",r.html=`
|
|
334
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
335
|
-
<filter id="cold-filter" color-interpolation-filters="sRGB">
|
|
336
|
-
<feColorMatrix type="matrix" values="
|
|
337
|
-
${i} 0 0 0 0
|
|
338
|
-
0 ${a} 0 0 0
|
|
339
|
-
0 0 ${o} 0 0
|
|
340
|
-
0 0 0 1 0" />
|
|
341
|
-
</filter>
|
|
342
|
-
</svg>`,r}case"natural":{const n=Math.max(0,Math.min(1,e??.5)),i=1+.1*n,a=1+.3*n,o=1+.2*n;return r.filter=`saturate(${a}) brightness(${i}) contrast(${o})`,r}case el.temperature:{const n=Math.max(-1,Math.min(1,e??0)),i=1+.15*n,a=1,o=1-.15*n;return r.filter="url(#temperature-filter)",r.html=`
|
|
343
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
344
|
-
<filter id="temperature-filter" color-interpolation-filters="sRGB">
|
|
345
|
-
<feColorMatrix type="matrix" values="
|
|
346
|
-
${i} 0 0 0 0
|
|
347
|
-
0 ${a} 0 0 0
|
|
348
|
-
0 0 ${o} 0 0
|
|
349
|
-
0 0 0 1 0" />
|
|
350
|
-
</filter>
|
|
351
|
-
</svg>
|
|
352
|
-
`,r}case el.contrast:{const n=100*Math.max(-1,Math.min(1,e??0)),i=259*(n+255)/(255*(259-n)),a=.5*(1-i);return r.filter="url(#contrast-filter)",r.html=`
|
|
353
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
354
|
-
<filter id="contrast-filter" color-interpolation-filters="sRGB">
|
|
355
|
-
<feComponentTransfer>
|
|
356
|
-
<feFuncR type="linear" slope="${i}" intercept="${a}" />
|
|
357
|
-
<feFuncG type="linear" slope="${i}" intercept="${a}" />
|
|
358
|
-
<feFuncB type="linear" slope="${i}" intercept="${a}" />
|
|
359
|
-
</feComponentTransfer>
|
|
360
|
-
</filter>
|
|
361
|
-
</svg>
|
|
362
|
-
`,r}case el.shadows:{const n=Math.max(-1,Math.min(1,e??0)),i=Math.min(Math.max(1-.6*n,.4),2.5);return r.filter="url(#shadows-filter)",r.html=`
|
|
363
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
364
|
-
<filter id="shadows-filter" color-interpolation-filters="sRGB">
|
|
365
|
-
<feComponentTransfer>
|
|
366
|
-
<feFuncR type="gamma" amplitude="1" exponent="${i}" offset="0" />
|
|
367
|
-
<feFuncG type="gamma" amplitude="1" exponent="${i}" offset="0" />
|
|
368
|
-
<feFuncB type="gamma" amplitude="1" exponent="${i}" offset="0" />
|
|
369
|
-
</feComponentTransfer>
|
|
370
|
-
</filter>
|
|
371
|
-
</svg>
|
|
372
|
-
`,r}case el.white:case el.black:return null;case el.vibrance:{const n=Math.max(-1,Math.min(1,e??0)),i=.299,a=.587,o=.114;let s;s=n>=0?1+1.5*n:1+n;const u=1-s,h=u*i+s,f=u*a,g=u*o,v=u*i,p=u*a+s,y=u*o,_=u*i,x=u*a,b=u*o+s;return r.filter="url(#vibrance-filter)",r.html=`
|
|
373
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
374
|
-
<filter id="vibrance-filter" color-interpolation-filters="sRGB">
|
|
375
|
-
<feColorMatrix type="matrix" values="
|
|
376
|
-
${h} ${f} ${g} 0 0
|
|
377
|
-
${v} ${p} ${y} 0 0
|
|
378
|
-
${_} ${x} ${b} 0 0
|
|
379
|
-
0 0 0 1 0" />
|
|
380
|
-
</filter>
|
|
381
|
-
</svg>
|
|
382
|
-
`,r}case el.saturation:{const o=1+Math.max(-1,Math.min(1,e??0)),s=1-o,u=s*.2126+o,h=s*.7152,f=s*.0722,g=s*.2126,v=s*.7152+o,p=s*.0722,y=s*.2126,_=s*.7152,x=s*.0722+o;return r.filter="url(#saturation-filter)",r.html=`
|
|
383
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="display:none">
|
|
384
|
-
<filter id="saturation-filter" color-interpolation-filters="sRGB">
|
|
385
|
-
<feColorMatrix type="matrix" values="
|
|
386
|
-
${u} ${h} ${f} 0 0
|
|
387
|
-
${g} ${v} ${p} 0 0
|
|
388
|
-
${y} ${_} ${x} 0 0
|
|
389
|
-
0 0 0 1 0" />
|
|
390
|
-
</filter>
|
|
391
|
-
</svg>
|
|
392
|
-
`,r}default:return null}}async function xT(t){return new Promise((e,r)=>{const n=document.createElement("video");n.crossOrigin="anonymous",n.src=t,n.addEventListener("loadedmetadata",()=>{const{videoWidth:i,videoHeight:a}=n;e({width:i,height:a})}),n.addEventListener("error",i=>{const a=t.slice(0,100);r(new Error(`Failed to load video: ${a}`))})})}var ST=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r};const Mi=(t,e,...r)=>({type:t,props:e,children:r||[]}),Z1=async({element:t,page:e,store:r})=>{let{src:n}=t;if(t.type==="svg"&&Object.keys(t.colorsReplace).length){const S=await jp(n);n=uy(S,new Map(Object.entries(t.colorsReplace)))}let i="";t.flipX&&(i+="scaleX(-1)"),t.flipY&&(i+="scaleY(-1)"),i||(i="none");const a={};if(t.type==="svg"&&t.maskSrc){const S=await $3(n);a["mask-image"]=`url(${S})`,a["mask-size"]="100% 100%",a["mask-position"]="0 0",a["mask-repeat"]="no-repeat",a["-webkit-mask-image"]=`url(${S})`,a["-webkit-mask-size"]="100% 100%",a["-webkit-mask-position"]="0 0",a["-webkit-mask-repeat"]="no-repeat",n=t.maskSrc}else if(t.clipSrc){const S=t.clipSrc,k=await $3(S);a["mask-image"]=`url(${k})`,a["mask-size"]="100% 100%",a["mask-position"]="0 0",a["mask-repeat"]="no-repeat",a["-webkit-mask-image"]=`url(${k})`,a["-webkit-mask-size"]="100% 100%",a["-webkit-mask-position"]="0 0",a["-webkit-mask-repeat"]="no-repeat"}const o=await Dp(n),s=o.width*t.cropWidth,u=o.height*t.cropHeight,h=t.width/t.height;let f,g;const v=s/u;t.type==="svg"||t.stretchEnabled?(f=s,g=u):h>=v?(f=s,g=s/h):(f=u*h,g=u);const p=f/o.width,y=g/o.height,_=f/g>t.width/t.height?t.height/g:t.width/f,x=f*_/p,b=g*_/y,E=t.cropX*_*o.width,A=t.cropY*_*o.height;return Mi("div",{style:Object.assign(Object.assign({},a),{width:"100%",height:"100%",borderRadius:t.cornerRadius+"px",border:t.borderSize?`${t.borderSize}px solid ${t.borderColor}`:"none",backgroundRepeat:"no-repeat",backgroundImage:`url(${n})`,transform:i,backgroundSize:`${Math.round(x)}px ${Math.round(b)}px`,backgroundPositionX:-Math.round(E)+"px",backgroundPositionY:-Math.round(A)+"px"})})},S4=({element:t,type:e})=>{const r={"stroke-width":t.height,stroke:t.color,"line-cap":"round","stroke-linejoin":"round",opacity:t.opacity};return e==="arrow"||e==="triangle"?Mi("polyline",Object.assign({points:`${3*t.height},${2*-t.height} 0,0 ${3*t.height},${2*t.height}`},r)):e==="bar"?Mi("polyline",Object.assign({points:`0,${2*-t.height} 0,${2*t.height}`},r)):e==="circle"?Mi("circle",Object.assign({r:t.height},r)):e==="square"?Mi("polyline",Object.assign({points:`${-t.height},${-t.height} ${-t.height},${t.height} ${t.height},${t.height} ${t.height},${-t.height}`},r)):null},ET={image:Z1,svg:Z1,text:async({element:t,page:e,store:r})=>{if(t.curveEnabled){const v=uh(t.width,t.height,t.curvePower,t.fontSize),p=ns(t.text).replace(/\n/g," "),y=`
|
|
393
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${t.width}" height="${t.height}" style="display: block;">
|
|
394
|
-
<defs><path id="curve-${t.id}" d="${v}" fill="none" /></defs>
|
|
395
|
-
<text
|
|
396
|
-
font-family="'${t.fontFamily}'"
|
|
397
|
-
font-size="${t.fontSize}"
|
|
398
|
-
font-weight="${t.fontWeight}"
|
|
399
|
-
font-style="${t.fontStyle}"
|
|
400
|
-
fill="${t.fill}"
|
|
401
|
-
text-anchor="middle"
|
|
402
|
-
dominant-baseline="central"
|
|
403
|
-
letter-spacing="${t.letterSpacing}em"${t.strokeWidth?` stroke="${t.stroke}" stroke-width="${t.strokeWidth}" paint-order="stroke fill"`:""}>
|
|
404
|
-
<textPath href="#curve-${t.id}" startOffset="50%">
|
|
405
|
-
${p}
|
|
406
|
-
</textPath>
|
|
407
|
-
</text>
|
|
408
|
-
</svg>`;return Mi("div",{style:{width:"100%",height:"100%"},innerHTML:y})}let n={top:0,left:0};t.fill.indexOf("gradient")>=0&&(n=Object.assign(Object.assign({},n),{backgroundColor:t.fill,backgroundImage:t.fill,backgroundSize:"100% 100%",backgroundRepeat:"repeat",backgroundClip:"text",WebkitBackgroundClip:"text",MozBackgroundClip:"text",WebkitTextFillColor:"transparent",MozTextFillColor:"transparent"}));const i=t.backgroundPadding*(t.fontSize*t.lineHeight),a=Mi("div",{style:{position:"absolute",top:-i/2+"px",left:-i/2+"px",display:t.backgroundEnabled?"block":"none",width:t.width+i+"px",height:t.height+i+"px",backgroundColor:t.backgroundColor,borderRadius:t.backgroundCornerRadius*(t.fontSize*t.lineHeight*.5)+"px"}});t.verticalAlign==="middle"?(n.top="50%",n.transform="translateY(-50%)"):t.verticalAlign==="bottom"&&(n.bottom=0);const o=/<[a-z][\s\S]*>/i.test(t.text),s=Object.assign(Object.assign({},n),{position:"absolute",width:t.width+"px",color:t.fill,whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:t.fontSize+"px",textAlign:t.align,fontFamily:`'${t.fontFamily}'`,textDecoration:t.textDecoration||"none",textDecorationColor:t.textDecoration?t.fill:void 0,textTransform:t.textTransform||"none",lineHeight:t.lineHeight,letterSpacing:t.letterSpacing*t.fontSize+"px",fontStyle:t.fontStyle,fontWeight:t.fontWeight,WebkitTextStroke:`${t.strokeWidth}px ${t.stroke}`,textStroke:`${t.strokeWidth}px ${t.stroke}`,paintOrder:t.strokeWidth?"stroke fill":void 0}),u="el-"+t.id,h=o?{id:u}:{},f=`<style>#${u} {${K0}}</style>`,g=Mi("div",Object.assign(Object.assign({style:s},h),{innerHTML:o?`${f}${t.text}`:t.text.split(`
|
|
409
|
-
`).join("<br />")}));return Mi("div",{style:{position:"relative",width:"100%",height:"100%"}},a,g)},line:async({element:t,page:e,store:r})=>Mi("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},Mi("rect",{x:0,y:0,width:t.width,height:t.height,fill:t.color}),Mi("g",{transform:`translate(0 ${t.height/2})`},S4({element:t,type:t.startHead})),Mi("g",{transform:`translate(${t.width} ${t.height/2}) rotate(180)`},S4({element:t,type:t.endHead}))),figure:async({element:t,page:e,store:r,elementHook:n})=>{const i=Z7(t),a=Mi("div",{innerHTML:i});return n&&n({dom:a,element:t})||a},group:async({element:t,page:e,store:r,elementHook:n})=>{const i=await Promise.all(t.children.map(o=>i_({element:o,page:e,store:r,elementHook:n}))),a=Mi("div",{style:{transformOrigin:"top left",opacity:t.opacity}},...i);return n&&n({dom:a,element:t})||a},video:async({element:t,page:e,store:r,elementHook:n})=>{const{cropX:i,cropY:a,cropWidth:o,cropHeight:s}=t,u=await xT(t.src),h=u.width*o,f=u.height*s,g=t.width/t.height;let v,p;g>=h/f?(v=h,p=h/g):(v=f*g,p=f);const y=v/o,_=p/s,x=i*u.width,b=a*u.height,E=Math.max(t.width/u.width,t.height/u.height),A={position:"absolute",width:`${Math.round(y*E)}px`,height:`${Math.round(_*E)}px`,left:-Math.round(x*E)+"px",top:-Math.round(b*E)+"px",objectFit:"fill"},S=`video-${t.id}`,k=Mi("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",borderRadius:t.cornerRadius+"px",border:t.borderSize?`${t.borderSize}px solid ${t.borderColor}`:"none"}},Mi("video",{id:S,src:t.src,style:A,controls:!0,playsInline:!0,muted:!0,volume:t.volume}));return n&&n({dom:k,element:t})||k},gif:Z1};async function i_({element:t,page:e,store:r,elementHook:n}){let i=await ET[t.type];if(i||(i=()=>Mi("div",{}),console.error(`HTML export does not support ${t.type} type...`)),!t.visible)return null;const a=await i({element:t,page:e,store:r}),o=[],s=[];if(t.blurEnabled&&o.push(`blur(${t.blurRadius/2}px)`),t.brightnessEnabled&&o.push(`brightness(${100*t.brightness+100}%)`),t.sepiaEnabled&&o.push("sepia()"),t.grayscaleEnabled&&o.push("grayscale()"),t.filters)for(const[h,f]of Object.entries(t.filters)){const g=n_(el[h],f.intensity);g&&(o.push(g.filter),g.html&&s.push(g.html))}t.shadowEnabled&&o.push(`drop-shadow(${t.shadowOffsetX}px ${t.shadowOffsetY}px ${t.shadowBlur}px ${t.shadowColor})`);const u=Mi("div",{id:t.id,style:{position:"absolute",left:t.x+"px",top:t.y+"px",width:t.width+"px",height:t.height+"px",transform:`rotate(${t.rotation}deg)`,transformOrigin:"top left",opacity:t.opacity,display:t.visible&&t.showInExport?"block":"none",filter:o.join(" ")||"none"}},a,...s);return n&&n({dom:u,element:t})||u}async function kT({json:t,elementHook:e}){const r=await Promise.all(t.pages.map(a=>async function({page:o,store:s,elementHook:u}){const h=await Promise.all(o.children.map(p=>i_({element:p,page:o,store:s,elementHook:u}))),f=o.width==="auto"?s.width:o.width,g=o.height==="auto"?s.height:o.height;let v={};if(o.background.indexOf("url")>=0||o.background.indexOf("http")>=0||o.background.indexOf(".jpg")>=0||o.background.indexOf(".png")>=0||o.background.indexOf(".jpeg")>=0){const{width:p,height:y}=await Dp(o.background),_=await Z1({element:Object.assign({x:0,y:0,width:f,height:g,src:o.background,cornerRadius:0},r_({width:f,height:g},{width:p,height:y})),page:o,store:s});h.unshift(_)}else v=Object.assign(Object.assign({},v),{backgroundColor:o.background});return Mi("div",{className:"page",id:o.id,style:Object.assign(Object.assign({},v),{width:f+"px",height:g+"px",overflow:"hidden",position:"relative"})},...h)}({page:a,store:t,elementHook:e}))),n=[];t.pages.forEach(a=>{a.children.forEach(o=>{o.type==="text"&&n.indexOf(o.fontFamily)===-1&&n.push(o.fontFamily)})});const i=n.map(a=>t.fonts.find(o=>o.fontFamily===a)?Mi("style",{},""):Mi("link",{href:H8(a),rel:"stylesheet"}));return Mi("div",{className:"design"},...i,...r)}const a_=({dom:t})=>{if(typeof t=="string")return t;if(!t)return"";const e=t.props,{innerHTML:r}=e,n=ST(e,["innerHTML"]),i=Object.keys(n).map(a=>a==="style"&&typeof n[a]=="object"?`style="${Object.keys(n[a]).map(o=>`${o.replace(/[A-Z]/g,s=>`-${s.toLowerCase()}`)}: ${n[a][o]}`).join("; ")}"`:((o,s)=>typeof s=="object"?`${o}="${Object.keys(s).map(u=>`${u.replace(/-([a-z])/g,h=>h[1].toUpperCase())}:${s[u]};`).join(" ")}"`:`${o}="${s}"`)(a,n[a])).join(" ");return`<${t.type} ${i}>${r||t.children.map(a=>a_({dom:a})).join("")}</${t.type}>`};async function AT({json:t,elementHook:e}){const r=await kT({json:t,elementHook:e});return a_({dom:r})}var PT=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r};const o_=(t,e)=>{if(t.children)for(const r of t.children){if(e(r)===!0)break;o_(r,e)}},jr=(t,e,...r)=>({type:t,props:e,children:r||[]}),vv=async t=>{try{const e=await fetch(t);if(typeof Buffer<"u"){const r=await e.arrayBuffer(),n=Buffer.from(r).toString("base64");return`data:${e.headers.get("content-type")||"image/png"};base64,${n}`}{const r=await e.blob();return new Promise((n,i)=>{const a=new FileReader;a.onloadend=()=>n(a.result),a.onerror=i,a.readAsDataURL(r)})}}catch(e){return console.error("Error converting URL to data URL:",e),t}},mv=async({element:t,page:e,store:r})=>{let{src:n}=t;if(t.type==="svg"){const ie=await jp(n);n=uy(ie,new Map(Object.entries(t.colorsReplace)))}else n=await vv(n);let i,a,o,s,u="";t.flipX&&(u+="scaleX(-1)"),t.flipY&&(u+="scaleY(-1)"),t.clipSrc&&(i=`clip-img-mask-${t.id}`,a=await vv(t.clipSrc)),t.maskSrc&&(o=`mask-img-${t.id}`,s=await vv(t.maskSrc));const h=await Dp(n),f=h.width*t.cropWidth,g=h.height*t.cropHeight,v=t.width/t.height;let p,y;const _=f/g;typeof t.stretchEnabled=="boolean"&&t.stretchEnabled||t.type==="svg"?(p=f,y=g):v>=_?(p=f,y=f/v):(p=g*v,y=g);const x=p/h.width,b=y/h.height,E=p/y>t.width/t.height?t.height/y:t.width/p,A=p*E/x,S=y*E/b,k=t.cropX*h.width*E,I=t.cropY*h.height*E,O=`clip-${t.id}`,M=t.cornerRadius||0,F=n.replace(/&/g,"&"),j={x:-k,y:-I,width:A,height:S,preserveAspectRatio:"none","clip-path":`url(#${O})`},T=[jr("clipPath",{id:O},jr("rect",{x:0,y:0,width:t.width,height:t.height,rx:M||void 0,ry:M||void 0}))];i&&a&&T.push(jr("mask",{id:i,maskUnits:"userSpaceOnUse","mask-type":"alpha"},jr("image",{href:a.replace(/&/g,"&"),x:0,y:0,width:t.width,height:t.height,preserveAspectRatio:"none"}))),o&&T.push(jr("mask",{id:o,maskUnits:"userSpaceOnUse","mask-type":"alpha"},jr("image",Object.assign({href:F},j))));let L=F;const $={};o&&s&&(L=s.replace(/&/g,"&"),$.mask=`url(#${o})`);const q={style:{transform:u}};i&&(q.mask=`url(#${i})`);const J=t.borderSize||0,ae=J>0?jr("rect",{x:J/2,y:J/2,width:Math.max(0,t.width-J),height:Math.max(0,t.height-J),fill:"none",stroke:t.borderColor,"stroke-width":J,rx:Math.max(0,M-J)||void 0,ry:Math.max(0,M-J)||void 0}):null;return jr("g",q,jr("defs",{},...T),jr("image",Object.assign(Object.assign({href:L},j),$)),ae)},E4=({element:t,type:e})=>{const r={"stroke-width":t.height,stroke:t.color,"line-cap":"round","stroke-linejoin":"round",fill:t.color};return e==="arrow"?jr("polyline",Object.assign({points:`${3*t.height},${2*-t.height} 0,0 ${3*t.height},${2*t.height}`},r)):e==="triangle"?jr("polygon",Object.assign({points:`${3*t.height},${2*-t.height} 0,0 ${3*t.height},${2*t.height}`},r)):e==="bar"?jr("polyline",Object.assign({points:`0,${2*-t.height} 0,${2*t.height}`},r)):e==="circle"?jr("circle",Object.assign({cx:2*t.height,cy:0,r:2*t.height},r)):e==="square"?jr("polygon",Object.assign({points:`0,${2*-t.height} ${4*t.height},${2*-t.height} ${4*t.height},${2*t.height} 0,${2*t.height}`},r)):null},OT={image:mv,svg:mv,text:async({element:t,page:e,store:r})=>{if(t.curveEnabled){const p=uh(t.width,t.height,t.curvePower,t.fontSize),y=`curve-path-${t.id}`,_=ns(t.text).replace(/\n/g," ");return jr("g",{},jr("defs",{},jr("path",{id:y,d:p,fill:"none"})),jr("text",{fill:t.fill,"font-size":t.fontSize+"px","text-anchor":"middle","dominant-baseline":"central","font-family":t.fontFamily,"font-style":t.fontStyle,"font-weight":t.fontWeight,"letter-spacing":t.letterSpacing+"em","stroke-width":t.strokeWidth||void 0,stroke:t.strokeWidth?t.stroke:void 0,"paint-order":t.strokeWidth?"stroke fill":void 0},jr("textPath",{href:`#${y}`,startOffset:"50%",innerHTML:_})))}const n=(p,y,_,x,b,E=0)=>{const A=document.createElement("canvas").getContext("2d");return A.font=`${b} ${x} ${y}px ${_}`,A.measureText(p).width+Math.max(0,(p?p.length:0)-1)*E*y},i=(p,y,_,x,b,E,A=0)=>{const S=[];return p.split(`
|
|
410
|
-
`).forEach(k=>{const I=k.split(" ");let O="";for(let M=0;M<I.length;M++){const F=O+I[M]+" ";n(F,_,x,b,E,A)>y+.5&&M>0?(S.push(O.trim()),O=I[M]+" "):O=F}S.push(O.trim())}),S};let a=ns(t.text);t.textTransform=="uppercase"&&(a=a.toUpperCase());let o=t.fontSize,s=[];for(;;){s=i(a,t.width,o,t.fontFamily,t.fontWeight,t.fontStyle,t.letterSpacing);const p=Math.max(...s.map(_=>n(_,o,t.fontFamily,t.fontWeight,t.fontStyle,t.letterSpacing))),y=s.length*o*t.lineHeight;if(p<=t.width&&y<=t.height||(o-=1,o<4))break}const u=o*t.lineHeight,h=s.length*u;let f=o;t.verticalAlign==="middle"?f=(t.height-h)/2+o:t.verticalAlign==="bottom"&&(f=t.height-h+o);const g=t.align==="center"?"middle":t.align==="right"?"end":"start",v=s.map((p,y)=>jr("tspan",{x:t.align==="center"?t.width/2:t.align==="right"?t.width:0,dy:y===0?0:u,innerHTML:p}));return jr("g",{},jr("text",{fill:t.fill,y:f,"font-size":o+"px","text-anchor":g,"font-family":t.fontFamily,"font-style":t.fontStyle,"font-weight":t.fontWeight,"text-decoration":t.textDecoration,"line-height":t.lineHeight,"letter-spacing":t.letterSpacing+"em","stroke-width":t.strokeWidth,stroke:t.stroke},...v))},line:async({element:t,page:e,store:r})=>jr("g",{},jr("line",{x1:0,y1:t.height/2,x2:t.width,y2:t.height/2,stroke:t.color,"stroke-width":t.height,"stroke-dasharray":t.dash&&t.dash.length?t.dash.map(n=>n*t.height).join(" "):void 0}),jr("g",{transform:`translate(0 ${t.height/2})`},E4({element:t,type:t.startHead})),jr("g",{transform:`translate(${t.width} ${t.height/2}) rotate(180)`},E4({element:t,type:t.endHead}))),figure:async({element:t,page:e,store:r,elementHook:n})=>{const i=function(o){let s=o.replace(/<svg[^>]*>/,"");return s=s.replace(/<\/svg>/,""),s}(Z7(t)),a=jr("g",{innerHTML:i});return n&&n({dom:a,element:t})||a},group:async({element:t,page:e,store:r,elementHook:n})=>{const i=await Promise.all(t.children.map(o=>s_({element:o,page:e,store:r,elementHook:n}))),a=jr("g",{style:{"transform-origin":"top left"}},...i);return n&&n({dom:a,element:t})||a},gif:mv};async function s_({element:t,page:e,store:r,elementHook:n}){var i;let a=await OT[t.type];a||(a=()=>jr("g",{}),console.error(`SVG export does not support ${t.type} type...`));const o=await a({element:t,page:e,store:r}),s=[],u=[];if(t.blurEnabled&&s.push(`blur(${t.blurRadius/2}px)`),t.brightnessEnabled&&s.push(`brightness(${100*t.brightness+100}%)`),t.sepiaEnabled&&s.push("sepia()"),t.grayscaleEnabled&&s.push("grayscale()"),t.shadowEnabled&&s.push(`drop-shadow(${t.shadowOffsetX}px ${t.shadowOffsetY}px ${t.shadowBlur}px ${t.shadowColor})`),t.filters)for(const[f,g]of Object.entries(t.filters)){const v=n_(el[f],g.intensity);if(v&&(s.push(v.filter),v.html)){const p=v.html.replace(/<svg([^>]*)>/,"<g$1>").replace(/<\/svg>/,"</g>");u.push(p)}}const h=jr("g",{className:"element",id:t.id,transform:t.type!=="group"?`translate(${t.x}, ${t.y}) rotate(${t.rotation})`:void 0,display:(i=t.visible)===null||i===void 0||i?void 0:"none",opacity:t.opacity,style:{"transform-origin":"top left",filter:s.join(" ")}},o,...u);return n&&n({dom:h,element:t})||h}async function k4(t){try{const e=await fetch(t),r=e.headers.get("content-type")||"font/ttf",n=await e.arrayBuffer();return`data:${r};base64,${typeof Buffer<"u"?Buffer.from(n).toString("base64"):function(i){const a=new Uint8Array(i);let o="";for(let s=0;s<a.length;s+=32768){const u=a.subarray(s,s+32768);o+=String.fromCharCode(...u)}if(typeof btoa<"u")return btoa(o);if(typeof Buffer<"u")return Buffer.from(a).toString("base64");throw new Error("No base64 encoder available in this environment")}(n)}`}catch(e){return console.error("Error embedding font:",e),t}}async function CT({json:t,elementHook:e,fontEmbedding:r="inline"}){const n=[];o_({children:t.pages},o=>{o.type==="text"&&n.indexOf(o.fontFamily)===-1&&n.push(o.fontFamily)});const i=r==="inline"?await async function(o,s){return await Promise.all(o.map(async u=>{var h,f;if(u==="Arial")return null;const g=s.find(v=>v.fontFamily===u);if(g){G8(g),await Zh(u,"normal","normal"),await Zh(u,"normal","bold"),await Zh(u,"normal","italic"),await Zh(u,"normal","bold-italic");const v=await k4(g.url);return jr("style",{},`@font-face { font-family: ${u}; src: url(${v}); }`)}{$8(u),await Zh(u,"normal","normal");const v=`https://fonts.googleapis.com/css?family=${u}:bi,normal,i,b`;try{const p=await fetch(v),y=await p.text(),_=(f=(h=y.match(/url\((.*?)\)/g))===null||h===void 0?void 0:h.map(b=>b.replace(/url\((.*?)\)/,"$1")))===null||f===void 0?void 0:f.filter(b=>b.startsWith("https"));if(!_?.length)throw new Error("No font URLs found");const x=await Promise.all(_.map(async b=>{const E=await k4(b),A=y.match(/font-style:\s*(.*?);/),S=y.match(/font-weight:\s*(.*?);/),k=A?A[1]:"normal",I=S?S[1]:"normal";return`@font-face {
|
|
411
|
-
font-family: ${u};
|
|
412
|
-
font-style: ${k};
|
|
413
|
-
font-weight: ${I};
|
|
414
|
-
src: url(${E});
|
|
415
|
-
}`}));return jr("style",{},x.join(`
|
|
416
|
-
`))}catch(p){return console.error("Error embedding Google Font:",p),jr("defs",{},jr("style",{type:"text/css",innerHTML:`@import url('${v}');`.replace(/&/g,"&")}))}}}))}(n,t.fonts):[],a=await Promise.all(t.pages.map(o=>async function({page:s,store:u,elementHook:h}){const f=await Promise.all(s.children.map(p=>s_({element:p,page:s,store:u,elementHook:h}))),g=s.background.indexOf("url")>=0||s.background.indexOf("http")>=0||s.background.indexOf(".jpg")>=0||s.background.indexOf(".png")>=0||s.background.indexOf(".jpeg")>=0;let v;if(g){const p=await Dp(s.background);v=await _T(s.background,Object.assign({width:u.width,height:u.height,x:0,y:0},r_({width:u.width,height:u.height},{width:p.width,height:p.height})))}return jr("g",{className:"page",style:{}},g?jr("image",{"xlink:href":v,x:0,y:0,width:u.width,height:u.height,preserveAspectRatio:"none"}):jr("rect",{x:0,y:0,width:u.width,height:u.height,fill:g?void 0:s.background}),...f)}({page:o,store:t,elementHook:e})));return jr("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${t.width} ${t.height}`,width:t.width,height:t.height},...i,...a)}const l_=({dom:t,nestLevel:e=0})=>{if(typeof t=="string")return t;if(!t)return"";const r=t.props,{innerHTML:n}=r,i=PT(r,["innerHTML"]),a=Object.keys(i).map(s=>((u,h)=>typeof h=="object"?`${u}="${Object.keys(h).map(f=>`${f}:${h[f]};`).join(" ")}"`:h==null||h===""?"":`${u}="${h}"`)(s,i[s])).filter(s=>s&&s.trim().length>0).join(" "),o=" ".repeat(e);return`${o}<${t.type}${a?" "+a:""}>${n||`
|
|
417
|
-
`+t.children.map(s=>l_({dom:s,nestLevel:e+1})).join("")}${o}</${t.type}>
|
|
418
|
-
`};async function LT({json:t,elementHook:e,fontEmbedding:r="inline"}){const n=await CT({json:t,elementHook:e,fontEmbedding:r});return l_({dom:n})}const cp=Zt.model("Page",{id:Zt.identifier,children:Zt.array(Zt.late(()=>v_)),width:Zt.optional(Zt.union(Zt.number,Zt.literal("auto")),"auto"),height:Zt.optional(Zt.union(Zt.number,Zt.literal("auto")),"auto"),background:"white",bleed:0,custom:Zt.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(t=>{const e=Object.assign({},t),r={};for(var n in e)n[0]!=="_"&&(r[n]=t[n]);return r}).views(t=>({get store(){return Yf(t,nh)}})).views(t=>({get startTime(){let e=0;for(const r of t.store.pages){if(r.id===t.id)return e;e+=r.duration}return e},get _exportingOrRendering(){return t._exporting||t._rendering}})).views(t=>({get computedWidth(){return t.width==="auto"?t.store.width:t.width},get computedHeight(){return t.height==="auto"?t.store.height:t.height}})).actions(t=>({toJSON:()=>JSON.parse(JSON.stringify(Ru(t))),_forEachElementUp(e,r){const n=e.map(i=>({id:i,index:t.children.findIndex(a=>a.id===i)}));n.sort((i,a)=>a.index-i.index);for(const{index:i}of n){if(i==-1)continue;const a=i<t.children.length-1&&t.children[i+1],o=e.indexOf(a?.id)>=0;i===t.children.length-1||o||r(i)}},_forEachElementDown(e,r){const n=e.map(i=>({id:i,index:t.children.findIndex(a=>a.id===i)}));n.sort((i,a)=>i.index-a.index);for(const{index:i}of n){if(i==-1)continue;const a=i>0&&t.children[i-1],o=e.indexOf(a?.id)>=0;i===0||o||r(i)}return!1}})).actions(t=>({clone(e={}){const r=t.toJSON();r.children.forEach(o=>{o.id=Cl(10),Ii(o,s=>{s.id=Cl(10)})});const n=Object.assign(Object.assign(Object.assign({},r),{id:Cl(10)}),e),i=t.store.addPage(n),a=t.store.pages.indexOf(t);return i.setZIndex(a+1),i.select(),i},setZIndex(e){t.store.setPageZIndex(t.id,e)},set(e){Object.assign(t,e)},select(){t.store.selectPage(t.id)},addElement(e,{skipSelect:r=!1}={}){const n=yy[e.type];if(!n)return void console.error("Can not find model with type "+e.type);"children"in e&&Array.isArray(e.children)&&Ii(e,o=>{o.id=o.id||Cl(10)});const i=t.children.reduce((o,s)=>{if(s.type==="group"){const u=s.children.reduce((h,f)=>{var g;const v=(g=f.name)===null||g===void 0?void 0:g.match(new RegExp(`${e.type}-(\\d+)`));if(v){const p=parseInt(v[1],10);return Math.max(h,p||0)}},0);return Math.max(o,u||0)}{const u=s.name.match(new RegExp(`${e.type}-(\\d+)`));if(u){const h=parseInt(u[1],10);return Math.max(o,h||0)}}return o},0),a=n.create(Object.assign({id:Cl(10),name:`${e.type}-${i+1}`},e));return t.children.push(a),a.selectable&&!r&&t.store.selectElements([a.id]),a},canMoveElementsUp(e){let r=!1;return t._forEachElementUp(e,()=>{r=r||!0}),r},moveElementsUp(e){t._forEachElementUp(e,r=>{const n=t.children[r];Jf(n),t.children.splice(r+1,0,n)})},canMoveElementsTop(e){return this.canMoveElementsUp(e)},moveElementsTop(e){const r=[],n=[];t.children.forEach(i=>{e.indexOf(i.id)>=0?r.push(i):n.push(i)}),t.children.replace(n.concat(r))},canMoveElementsDown(e){let r=!1;return t._forEachElementDown(e,()=>{r=r||!0}),r},moveElementsDown(e){t._forEachElementDown(e,r=>{const n=t.children[r];Jf(n),t.children.splice(r-1,0,n)})},canMoveElementsBottom(e){return this.canMoveElementsDown(e)},moveElementsBottom(e){const r=[],n=[];t.children.forEach(i=>{e.indexOf(i.id)>=0?r.push(i):n.push(i)}),t.children.replace(r.concat(n))},setElementZIndex(e,r){const n=t.children.find(i=>i.id===e);n&&(Jf(n),t.children.remove(n),t.children.splice(r,0,n))},setSize({width:e,height:r,useMagic:n,softChange:i}){if(n){const a=[],o=I=>I.type==="image"&&I.x<1&&I.y<1&&I.width>=t.computedWidth-2&&I.height>=t.computedHeight-2;Ii(t,I=>{I.type!=="group"&&(o(I)||a.push(I))});const s=a.length?Z0(a):{x:0,y:0,width:t.computedWidth,height:t.computedHeight},u=1/4,h=Math.max(0,Math.min(s.x,t.computedWidth-s.x-s.width)),f=t.computedWidth*u,g=Math.max(0,h-f),v=Math.max(0,Math.min(s.y,t.computedHeight-s.y-s.height)),p=t.computedHeight*u,y=Math.max(0,v-p),_=t.computedWidth-2*g,x=t.computedHeight-2*y,b=e/_,E=r/x,A=Math.min(b,E),S=(e-_*A)/2-g*A,k=(r-x*A)/2-y*A;Ii(t,I=>{I.type!=="group"&&(o(I)?I.set({x:I.x*A,y:I.y*A,width:I.width*b,height:I.height*E,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(I.set({x:S+I.x*A,y:k+I.y*A,width:I.width*A,height:I.height*A}),I.type==="text"?I.set({fontSize:I.fontSize*A}):I.type==="figure"&&I.set({strokeWidth:I.strokeWidth*A})))})}i||(t.width=e),i||(t.height=r)}})).actions(t=>({moveElementUp(e){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),t.moveElementsUp([e])},moveElementDown(e){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),t.moveElementsDown([e])},moveElementTop(e){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),t.moveElementsTop([e])},moveElementBottom(e){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),t.moveElementsBottom([e])},play(){t.store.play({startTime:t.startTime,endTime:t.startTime+t.duration})}})),A4=Zt.model("Audio",{id:Zt.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0,custom:Zt.frozen()}).actions(t=>({toJSON:()=>Object.assign({},Ru(t))})).actions(t=>({set(e){Object.assign(t,e)}}));var Hd=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r};hO("ignore");const NT=Zt.model("Font",{fontFamily:Zt.string,url:Zt.optional(Zt.string,""),styles:Zt.frozen()}).preProcessSnapshot(t=>Object.assign(Object.assign({},t),{fontFamily:t.fontFamily||t.name})),nh=Zt.model("Store",{role:"",pages:Zt.array(cp),fonts:Zt.array(NT),audios:Zt.array(A4),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:Zt.frozen(),selectedElementsIds:Zt.array(Zt.string),animatedElementsIds:Zt.array(Zt.string),history:Zt.optional(iT,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),_activePageId:"",_selectedPagesIds:Zt.array(Zt.string),_forceShowCredit:!1,_key:"",_validated:!1}).views(t=>{const e=dh(()=>{const r={};return Ii({children:t.pages},n=>(r[n.id]=n,!1)),r},{keepAlive:!0});return{get _idsMap(){return e.get()}}}).views(t=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),t.bleedVisible},get selectedElements(){return t.selectedElementsIds.map(e=>{for(const r of t.pages)for(const n of r.children)if(n.id===e)return n}).filter(e=>!!e)},get children(){return t.pages},get selectedShapes(){const e=[];return Ii({children:t.selectedElements},r=>{r.type!=="group"&&e.push(r)}),e},get activePage(){return t.pages.slice().find(e=>e.id===t._activePageId)||(t.pages.length?t.pages[0]:null)},get selectedPages(){return t._selectedPagesIds.map(e=>t.pages.find(r=>r.id===e))},get duration(){let e=0;return t.pages.forEach(r=>{e+=r.duration}),e},get _hasCroppedImages(){return t.find(e=>e.type==="image"&&e._cropModeEnabled)},find(e){let r;return Ii({children:t.pages},n=>{if(!r&&e(n))return r=n,!0}),r},getElementById:e=>t._idsMap[e]})).actions(t=>{let e=0,r=null,n=!1;return{afterCreate(){t.history.canUndo},setCurrentTime(i){t.currentTime=i},_togglePlaying(i=!t.isPlaying){t.isPlaying=i},play({animatedElementsIds:i=[],startTime:a=0,currentTime:o=0,endTime:s=t.duration,repeat:u=!1}={}){o&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),a=o),t.animatedElementsIds=i,t.currentTime=a,t.isPlaying=!0,e=Date.now(),r=s,n=u,requestAnimationFrame(t.seek)},checkActivePage(){let i=0;for(const a of t.pages){if(t.currentTime>=a.startTime&&t.currentTime<a.startTime+a.duration){t.selectPage(a.id);break}i+=a.duration}},seek(){if(!t.isPlaying)return;const i=Date.now(),a=i-e;e=i,t.currentTime+=a,t.checkActivePage();const o=r||t.duration;t.isPlaying&&t.currentTime<o?requestAnimationFrame(t.seek):t.isPlaying&&n?(t.currentTime=0,requestAnimationFrame(t.seek)):t.stop()},stop(){t.isPlaying=!1,t.currentTime=0,t.animatedElementsIds=[],t.checkActivePage()}}}).actions(t=>({__(){t._validated||(yT(t._key,t._forceShowCredit),t._validated=!0)},set(e){Object.assign(t,e)},setUnit({unit:e,dpi:r}){t.unit=e||t.unit,t.dpi=r||t.dpi},setRole(e){t.role=e},addPage(e){const r=cp.create(Object.assign({id:Cl(10)},e));return t.pages.push(r),t._activePageId=r.id,r},selectPage(e){t._activePageId=e,t._selectedPagesIds.length===1&&(t._selectedPagesIds=[e])},selectPages(e){t._selectedPagesIds=e,t._selectedPagesIds.length===1&&(t._activePageId=t._selectedPagesIds[0])},selectElements(e){const r=e.map(n=>t.getElementById(n)).sort((n,i)=>n.page.children.indexOf(n)-n.page.children.indexOf(i)).filter(n=>!!n).map(n=>n.id);t.selectedElementsIds=r},toggleBleed(e){t.bleedVisible=e??!t.bleedVisible},toggleRulers(e){t.rulesVisible=e??!t.rulesVisible},openSidePanel(e){t.openedSidePanel!==e&&(t.previousOpenedSidePanel=t.openedSidePanel,t.openedSidePanel=e)},setScale(e){t.scale=e},_setScaleToFit(e){t.scaleToFit=e},setElementsPixelRatio(e){t._elementsPixelRatio=e},setSize(e,r,n){t.pages.forEach(i=>{i.setSize({width:e,height:r,useMagic:n,softChange:!0})}),t.width=e,t.height=r},setPageZIndex(e,r){const n=t.pages.find(i=>i.id===e);n&&(Jf(n),t.pages.remove(n),t.pages.splice(r,0,n))},deletePages(e){const r=t.pages.indexOf(t.activePage);e.forEach(a=>{const o=t.pages.find(s=>s.id===a);e2(o)});const n=Math.min(t.pages.length-1,r),i=t.pages[n];i&&(t._activePageId=i.id),t.selectedElementsIds=t.selectedElementsIds.filter(a=>t.getElementById(a))},groupElements(e,r={}){const n=e.map(s=>t.getElementById(s)),i=n[0].page;if(n.forEach(s=>{s&&Jf(s)}),!n.length)return;const a=i.children.reduce((s,u)=>{if(u.type==="group"){const h=u.name.match(/group-(\d+)/);if(h){const f=parseInt(h[1],10);return Math.max(s,f)}}return s},0),o=Object.assign({id:Cl(10),name:`group-${a+1}`,children:n,type:"group"},r);return i.children.push(o),t.selectedElementsIds=[o.id],i.children.find(s=>s.id===o.id)},ungroupElements(e){const r=e.map(i=>t.getElementById(i)),n=[];r.forEach(i=>{if(i&&i.type==="group"){const a=i.page,o=a.children.indexOf(i);i.children.forEach(s=>{n.push(s.id)}),i.children.forEach(s=>{Jf(s),a.children.push(s)}),a.children.splice(o,1)}}),t.selectedElementsIds=n},deleteElements(e){const r=[];t.find(n=>(e.includes(n.id)&&r.push(n),!1)),r.forEach(n=>{e2(n)}),t.selectedElementsIds=t.selectedElementsIds.filter(n=>t.getElementById(n))},on(e,r){if(e==="change"){let n=t.toJSON();return X8(t,i=>{const a=t.toJSON();!up(n,a)&&(n=a,r(a))})}},async _toCanvas({pixelRatio:e,ignoreBackground:r,pageId:n,mimeType:i,includeBleed:a,_skipTimeout:o,quickMode:s=!1}={}){var u;const h=e||1;n=n||((u=t.pages[0])===null||u===void 0?void 0:u.id);const f=t.pages.find(L=>L.id===n);if(!f)throw new Error(`No page for export with id ${n}`);const g=t._elementsPixelRatio;h>t._elementsPixelRatio&&t.setElementsPixelRatio(h),s?f?.set({_forceMount:!0}):f?.set({_exporting:!0});const v=await wT(()=>{const L=or.stages.filter($=>$.getAttr("pageId")===n);return L.length===0?null:L});if(!v)throw f?.set({_forceMount:!1,_exporting:!1}),t.setElementsPixelRatio(g),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.`);v.length>1&&console.error(`Polotno error: Detected several canvas elements for page "${n}" in the document. This is not supported and will lead to incorrect export. Make sure to use unique ids for all pages and make sure you unmount <Workspace /> when it is not needed.`);const p=v[0];await t.waitLoading({_skipTimeout:o});const y=p.findOne(".page-container");if(!y)throw t.setElementsPixelRatio(g),f?.set({_forceMount:!1,_exporting:!1}),new Error("Export is failed. Canvas was unmounted.");const _=p.position();p.position({x:0,y:0}),p.find("Transformer").forEach(L=>{L.setAttr("oldVisible",L.visible()),L.visible(!1)}),y.find(".page-background").forEach(L=>L.shadowEnabled(!1)),y.find(".page-background").forEach(L=>L.strokeEnabled(!1)),y.find(".highlighter").forEach(L=>L.visible(!1));const x=y.findOne(".page-background-group"),b=x.clip();x.clip({x:null,y:null,width:null,height:null});const E=y.findOne(".elements-container"),A=E.clip();E.clip({x:null,y:null,width:null,height:null});const S=y.find(L=>!L.visible()&&L.getAttr("editModeEnabled")&&!L.getAttr("hideInExport"));S.forEach(L=>{L.setAttr("oldVisible",L.visible()),L.show()});const k=y.find(L=>L.getAttr("hideInExport"));k.forEach(L=>{L.setAttr("oldVisible",L.visible()),L.hide()}),r&&y.find(".page-background").forEach(L=>L.hide());const I=a?f.bleed:0;let O=I;!t.bleedVisible&&a||(t.bleedVisible||a?t.bleedVisible&&a?O=0:t.bleedVisible&&!a&&(O=-f.bleed):O=0);const M=document.createElement("canvas");M.width=Math.round((f.computedWidth+2*I)*h),M.height=Math.round((f.computedHeight+2*I)*h);const F=M.getContext("2d");i==="image/jpeg"&&(F.fillStyle="white",F.fillRect(0,0,M.width,M.height));const j=y.scale();y.scale({x:1,y:1});const T=y.toCanvas({x:y.x()-O,y:y.y()-O,width:f.computedWidth+2*I,height:f.computedHeight+2*I,pixelRatio:h});return y.scale(j),F.drawImage(T,0,0,M.width,M.height),or.Util.releaseCanvas(T),r&&y.find(".page-background").forEach(L=>L.show()),k.forEach(L=>{L.visible(L.getAttr("oldVisible"))}),S.forEach(L=>{L.visible(L.getAttr("oldVisible"))}),y.find(".page-background").forEach(L=>L.shadowEnabled(!0)),y.find(".page-background").forEach(L=>L.strokeEnabled(!0)),p.find("Transformer").forEach(L=>{L.visible(L.getAttr("oldVisible"))}),y.find(".highlighter").forEach(L=>L.visible(!0)),x.clip(b),E.clip(A),p.position(_),f?.set({_exporting:!1,_forceMount:!1}),await new Promise(L=>setTimeout(L)),t.setElementsPixelRatio(g),M},async toDataURL(e={}){var{mimeType:r,quality:n}=e,i=Hd(e,["mimeType","quality"]);const a=await t._toCanvas(Object.assign({mimeType:r},i)),o=a.toDataURL(r,n);return or.Util.releaseCanvas(a),o},async toBlob(e={}){var{mimeType:r,quality:n}=e,i=Hd(e,["mimeType","quality"]);const a=await t._toCanvas(Object.assign({mimeType:r},i)),o=await new Promise(s=>{a.toBlob(s,r,n)});return or.Util.releaseCanvas(a),o},async saveAsImage(e={}){var{fileName:r}=e,n=Hd(e,["fileName"]);const i=n.mimeType||"image/png",a=i.split("/")[1];N1(await t.toDataURL(n),r||"polotno."+a)},async _toPDF(e){const r=e.dpi||t.dpi,n=e.parallel||1,i=e.unit||(t.unit==="px"?"mm":t.unit),a=e.pixelRatio||1,o=e.pageIds||t.pages.map(A=>A.id),s=t.pages.filter(A=>o.includes(A.id)),u=await aT(),h=A=>Q0({px:A,unit:i,dpi:r}),f=e.cropMarkSize||0,g=h(f),v=s[0]||{},p=e.includeBleed?v.bleed:0,y=h(v.computedWidth+2*p+2*g),_=h(v.computedHeight+2*p+2*g);var x=new u({unit:i,orientation:y>_?"landscape":"portrait",format:[y,_],compress:!0,putOnlyUsedFonts:!0});x.deletePage(1);const b=((A,S)=>{for(var k=[],I=0;I<A.length;I+=S)k.push(A.slice(I,I+S));return k})(s,n);let E=0;for(const A of b){const S=A.map(async k=>{const I=e.includeBleed?k.bleed:0,O=k.computedWidth+2*I+2*f,M=k.computedHeight+2*I+2*f,F=h(O),j=h(M);let T=0,L=a;for(;T<10;){T+=1,T===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const $=await t.toDataURL(Object.assign(Object.assign({},e),{pageId:k.id,pixelRatio:L}));if($.length>20)return e.onProgress&&e.onProgress(++E/o.length*.9),{url:$,width:F,height:j,widthPx:O,heightPx:M};L*=.8}});(await Promise.all(S)).forEach(({url:k,width:I,height:O,widthPx:M,heightPx:F})=>{x.addPage([I,O],I>O?"landscape":"portrait");const j=x.getCurrentPageInfo();var T;switch(i){case"pt":T=1;break;case"mm":T=72/25.4;break;case"cm":T=72/2.54;break;case"in":T=72;break;case"px":T=.75;break;case"pc":case"em":T=12;break;case"ex":T=6;break;default:throw"Invalid unit: "+i}if(j.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:I*T,topRightY:O*T},j.pageContext.artBox={bottomLeftX:h(f+p)*T,bottomLeftY:h(f+p)*T,topRightX:h(M-f-p)*T,topRightY:h(F-f-p)*T},j.pageContext.bleedBox={bottomLeftX:h(f+p)*T,bottomLeftY:h(f+p)*T,topRightX:h(M-f-p)*T,topRightY:h(F-f-p)*T},g){x.setLineWidth(h(1));const L=g+h(p);x.line(L,0,L,g),x.line(0,L,g,L),x.line(I-L,0,I-L,g),x.line(I,L,I-g,L),x.line(0,O-L,g,O-L),x.line(L,O,L,O-g),x.line(I,O-L,I-g,O-L),x.line(I-L,O,I-L,O-g)}x.addImage(k,g,g,I-2*g,O-2*g,void 0,"FAST")})}return x},toPDFDataURL:async e=>(await t._toPDF(Object.assign({mimeType:"image/jpeg"},e))).output("datauristring"),async toGIFDataURL(e={}){const r=e.pixelRatio||1,n=await sT({width:t.width*r,height:t.height*r}),i=1e3/(e.fps||10),a=t.duration/i;for(let o=0;o<a-1;o++){const s=o*i||1;t.setCurrentTime(s);let u=0,h="";for(const g of t.pages)if(u+=g.duration,g.set({_rendering:u>s}),u>s){h=g.id;break}const f=await t._toCanvas({pixelRatio:r,pageId:h,_skipTimeout:!0});n.addFrame(f.getContext("2d"),{delay:i,copy:!0})}for(const o of t.pages)o.set({_rendering:!1});return t.stop(),n.render(),new Promise(o=>{n.on("finished",function(s){(function(u,h){var f=new FileReader;f.onload=function(g){h(g.target.result)},f.readAsDataURL(u)})(s,o)})})},async saveAsGIF(e={}){var{fileName:r}=e,n=Hd(e,["fileName"]);const i=await t.toGIFDataURL(n);N1(i,r||"polotno.gif")},async toHTML({elementHook:e}={elementHook:void 0}){const r=t.toJSON();return AT({json:r,elementHook:e})},async saveAsHTML({fileName:e,elementHook:r}={}){const n=await t.toHTML({elementHook:r}),i="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(n)));N1(i,e||"polotno.html")},async toSVG({elementHook:e,pageId:r,fontEmbedding:n="inline"}={fontEmbedding:"inline"}){var i;const a=t.toJSON();r=r||((i=a.pages[0])===null||i===void 0?void 0:i.id);const o=a.pages.find(s=>s.id===r);return LT({json:Object.assign(Object.assign({},a),{pages:o?[o]:[]}),elementHook:e,fontEmbedding:n})},async saveAsSVG({fileName:e,elementHook:r,pageId:n,fontEmbedding:i="inline"}={}){const a=await t.toSVG({elementHook:r,pageId:n,fontEmbedding:i}),o="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(a)));N1(o,e||"polotno.svg")},async saveAsPDF(e={}){var{fileName:r}=e,n=Hd(e,["fileName"]);(await t._toPDF(Object.assign({mimeType:"image/jpeg"},n))).save(r||"polotno.pdf")},async waitLoading({_skipTimeout:e=!1}={}){e||await new Promise(r=>setTimeout(r,50)),await eO()},toJSON:()=>({width:t.width,height:t.height,fonts:Ru(t.fonts),pages:Ru(t.pages),audios:Ru(t.audios),unit:t.unit,dpi:t.dpi,custom:t.custom,schemaVersion:t.schemaVersion}),loadJSON(e,r=!1){var n;const i=JSON.parse(JSON.stringify(e)),a=i.schemaVersion||0;a<1&&Si.htmlRenderEnabled&&Ii({children:i.pages},h=>{if(h.type==="text"){const g=h.letterSpacing*16;h.letterSpacing=g/h.fontSize}}),a<2&&Ii({children:i.pages},h=>{h.filters&&Object.keys(h.filters).forEach(f=>{if(["warm","cold","natural"].includes(f))return;const g=h.filters[f];g&&typeof g.intensity=="number"&&(g.intensity=g.intensity/100)})}),delete i.schemaVersion;const o=t.pages.indexOf(t.activePage);let s=(n=i.pages[o]||i.pages[0])===null||n===void 0?void 0:n.id;i._activePageId=s;const u=Object.assign({},Ru(t));Object.assign(u,i),u.history=r?t.history.toJSON():{history:[],undoIdx:-1},mm(t,u)},clear({keepHistory:e=!1}={}){const r=t.pages.map(n=>n.id);t.deletePages(r),t.custom=null,e||t.history.clear()},addFont(e){t.removeFont(e.fontFamily),t.fonts.push(e),t.loadFont(e.fontFamily)},removeFont(e){t.fonts.filter(r=>r.fontFamily===e).forEach(r=>e2(r))},addAudio(e){const r=A4.create(Object.assign({id:Cl(10)},e));t.audios.push(r)},removeAudio(e){const r=t.audios.find(n=>n.id===e);r&&t.audios.remove(r)},async loadFont(e){const r=t.fonts.find(i=>i.fontFamily===e)||ny.find(i=>i.fontFamily===e);let n=[{fontStyle:"normal",fontWeight:"normal"},{fontStyle:"normal",fontWeight:"bold"}];return r?(r.styles&&(n=r.styles.map(i=>({fontStyle:i.fontStyle||"normal",fontWeight:i.fontWeight||"normal"}))),G8(r)):$8(e),Promise.all(n.map(i=>Zh(e,i.fontStyle,i.fontWeight)))},validate:e=>nh.validate(e,[{path:"",type:nh}]).map(r=>({path:"store"+r.context.map(n=>n.path).join("."),message:r.message}))}));function TT({key:t,showCredit:e}={key:"",showCredit:!1}){return nh.create({_forceShowCredit:e,_key:t})}const u_=Zt.model("Node",{id:Zt.identifier,type:"none",name:"",opacity:1,custom:Zt.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(t=>{for(var e in t)t[e]===null&&(t[e]=void 0);return t}).postProcessSnapshot(t=>{const e=Object.assign({},t),r={};for(var n in e)n[0]!=="_"&&(r[n]=t[n]);return r}).views(t=>({get locked(){return!(t.draggable||t.contentEditable||t.styleEditable||t.resizable)},get page(){return Yf(t,cp)},get store(){return Yf(t,nh)},get top(){let e=t;for(;;){if(!O1(e,id))return e;e=Yf(e,id)}},get parent(){if(O1(t,id)){const e=Yf(t,id);return e&&e.children&&e.children.length,e}if(O1(t,cp)){const e=Yf(t,cp);return e&&e.children&&e.children.length,e}if(O1(t,nh)){const e=Yf(t,nh);return e&&e.pages&&e.pages.length,e}return null},get zIndex(){return t.parent.children.indexOf(t)}})).actions(t=>({toJSON:()=>Object.assign({},Ru(t))})).actions(t=>({clone(e={},{skipSelect:r=!1}={}){const n=JSON.parse(JSON.stringify(t.toJSON()));return e.id=e.id||Cl(10),Ii(n,i=>{i.id=Cl(10)}),Object.assign(n,e),t.page.addElement(n,{skipSelect:r})},set(e){Object.assign(t,e)},moveUp(){t.page.moveElementsUp([t.id])},moveTop(){t.page.moveElementsTop([t.id])},moveDown(){t.page.moveElementsDown([t.id])},moveBottom(){t.page.moveElementsBottom([t.id])},setZIndex(e){t.parent.setElementZIndex(t.id,e)},beforeDestroy(){}})),P4={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}}},O4={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}},RT={fade:({dTime:t,element:e,animation:r})=>{const n=t/r.duration;return r.type==="enter"?{opacity:n*e.opacity}:{opacity:(1-n)*e.opacity}},rotate:({dTime:t,element:e,animation:r})=>{const n=t/r.duration*360;return PN({x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation},n)},blink:({dTime:t,element:e,animation:r})=>{const n=r.duration,i=t%n/(n/2),a=i<=1?i:2-i;return{opacity:e.opacity*a}},bounce:({dTime:t,element:e,animation:r})=>{var n;const i=r.duration,a=i/2,o=(n=r.data.strength)!==null&&n!==void 0?n:1,s={},u={x:e.x+e.width/3*o,y:e.y+e.height/3*o,width:e.width/3*o,height:e.height/3*o,fontSize:e.fontSize/3*o},h={x:e.x,y:e.y,width:e.width,height:e.height,fontSize:e.fontSize},f=t%i/a,g=f<=1?f:2-f;for(let v in u){const p=u[v],y=h[v]-p;s[v]=p+g*y}return s},move:({dTime:t,element:e,animation:r})=>{var n;const i=P4[r.data.direction]||P4.right,a=(n=r.data.strength)!==null&&n!==void 0?n:1,o={};for(var s in i.from){let u=i.from[s],h=i.to[s];r.type==="exit"&&(u=i.to[s],h=-i.from[s]),u*=a,h*=a;const f=e[s]+u,g=e[s]+h-f;o[s]=f+t/r.duration*g}return o},zoom:({dTime:t,element:e,animation:r})=>{var n;const i={},a=1+(((r.data.direction||"in")==="in"?.75:1.25)-1)*((n=r.data.strength)!==null&&n!==void 0?n:1),o=e.rotation*Math.PI/180,s=Math.cos(o),u=Math.sin(o),h=e.width*(1-a),f=e.height*(1-a),g=(h*s-f*u)/2,v=(h*u+f*s)/2,p={x:e.x+g,y:e.y+v,width:e.width*a,height:e.height*a,fontSize:e.fontSize*a},y={x:e.x,y:e.y,width:e.width,height:e.height,fontSize:e.fontSize};for(var _ in p){let x=p[_],b=y[_];if(r.type==="exit"){const A=x;x=b,b=A}const E=b-x;i[_]=x+t/r.duration*E}return i},cameraZoom:({dTime:t,element:e,animation:r})=>{var n,i,a;const o={},s=r.data.direction||"right",u=O4[s]||O4.right,h=(n=r.data.movementStrength)!==null&&n!==void 0?n:.1,f=(i=r.data.shakeStrength)!==null&&i!==void 0?i:.015;a=r.data.zoomStrength;const g=t/r.duration,v=f*(1-g),p=Math.sin(12*g)*v*.7+Math.sin(8*g)*v*.3;r.type==="exit"&&Math.max(e.cropWidth||1,e.cropHeight||1),r.type;const y=1-Math.pow(1-g,2),_=e.cropX||0,x=e.cropY||0,b=e.cropWidth||1,E=e.cropHeight||1,A=b,S=E;let k,I,O=0,M=0;if(u.cropX){const F=u.cropX>0?1-(_+b):_;O=Math.min(F,Math.abs(h))*u.cropX}if(u.cropY){const F=u.cropY>0?1-(x+E):x;M=Math.min(F,Math.abs(h))*u.cropY}return r.type==="enter"?(k=u.cropX?_+O*(1-y):_,I=u.cropY?x+M*(1-y):x):(k=u.cropX?_+O*y:_,I=u.cropY?x+M*y:x),o.cropX=Math.max(0,Math.min(1-A,k+p*A)),o.cropY=Math.max(0,Math.min(1-S,I+p*S)),o.cropWidth=A,o.cropHeight=S,o}},yv=({element:t,dTime:e,animation:r})=>{const n=RT[r.name];return n?n({element:t,dTime:e,animation:r}):(console.error("Can not find animation type: "+r.name),{})},MT=Zt.model("Animation",{delay:0,duration:500,enabled:!0,type:Zt.enumeration("Type",["enter","exit","loop"]),name:"none",data:Zt.frozen({})}),bv=(t,e)=>{const r={};for(const n in e)if(typeof t[n]=="number"&&typeof e[n]=="number"){const i=e[n]-t[n];i!==0&&(r[n]=i)}return r},IT=Zt.model("ShapeFilter",{intensity:1}),C4=["temperature","contrast","highlights","shadows","white","black","saturation","vibrance"],Fp=u_.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:Zt.array(MT),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:Zt.map(IT),shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(t=>{const e=Object.assign(Object.assign({},t),{x:t.x||0,y:t.y||0,filters:Array.isArray(t.filters)?{}:t.filters});return"width"in t&&(e.width=e.width||1),"height"in t&&(e.height=e.height||1),t.locked&&(e.draggable=!1,e.contentEditable=!1,e.styleEditable=!1,e.resizable=!1,e.removable=!1),e}).views(t=>{const e=Xr({x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.rotation,opacity:t.opacity,color:t.color,fontSize:t.fontSize}),r=Qr(i=>{Object.assign(e,i)}),n=Qr(i=>{for(const a in i)typeof e[a]=="number"&&(e[a]=e[a]+i[a])});return{get a(){const{currentTime:i}=t.store;if(r({x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.rotation,opacity:t.opacity,color:t.color,fontSize:t.fontSize,cropX:t.cropX,cropY:t.cropY,cropWidth:t.cropWidth,cropHeight:t.cropHeight}),i===0)return e;const a=i-t.page.startTime;if(a>t.page.duration||a<0)return e;const o=t.store.animatedElementsIds;if(o.length&&!o.includes(t.id))return e;const s=t.animations.find(v=>v.type==="enter"),u=s?.enabled&&a<s.delay;u&&r({opacity:0});const h=s?.enabled&&a>=s.delay&&a<=s.delay+s.duration;if(h){const v=a-s.delay,p=yv({element:t,animation:s,dTime:v}),y=bv(t,p);n(y)}const f=t.animations.find(v=>v.type==="exit");if(!u&&!h&&f?.enabled&&a>=t.page.duration-f.duration-f.delay&&a<=t.page.duration-f.delay){const v=a-(t.page.duration-f.duration-f.delay),p=yv({element:t,animation:f,dTime:v}),y=bv(t,p);n(y)}f?.enabled&&a>=t.page.duration-f.delay&&r({opacity:0});const g=t.animations.find(v=>v.type==="loop");if(g?.enabled){const v=yv({element:t,animation:g,dTime:a}),p=bv(t,v);n(p)}return e},animated:i=>t.a[i]}}).actions(t=>({setAnimation(e,r){const n=t.animations.find(i=>i.type===e);n?Object.assign(n,r):t.animations.push(Object.assign({type:e},r))},setFilter(e,r){C4.includes(e)||t.filters.forEach((n,i)=>{C4.includes(i.toString())||t.filters.delete(i.toString())}),r==null?t.filters.delete(e):t.filters.set(e,{intensity:r})}})),c_=Fp.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:Zt.optional(Zt.union(Zt.number,Zt.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5,curveEnabled:!1,curvePower:.5}).preProcessSnapshot(t=>Object.assign({},t)).actions(t=>({toggleEditMode(e){t._editModeEnabled=e??!t._editModeEnabled,t._editModeEnabled?t.store.history.startTransaction():t.store.history.endTransaction()}})),J0=Fp.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}).extend(t=>{const e=Xr.box(!1);let r=!1;return{views:{get _cropModeEnabled(){return e.get()}},actions:{toggleCropMode(n){const i=n??!e.get();e.set(i),i&&!r?(t.store.history.startTransaction(),r=!0):!i&&r&&(t.store.history.endTransaction(),r=!1)},beforeDestroy(){r&&(t.store.history.endTransaction(),r=!1)}}}}),f_=J0.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1}),h_=Fp.named("Line").props({type:"line",width:400,height:10,color:"black",dash:Zt.array(Zt.number),startHead:"",endHead:""}).actions(t=>({})),d_=Fp.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:Zt.map(Zt.string)}).preProcessSnapshot(t=>Object.assign(Object.assign({},t),{src:t.src||t.svgSource,colorsReplace:Array.isArray(t.colorsReplace)?{}:t.colorsReplace})).actions(t=>({replaceColor(e,r){t.colorsReplace.set(e,r)}})),p_=Fp.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:Zt.array(Zt.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0}),g_=J0.named("Gif").props({type:"gif",duration:0,keepRatio:!0});var jT=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r};const Ii=(t,e)=>{if(t.children)for(const r of t.children){if(e(r)===!0)break;Ii(r,e)}},DT=[...new Array(20)].map((t,e)=>Zt.late(()=>FT[e])),v_=Zt.union({dispatcher:t=>{const e=yy[t.type];if(!e)throw new Error(`Unknown element type: "${t.type}"`);return e}},d_,c_,J0,h_,f_,p_,g_,Zt.late(()=>id),...DT),id=u_.named("Group").props({type:"group",children:Zt.array(v_)}).views(t=>({get draggable(){let e=!0;return Ii(t,r=>{r.draggable||(e=!1)}),e},get resizable(){let e=!0;return Ii(t,r=>{r.resizable||(e=!1)}),e},get contentEditable(){let e=!0;return Ii(t,r=>{r.contentEditable||(e=!1)}),e},get styleEditable(){let e=!0;return Ii(t,r=>{r.styleEditable||(e=!1)}),e},get locked(){let e=!0;return Ii(t,r=>{r.locked||(e=!1)}),e}})).actions(t=>({set(e){var{draggable:r,contentEditable:n,styleEditable:i,resizable:a}=e,o=jT(e,["draggable","contentEditable","styleEditable","resizable"]);r!==void 0&&Ii(t,s=>{s.set({draggable:r})}),n!==void 0&&Ii(t,s=>{s.set({contentEditable:n})}),i!==void 0&&Ii(t,s=>{s.set({styleEditable:i})}),a!==void 0&&Ii(t,s=>{s.set({resizable:a})}),Object.assign(t,o)},addElement(e,{skipSelect:r=!1}={}){const n=yy[e.type];if(!n)return void console.error("Can not find model with type "+e.type);e.children&&e.children.forEach(a=>{a.id=a.id||Cl(10)});const i=n.create(Object.assign({id:Cl(10)},e));return t.children.push(i),i.selectable&&!r&&t.store.selectElements([i.id]),i},setElementZIndex(e,r){const n=t.children.find(i=>i.id===e);n&&(Jf(n),t.children.remove(n),t.children.splice(r,0,n))}})),FT=[],yy={svg:d_,text:c_,image:J0,group:id,line:h_,video:f_,figure:p_,gif:g_},BT={text:ZC,image:Y3,svg:Y3,line:TN,video:DN,figure:YN,group:ni(t=>{const{element:e,store:r}=t,{children:n}=e,i=e.selectable||r.role==="admin";return se.createElement(bn,{opacity:e.opacity,listening:i,hideInExport:!e.showInExport},n.map(a=>se.createElement(m_,Object.assign({},t,{key:a.id,store:r,element:a}))))}),gif:tT},zT=(t,e)=>{const r=[];Ii(t,f=>{f.type!=="group"&&r.push(f.a)});const n=[];r.forEach(f=>{const g=[{x:0,y:0},{x:0+f.width,y:0},{x:0+f.width,y:0+f.height},{x:0,y:0+f.height}],v=new or.Transform;v.translate(f.x,f.y),v.rotate(or.Util.degToRad(f.rotation)),g.forEach(p=>{const y=v.point(p);n.push(y)})});const i=new or.Transform;i.rotate(-or.Util.degToRad(e));let a=1/0,o=1/0,s=-1/0,u=-1/0;n.forEach(f=>{const g=i.point(f);a=Math.min(a,g.x),o=Math.min(o,g.y),s=Math.max(s,g.x),u=Math.max(u,g.y)}),i.invert();const h=i.point({x:a,y:o});return{x:h.x,y:h.y,width:s-a,height:u-o,rotation:e}},m_=ni(t=>{var e;const{element:r,store:n}=t,[i,a]=se.useState(!1),o=n.selectedElements.indexOf(r)>=0&&r.selectable,s=((e=r.parent)===null||e===void 0?void 0:e.type)==="group",u=(g=>{const[v,p]=se.useState(null);return se.useEffect(()=>{const y=setTimeout(()=>{const _=g.page.id,x=or.stages.find(b=>b.getAttr("pageId")===_);x||console.error("No stage is found for element",g.id),p(x)});return()=>clearTimeout(y)},[g.id]),v})(r),h=u?.findOne("Transformer");se.useEffect(()=>{if(u){const g=p=>{const y=p.target.findAncestor(".element",!0),_=n.getElementById(y?.id()),x=_?.top,b=x?.id;a(b===r.id)};u.on("mouseover",g);const v=()=>{a(!1)};return u.on("mouseleave",v),()=>{u.off("mouseover",g),u.off("mouseleave",v)}}},[u]);let f=BT[t.element.type];return t.element.type==="text"&&Si.htmlRenderEnabled&&(f=SN),t.element.visible?f?se.createElement(se.Fragment,null,se.createElement(f,Object.assign({},t)),(i||o)&&!s&&se.createElement(nT,{element:r.type==="group"?{a:zT(r,h?.rotation()||0)}:r})):(console.error("Can not find component for "+t.element.type),null):null});function qT(t,e,r="scale"){const n=e.width/e.height;let i,a;n>=t.width/t.height?(i=t.width,a=t.width/n):(i=t.height*n,a=t.height);let o=0,s=0;return r==="left-top"?(o=0,s=0):r==="left-middle"?(o=0,s=(t.height-a)/2):r==="left-bottom"?(o=0,s=t.height-a):r==="center-top"?(o=(t.width-i)/2,s=0):r==="center-middle"?(o=(t.width-i)/2,s=(t.height-a)/2):r==="center-bottom"?(o=(t.width-i)/2,s=t.height-a):r==="right-top"?(o=t.width-i,s=0):r==="right-middle"?(o=t.width-i,s=(t.height-a)/2):r==="right-bottom"?(o=t.width-i,s=t.height-a):r==="scale"?(o=0,s=0,i=t.width,a=t.height):console.error(new Error("Unknown clip position property - "+r)),{cropX:o,cropY:s,cropWidth:i,cropHeight:a}}var y_=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r};const L4=or.DD._drag;window.removeEventListener("mousemove",L4),or.DD._drag=function(t){dc(()=>{L4.call(this,t)})},window.addEventListener("mousemove",or.DD._drag);const xm=new or.Group,df=20;xm.add(new or.Rect({width:df,height:df,fill:"white"})),xm.add(new or.Path({scaleX:df/24,scaleY:df/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 UT=xm.toCanvas({pixelRatio:2,width:df,height:df}),wv={enabledAnchors:["top-left","top-center","top-right","middle-left","bottom-left","bottom-right","bottom-center","middle-right"],borderEnabled:!0,rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:t=>{t.hasName("rotater")&&t.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:UT,fillPatternScaleX:20/df/2,fillPatternScaleY:20/df/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},T1={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"]}},HT=t=>se.createElement(Tn,Object.assign({},t,{preventDefault:!1})),$T=t=>{var{url:e}=t,r=y_(t,["url"]);const[n,i]=ty(e,"anonymous"),a=n?qT(n,{width:r.width,height:r.height},"center-middle"):{};return lp(i,e,"page background"),se.createElement(Tu,Object.assign({image:n},r,a))},GT=t=>{const e=bf({fill:t.fill,a:{width:t.width,height:t.height}});return se.createElement(Tn,Object.assign({},t,e))},WT=t=>{const{background:e,scale:r,borderColor:n}=t,i=y_(t,["background","scale","borderColor"]),a=se.useMemo(()=>!!or.Util.colorToRGBA(e)||U0(e),[e]),o=se.useMemo(()=>{const s=document.createElement("canvas"),u=30;s.width=60,s.height=60;const h=s.getContext("2d");return h&&(h.fillStyle="black",h.fillRect(u,0,u,u),h.fillRect(0,u,u,u)),s},[]);return se.createElement(se.Fragment,null,se.createElement(Tn,Object.assign({fillPatternImage:o},i,{opacity:.1,hideInExport:!0})),a?se.createElement(GT,Object.assign({fill:e},i)):se.createElement($T,Object.assign({url:e},i)))},VT=ni(({selection:t,fill:e="rgba(0, 161, 255, 0.3)",stroke:r="rgb(0, 161, 255)",strokeWidth:n=1})=>t.visible?se.createElement(Tn,{name:"selection",x:Math.min(t.x1,t.x2),y:Math.min(t.y1,t.y2),width:Math.abs(t.x1-t.x2),height:Math.abs(t.y1-t.y2),fill:e,stroke:r,strokeWidth:n}):null),YT=ni(({x:t,y:e,width:r,height:n,rotation:i,anchor:a,store:o,tagFill:s,textFill:u})=>{const h=kd({x:t,y:e,width:r,height:n,rotation:or.Util.radToDeg(i)});if(a===void 0)return null;const f=(n/2+70)*Math.cos(i-Math.PI/2),g=(n/2+70)*Math.sin(i-Math.PI/2),v=_4({unit:o.unit,dpi:o.dpi,px:r/o.scale,precious:o.unit==="px"?0:1})+" x "+_4({unit:o.unit,dpi:o.dpi,px:n/o.scale,precious:o.unit==="px"?0:1})+(o.unit==="px"?"":" "+o.unit);return se.createElement(se.Fragment,null,se.createElement(g0,{x:(h.minX+h.maxX)/2+f,y:(h.minY+h.maxY)/2+g,offsetX:14,offsetY:14,visible:a==="rotater"},se.createElement(v0,{cornerRadius:5,fill:s||"rgb(0, 161, 255)"}),se.createElement(Fu,{align:"center",verticalAlign:"middle",fill:u||"white",padding:8,text:Math.round(or.Util.radToDeg(i)).toString()+"°"})),se.createElement(g0,{x:(h.minX+h.maxX)/2,y:h.maxY+20,visible:a!=="rotater"},se.createElement(v0,{cornerRadius:5,fill:s||"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),se.createElement(Fu,{align:"center",verticalAlign:"middle",fill:u||"white",padding:8,text:v})))}),XT=ni(({elements:t,store:e})=>{const r=t.filter(i=>i.alwaysOnTop),n=t.filter(i=>!i.alwaysOnTop).concat(r);return se.createElement(se.Fragment,null,n.map(i=>se.createElement(m_,{key:i.id,store:e,element:i,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))}),KT=({store:t})=>{const[e,r]=se.useState(!1),[n,i]=se.useState({x:0,y:0});return{open:se.useCallback(o=>{r(!0),i(o)},[]),close:se.useCallback(()=>{r(!1)},[]),props:{isOpen:e,offset:n,setIsOpen:r}}},ZT=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),N4=atob("cmVk"),QT=atob("djAuOS4y"),JT=t=>se.createElement(se.Fragment,null,se.createElement(g0,{fill:N4,height:200},se.createElement(v0,{fill:N4}),se.createElement(Fu,Object.assign({},t,{fill:"white",text:ZT,height:void 0,padding:10,fontSize:20})))),eR=ni(({store:t,page:e,width:r,height:n,pageControlsEnabled:i,backColor:a,pageBorderColor:o,activePageBorderColor:s,components:u,bleedColor:h,altCloneEnabled:f,viewportSize:g,selectionRectFill:v,selectionRectStroke:p,selectionRectStrokeWidth:y,snapGuideStroke:_,snapGuideStrokeWidth:x,snapGuideDash:b,transformLabelFill:E,transformLabelTextFill:A,distanceGuideStroke:S,distanceLabelFill:k,distanceLabelTextFill:I})=>{const O=t.bleedVisible?e.bleed:0,M=e.computedWidth+2*O,F=e.computedHeight+2*O,j=(r-M*t.scale)/2,T=(n-F*t.scale)/2,L=se.useRef(null),$=se.useRef(null),q=se.useRef(null),J=i==null||i,[ae,ie]=se.useState(null),[Z,te]=se.useState({}),V=KT({store:t}),B=t.selectedElements.find(fe=>fe._cropModeEnabled),D=t.selectedElements.find(fe=>fe.curveEnabled),U=t.selectedShapes.filter(fe=>!fe.resizable).length>0,X=t.selectedShapes.filter(fe=>!fe.draggable).length>0,ee=t.selectedElements.filter(fe=>!fe.visible).length>0;se.useLayoutEffect(()=>{var fe,Le,Ne;if(!L.current)return;const ue=L.current.getStage(),Ae=t.selectedShapes.map(st=>st._cropModeEnabled?null:ue.findOne("#"+st.id)).filter(st=>st),Pe=t.selectedElements.length===1,Ue=Pe&&((fe=t.selectedElements[0])===null||fe===void 0?void 0:fe.type)||"many";T1[Ue]?(L.current.setAttrs(Object.assign(Object.assign({},wv),T1[Ue])),Ue!=="svg"&&Ue!=="image"&&Ue!=="gif"||t.selectedElements[0].keepRatio||L.current.setAttrs({enabledAnchors:wv.enabledAnchors}),Ue==="text"&&Si.textVerticalResizeEnabled&&L.current.setAttrs({enabledAnchors:(Le=T1.text.enabledAnchors)===null||Le===void 0?void 0:Le.concat(["bottom-center"])}),Ue==="text"&&Pe&&t.selectedElements[0].curveEnabled&&L.current.setAttrs({enabledAnchors:T1.many.enabledAnchors})):L.current.setAttrs(wv),U&&L.current.enabledAnchors([]),X&&L.current.rotateEnabled(!1),Ae.find(st=>st?.isDragging())&&Ae.forEach(st=>{st.isDragging()||st==null||st.startDrag()}),L.current.nodes(Ae),W7(),(Ne=L.current.getLayer())===null||Ne===void 0||Ne.batchDraw()},[t.selectedShapes,B,U,ee,X,D]);const K=eE(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),oe=se.useRef(!1),me=Cf(),de=Qr(fe=>{var Le,Ne,ue,Ae;if(me)return;oe.current=!1;const Pe=fe.target.findAncestor(".elements-container"),Ue=fe.target.findAncestor("Transformer"),st=fe.target.findAncestor(".page-abs-container");if(Pe||Ue||st)return;const dt=(Le=fe.target.getStage())===null||Le===void 0?void 0:Le.getPointerPosition();dt.x-=(Ne=fe.target.getStage())===null||Ne===void 0?void 0:Ne.x(),dt.y-=(ue=fe.target.getStage())===null||ue===void 0?void 0:ue.y(),dt&&(K.visible=!0,K.x1=dt.x,K.y1=dt.y,K.x2=dt.x,K.y2=dt.y,((Ae=fe.target.getStage())===null||Ae===void 0?void 0:Ae.getPointersPositions().length)>=2&&(K.visible=!1))});(({stageRef:fe,containerRef:Le,viewportSize:Ne})=>{se.useEffect(()=>{var ue;const Ae=(ue=Le.current)===null||ue===void 0?void 0:ue.closest(".polotno-workspace-inner");function Pe(){var Ue;if(!fe.current)return;const st=(Ue=Le.current)===null||Ue===void 0?void 0:Ue.getBoundingClientRect(),dt=Ae?.getBoundingClientRect(),pt=Math.max(0,dt.left-st.left-100),xt=Math.max(0,dt.top-st.top-100);fe.current.position({x:-pt,y:-xt}),fe.current.container().style.transform=`translate(${pt}px, ${xt}px)`}return Pe(),Ae.addEventListener("scroll",Pe),()=>{Ae.removeEventListener("scroll",Pe)}},[Ne.width,Ne.height])})({stageRef:$,containerRef:q,viewportSize:g}),se.useEffect(()=>{const fe=Qr(Ne=>{var ue,Ae,Pe,Ue;if(!K.visible)return;(ue=$.current)===null||ue===void 0||ue.setPointersPositions(Ne);let st=(Ae=$.current)===null||Ae===void 0?void 0:Ae.getPointerPosition();st?(st.x-=(Pe=$.current)===null||Pe===void 0?void 0:Pe.x(),st.y-=(Ue=$.current)===null||Ue===void 0?void 0:Ue.y()):st={x:K.x2,y:K.y2},K.x2=st.x,K.y2=st.y}),Le=Qr(()=>{if(!K.visible||!$.current)return;const Ne=$.current.findOne(".selection"),ue=Ne?Ne.getClientRect():{width:0,height:0,x:0,y:0};if(ue.width&&ue.height){const Ae=[];$.current.find(".element").forEach(Ue=>{const st=Ue.getClientRect(),dt=t.getElementById(Ue.id()),pt=dt?.draggable,xt=dt?.selectable;or.Util.haveIntersection(ue,st)&&pt&&xt&&Ae.push(dt.top.id)});const Pe=[...new Set(Ae)];t.selectElements(Pe)}K.visible=!1,oe.current=!0});return window.addEventListener("mousemove",fe),window.addEventListener("touchmove",fe),window.addEventListener("mouseup",Le),window.addEventListener("touchend",Le),()=>{window.removeEventListener("mousemove",fe),window.removeEventListener("touchmove",fe),window.removeEventListener("mouseup",Le),window.removeEventListener("touchend",Le)}},[]);const ye=se.useRef(!1);se.useEffect(()=>{var fe;let Le;const Ne=(fe=q.current)===null||fe===void 0?void 0:fe.closest(".polotno-workspace-inner"),ue=()=>{ye.current=!0,clearTimeout(Le),Le=setTimeout(()=>{ye.current=!1},300)};return Ne.addEventListener("scroll",ue),()=>{clearTimeout(Le),Ne.removeEventListener("scroll",ue)}},[]);const Te=fe=>{if(t.activePage!==e&&e.select(),ye.current||oe.current)return;const Le=fe.evt.ctrlKey||fe.evt.metaKey||fe.evt.shiftKey,Ne=fe.target.findAncestor(".elements-container"),ue=fe.target.findAncestor(".page-abs-container"),Ae=fe.target.findAncestor("Transformer");if(!(Le||Ne||Ae||ue||K.visible))return void t.selectElements([]);const Pe=fe.target.findAncestor(".element",!0),Ue=t.getElementById(Pe?.id()),st=Ue?.top,dt=st?.id,pt=t.selectedElementsIds.indexOf(dt)>=0,xt=fe.target.findAncestor(".page-container",!0);dt&&Le&&!pt?t.selectElements(t.selectedElementsIds.concat([dt])):dt&&Le&&pt?t.selectElements(t.selectedElementsIds.filter(bt=>bt!==dt)):!dt||Le||pt?xt?t.selectPages([e.id]):t.selectPages([]):t.selectElements([dt])};CN(L,t,{stroke:_,strokeWidth:x,dash:b});const Ce=t.activePage===e,Ie=t._selectedPagesIds.includes(e.id),Ee=u?.PageControls,ge=u?.Tooltip,Re=u?.ContextMenu,Be=1/t.scale,Oe=0/t.scale;return se.createElement("div",{ref:q,onDragOver:fe=>fe.preventDefault(),onDrop:fe=>{if(fe.preventDefault(),!$.current)return;$.current.setPointersPositions(fe),$.current.findOne(".elements-container").getRelativePointerPosition();const Le=$.current.getPointerPosition(),Ne=$.current.getAllIntersections(Le).map(Ae=>Ae.findAncestor(".element",!0)).filter(Boolean);[...new Set(Ne.reverse())].map(Ae=>t.getElementById(Ae.id()))[0]},style:{position:"relative",width:r+"px",height:n+"px",overflow:"hidden"},className:"polotno-page-container"+(Ce?" active-page":"")},se.createElement(LP,{ref:$,width:Math.min(r,g.width+200),height:Math.min(g.height+200,n),onClick:Te,onTap:Te,onContextMenu:fe=>{fe.evt.preventDefault();const Le=fe.target.findAncestor(".element",!0),Ne=t.getElementById(Le?.id()),ue=Ne?.top,Ae=ue?.id;Ae?t.selectedElementsIds.indexOf(Ae)>=0||t.selectElements([Ae]):t.selectElements([]),V.open({x:fe.evt.clientX,y:fe.evt.clientY})},onMouseDown:de,onMouseMove:fe=>{if(!fe.evt.altKey&&ae)return void ie(null);if(!fe.evt.altKey)return;const Le=fe.target.findAncestor(".element",!0),Ne=Le?.id();if(!t.selectedElements[0]||t.selectedElementsIds.includes(Ne))return;const ue=Z0(t.selectedShapes),Ae=Ne?t.getElementById(Ne):{x:0,y:0,width:e.computedWidth,height:e.computedHeight,rotation:0},Pe=kd(Ae),Ue=[];ue.minX>Pe.maxX&&Ue.push({distance:ue.minX-Pe.maxX,box1:ue,box2:Pe,points:[{x:ue.minX,y:ue.minY+ue.height/2},{x:Pe.maxX,y:ue.minY+ue.height/2},{x:Pe.maxX,y:Pe.minY+Pe.height/2}]}),ue.maxX<Pe.minX&&Ue.push({distance:Pe.minX-ue.maxX,box1:ue,box2:Pe,points:[{x:ue.maxX,y:ue.minY+ue.height/2},{x:Pe.minX,y:ue.minY+ue.height/2},{x:Pe.minX,y:Pe.minY+Pe.height/2}]}),ue.minY>Pe.maxY&&Ue.push({box1:ue,box2:Pe,distance:ue.minY-Pe.maxY,points:[{x:ue.minX+ue.width/2,y:ue.minY},{x:ue.minX+ue.width/2,y:Pe.maxY},{x:Pe.minX+Pe.width/2,y:Pe.maxY}]}),ue.maxY<Pe.minY&&Ue.push({box1:ue,box2:Pe,distance:Pe.minY-ue.maxY,points:[{x:ue.minX+ue.width/2,y:ue.maxY},{x:ue.minX+ue.width/2,y:Pe.minY},{x:Pe.minX+Pe.width/2,y:Pe.minY}]}),ue.minX>=Pe.minX&&ue.maxX<=Pe.maxX&&ue.minY>=Pe.minY&&ue.maxY<=Pe.maxY&&(Ue.push({distance:ue.minX-Pe.minX,box1:ue,box2:Pe,points:[{x:ue.minX,y:ue.minY+ue.height/2},{x:Pe.minX,y:ue.minY+ue.height/2},{x:Pe.minX,y:Pe.minY+Pe.height/2}]}),Ue.push({distance:Pe.maxX-ue.maxX,box1:ue,box2:Pe,points:[{x:ue.maxX,y:ue.minY+ue.height/2},{x:Pe.maxX,y:ue.minY+ue.height/2},{x:Pe.maxX,y:Pe.minY+Pe.height/2}]}),Ue.push({box1:ue,box2:Pe,distance:ue.minY-Pe.minY,points:[{x:ue.minX+ue.width/2,y:ue.minY},{x:ue.minX+ue.width/2,y:Pe.minY},{x:Pe.minX+Pe.width/2,y:Pe.minY}]}),Ue.push({box1:ue,box2:Pe,distance:Pe.maxY-ue.maxY,points:[{x:ue.minX+ue.width/2,y:ue.maxY},{x:ue.minX+ue.width/2,y:Pe.maxY},{x:Pe.minX+Pe.width/2,y:Pe.maxY}]})),JSON.stringify(ae)!==JSON.stringify(Ue)&&ie(Ue)},onDragStart:fe=>{var Le;const Ne=fe.target.findAncestor(".element",!0);if(Ne){const ue=t.getElementById(Ne?.id()),Ae=ue?.top,Pe=Ae?.id;!(t.selectedElementsIds.indexOf(Pe)>=0)&&Pe&&(t.selectElements([Pe]),fe.target.stopDrag(),fe.target.startDrag(fe),(Le=L.current)===null||Le===void 0||Le.startDrag(fe))}ae&&ie(null)},pageId:e.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},se.createElement(PP,null,se.createElement(HT,{width:r,height:n,fill:a}),se.createElement(bn,{x:j,y:T,scaleX:t.scale,scaleY:t.scale,name:"page-container"},se.createElement(bn,{name:"page-container-2"},se.createElement(bn,{name:"page-background-group",x:O,y:O},se.createElement(WT,{x:-e.bleed,y:-e.bleed,width:e.computedWidth+2*e.bleed,height:e.computedHeight+2*e.bleed,background:e.background,name:"page-background",preventDefault:!1,scale:t.scale})),se.createElement(bn,{x:O,y:O,name:"elements-container",listening:!t.isPlaying},se.createElement(Tn,{name:"elements-area",width:e.computedWidth,height:e.computedHeight,listening:!1}),se.createElement(XT,{elements:e.children,store:t})),se.createElement(Tn,{stroke:h,name:"bleed",strokeWidth:e.bleed,x:e.bleed/2,y:e.bleed/2,width:e.computedWidth+e.bleed,height:e.computedHeight+e.bleed,listening:!1,visible:e.bleed>0&&t.bleedVisible,hideInExport:!0}),cT()===QT&&se.createElement(JT,{name:"hit-detection",x:-Be/2-Oe,y:-Be/2-Oe,width:M+Be+2*Oe,height:F+Be+2*Oe}))),se.createElement(hf,{name:"workspace-background",points:[0,0,r,0,r,n,0,n,0,0,j,T,j,n-T,r-j,n-T,r-j,T,j,T],listening:!1,closed:!0,fill:a}),se.createElement(bn,{x:j,y:T,scaleX:t.scale,scaleY:t.scale},se.createElement(Tn,{name:"page-highlight",hideInExport:!0,x:-Be/2-Oe,y:-Be/2-Oe,width:M+Be+2*Oe,height:F+Be+2*Oe,stroke:Ie?s:o,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),se.createElement(bn,{x:j+O*t.scale,y:T+O*t.scale,scaleX:t.scale,scaleY:t.scale,name:"page-abs-container"},se.createElement(yp,{ref:L,onDragStart:fe=>{var Le;!((Le=fe.evt)===null||Le===void 0)&&Le.altKey&&f&&t.selectedElements.forEach(Ne=>{const ue=Ne.clone({},{skipSelect:!0}),Ae=e.children.indexOf(Ne);e.setElementZIndex(ue.id,Ae)}),t.history.startTransaction()},onDragEnd:()=>{t.history.endTransaction()},onTransformStart:()=>{t.history.startTransaction(),ie(null)},boundBoxFunc:(fe,Le)=>{const Ne=Math.abs(Le.width)<1||Math.abs(Le.height)<1,ue=Math.abs(fe.width)<1||Math.abs(fe.height)<1;return Ne&&!ue?fe:Le},onTransform:fe=>{var Le,Ne;const ue=L.current.nodes(),Ae=ue[ue.length-1];if(fe.target!==Ae)return;const Pe=(Le=L.current)===null||Le===void 0?void 0:Le.__getNodeRect(),Ue=(Ne=L.current)===null||Ne===void 0?void 0:Ne.getActiveAnchor();te({anchor:Ue,x:Pe.x,y:Pe.y,rotation:Pe.rotation,width:Pe.width,height:Pe.height})},onTransformEnd:fe=>{te({}),t.history.endTransaction()},visible:!t.isPlaying}),ae&&ae.map(({points:fe,distance:Le,box1:Ne,box2:ue},Ae)=>se.createElement(bn,{name:"distances-container",hideInExport:!0,key:Ae,listening:!1},se.createElement(Tn,Object.assign({},Ne,{stroke:S,strokeWidth:1,strokeScaleEnabled:!1})),se.createElement(Tn,Object.assign({},ue,{stroke:S,strokeWidth:1,strokeScaleEnabled:!1})),se.createElement(hf,{points:[fe[0].x,fe[0].y,fe[1].x,fe[1].y],stroke:S,strokeWidth:1,strokeScaleEnabled:!1}),se.createElement(hf,{points:[fe[1].x,fe[1].y,fe[2].x,fe[2].y],stroke:S,strokeWidth:1,strokeScaleEnabled:!1}),se.createElement(g0,{x:(fe[0].x+fe[1].x)/2,y:(fe[0].y+fe[1].y)/2,offsetY:-10,scaleX:1/t.scale,scaleY:1/t.scale},se.createElement(v0,{cornerRadius:5,fill:k,pointerDirection:"down"}),se.createElement(Fu,{align:"center",verticalAlign:"middle",fill:I,padding:5,text:bT({unit:t.unit,dpi:t.dpi,px:Le})})))),e._rendering&&se.createElement(bn,null,se.createElement(Tn,{width:M,height:F,fill:"rgba(255,255,255,0.9)"}),se.createElement(Fu,{text:"Rendering...",fontSize:60,width:M,height:F,align:"center",verticalAlign:"middle"})),ge&&se.createElement(ge,{components:u,store:t,page:e,stageRef:$}),Re&&se.createElement(m0,null,se.createElement(Re,Object.assign({components:u,store:t},V.props)))),se.createElement(YT,Object.assign({},Z,{store:t,tagFill:E,textFill:A})),se.createElement(VT,{selection:K,fill:v,stroke:p,strokeWidth:y}),fT()&&se.createElement(Fu,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:r-170,y:n-18,onMouseEnter:fe=>{fe.target.getStage().container().style.cursor="pointer"},onMouseLeave:fe=>{fe.target.getStage().container().style.cursor=""},onTouchStart:fe=>{fe.cancelBubble=!0},onMouseDown:fe=>{fe.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),se.createElement(bn,{name:"line-guides"}))),J&&Ee&&se.createElement(Ee,{store:t,page:e,xPadding:j,yPadding:T}))}),tR=Ed("div",se.forwardRef)`
|
|
419
|
-
position: absolute;
|
|
420
|
-
top: 0;
|
|
421
|
-
left: 0;
|
|
422
|
-
pointer-events: none;
|
|
423
|
-
`,rR=Ed("div",se.forwardRef)`
|
|
424
|
-
height: 14px;
|
|
425
|
-
position: sticky;
|
|
426
|
-
font-size: 8px;
|
|
427
|
-
line-height: 14px;
|
|
428
|
-
top: 0;
|
|
429
|
-
left: 0;
|
|
430
|
-
color: grey;
|
|
431
|
-
border-bottom: 1px solid grey;
|
|
432
|
-
background-color: #e8e8e8;
|
|
433
|
-
overflow: hidden;
|
|
434
|
-
`,nR=Ed("div",se.forwardRef)`
|
|
435
|
-
left: 0;
|
|
436
|
-
width: 14px;
|
|
437
|
-
position: sticky;
|
|
438
|
-
font-size: 8px;
|
|
439
|
-
line-height: 14px;
|
|
440
|
-
color: grey;
|
|
441
|
-
border-right: 1px solid grey;
|
|
442
|
-
background-color: #e8e8e8;
|
|
443
|
-
overflow: hidden;
|
|
444
|
-
`,iR=Ed("div",se.forwardRef)`
|
|
445
|
-
position: absolute;
|
|
446
|
-
border-left: 1px solid grey;
|
|
447
|
-
padding-left: 2px;
|
|
448
|
-
`,aR=Ed("div",se.forwardRef)`
|
|
449
|
-
position: absolute;
|
|
450
|
-
left: 14px;
|
|
451
|
-
border-left: 1px solid grey;
|
|
452
|
-
padding-left: 2px;
|
|
453
|
-
transform: rotate(90deg);
|
|
454
|
-
transform-origin: left top;
|
|
455
|
-
overflow: hidden;
|
|
456
|
-
`,oR=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4],sR=ni(({store:t,width:e,height:r})=>{const n=se.useRef(null);if(!t.activePage)return null;const i=t.activePage,a=(t.bleedVisible&&i.bleed,i.computedWidth*t.scale),o=i.computedHeight*t.scale,s=(e-a)/2,u=(h=y=>x4({unitVal:y,dpi:t.dpi,unit:t.unit})*t.scale,oR.find(y=>h(y)>30)||1e4);var h;const f=x4({unitVal:u,dpi:t.dpi,unit:t.unit})*t.scale,g=Math.round(a/f)+1,v=Math.round(o/f)+1,p=Z0(t.selectedShapes);return se.createElement(tR,{ref:n,className:"polotno-rulers"},se.createElement(rR,{style:{width:e+"px"},className:"polotno-x-ruler"},[...Array(g)].map((y,_)=>se.createElement(iR,{key:_,style:{left:s+_*f+"px",width:f+"px"}},t.unit==="px"||u>=1?Math.round(u*_):(u*_).toFixed(1))),!!t.selectedShapes.length&&se.createElement("div",{style:{position:"absolute",left:s+p.x*t.scale+"px",height:"14px",width:p.width*t.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),t.pages.map((y,_)=>{var x;const b=y.computedHeight*t.scale,E=(r-b)/2;return se.createElement(nR,{key:y.id,style:{height:r-14+"px"},className:"polotno-y-ruler"},[...Array(v)].map((A,S)=>se.createElement(aR,{key:S,style:{top:E+S*f-14+"px",width:f+"px"}},t.unit==="px"||u>=1?Math.round(u*S):(u*S).toFixed(1))),((x=t.selectedShapes[0])===null||x===void 0?void 0:x.page)===y&&se.createElement("div",{style:{position:"absolute",top:E+p.y*t.scale-14+"px",width:"14px",height:p.height*t.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),lR=ni(({audio:t,store:e})=>{const[r,n]=function(i){const[a,o]=se.useState(null),[s,u]=se.useState("loading");return se.useEffect(()=>{const h=new Audio(i),f=()=>{u("loaded"),o(h)},g=()=>{u("failed"),o(null)};return h.addEventListener("canplay",f),h.addEventListener("error",g),()=>{h.removeEventListener("canplay",f),h.removeEventListener("error",g)}},[i]),[a,s]}(t.src);return se.useEffect(()=>{r&&e.history.ignore(()=>{t.set({duration:1e3*r.duration})})},[r,t,e.history]),se.useEffect(()=>{if(!r)return;const i=()=>{r.currentTime=t.startTime*t.duration/1e3},a=()=>{const s=t.endTime*t.duration/1e3;r.currentTime>=s&&(r.pause(),r.currentTime=t.startTime*t.duration/1e3)};r.addEventListener("ended",i),r.addEventListener("timeupdate",a);const o=zu(()=>{const s=e.animatedElementsIds;if(s.length&&!s.includes(t.id))return;const u=e.currentTime-t.delay,h=t.duration*(t.endTime-t.startTime),f=u>=0&&u<h;if(!e.isPlaying||e.animatedElementsIds.length!==0||!f)return void r.pause();r.volume=t.volume,r.paused&&r.play();const g=u%h/1e3+t.startTime*t.duration/1e3,v=r.currentTime;Math.abs(v-g)>.5&&g!==v&&(r.currentTime=g)});return()=>{r.pause(),r.removeEventListener("ended",i),r.removeEventListener("timeupdate",a),o()}},[e.isPlaying,t.startTime,t.endTime,t.volume,r]),null});let b_={data:[],pageId:""};const x0="polotno_clipboard",by=(t,e)=>{b_={data:JSON.parse(JSON.stringify(t)),pageId:e};try{localStorage.setItem(x0,JSON.stringify(t)),localStorage.setItem(x0+"_page",e)}catch{}},uR=()=>{try{const t=localStorage.getItem(x0),e=localStorage.getItem(x0+"_page");if(t)return{data:JSON.parse(t),pageId:e}}catch{}return b_},cR=t=>{var e;t.selectedElements.length!==0&&by(t.selectedElements.map(r=>r.toJSON()),(e=t.activePage)===null||e===void 0?void 0:e.id)},fR=t=>{var e;by(t.selectedElements.map(n=>n.toJSON()),(e=t.activePage)===null||e===void 0?void 0:e.id);let r=t.selectedElements.filter(n=>n.removable).map(n=>n.id);t.deleteElements(r)},hR=t=>{t.history.transaction(()=>{var e,r;let n=0,i=0;const{data:a,pageId:o}=uR();if(o===((e=t.activePage)===null||e===void 0?void 0:e.id))n=t.width/20,i=t.height/20;else{const u=[];Ii({children:a},f=>{f.type!=="group"&&u.push(f)});const h=Z0(u);h.maxX>t.width&&(n=-h.minX),h.maxY>t.height&&(i=-h.minY)}const s=[];Ii({children:a},u=>{delete u.id,u.type!=="group"&&(u.x+=n,u.y+=i)}),a.forEach(u=>{var h;const f=(h=t.activePage)===null||h===void 0?void 0:h.addElement(u);f&&s.push(f.id)}),by(a,(r=t.activePage)===null||r===void 0?void 0:r.id),t.selectElements(s)})};function dR(t,e){const r=[];t.forEach(n=>{if(n.removable===!1)return;const i=n.clone();n.type==="group"?i.children.forEach(a=>{a.set({x:a.x+50,y:a.y+50})}):i.set({x:n.x+50,y:n.y+50}),r.push(i.id)}),e.selectElements(r)}const Uo=t=>{if(t.type!=="group")return kd(t);let e=1/0,r=1/0,n=-1/0,i=-1/0;return t.children.forEach(a=>{const o=Uo(a);e=Math.min(e,o.x),r=Math.min(r,o.y),n=Math.max(n,o.x+o.width),i=Math.max(i,o.y+o.height)}),{x:e,y:r,width:n-e,height:i-r}},Sh=(t,e,r)=>{if(t.type!=="group"){const n=kd(t),i=e-n.x,a=r-n.y;t.set({x:t.x+i,y:t.y+a})}else{const n=e-Uo(t).x,i=r-Uo(t).y;t.children.forEach(a=>{const o=Uo(a);Sh(a,o.x+n,o.y+i)})}};function pR(t){var e;let r=(e=t.activePage)===null||e===void 0?void 0:e.computedWidth;t.selectedElements.forEach(n=>{r=Math.min(r,Uo(n).x)}),t.selectedElements.length===1&&(r=0),t.selectedElements.forEach(n=>{const i=Uo(n);Sh(n,i.x-i.x+r,i.y)})}function gR(t){var e;let r=0;t.selectedElements.forEach(n=>{const i=Uo(n);r=Math.max(r,i.x+i.width)}),t.selectedElements.length===1&&(r=(e=t.activePage)===null||e===void 0?void 0:e.computedWidth),t.selectedElements.forEach(n=>{const i=Uo(n);Sh(n,r-i.width,i.y)})}function vR(t){var e;let r=(e=t.activePage)===null||e===void 0?void 0:e.computedHeight;t.selectedElements.forEach(n=>{r=Math.min(r,Uo(n).y)}),t.selectedElements.length===1&&(r=0),t.selectedElements.forEach(n=>{const i=Uo(n);Sh(n,i.x,i.y-i.y+r)})}function mR(t){var e,r;let n=(e=t.activePage)===null||e===void 0?void 0:e.computedHeight,i=0;t.selectedElements.forEach(o=>{const s=Uo(o);n=Math.min(n,s.y),i=Math.max(i,s.y+s.height)});let a=(i+n)/2;t.selectedElements.length===1&&(a=((r=t.activePage)===null||r===void 0?void 0:r.computedHeight)/2),t.selectedElements.forEach(o=>{const s=Uo(o);Sh(o,s.x,a-s.height/2)})}function yR(t){var e;let r=0;t.selectedElements.forEach(n=>{const i=Uo(n);r=Math.max(r,i.y+i.height)}),t.selectedElements.length===1&&(r=(e=t.activePage)===null||e===void 0?void 0:e.computedHeight),t.selectedElements.forEach(n=>{const i=Uo(n);Sh(n,i.x,r-i.height)})}function bR(t){var e,r;let n=(e=t.activePage)===null||e===void 0?void 0:e.computedWidth,i=0;t.selectedElements.forEach(o=>{const s=Uo(o);n=Math.min(n,s.x),i=Math.max(i,s.x+s.width)});let a=(i+n)/2;t.selectedElements.length===1&&(a=((r=t.activePage)===null||r===void 0?void 0:r.computedWidth)/2),t.selectedElements.forEach(o=>{const s=Uo(o);Sh(o,a-s.width/2,s.y)})}const _v="rgba(191, 191, 191, 100)";function wR(t,e){var r,n,i,a;if(((r=document.activeElement)===null||r===void 0?void 0:r.tagName)==="INPUT"||((n=document.activeElement)===null||n===void 0?void 0:n.tagName)==="TEXTAREA"||((i=document.activeElement)===null||i===void 0?void 0:i.contentEditable)==="true")return;const o=document.querySelector(".polotno-workspace-container");if(document.activeElement!==o&&!o?.contains(document.activeElement)){const g=window.getSelection();if(g&&g.toString().length>0)return}const s=e.selectedElements.filter(g=>g.removable).map(g=>g.id);t.keyCode!==46&&t.keyCode!==8||e.deleteElements(s);const u=t.ctrlKey||t.metaKey,h=t.shiftKey,f=t.altKey;if(!u||h||t.key.toLowerCase()!=="z"&&t.key.toLowerCase()!=="y"||(t.preventDefault(),e.history.undo()),u&&h&&(t.key.toLowerCase()==="z"||t.key.toLowerCase()==="y")&&(t.preventDefault(),e.history.redo()),u&&t.code==="KeyA"){t.preventDefault();const g=(a=e.activePage)===null||a===void 0?void 0:a.children.filter(p=>p.selectable),v=g?.map(p=>p.id)||[];e.selectElements(v)}if(u&&t.code==="KeyC"&&(t.preventDefault(),cR(e)),u&&t.code==="KeyX"&&(t.preventDefault(),fR(e)),u&&t.code==="KeyV"&&(t.preventDefault(),hR(e)),t.code==="ArrowDown"&&(t.preventDefault(),e.selectedShapes.forEach(g=>{g.draggable&&g.set({y:g.y+1})})),t.code==="ArrowUp"&&(t.preventDefault(),e.selectedShapes.forEach(g=>{g.draggable&&g.set({y:g.y-1})})),t.code==="ArrowLeft"&&(t.preventDefault(),e.selectedShapes.forEach(g=>{g.draggable&&g.set({x:g.x-1})})),t.code==="ArrowRight"&&(t.preventDefault(),e.selectedShapes.forEach(g=>{g.draggable&&g.set({x:g.x+1})})),u&&t.code==="KeyG"){t.preventDefault();const g=e.selectedElements[0];if(g&&g.type==="group"){const v=g;e.ungroupElements([v.id])}else e.groupElements(e.selectedElements.map(v=>v.id))}if(u&&t.code==="KeyD"&&(t.preventDefault(),dR(e.selectedElements,e)),t.code==="KeyT"&&!u){t.preventDefault();const g=30,v=e.width/2,p=e.width/2-v/2,y=e.height/2-g/2,_=2160,x=(e.width+e.height)/_;e.activePage.addElement({type:"text",x:p,y,width:v,fontSize:g*x,text:"Sample Text",fontFamily:"Roboto"})}if(t.code==="KeyR"&&!u){t.preventDefault();const g={type:"figure",x:e.width/4,y:e.height/4,width:300,height:300,fill:_v,stroke:"#0c0c0c",strokeWidth:0,subType:"rect"};e.activePage.addElement(g)}if(t.code==="KeyL"&&!u){t.preventDefault();const g=e.activePage.computedWidth/3,v={type:"line",x:e.activePage.computedWidth/2-g/2,y:e.activePage.computedHeight/2,width:g,color:_v};e.activePage.addElement(v)}if(t.code==="KeyO"&&!u){t.preventDefault(),t.preventDefault();const g={type:"figure",x:e.width/4,y:e.height/4,width:300,height:300,fill:_v,stroke:"#0c0c0c",strokeWidth:0,subType:"circle"};e.activePage.addElement(g)}u&&t.code==="Equal"&&(t.preventDefault(),e.setScale(e.scale+.1)),u&&t.code==="Minus"&&(t.preventDefault(),e.setScale(e.scale-.1)),f&&(t.code==="KeyA"&&(t.preventDefault(),pR(e)),t.code==="KeyD"&&(t.preventDefault(),gR(e)),t.code==="KeyS"&&(t.preventDefault(),yR(e)),t.code==="KeyW"&&(t.preventDefault(),vR(e)),t.code==="KeyV"&&(t.preventDefault(),mR(e)),t.code==="KeyH"&&(t.preventDefault(),bR(e))),t.code==="BracketRight"&&(t.preventDefault(),u?e.activePage.moveElementsUp(e.selectedElementsIds):e.activePage.moveElementsTop(e.selectedElementsIds)),t.code==="BracketLeft"&&(t.preventDefault(),u?e.activePage.moveElementsDown(e.selectedElementsIds):e.activePage.moveElementsBottom(e.selectedElementsIds))}const Sm=Xr({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",curvedText:"Curved text",curvePower:"Power",temperature:"Temperature",saturation:"Saturation",contrast:"Contrast",shadows:"Shadows",white:"White",black:"Black",vibrance:"Vibrance",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",filters:"Filters",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",copyStyle:"Copy style",uppercase:"Uppercase",position:"Position",layering:"Layering",toForward:"To Front",up:"Forward",down:"Backward",toBottom:"To back",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",rotate:"Rotate",none:"None",bounce:"Bounce",blink:"Blink",strength:"Strength",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",colorPicker:{solid:"Solid",linear:"Linear",angle:"Angle"},aiText:{aiWrite:"AI write",rewrite:"Rewrite",shorten:"Shorten",continue:"Continue writing",proofread:"Proofread",tones:"Tones",friendly:"Friendly",professional:"Professional",humorous:"Humorous",formal:"Formal",customPrompt:"Custom prompt",generatedResult:"Generated result",cancel:"Cancel",generate:"Generate",back:"Back",tryAgain:"Try Again",insert:"Insert",promptPlaceholder:"Describe what you want to generate"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",animations:"Animations",effects:"Effects",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Add file",uploadTip:"Upload your assets",background:"Background",resize:"Resize",layers:"Layers",animate:"Animate",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"},pagesTimeline:{pages:"Pages",removePage:"Remove page",addPage:"Add page",duplicatePage:"Duplicate page",removeAudio:"Remove audio"},contextMenu:{duplicate:"Duplicate",remove:"Remove",lock:"Lock",unlock:"Unlock",copy:"Copy",paste:"Paste",copyStyle:"Copy style",moveUp:"Move up",moveDown:"Move down",moveBack:"Move back",moveForward:"Move forward"}}),S0=t=>t&&typeof t=="object";function w_(t,e){Object.keys(e).forEach(r=>{const n=t[r],i=e[r];S0(i)&&S0(n)?w_(n,i):t[r]=i})}function __(t,e,r=""){Object.keys(e).forEach(n=>{const i=e[n],a=r?`${r}.${n}`:n;S0(i)?S0(t[n])?__(t[n],i,a):console.warn(`Missing nested translation object at '${a}'`):t[n]===void 0&&console.warn(`Missing translation '${a}'`)})}Qr((t,{validate:e=!1}={})=>{e&&__(t,Sm),w_(Sm,t)});const T4={},R4=t=>{const e=function(i,a){var o,s=a.split("."),u=i;for(o=0;o<s.length;++o){if(u[s[o]]==null)return;u=u[s[o]]}return u}(Sm,t);if(e!==void 0)return e;T4[t]||(T4[t]=!0,console.warn(`Missing translation '${t}'`));const r=t.split("."),n=r[r.length-1]||" ";return n.charAt(0).toUpperCase()+n.slice(1)},_R=({store:t})=>se.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},se.createElement("p",null,R4("workspace.noPages")),se.createElement("button",{onClick:()=>{t.addPage()}},R4("workspace.addPage"))),xR=({width:t,height:e,xPadding:r,yPadding:n,backgroundColor:i})=>se.createElement("div",{style:{width:t+"px",height:e+"px",backgroundColor:i,paddingLeft:r+"px",paddingRight:r+"px",paddingTop:n+"px",paddingBottom:n+"px"}},se.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}})),SR=[4,6],ER=ni(({store:t,pageControlsEnabled:e,backgroundColor:r,pageBorderColor:n,activePageBorderColor:i,bleedColor:a,snapGuideStroke:o,snapGuideStrokeWidth:s,snapGuideDash:u,selectionRectFill:h,selectionRectStroke:f,selectionRectStrokeWidth:g,transformLabelFill:v,transformLabelTextFill:p,distanceGuideStroke:y,distanceLabelFill:_,distanceLabelTextFill:x,components:b,onKeyDown:E,paddingX:A,paddingY:S,altCloneEnabled:k=!0,visiblePagesOffset:I,renderOnlyActivePage:O})=>{var M;const F=A??20,j=S??55,[T,L]=se.useState({width:100,height:100}),$=se.useRef(T),q=se.useRef(null),J=se.useRef(null),ae=t.bleedVisible?Math.max(0,...t.pages.map(Ee=>Ee.bleed)):0,ie=Math.max(...t.pages.map(Ee=>Ee.computedWidth)),Z=Math.max(...t.pages.map(Ee=>Ee.computedHeight)),te=((M=t.activePage)===null||M===void 0?void 0:M.computedHeight)||0,V=ie+2*ae,B=(O?te:Z)+2*ae,D=async({skipTimeout:Ee}={skipTimeout:!1})=>{if(Ee||await new Promise(ue=>setTimeout(ue,50)),q.current===null)return;const ge=q.current.getBoundingClientRect();ge.width!==0&&ge.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
457
|
-
Width or height of parent elements is equal 0.
|
|
458
|
-
Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
|
|
459
|
-
For simpler debugging here is the log of the parent element:`),console.log(q.current));const Re=J.current.clientWidth||ge.width,Be={width:Re,height:ge.height};($.current.width!==Be.width||$.current.height!==Be.height)&&(L(Be),$.current=Be);const Oe=(Re-2*F)/V,fe=t.pages.length>1?3.1:2,Le=(ge.height-j*fe)/B,Ne=t.pages.length?Math.max(Math.min(Oe,Le),.01):1;t.scaleToFit!==Ne&&(t.setScale(Ne),t._setScaleToFit(Ne))};se.useLayoutEffect(()=>{D({skipTimeout:!0})},[]),se.useEffect(()=>{D()},[V,B,S,A]),se.useLayoutEffect(()=>{D({skipTimeout:!0})},[t.openedSidePanel]),se.useEffect(()=>{t.__()},[]),se.useEffect(()=>{const Ee=q.current;if(window.ResizeObserver){const ge=new ResizeObserver(()=>{D({skipTimeout:!0})});return ge.observe(Ee),()=>ge.unobserve(Ee)}{const ge=setInterval(()=>{D({skipTimeout:!0})},100);return()=>clearInterval(ge)}},[V,B]);const U=Math.max(F,(T.width-V*t.scale)/2),X=O?1:t.pages.length,ee=B*t.scale*X,K=Math.max(j,(T.height-ee)/X/2);se.useEffect(()=>{const Ee=ge=>{(E||wR)(ge,t)};return window.addEventListener("keydown",Ee),()=>window.removeEventListener("keydown",Ee)},[]),se.useEffect(()=>{var Ee;const ge=Re=>{if(Re.ctrlKey||Re.metaKey){Re.preventDefault();const Le=Math.max(5,t.scaleToFit),Ne=Math.min(.1,t.scaleToFit),ue=.03,Ae=(Be=Re.deltaY<0?t.scale*(1+ue):t.scale/(1+ue),Oe=Ne,fe=Le,Math.max(Oe,Math.min(fe,Be)));return void t.setScale(Ae)}var Be,Oe,fe};return(Ee=J.current)===null||Ee===void 0||Ee.addEventListener("wheel",ge),()=>{var Re;return(Re=J.current)===null||Re===void 0?void 0:Re.removeEventListener("wheel",ge)}},[]);const oe=se.useRef(!1);((Ee,ge,Re,Be,Oe,fe)=>{const Le=se.useRef({width:ge,height:Re}),Ne=se.useRef({top:0,left:0}),ue=se.useRef(!1),Ae=se.useRef(Oe.pages.length);ue.current=Ae.current!==Oe.pages.length,Ae.current=Oe.pages.length,se.useEffect(()=>{const Pe=Ee.current,Ue=st=>{Ne.current={top:Pe.scrollTop,left:Pe.scrollLeft}};return Pe.addEventListener("scroll",Ue),()=>{Pe.removeEventListener("scroll",Ue)}},[]),se.useLayoutEffect(()=>{if(!Ee.current||ue.current)return;const Pe=Ee.current,Ue=(Ne.current.left+Pe.offsetWidth/2)/Le.current.width,st=(Ne.current.top+Pe.offsetHeight/2)/Le.current.height;fe.current=!0,Pe.scrollLeft=Ue*ge-Pe.offsetWidth/2,Pe.scrollTop=st*Re-Pe.offsetHeight/2,Le.current={width:ge,height:Re}},[Be,ge,Re])})(J,V*t.scale+2*U,B*t.scale+2*K,t.scale,t,oe);const{handleScroll:me}=((Ee,ge,Re,Be,Oe,fe)=>{const Le=se.useRef(!1),Ne=se.useRef(null),ue=se.useRef(!1);se.useEffect(()=>{const Pe=Ee.current,Ue=()=>{Oe.current};return Pe.addEventListener("scroll",Ue),()=>{Pe.removeEventListener("scroll",Ue)}},[]);const Ae=Re.pages.indexOf(Re.activePage);return se.useLayoutEffect(()=>{if(fe||!Re.activePage||!Ee.current||Le.current)return;const Pe=Ee.current,Ue=Re.pages.indexOf(Re.activePage)*ge;let st=()=>{};return(Math.abs(Ue-Pe.scrollTop)>.5*ge||ue.current)&&(ue.current=!0,st=(({element:dt,scrollTop:pt=0,duration:xt=300,onFinish:bt=()=>{}})=>{const kt=dt.scrollTop,zr=pt-kt;let _r=0,It=!1;if(xt===0)return dt.scrollTop=pt,()=>{};const Jt=()=>{if(It)return;_r+=20;const qe=Ve(_r,kt,zr,xt);dt.scrollTop=qe,_r<xt?setTimeout(Jt,20):bt()},Ve=(qe,Nt,Ct,ir)=>(qe/=ir/2)<1?Ct/2*qe*qe+Nt:-Ct/2*(--qe*(qe-2)-1)+Nt;return Jt(),()=>{It=!0}})({element:Pe,scrollTop:Ue,onFinish:()=>{ue.current=!1},duration:Re.isPlaying?0:300})),st},[Re.activePage,Ae,Re.isPlaying,fe]),{handleScroll:Pe=>{if(fe||ue.current)return;Le.current=!0,clearTimeout(Ne.current),Ne.current=setTimeout(()=>{Le.current=!1},300);const Ue=Pe.currentTarget.childNodes[0].offsetHeight,st=Pe.currentTarget.scrollTop,dt=Math.floor((st+Be.height/3)/Ue),pt=Re.pages[dt];pt&&Re.activePage!==pt&&pt.select()}}})(J,B*t.scale+2*K,t,T,oe,O),de=T.width>=V*t.scale+2*U,ye=r||"rgba(232, 232, 232, 0.9)",Te=t.pages.indexOf(t.activePage),Ce=b?.NoPages||_R,Ie=I??Math.min(3,Math.max(1,Math.ceil(T.height/2/(B*t.scale))));return se.createElement("div",{ref:q,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:ye,overflow:"hidden"},tabIndex:0,className:"polotno-workspace-container"},se.createElement("div",{ref:J,onScroll:me,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:de?"hidden":"auto"},className:"polotno-workspace-inner"},t.pages.map((Ee,ge)=>{const Re=Ee===t.activePage;if(O&&!Re&&!Ee._exportingOrRendering&&!Ee._forceMount)return null;if(!(Math.abs(ge-Te)<=Ie||Ee._exportingOrRendering||Ee._forceMount))return se.createElement(xR,{key:Ee.id,width:V*t.scale+2*U,height:B*t.scale+2*K,backgroundColor:ye,xPadding:U,yPadding:K});const Be=se.createElement(eR,{key:Ee.id,page:Ee,xPadding:U,yPadding:K,width:V*t.scale+2*U,height:B*t.scale+2*K,store:t,pageControlsEnabled:e,backColor:ye,pageBorderColor:n||"lightgrey",activePageBorderColor:i||"rgb(0, 161, 255)",altCloneEnabled:k,bleedColor:a||"rgba(255, 0, 0, 0.1)",selectionRectFill:h,selectionRectStroke:f,selectionRectStrokeWidth:g,snapGuideStroke:o||"rgb(0, 161, 255)",snapGuideStrokeWidth:s||1,snapGuideDash:u||SR,transformLabelFill:v,transformLabelTextFill:p,distanceGuideStroke:y||"rgb(0, 161, 255)",distanceLabelFill:_||"rgb(0, 161, 255)",distanceLabelTextFill:x||"white",components:b,viewportSize:T});return(Ee._exportingOrRendering||Ee._forceMount)&&!Re&&O?se.createElement("div",{style:{display:"none"},key:Ee.id},Be):Be}),t.rulesVisible&&se.createElement(sR,{store:t,xPadding:U,yPadding:K,width:V*t.scale+2*U,height:B*t.scale+2*K}),t.pages.length===0&&se.createElement(Ce,{store:t}),t.audios.map(Ee=>se.createElement(lR,{key:Ee.id,audio:Ee,store:t}))))}),kR="modulepreload",AR=function(t,e){return new URL(t,e).href},M4={},xv=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){let h=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const o=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),u=s?.nonce||s?.getAttribute("nonce");i=h(r.map(f=>{if(f=AR(f,n),f in M4)return;M4[f]=!0;const g=f.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(n)for(let y=o.length-1;y>=0;y--){const _=o[y];if(_.href===f&&(!g||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${v}`))return;const p=document.createElement("link");if(p.rel=g?"stylesheet":kR,g||(p.as="script"),p.crossOrigin="",p.href=f,u&&p.setAttribute("nonce",u),document.head.appendChild(p),g)return new Promise((y,_)=>{p.addEventListener("load",y),p.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return i.then(o=>{for(const s of o||[])s.status==="rejected"&&a(s.reason);return e().catch(a)})};function Nn(t){"@babel/helpers - typeof";return Nn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nn(t)}var ru=Uint8Array,il=Uint16Array,wy=Int32Array,_y=new ru([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]),xy=new ru([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]),I4=new ru([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),x_=function(t,e){for(var r=new il(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var i=new wy(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}},S_=x_(_y,2),PR=S_.b,Em=S_.r;PR[28]=258,Em[258]=28;var OR=x_(xy,0),j4=OR.r,km=new il(32768);for(var di=0;di<32768;++di){var nf=(di&43690)>>1|(di&21845)<<1;nf=(nf&52428)>>2|(nf&13107)<<2,nf=(nf&61680)>>4|(nf&3855)<<4,km[di]=((nf&65280)>>8|(nf&255)<<8)>>1}var fp=function(t,e,r){for(var n=t.length,i=0,a=new il(e);i<n;++i)t[i]&&++a[t[i]-1];var o=new il(e);for(i=1;i<e;++i)o[i]=o[i-1]+a[i-1]<<1;var s;if(r){s=new il(1<<e);var u=15-e;for(i=0;i<n;++i)if(t[i])for(var h=i<<4|t[i],f=e-t[i],g=o[t[i]-1]++<<f,v=g|(1<<f)-1;g<=v;++g)s[km[g]>>u]=h}else for(s=new il(n),i=0;i<n;++i)t[i]&&(s[i]=km[o[t[i]-1]++]>>15-t[i]);return s},ch=new ru(288);for(var di=0;di<144;++di)ch[di]=8;for(var di=144;di<256;++di)ch[di]=9;for(var di=256;di<280;++di)ch[di]=7;for(var di=280;di<288;++di)ch[di]=8;var E0=new ru(32);for(var di=0;di<32;++di)E0[di]=5;var CR=fp(ch,9,0),LR=fp(E0,5,0),E_=function(t){return(t+7)/8|0},NR=function(t,e,r){return(r==null||r>t.length)&&(r=t.length),new ru(t.subarray(e,r))},lc=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8},$d=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8,t[n+2]|=r>>16},Sv=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var i=r.length,a=r.slice();if(!i)return{t:A_,l:0};if(i==1){var o=new ru(r[0].s+1);return o[r[0].s]=1,{t:o,l:1}}r.sort(function(k,I){return k.f-I.f}),r.push({s:-1,f:25001});var s=r[0],u=r[1],h=0,f=1,g=2;for(r[0]={s:-1,f:s.f+u.f,l:s,r:u};f!=i-1;)s=r[r[h].f<r[g].f?h++:g++],u=r[h!=f&&r[h].f<r[g].f?h++:g++],r[f++]={s:-1,f:s.f+u.f,l:s,r:u};for(var v=a[0].s,n=1;n<i;++n)a[n].s>v&&(v=a[n].s);var p=new il(v+1),y=Am(r[f-1],p,0);if(y>e){var n=0,_=0,x=y-e,b=1<<x;for(a.sort(function(I,O){return p[O.s]-p[I.s]||I.f-O.f});n<i;++n){var E=a[n].s;if(p[E]>e)_+=b-(1<<y-p[E]),p[E]=e;else break}for(_>>=x;_>0;){var A=a[n].s;p[A]<e?_-=1<<e-p[A]++-1:++n}for(;n>=0&&_;--n){var S=a[n].s;p[S]==e&&(--p[S],++_)}y=e}return{t:new ru(p),l:y}},Am=function(t,e,r){return t.s==-1?Math.max(Am(t.l,e,r+1),Am(t.r,e,r+1)):e[t.s]=r},D4=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new il(++e),n=0,i=t[0],a=1,o=function(u){r[n++]=u},s=1;s<=e;++s)if(t[s]==i&&s!=e)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=t[s]}return{c:r.subarray(0,n),n:e}},Gd=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},k_=function(t,e,r){var n=r.length,i=E_(e+2);t[i]=n&255,t[i+1]=n>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var a=0;a<n;++a)t[i+a+4]=r[a];return(i+4+n)*8},F4=function(t,e,r,n,i,a,o,s,u,h,f){lc(e,f++,r),++i[256];for(var g=Sv(i,15),v=g.t,p=g.l,y=Sv(a,15),_=y.t,x=y.l,b=D4(v),E=b.c,A=b.n,S=D4(_),k=S.c,I=S.n,O=new il(19),M=0;M<E.length;++M)++O[E[M]&31];for(var M=0;M<k.length;++M)++O[k[M]&31];for(var F=Sv(O,7),j=F.t,T=F.l,L=19;L>4&&!j[I4[L-1]];--L);var $=h+5<<3,q=Gd(i,ch)+Gd(a,E0)+o,J=Gd(i,v)+Gd(a,_)+o+14+3*L+Gd(O,j)+2*O[16]+3*O[17]+7*O[18];if(u>=0&&$<=q&&$<=J)return k_(e,f,t.subarray(u,u+h));var ae,ie,Z,te;if(lc(e,f,1+(J<q)),f+=2,J<q){ae=fp(v,p,0),ie=v,Z=fp(_,x,0),te=_;var V=fp(j,T,0);lc(e,f,A-257),lc(e,f+5,I-1),lc(e,f+10,L-4),f+=14;for(var M=0;M<L;++M)lc(e,f+3*M,j[I4[M]]);f+=3*L;for(var B=[E,k],D=0;D<2;++D)for(var U=B[D],M=0;M<U.length;++M){var X=U[M]&31;lc(e,f,V[X]),f+=j[X],X>15&&(lc(e,f,U[M]>>5&127),f+=U[M]>>12)}}else ae=CR,ie=ch,Z=LR,te=E0;for(var M=0;M<s;++M){var ee=n[M];if(ee>255){var X=ee>>18&31;$d(e,f,ae[X+257]),f+=ie[X+257],X>7&&(lc(e,f,ee>>23&31),f+=_y[X]);var K=ee&31;$d(e,f,Z[K]),f+=te[K],K>3&&($d(e,f,ee>>5&8191),f+=xy[K])}else $d(e,f,ae[ee]),f+=ie[ee]}return $d(e,f,ae[256]),f+ie[256]},TR=new wy([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),A_=new ru(0),RR=function(t,e,r,n,i,a){var o=a.z||t.length,s=new ru(n+o+5*(1+Math.ceil(o/7e3))+i),u=s.subarray(n,s.length-i),h=a.l,f=(a.r||0)&7;if(e){f&&(u[0]=a.r>>3);for(var g=TR[e-1],v=g>>13,p=g&8191,y=(1<<r)-1,_=a.p||new il(32768),x=a.h||new il(y+1),b=Math.ceil(r/3),E=2*b,A=function(Ee){return(t[Ee]^t[Ee+1]<<b^t[Ee+2]<<E)&y},S=new wy(25e3),k=new il(288),I=new il(32),O=0,M=0,F=a.i||0,j=0,T=a.w||0,L=0;F+2<o;++F){var $=A(F),q=F&32767,J=x[$];if(_[q]=J,x[$]=q,T<=F){var ae=o-F;if((O>7e3||j>24576)&&(ae>423||!h)){f=F4(t,u,0,S,k,I,M,j,L,F-L,f),j=O=M=0,L=F;for(var ie=0;ie<286;++ie)k[ie]=0;for(var ie=0;ie<30;++ie)I[ie]=0}var Z=2,te=0,V=p,B=q-J&32767;if(ae>2&&$==A(F-B))for(var D=Math.min(v,ae)-1,U=Math.min(32767,F),X=Math.min(258,ae);B<=U&&--V&&q!=J;){if(t[F+Z]==t[F+Z-B]){for(var ee=0;ee<X&&t[F+ee]==t[F+ee-B];++ee);if(ee>Z){if(Z=ee,te=B,ee>D)break;for(var K=Math.min(B,ee-2),oe=0,ie=0;ie<K;++ie){var me=F-B+ie&32767,de=_[me],ye=me-de&32767;ye>oe&&(oe=ye,J=me)}}}q=J,J=_[q],B+=q-J&32767}if(te){S[j++]=268435456|Em[Z]<<18|j4[te];var Te=Em[Z]&31,Ce=j4[te]&31;M+=_y[Te]+xy[Ce],++k[257+Te],++I[Ce],T=F+Z,++O}else S[j++]=t[F],++k[t[F]]}}for(F=Math.max(F,T);F<o;++F)S[j++]=t[F],++k[t[F]];f=F4(t,u,h,S,k,I,M,j,L,F-L,f),h||(a.r=f&7|u[f/8|0]<<3,f-=7,a.h=x,a.p=_,a.i=F,a.w=T)}else{for(var F=a.w||0;F<o+h;F+=65535){var Ie=F+65535;Ie>=o&&(u[f/8|0]=h,Ie=o),f=k_(u,f+1,t.subarray(F,Ie))}a.i=o}return NR(s,0,n+E_(f)+i)},P_=function(){var t=1,e=0;return{p:function(r){for(var n=t,i=e,a=r.length|0,o=0;o!=a;){for(var s=Math.min(o+2655,a);o<s;++o)i+=n+=r[o];n=(n&65535)+15*(n>>16),i=(i&65535)+15*(i>>16)}t=n,e=i},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},MR=function(t,e,r,n,i){if(!i&&(i={l:1},e.dictionary)){var a=e.dictionary.subarray(-32768),o=new ru(a.length+t.length);o.set(a),o.set(t,a.length),t=o,i.w=a.length}return RR(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,r,n,i)},O_=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},IR=function(t,e){var r=e.level,n=r==0?0:r<6?1:r==9?3:2;if(t[0]=120,t[1]=n<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=P_();i.p(e.dictionary),O_(t,2,i.d())}};function Pm(t,e){e||(e={});var r=P_();r.p(t);var n=MR(t,e,e.dictionary?6:2,4);return IR(n,e),O_(n,n.length-4,r.d()),n}var jR=typeof TextDecoder<"u"&&new TextDecoder,DR=0;try{jR.decode(A_,{stream:!0}),DR=1}catch{}function FR(t){if(Array.isArray(t))return t}function BR(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],u=!0,h=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(f){h=!0,i=f}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(h)throw i}}return s}}function B4(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function zR(t,e){if(t){if(typeof t=="string")return B4(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?B4(t,e):void 0}}function qR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
460
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z4(t,e){return FR(t)||BR(t,e)||zR(t,e)||qR()}function q4(t,e="utf8"){return new TextDecoder(e).decode(t)}const UR=new TextEncoder;function HR(t){return UR.encode(t)}const $R=1024*8,GR=(()=>{const t=new Uint8Array(4),e=new Uint32Array(t.buffer);return!((e[0]=1)&t[0])})(),Ev={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class Sy{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(e=$R,r={}){let n=!1;typeof e=="number"?e=new ArrayBuffer(e):(n=!0,this.lastWrittenByte=e.byteLength);const i=r.offset?r.offset>>>0:0,a=e.byteLength-i;let o=i;(ArrayBuffer.isView(e)||e instanceof Sy)&&(e.byteLength!==e.buffer.byteLength&&(o=e.byteOffset+i),e=e.buffer),n?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=e,this.length=a,this.byteLength=a,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,a),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const n=(this.offset+e)*2,i=new Uint8Array(n);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=n,this.byteLength=n,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,r){const n=Ev[r].BYTES_PER_ELEMENT*e,i=this.byteOffset+this.offset,a=this.buffer.slice(i,i+n);if(this.littleEndian===GR&&r!=="uint8"&&r!=="int8"){const s=new Uint8Array(this.buffer.slice(i,i+n));s.reverse();const u=new Ev[r](s.buffer);return this.offset+=n,u.reverse(),u}const o=new Ev[r](a);return this.offset+=n,o}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let r="";for(let n=0;n<e;n++)r+=this.readChar();return r}readUtf8(e=1){return q4(this.readBytes(e))}decodeText(e=1,r="utf8"){return q4(this.readBytes(e),r)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let r=0;r<e.length;r++)this._data.setUint8(this.offset++,e[r]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let r=0;r<e.length;r++)this.writeUint8(e.charCodeAt(r));return this}writeUtf8(e){return this.writeBytes(HR(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function Ad(t){let e=t.length;for(;--e>=0;)t[e]=0}const WR=3,VR=258,C_=29,YR=256,XR=YR+1+C_,L_=30,KR=512,ZR=new Array((XR+2)*2);Ad(ZR);const QR=new Array(L_*2);Ad(QR);const JR=new Array(KR);Ad(JR);const eM=new Array(VR-WR+1);Ad(eM);const tM=new Array(C_);Ad(tM);const rM=new Array(L_);Ad(rM);const nM=(t,e,r,n)=>{let i=t&65535|0,a=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do i=i+e[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0};var Om=nM;const iM=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},aM=new Uint32Array(iM()),oM=(t,e,r,n)=>{const i=aM,a=n+r;t^=-1;for(let o=n;o<a;o++)t=t>>>8^i[(t^e[o])&255];return t^-1};var Cu=oM,Cm={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},N_={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const sM=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var lM=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const n in r)sM(r,n)&&(t[n]=r[n])}}return t},uM=t=>{let e=0;for(let n=0,i=t.length;n<i;n++)e+=t[n].length;const r=new Uint8Array(e);for(let n=0,i=0,a=t.length;n<a;n++){let o=t[n];r.set(o,i),i+=o.length}return r},T_={assign:lM,flattenChunks:uM};let R_=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{R_=!1}const Ep=new Uint8Array(256);for(let t=0;t<256;t++)Ep[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Ep[254]=Ep[254]=1;var cM=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,i,a,o=t.length,s=0;for(i=0;i<o;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(s),a=0,i=0;a<s;i++)r=t.charCodeAt(i),(r&64512)===55296&&i+1<o&&(n=t.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|r&63):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|r&63):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|r&63);return e};const fM=(t,e)=>{if(e<65534&&t.subarray&&R_)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r};var hM=(t,e)=>{const r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,i;const a=new Array(r*2);for(i=0,n=0;n<r;){let o=t[n++];if(o<128){a[i++]=o;continue}let s=Ep[o];if(s>4){a[i++]=65533,n+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&n<r;)o=o<<6|t[n++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return fM(a,i)},dM=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Ep[t[r]]>e?r:e},Lm={string2buf:cM,buf2string:hM,utf8border:dM};function pM(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var gM=pM;const R1=16209,vM=16191;var mM=function(e,r){let n,i,a,o,s,u,h,f,g,v,p,y,_,x,b,E,A,S,k,I,O,M,F,j;const T=e.state;n=e.next_in,F=e.input,i=n+(e.avail_in-5),a=e.next_out,j=e.output,o=a-(r-e.avail_out),s=a+(e.avail_out-257),u=T.dmax,h=T.wsize,f=T.whave,g=T.wnext,v=T.window,p=T.hold,y=T.bits,_=T.lencode,x=T.distcode,b=(1<<T.lenbits)-1,E=(1<<T.distbits)-1;e:do{y<15&&(p+=F[n++]<<y,y+=8,p+=F[n++]<<y,y+=8),A=_[p&b];t:for(;;){if(S=A>>>24,p>>>=S,y-=S,S=A>>>16&255,S===0)j[a++]=A&65535;else if(S&16){k=A&65535,S&=15,S&&(y<S&&(p+=F[n++]<<y,y+=8),k+=p&(1<<S)-1,p>>>=S,y-=S),y<15&&(p+=F[n++]<<y,y+=8,p+=F[n++]<<y,y+=8),A=x[p&E];r:for(;;){if(S=A>>>24,p>>>=S,y-=S,S=A>>>16&255,S&16){if(I=A&65535,S&=15,y<S&&(p+=F[n++]<<y,y+=8,y<S&&(p+=F[n++]<<y,y+=8)),I+=p&(1<<S)-1,I>u){e.msg="invalid distance too far back",T.mode=R1;break e}if(p>>>=S,y-=S,S=a-o,I>S){if(S=I-S,S>f&&T.sane){e.msg="invalid distance too far back",T.mode=R1;break e}if(O=0,M=v,g===0){if(O+=h-S,S<k){k-=S;do j[a++]=v[O++];while(--S);O=a-I,M=j}}else if(g<S){if(O+=h+g-S,S-=g,S<k){k-=S;do j[a++]=v[O++];while(--S);if(O=0,g<k){S=g,k-=S;do j[a++]=v[O++];while(--S);O=a-I,M=j}}}else if(O+=g-S,S<k){k-=S;do j[a++]=v[O++];while(--S);O=a-I,M=j}for(;k>2;)j[a++]=M[O++],j[a++]=M[O++],j[a++]=M[O++],k-=3;k&&(j[a++]=M[O++],k>1&&(j[a++]=M[O++]))}else{O=a-I;do j[a++]=j[O++],j[a++]=j[O++],j[a++]=j[O++],k-=3;while(k>2);k&&(j[a++]=j[O++],k>1&&(j[a++]=j[O++]))}}else if((S&64)===0){A=x[(A&65535)+(p&(1<<S)-1)];continue r}else{e.msg="invalid distance code",T.mode=R1;break e}break}}else if((S&64)===0){A=_[(A&65535)+(p&(1<<S)-1)];continue t}else if(S&32){T.mode=vM;break e}else{e.msg="invalid literal/length code",T.mode=R1;break e}break}}while(n<i&&a<s);k=y>>3,n-=k,y-=k<<3,p&=(1<<y)-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?5+(i-n):5-(n-i),e.avail_out=a<s?257+(s-a):257-(a-s),T.hold=p,T.bits=y};const Vh=15,U4=852,H4=592,$4=0,kv=1,G4=2,yM=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),bM=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),wM=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),_M=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),xM=(t,e,r,n,i,a,o,s)=>{const u=s.bits;let h=0,f=0,g=0,v=0,p=0,y=0,_=0,x=0,b=0,E=0,A,S,k,I,O,M=null,F;const j=new Uint16Array(Vh+1),T=new Uint16Array(Vh+1);let L=null,$,q,J;for(h=0;h<=Vh;h++)j[h]=0;for(f=0;f<n;f++)j[e[r+f]]++;for(p=u,v=Vh;v>=1&&j[v]===0;v--);if(p>v&&(p=v),v===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(g=1;g<v&&j[g]===0;g++);for(p<g&&(p=g),x=1,h=1;h<=Vh;h++)if(x<<=1,x-=j[h],x<0)return-1;if(x>0&&(t===$4||v!==1))return-1;for(T[1]=0,h=1;h<Vh;h++)T[h+1]=T[h]+j[h];for(f=0;f<n;f++)e[r+f]!==0&&(o[T[e[r+f]]++]=f);if(t===$4?(M=L=o,F=20):t===kv?(M=yM,L=bM,F=257):(M=wM,L=_M,F=0),E=0,f=0,h=g,O=a,y=p,_=0,k=-1,b=1<<p,I=b-1,t===kv&&b>U4||t===G4&&b>H4)return 1;for(;;){$=h-_,o[f]+1<F?(q=0,J=o[f]):o[f]>=F?(q=L[o[f]-F],J=M[o[f]-F]):(q=96,J=0),A=1<<h-_,S=1<<y,g=S;do S-=A,i[O+(E>>_)+S]=$<<24|q<<16|J|0;while(S!==0);for(A=1<<h-1;E&A;)A>>=1;if(A!==0?(E&=A-1,E+=A):E=0,f++,--j[h]===0){if(h===v)break;h=e[r+o[f]]}if(h>p&&(E&I)!==k){for(_===0&&(_=p),O+=g,y=h-_,x=1<<y;y+_<v&&(x-=j[y+_],!(x<=0));)y++,x<<=1;if(b+=1<<y,t===kv&&b>U4||t===G4&&b>H4)return 1;k=E&I,i[k]=p<<24|y<<16|O-a|0}}return E!==0&&(i[O+E]=h-_<<24|64<<16|0),s.bits=p,0};var hp=xM;const SM=0,M_=1,I_=2,{Z_FINISH:W4,Z_BLOCK:EM,Z_TREES:M1,Z_OK:fh,Z_STREAM_END:kM,Z_NEED_DICT:AM,Z_STREAM_ERROR:Ll,Z_DATA_ERROR:j_,Z_MEM_ERROR:D_,Z_BUF_ERROR:PM,Z_DEFLATED:V4}=N_,eg=16180,Y4=16181,X4=16182,K4=16183,Z4=16184,Q4=16185,J4=16186,ew=16187,tw=16188,rw=16189,k0=16190,uc=16191,Av=16192,nw=16193,Pv=16194,iw=16195,aw=16196,ow=16197,sw=16198,I1=16199,j1=16200,lw=16201,uw=16202,cw=16203,fw=16204,hw=16205,Ov=16206,dw=16207,pw=16208,xi=16209,F_=16210,B_=16211,OM=852,CM=592,LM=15,NM=LM,gw=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function TM(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Eh=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<eg||e.mode>B_?1:0},z_=t=>{if(Eh(t))return Ll;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=eg,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(OM),e.distcode=e.distdyn=new Int32Array(CM),e.sane=1,e.back=-1,fh},q_=t=>{if(Eh(t))return Ll;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,z_(t)},U_=(t,e)=>{let r;if(Eh(t))return Ll;const n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Ll:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,q_(t))},H_=(t,e)=>{if(!t)return Ll;const r=new TM;t.state=r,r.strm=t,r.window=null,r.mode=eg;const n=U_(t,e);return n!==fh&&(t.state=null),n},RM=t=>H_(t,NM);let vw=!0,Cv,Lv;const MM=t=>{if(vw){Cv=new Int32Array(512),Lv=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(hp(M_,t.lens,0,288,Cv,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;hp(I_,t.lens,0,32,Lv,0,t.work,{bits:5}),vw=!1}t.lencode=Cv,t.lenbits=9,t.distcode=Lv,t.distbits=5},$_=(t,e,r,n)=>{let i;const a=t.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(e.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(e.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(e.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},IM=(t,e)=>{let r,n,i,a,o,s,u,h,f,g,v,p,y,_,x=0,b,E,A,S,k,I,O,M;const F=new Uint8Array(4);let j,T;const L=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Eh(t)||!t.output||!t.input&&t.avail_in!==0)return Ll;r=t.state,r.mode===uc&&(r.mode=Av),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,h=r.hold,f=r.bits,g=s,v=u,M=fh;e:for(;;)switch(r.mode){case eg:if(r.wrap===0){r.mode=Av;break}for(;f<16;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(r.wrap&2&&h===35615){r.wbits===0&&(r.wbits=15),r.check=0,F[0]=h&255,F[1]=h>>>8&255,r.check=Cu(r.check,F,2,0),h=0,f=0,r.mode=Y4;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((h&255)<<8)+(h>>8))%31){t.msg="incorrect header check",r.mode=xi;break}if((h&15)!==V4){t.msg="unknown compression method",r.mode=xi;break}if(h>>>=4,f-=4,O=(h&15)+8,r.wbits===0&&(r.wbits=O),O>15||O>r.wbits){t.msg="invalid window size",r.mode=xi;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=h&512?rw:uc,h=0,f=0;break;case Y4:for(;f<16;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(r.flags=h,(r.flags&255)!==V4){t.msg="unknown compression method",r.mode=xi;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=xi;break}r.head&&(r.head.text=h>>8&1),r.flags&512&&r.wrap&4&&(F[0]=h&255,F[1]=h>>>8&255,r.check=Cu(r.check,F,2,0)),h=0,f=0,r.mode=X4;case X4:for(;f<32;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}r.head&&(r.head.time=h),r.flags&512&&r.wrap&4&&(F[0]=h&255,F[1]=h>>>8&255,F[2]=h>>>16&255,F[3]=h>>>24&255,r.check=Cu(r.check,F,4,0)),h=0,f=0,r.mode=K4;case K4:for(;f<16;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}r.head&&(r.head.xflags=h&255,r.head.os=h>>8),r.flags&512&&r.wrap&4&&(F[0]=h&255,F[1]=h>>>8&255,r.check=Cu(r.check,F,2,0)),h=0,f=0,r.mode=Z4;case Z4:if(r.flags&1024){for(;f<16;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}r.length=h,r.head&&(r.head.extra_len=h),r.flags&512&&r.wrap&4&&(F[0]=h&255,F[1]=h>>>8&255,r.check=Cu(r.check,F,2,0)),h=0,f=0}else r.head&&(r.head.extra=null);r.mode=Q4;case Q4:if(r.flags&1024&&(p=r.length,p>s&&(p=s),p&&(r.head&&(O=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+p),O)),r.flags&512&&r.wrap&4&&(r.check=Cu(r.check,n,p,a)),s-=p,a+=p,r.length-=p),r.length))break e;r.length=0,r.mode=J4;case J4:if(r.flags&2048){if(s===0)break e;p=0;do O=n[a+p++],r.head&&O&&r.length<65536&&(r.head.name+=String.fromCharCode(O));while(O&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Cu(r.check,n,p,a)),s-=p,a+=p,O)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=ew;case ew:if(r.flags&4096){if(s===0)break e;p=0;do O=n[a+p++],r.head&&O&&r.length<65536&&(r.head.comment+=String.fromCharCode(O));while(O&&p<s);if(r.flags&512&&r.wrap&4&&(r.check=Cu(r.check,n,p,a)),s-=p,a+=p,O)break e}else r.head&&(r.head.comment=null);r.mode=tw;case tw:if(r.flags&512){for(;f<16;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(r.wrap&4&&h!==(r.check&65535)){t.msg="header crc mismatch",r.mode=xi;break}h=0,f=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=uc;break;case rw:for(;f<32;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}t.adler=r.check=gw(h),h=0,f=0,r.mode=k0;case k0:if(r.havedict===0)return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=h,r.bits=f,AM;t.adler=r.check=1,r.mode=uc;case uc:if(e===EM||e===M1)break e;case Av:if(r.last){h>>>=f&7,f-=f&7,r.mode=Ov;break}for(;f<3;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}switch(r.last=h&1,h>>>=1,f-=1,h&3){case 0:r.mode=nw;break;case 1:if(MM(r),r.mode=I1,e===M1){h>>>=2,f-=2;break e}break;case 2:r.mode=aw;break;case 3:t.msg="invalid block type",r.mode=xi}h>>>=2,f-=2;break;case nw:for(h>>>=f&7,f-=f&7;f<32;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if((h&65535)!==(h>>>16^65535)){t.msg="invalid stored block lengths",r.mode=xi;break}if(r.length=h&65535,h=0,f=0,r.mode=Pv,e===M1)break e;case Pv:r.mode=iw;case iw:if(p=r.length,p){if(p>s&&(p=s),p>u&&(p=u),p===0)break e;i.set(n.subarray(a,a+p),o),s-=p,a+=p,u-=p,o+=p,r.length-=p;break}r.mode=uc;break;case aw:for(;f<14;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(r.nlen=(h&31)+257,h>>>=5,f-=5,r.ndist=(h&31)+1,h>>>=5,f-=5,r.ncode=(h&15)+4,h>>>=4,f-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=xi;break}r.have=0,r.mode=ow;case ow:for(;r.have<r.ncode;){for(;f<3;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}r.lens[L[r.have++]]=h&7,h>>>=3,f-=3}for(;r.have<19;)r.lens[L[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,j={bits:r.lenbits},M=hp(SM,r.lens,0,19,r.lencode,0,r.work,j),r.lenbits=j.bits,M){t.msg="invalid code lengths set",r.mode=xi;break}r.have=0,r.mode=sw;case sw:for(;r.have<r.nlen+r.ndist;){for(;x=r.lencode[h&(1<<r.lenbits)-1],b=x>>>24,E=x>>>16&255,A=x&65535,!(b<=f);){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(A<16)h>>>=b,f-=b,r.lens[r.have++]=A;else{if(A===16){for(T=b+2;f<T;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(h>>>=b,f-=b,r.have===0){t.msg="invalid bit length repeat",r.mode=xi;break}O=r.lens[r.have-1],p=3+(h&3),h>>>=2,f-=2}else if(A===17){for(T=b+3;f<T;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}h>>>=b,f-=b,O=0,p=3+(h&7),h>>>=3,f-=3}else{for(T=b+7;f<T;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}h>>>=b,f-=b,O=0,p=11+(h&127),h>>>=7,f-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=xi;break}for(;p--;)r.lens[r.have++]=O}}if(r.mode===xi)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=xi;break}if(r.lenbits=9,j={bits:r.lenbits},M=hp(M_,r.lens,0,r.nlen,r.lencode,0,r.work,j),r.lenbits=j.bits,M){t.msg="invalid literal/lengths set",r.mode=xi;break}if(r.distbits=6,r.distcode=r.distdyn,j={bits:r.distbits},M=hp(I_,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,j),r.distbits=j.bits,M){t.msg="invalid distances set",r.mode=xi;break}if(r.mode=I1,e===M1)break e;case I1:r.mode=j1;case j1:if(s>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=h,r.bits=f,mM(t,v),o=t.next_out,i=t.output,u=t.avail_out,a=t.next_in,n=t.input,s=t.avail_in,h=r.hold,f=r.bits,r.mode===uc&&(r.back=-1);break}for(r.back=0;x=r.lencode[h&(1<<r.lenbits)-1],b=x>>>24,E=x>>>16&255,A=x&65535,!(b<=f);){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(E&&(E&240)===0){for(S=b,k=E,I=A;x=r.lencode[I+((h&(1<<S+k)-1)>>S)],b=x>>>24,E=x>>>16&255,A=x&65535,!(S+b<=f);){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}h>>>=S,f-=S,r.back+=S}if(h>>>=b,f-=b,r.back+=b,r.length=A,E===0){r.mode=hw;break}if(E&32){r.back=-1,r.mode=uc;break}if(E&64){t.msg="invalid literal/length code",r.mode=xi;break}r.extra=E&15,r.mode=lw;case lw:if(r.extra){for(T=r.extra;f<T;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}r.length+=h&(1<<r.extra)-1,h>>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=uw;case uw:for(;x=r.distcode[h&(1<<r.distbits)-1],b=x>>>24,E=x>>>16&255,A=x&65535,!(b<=f);){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if((E&240)===0){for(S=b,k=E,I=A;x=r.distcode[I+((h&(1<<S+k)-1)>>S)],b=x>>>24,E=x>>>16&255,A=x&65535,!(S+b<=f);){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}h>>>=S,f-=S,r.back+=S}if(h>>>=b,f-=b,r.back+=b,E&64){t.msg="invalid distance code",r.mode=xi;break}r.offset=A,r.extra=E&15,r.mode=cw;case cw:if(r.extra){for(T=r.extra;f<T;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}r.offset+=h&(1<<r.extra)-1,h>>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=xi;break}r.mode=fw;case fw:if(u===0)break e;if(p=v-u,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=xi;break}p>r.wnext?(p-=r.wnext,y=r.wsize-p):y=r.wnext-p,p>r.length&&(p=r.length),_=r.window}else _=i,y=o-r.offset,p=r.length;p>u&&(p=u),u-=p,r.length-=p;do i[o++]=_[y++];while(--p);r.length===0&&(r.mode=j1);break;case hw:if(u===0)break e;i[o++]=r.length,u--,r.mode=j1;break;case Ov:if(r.wrap){for(;f<32;){if(s===0)break e;s--,h|=n[a++]<<f,f+=8}if(v-=u,t.total_out+=v,r.total+=v,r.wrap&4&&v&&(t.adler=r.check=r.flags?Cu(r.check,i,v,o-v):Om(r.check,i,v,o-v)),v=u,r.wrap&4&&(r.flags?h:gw(h))!==r.check){t.msg="incorrect data check",r.mode=xi;break}h=0,f=0}r.mode=dw;case dw:if(r.wrap&&r.flags){for(;f<32;){if(s===0)break e;s--,h+=n[a++]<<f,f+=8}if(r.wrap&4&&h!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=xi;break}h=0,f=0}r.mode=pw;case pw:M=kM;break e;case xi:M=j_;break e;case F_:return D_;case B_:default:return Ll}return t.next_out=o,t.avail_out=u,t.next_in=a,t.avail_in=s,r.hold=h,r.bits=f,(r.wsize||v!==t.avail_out&&r.mode<xi&&(r.mode<Ov||e!==W4))&&$_(t,t.output,t.next_out,v-t.avail_out),g-=t.avail_in,v-=t.avail_out,t.total_in+=g,t.total_out+=v,r.total+=v,r.wrap&4&&v&&(t.adler=r.check=r.flags?Cu(r.check,i,v,t.next_out-v):Om(r.check,i,v,t.next_out-v)),t.data_type=r.bits+(r.last?64:0)+(r.mode===uc?128:0)+(r.mode===I1||r.mode===Pv?256:0),(g===0&&v===0||e===W4)&&M===fh&&(M=PM),M},jM=t=>{if(Eh(t))return Ll;let e=t.state;return e.window&&(e.window=null),t.state=null,fh},DM=(t,e)=>{if(Eh(t))return Ll;const r=t.state;return(r.wrap&2)===0?Ll:(r.head=e,e.done=!1,fh)},FM=(t,e)=>{const r=e.length;let n,i,a;return Eh(t)||(n=t.state,n.wrap!==0&&n.mode!==k0)?Ll:n.mode===k0&&(i=1,i=Om(i,e,r,0),i!==n.check)?j_:(a=$_(t,e,r,r),a?(n.mode=F_,D_):(n.havedict=1,fh))};var BM=q_,zM=U_,qM=z_,UM=RM,HM=H_,$M=IM,GM=jM,WM=DM,VM=FM,YM="pako inflate (from Nodeca project)",fc={inflateReset:BM,inflateReset2:zM,inflateResetKeep:qM,inflateInit:UM,inflateInit2:HM,inflate:$M,inflateEnd:GM,inflateGetHeader:WM,inflateSetDictionary:VM,inflateInfo:YM};function XM(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var KM=XM;const G_=Object.prototype.toString,{Z_NO_FLUSH:ZM,Z_FINISH:QM,Z_OK:kp,Z_STREAM_END:Nv,Z_NEED_DICT:Tv,Z_STREAM_ERROR:JM,Z_DATA_ERROR:mw,Z_MEM_ERROR:eI}=N_;function Bp(t){this.options=T_.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new gM,this.strm.avail_out=0;let r=fc.inflateInit2(this.strm,e.windowBits);if(r!==kp)throw new Error(Cm[r]);if(this.header=new KM,fc.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Lm.string2buf(e.dictionary):G_.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=fc.inflateSetDictionary(this.strm,e.dictionary),r!==kp)))throw new Error(Cm[r])}Bp.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?QM:ZM,G_.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=fc.inflate(r,o),a===Tv&&i&&(a=fc.inflateSetDictionary(r,i),a===kp?a=fc.inflate(r,o):a===mw&&(a=Tv));r.avail_in>0&&a===Nv&&r.state.wrap>0&&t[r.next_in]!==0;)fc.inflateReset(r),a=fc.inflate(r,o);switch(a){case JM:case mw:case Tv:case eI:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(r.avail_out===0||a===Nv))if(this.options.to==="string"){let u=Lm.utf8border(r.output,r.next_out),h=r.next_out-u,f=Lm.buf2string(r.output,u);r.next_out=h,r.avail_out=n-h,h&&r.output.set(r.output.subarray(u,u+h),0),this.onData(f)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===kp&&s===0)){if(a===Nv)return a=fc.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Bp.prototype.onData=function(t){this.chunks.push(t)};Bp.prototype.onEnd=function(t){t===kp&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=T_.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function tI(t,e){const r=new Bp(e);if(r.push(t),r.err)throw r.msg||Cm[r.err];return r.result}var rI=Bp,nI=tI,iI={Inflate:rI,inflate:nI};const{Inflate:aI,inflate:oI}=iI;var yw=aI,sI=oI;const W_=[];for(let t=0;t<256;t++){let e=t;for(let r=0;r<8;r++)e&1?e=3988292384^e>>>1:e=e>>>1;W_[t]=e}const bw=4294967295;function lI(t,e,r){let n=t;for(let i=0;i<r;i++)n=W_[(n^e[i])&255]^n>>>8;return n}function uI(t,e){return(lI(bw,t,e)^bw)>>>0}function ww(t,e,r){const n=t.readUint32(),i=uI(new Uint8Array(t.buffer,t.byteOffset+t.offset-e-4,e),e);if(i!==n)throw new Error(`CRC mismatch for chunk ${r}. Expected ${n}, found ${i}`)}function V_(t,e,r){for(let n=0;n<r;n++)e[n]=t[n]}function Y_(t,e,r,n){let i=0;for(;i<n;i++)e[i]=t[i];for(;i<r;i++)e[i]=t[i]+e[i-n]&255}function X_(t,e,r,n){let i=0;if(r.length===0)for(;i<n;i++)e[i]=t[i];else for(;i<n;i++)e[i]=t[i]+r[i]&255}function K_(t,e,r,n,i){let a=0;if(r.length===0){for(;a<i;a++)e[a]=t[a];for(;a<n;a++)e[a]=t[a]+(e[a-i]>>1)&255}else{for(;a<i;a++)e[a]=t[a]+(r[a]>>1)&255;for(;a<n;a++)e[a]=t[a]+(e[a-i]+r[a]>>1)&255}}function Z_(t,e,r,n,i){let a=0;if(r.length===0){for(;a<i;a++)e[a]=t[a];for(;a<n;a++)e[a]=t[a]+e[a-i]&255}else{for(;a<i;a++)e[a]=t[a]+r[a]&255;for(;a<n;a++)e[a]=t[a]+cI(e[a-i],r[a],r[a-i])&255}}function cI(t,e,r){const n=t+e-r,i=Math.abs(n-t),a=Math.abs(n-e),o=Math.abs(n-r);return i<=a&&i<=o?t:a<=o?e:r}function fI(t,e,r,n,i,a){switch(t){case 0:V_(e,r,i);break;case 1:Y_(e,r,i,a);break;case 2:X_(e,r,n,i);break;case 3:K_(e,r,n,i,a);break;case 4:Z_(e,r,n,i,a);break;default:throw new Error(`Unsupported filter: ${t}`)}}const hI=new Uint16Array([255]),dI=new Uint8Array(hI.buffer),pI=dI[0]===255;function gI(t){const{data:e,width:r,height:n,channels:i,depth:a}=t,o=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],s=Math.ceil(a/8)*i,u=new Uint8Array(n*r*s);let h=0;for(let f=0;f<7;f++){const g=o[f],v=Math.ceil((r-g.x)/g.xStep),p=Math.ceil((n-g.y)/g.yStep);if(v<=0||p<=0)continue;const y=v*s,_=new Uint8Array(y);for(let x=0;x<p;x++){const b=e[h++],E=e.subarray(h,h+y);h+=y;const A=new Uint8Array(y);fI(b,E,A,_,y,s),_.set(A);for(let S=0;S<v;S++){const k=g.x+S*g.xStep,I=g.y+x*g.yStep;if(!(k>=r||I>=n))for(let O=0;O<s;O++)u[(I*r+k)*s+O]=A[S*s+O]}}}if(a===16){const f=new Uint16Array(u.buffer);if(pI)for(let g=0;g<f.length;g++)f[g]=vI(f[g]);return f}else return u}function vI(t){return(t&255)<<8|t>>8&255}const mI=new Uint16Array([255]),yI=new Uint8Array(mI.buffer),bI=yI[0]===255,wI=new Uint8Array(0);function _w(t){const{data:e,width:r,height:n,channels:i,depth:a}=t,o=Math.ceil(a/8)*i,s=Math.ceil(a/8*i*r),u=new Uint8Array(n*s);let h=wI,f=0,g,v;for(let p=0;p<n;p++){switch(g=e.subarray(f+1,f+1+s),v=u.subarray(p*s,(p+1)*s),e[f]){case 0:V_(g,v,s);break;case 1:Y_(g,v,s,o);break;case 2:X_(g,v,h,s);break;case 3:K_(g,v,h,s,o);break;case 4:Z_(g,v,h,s,o);break;default:throw new Error(`Unsupported filter: ${e[f]}`)}h=v,f+=s+1}if(a===16){const p=new Uint16Array(u.buffer);if(bI)for(let y=0;y<p.length;y++)p[y]=_I(p[y]);return p}else return u}function _I(t){return(t&255)<<8|t>>8&255}const Q1=Uint8Array.of(137,80,78,71,13,10,26,10);function xw(t){if(!xI(t.readBytes(Q1.length)))throw new Error("wrong PNG signature")}function xI(t){if(t.length<Q1.length)return!1;for(let e=0;e<Q1.length;e++)if(t[e]!==Q1[e])return!1;return!0}const SI="tEXt",EI=0,Q_=new TextDecoder("latin1");function kI(t){if(PI(t),t.length===0||t.length>79)throw new Error("keyword length must be between 1 and 79")}const AI=/^[\u0000-\u00FF]*$/;function PI(t){if(!AI.test(t))throw new Error("invalid latin1 text")}function OI(t,e,r){const n=J_(e);t[n]=CI(e,r-n.length-1)}function J_(t){for(t.mark();t.readByte()!==EI;);const e=t.offset;t.reset();const r=Q_.decode(t.readBytes(e-t.offset-1));return t.skip(1),kI(r),r}function CI(t,e){return Q_.decode(t.readBytes(e))}const Qs={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},Rv={UNKNOWN:-1,DEFLATE:0},Sw={UNKNOWN:-1,ADAPTIVE:0},Mv={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},D1={NONE:0,BACKGROUND:1,PREVIOUS:2},Iv={SOURCE:0,OVER:1};class LI extends Sy{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(e,r={}){super(e);const{checkCrc:n=!1}=r;this._checkCrc=n,this._inflator=new yw,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=Rv.UNKNOWN,this._filterMethod=Sw.UNKNOWN,this._interlaceMethod=Mv.UNKNOWN,this._colorType=Qs.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(xw(this);!this._end;){const e=this.readUint32(),r=this.readChars(4);this.decodeChunk(e,r)}return this.decodeImage(),this._png}decodeApng(){for(xw(this);!this._end;){const e=this.readUint32(),r=this.readChars(4);this.decodeApngChunk(e,r)}return this.decodeApngImage(),this._apng}decodeChunk(e,r){const n=this.offset;switch(r){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(e);break;case"IDAT":this.decodeIDAT(e);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(e);break;case"iCCP":this.decodeiCCP(e);break;case SI:OI(this._png.text,this,e);break;case"pHYs":this.decodepHYs();break;default:this.skip(e);break}if(this.offset-n!==e)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?ww(this,e+4,r):this.skip(4)}decodeApngChunk(e,r){const n=this.offset;switch(r!=="fdAT"&&r!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),r){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(e);break;default:this.decodeChunk(e,r),this.offset=n+e;break}if(this.offset-n!==e)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?ww(this,e+4,r):this.skip(4)}decodeIHDR(){const e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=NI(this.readUint8());const r=this.readUint8();this._colorType=r;let n;switch(r){case Qs.GREYSCALE:n=1;break;case Qs.TRUECOLOUR:n=3;break;case Qs.INDEXED_COLOUR:n=1;break;case Qs.GREYSCALE_ALPHA:n=2;break;case Qs.TRUECOLOUR_ALPHA:n=4;break;case Qs.UNKNOWN:default:throw new Error(`Unknown color type: ${r}`)}if(this._png.channels=n,this._compressionMethod=this.readUint8(),this._compressionMethod!==Rv.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const e={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(e)}decodePLTE(e){if(e%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);const r=e/3;this._hasPalette=!0;const n=[];this._palette=n;for(let i=0;i<r;i++)n.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(e){this._writingDataChunks=!0;const r=e,n=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,n,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodeFDAT(e){this._writingDataChunks=!0;let r=e,n=this.offset+this.byteOffset;if(n+=4,r-=4,this._inflator.push(new Uint8Array(this.buffer,n,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodetRNS(e){switch(this._colorType){case Qs.GREYSCALE:case Qs.TRUECOLOUR:{if(e%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${e}`);if(e/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${e/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(e/2);for(let r=0;r<e/2;r++)this._transparency[r]=this.readUint16();break}case Qs.INDEXED_COLOUR:{if(e>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);let r=0;for(;r<e;r++){const n=this.readByte();this._palette[r].push(n)}for(;r<this._palette.length;r++)this._palette[r].push(255);break}case Qs.UNKNOWN:case Qs.GREYSCALE_ALPHA:case Qs.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(e){const r=J_(this),n=this.readUint8();if(n!==Rv.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${n}`);const i=this.readBytes(e-r.length-2);this._png.iccEmbeddedProfile={name:r,profile:sI(i)}}decodepHYs(){const e=this.readUint32(),r=this.readUint32(),n=this.readByte();this._png.resolution={x:e,y:r,unit:n}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let e=0;e<this._numberOfFrames;e++){const r={sequenceNumber:this._frames[e].sequenceNumber,delayNumber:this._frames[e].delayNumber,delayDenominator:this._frames[e].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},n=this._frames.at(e);if(n){if(n.data=_w({data:n.data,width:n.width,height:n.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),e===0||n.xOffset===0&&n.yOffset===0&&n.width===this._png.width&&n.height===this._png.height)r.data=n.data;else{const i=this._apng.frames.at(e-1);this.disposeFrame(n,i,r),this.addFrameDataToCanvas(r,n)}this._apng.frames.push(r)}}return this._apng}disposeFrame(e,r,n){switch(e.disposeOp){case D1.NONE:break;case D1.BACKGROUND:for(let i=0;i<this._png.height;i++)for(let a=0;a<this._png.width;a++){const o=(i*e.width+a)*this._png.channels;for(let s=0;s<this._png.channels;s++)n.data[o+s]=0}break;case D1.PREVIOUS:n.data.set(r.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(e,r){const n=1<<this._png.depth,i=(a,o)=>{const s=((a+r.yOffset)*this._png.width+r.xOffset+o)*this._png.channels,u=(a*r.width+o)*this._png.channels;return{index:s,frameIndex:u}};switch(r.blendOp){case Iv.SOURCE:for(let a=0;a<r.height;a++)for(let o=0;o<r.width;o++){const{index:s,frameIndex:u}=i(a,o);for(let h=0;h<this._png.channels;h++)e.data[s+h]=r.data[u+h]}break;case Iv.OVER:for(let a=0;a<r.height;a++)for(let o=0;o<r.width;o++){const{index:s,frameIndex:u}=i(a,o);for(let h=0;h<this._png.channels;h++){const f=r.data[u+this._png.channels-1]/n,g=h%(this._png.channels-1)===0?1:r.data[u+h],v=Math.floor(f*g+(1-f)*e.data[s+h]);e.data[s+h]+=v}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const e=this._isAnimated?(this._frames?.at(0)).data:this._inflator.result;if(this._filterMethod!==Sw.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===Mv.NO_INTERLACE)this._png.data=_w({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===Mv.ADAM7)this._png.data=gI({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const e=this._inflator.result,r=this._frames.at(-1);r?r.data=e:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:D1.NONE,blendOp:Iv.SOURCE,data:e}),this._inflator=new yw,this._writingDataChunks=!1}}function NI(t){if(t!==1&&t!==2&&t!==4&&t!==8&&t!==16)throw new Error(`invalid bit depth: ${t}`);return t}var Ew;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.METRE=1]="METRE"})(Ew||(Ew={}));function TI(t,e){return new LI(t,e).decode()}var yr=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function jv(){yr.console&&typeof yr.console.log=="function"&&yr.console.log.apply(yr.console,arguments)}var Yn={log:jv,warn:function(t){yr.console&&(typeof yr.console.warn=="function"?yr.console.warn.apply(yr.console,arguments):jv.call(null,arguments))},error:function(t){yr.console&&(typeof yr.console.error=="function"?yr.console.error.apply(yr.console,arguments):jv(t))}};function Dv(t,e,r){var n=new XMLHttpRequest;n.open("GET",t),n.responseType="blob",n.onload=function(){Xf(n.response,e,r)},n.onerror=function(){Yn.error("could not download file")},n.send()}function kw(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function F1(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var Xf=yr.saveAs||((typeof window>"u"?"undefined":Nn(window))!=="object"||window!==yr?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(t,e,r){var n=yr.URL||yr.webkitURL,i=document.createElement("a");e=e||t.name||"download",i.download=e,i.rel="noopener",typeof t=="string"?(i.href=t,i.origin!==location.origin?kw(i.href)?Dv(t,e,r):F1(i,i.target="_blank"):F1(i)):(i.href=n.createObjectURL(t),setTimeout(function(){n.revokeObjectURL(i.href)},4e4),setTimeout(function(){F1(i)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,r){if(e=e||t.name||"download",typeof t=="string")if(kw(t))Dv(t,e,r);else{var n=document.createElement("a");n.href=t,n.target="_blank",setTimeout(function(){F1(n)})}else navigator.msSaveOrOpenBlob(function(i,a){return a===void 0?a={autoBom:!1}:Nn(a)!=="object"&&(Yn.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i}(t,r),e)}:function(t,e,r,n){if((n=n||open("","_blank"))&&(n.document.title=n.document.body.innerText="downloading..."),typeof t=="string")return Dv(t,e,r);var i=t.type==="application/octet-stream",a=/constructor/i.test(yr.HTMLElement)||yr.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a)&&(typeof FileReader>"u"?"undefined":Nn(FileReader))==="object"){var s=new FileReader;s.onloadend=function(){var f=s.result;f=o?f:f.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=f:location=f,n=null},s.readAsDataURL(t)}else{var u=yr.URL||yr.webkitURL,h=u.createObjectURL(t);n?n.location=h:location.href=h,n=null,setTimeout(function(){u.revokeObjectURL(h)},4e4)}});/**
|
|
461
|
-
* A class to parse color values
|
|
462
|
-
* @author Stoyan Stefanov <sstoo@gmail.com>
|
|
463
|
-
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
|
|
464
|
-
* @license Use it if you like it
|
|
465
|
-
*/function ex(t){var e;t=t||"",this.ok=!1,t.charAt(0)=="#"&&(t=t.substr(1,6)),t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[t=(t=t.replace(/ /g,"")).toLowerCase()]||t;for(var r=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(s){return[parseInt(s[1]),parseInt(s[2]),parseInt(s[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(s){return[parseInt(s[1],16),parseInt(s[2],16),parseInt(s[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(s){return[parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16),parseInt(s[3]+s[3],16)]}}],n=0;n<r.length;n++){var i=r[n].re,a=r[n].process,o=i.exec(t);o&&(e=a(o),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var s=this.r.toString(16),u=this.g.toString(16),h=this.b.toString(16);return s.length==1&&(s="0"+s),u.length==1&&(u="0"+u),h.length==1&&(h="0"+h),"#"+s+u+h}}var J1=yr.atob.bind(yr),Aw=yr.btoa.bind(yr);/**
|
|
466
|
-
* @license
|
|
467
|
-
* Joseph Myers does not specify a particular license for his work.
|
|
468
|
-
*
|
|
469
|
-
* Author: Joseph Myers
|
|
470
|
-
* Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
|
|
471
|
-
*
|
|
472
|
-
* Modified by: Owen Leong
|
|
473
|
-
*/function Fv(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];r=Fo(r,n,i,a,e[0],7,-680876936),a=Fo(a,r,n,i,e[1],12,-389564586),i=Fo(i,a,r,n,e[2],17,606105819),n=Fo(n,i,a,r,e[3],22,-1044525330),r=Fo(r,n,i,a,e[4],7,-176418897),a=Fo(a,r,n,i,e[5],12,1200080426),i=Fo(i,a,r,n,e[6],17,-1473231341),n=Fo(n,i,a,r,e[7],22,-45705983),r=Fo(r,n,i,a,e[8],7,1770035416),a=Fo(a,r,n,i,e[9],12,-1958414417),i=Fo(i,a,r,n,e[10],17,-42063),n=Fo(n,i,a,r,e[11],22,-1990404162),r=Fo(r,n,i,a,e[12],7,1804603682),a=Fo(a,r,n,i,e[13],12,-40341101),i=Fo(i,a,r,n,e[14],17,-1502002290),r=Bo(r,n=Fo(n,i,a,r,e[15],22,1236535329),i,a,e[1],5,-165796510),a=Bo(a,r,n,i,e[6],9,-1069501632),i=Bo(i,a,r,n,e[11],14,643717713),n=Bo(n,i,a,r,e[0],20,-373897302),r=Bo(r,n,i,a,e[5],5,-701558691),a=Bo(a,r,n,i,e[10],9,38016083),i=Bo(i,a,r,n,e[15],14,-660478335),n=Bo(n,i,a,r,e[4],20,-405537848),r=Bo(r,n,i,a,e[9],5,568446438),a=Bo(a,r,n,i,e[14],9,-1019803690),i=Bo(i,a,r,n,e[3],14,-187363961),n=Bo(n,i,a,r,e[8],20,1163531501),r=Bo(r,n,i,a,e[13],5,-1444681467),a=Bo(a,r,n,i,e[2],9,-51403784),i=Bo(i,a,r,n,e[7],14,1735328473),r=zo(r,n=Bo(n,i,a,r,e[12],20,-1926607734),i,a,e[5],4,-378558),a=zo(a,r,n,i,e[8],11,-2022574463),i=zo(i,a,r,n,e[11],16,1839030562),n=zo(n,i,a,r,e[14],23,-35309556),r=zo(r,n,i,a,e[1],4,-1530992060),a=zo(a,r,n,i,e[4],11,1272893353),i=zo(i,a,r,n,e[7],16,-155497632),n=zo(n,i,a,r,e[10],23,-1094730640),r=zo(r,n,i,a,e[13],4,681279174),a=zo(a,r,n,i,e[0],11,-358537222),i=zo(i,a,r,n,e[3],16,-722521979),n=zo(n,i,a,r,e[6],23,76029189),r=zo(r,n,i,a,e[9],4,-640364487),a=zo(a,r,n,i,e[12],11,-421815835),i=zo(i,a,r,n,e[15],16,530742520),r=qo(r,n=zo(n,i,a,r,e[2],23,-995338651),i,a,e[0],6,-198630844),a=qo(a,r,n,i,e[7],10,1126891415),i=qo(i,a,r,n,e[14],15,-1416354905),n=qo(n,i,a,r,e[5],21,-57434055),r=qo(r,n,i,a,e[12],6,1700485571),a=qo(a,r,n,i,e[3],10,-1894986606),i=qo(i,a,r,n,e[10],15,-1051523),n=qo(n,i,a,r,e[1],21,-2054922799),r=qo(r,n,i,a,e[8],6,1873313359),a=qo(a,r,n,i,e[15],10,-30611744),i=qo(i,a,r,n,e[6],15,-1560198380),n=qo(n,i,a,r,e[13],21,1309151649),r=qo(r,n,i,a,e[4],6,-145523070),a=qo(a,r,n,i,e[11],10,-1120210379),i=qo(i,a,r,n,e[2],15,718787259),n=qo(n,i,a,r,e[9],21,-343485551),t[0]=pf(r,t[0]),t[1]=pf(n,t[1]),t[2]=pf(i,t[2]),t[3]=pf(a,t[3])}function tg(t,e,r,n,i,a){return e=pf(pf(e,t),pf(n,a)),pf(e<<i|e>>>32-i,r)}function Fo(t,e,r,n,i,a,o){return tg(e&r|~e&n,t,e,i,a,o)}function Bo(t,e,r,n,i,a,o){return tg(e&n|r&~n,t,e,i,a,o)}function zo(t,e,r,n,i,a,o){return tg(e^r^n,t,e,i,a,o)}function qo(t,e,r,n,i,a,o){return tg(r^(e|~n),t,e,i,a,o)}function tx(t){var e,r=t.length,n=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=t.length;e+=64)Fv(n,RI(t.substring(e-64,e)));t=t.substring(e-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<t.length;e++)i[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),e>55)for(Fv(n,i),e=0;e<16;e++)i[e]=0;return i[14]=8*r,Fv(n,i),n}function RI(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return r}var Pw="0123456789abcdef".split("");function MI(t){for(var e="",r=0;r<4;r++)e+=Pw[t>>8*r+4&15]+Pw[t>>8*r&15];return e}function II(t){return String.fromCharCode(255&t,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function Nm(t){return tx(t).map(II).join("")}var jI=function(t){for(var e=0;e<t.length;e++)t[e]=MI(t[e]);return t.join("")}(tx("hello"))!="5d41402abc4b2a76b9719d911017c592";function pf(t,e){if(jI){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}return t+e&4294967295}/**
|
|
474
|
-
* @license
|
|
475
|
-
* FPDF is released under a permissive license: there is no usage restriction.
|
|
476
|
-
* You may embed it freely in your application (commercial or not), with or
|
|
477
|
-
* without modifications.
|
|
478
|
-
*
|
|
479
|
-
* Reference: http://www.fpdf.org/en/script/script37.php
|
|
480
|
-
*/function Tm(t,e){var r,n,i,a;if(t!==r){for(var o=(i=t,a=1+(256/t.length|0),new Array(a+1).join(i)),s=[],u=0;u<256;u++)s[u]=u;var h=0;for(u=0;u<256;u++){var f=s[u];h=(h+f+o.charCodeAt(u))%256,s[u]=s[h],s[h]=f}r=t,n=s}else s=n;var g=e.length,v=0,p=0,y="";for(u=0;u<g;u++)p=(p+(f=s[v=(v+1)%256]))%256,s[v]=s[p],s[p]=f,o=s[(s[v]+s[p])%256],y+=String.fromCharCode(e.charCodeAt(u)^o);return y}/**
|
|
481
|
-
* @license
|
|
482
|
-
* Licensed under the MIT License.
|
|
483
|
-
* http://opensource.org/licenses/mit-license
|
|
484
|
-
* Author: Owen Leong (@owenl131)
|
|
485
|
-
* Date: 15 Oct 2020
|
|
486
|
-
* References:
|
|
487
|
-
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
|
|
488
|
-
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
|
|
489
|
-
* http://www.fpdf.org/en/script/script37.php
|
|
490
|
-
*/var Ow={print:4,modify:8,copy:16,"annot-forms":32};function Qh(t,e,r,n){this.v=1,this.r=2;var i=192;t.forEach(function(s){if(Ow.perm!==void 0)throw new Error("Invalid permission: "+s);i+=Ow[s]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var a=(e+this.padding).substr(0,32),o=(r+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,o),this.P=-(1+(255^i)),this.encryptionKey=Nm(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=Tm(this.encryptionKey,this.padding)}function Jh(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var e="",r=t.length,n=0;n<r;n++){var i=t.charCodeAt(n);e+=i<33||i===35||i===37||i===40||i===41||i===47||i===60||i===62||i===91||i===93||i===123||i===125||i>126?"#"+("0"+i.toString(16)).slice(-2):t[n]}return e}function Cw(t){if(Nn(t)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(r,n,i){if(i=i||!1,typeof r!="string"||typeof n!="function"||typeof i!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(r)||(e[r]={});var a=Math.random().toString(35);return e[r][a]=[n,!!i],a},this.unsubscribe=function(r){for(var n in e)if(e[n][r])return delete e[n][r],Object.keys(e[n]).length===0&&delete e[n],!0;return!1},this.publish=function(r){if(e.hasOwnProperty(r)){var n=Array.prototype.slice.call(arguments,1),i=[];for(var a in e[r]){var o=e[r][a];try{o[0].apply(t,n)}catch(s){yr.console&&Yn.error("jsPDF PubSub Error",s.message,s)}o[1]&&i.push(a)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function A0(t){if(!(this instanceof A0))return new A0(t);var e="opacity,stroke-opacity".split(",");for(var r in t)t.hasOwnProperty(r)&&e.indexOf(r)>=0&&(this[r]=t[r]);this.id="",this.objectNumber=-1}function rx(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function Kf(t,e,r,n,i){if(!(this instanceof Kf))return new Kf(t,e,r,n,i);this.type=t==="axial"?2:3,this.coords=e,this.colors=r,rx.call(this,n,i)}function ad(t,e,r,n,i){if(!(this instanceof ad))return new ad(t,e,r,n,i);this.boundingBox=t,this.xStep=e,this.yStep=r,this.stream="",this.cloneIndex=0,rx.call(this,n,i)}function tr(t){var e,r=typeof arguments[0]=="string"?arguments[0]:"p",n=arguments[1],i=arguments[2],a=arguments[3],o=[],s=1,u=16,h="S",f=null;Nn(t=t||{})==="object"&&(r=t.orientation,n=t.unit||n,i=t.format||i,a=t.compress||t.compressPdf||a,(f=t.encryption||null)!==null&&(f.userPassword=f.userPassword||"",f.ownerPassword=f.ownerPassword||"",f.userPermissions=f.userPermissions||[]),s=typeof t.userUnit=="number"?Math.abs(t.userUnit):1,t.precision!==void 0&&(e=t.precision),t.floatPrecision!==void 0&&(u=t.floatPrecision),h=t.defaultPathOperation||"S"),o=t.filters||(a===!0?["FlateEncode"]:o),n=n||"mm",r=(""+(r||"P")).toLowerCase();var g=t.putOnlyUsedFonts||!1,v={},p={internal:{},__private__:{}};p.__private__.PubSub=Cw;var y="1.3",_=p.__private__.getPdfVersion=function(){return y};p.__private__.setPdfVersion=function(H){y=H};var x={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};p.__private__.getPageFormats=function(){return x};var b=p.__private__.getPageFormat=function(H){return x[H]};i=i||"a4";var E="compat",A="advanced",S=E;function k(){this.saveGraphicsState(),ge(new Qt(bt,0,0,-bt,0,vi()*bt).toString()+" cm"),this.setFontSize(this.getFontSize()/bt),h="n",S=A}function I(){this.restoreGraphicsState(),h="S",S=E}var O=p.__private__.combineFontStyleAndFontWeight=function(H,ce){if(H=="bold"&&ce=="normal"||H=="bold"&&ce==400||H=="normal"&&ce=="italic"||H=="bold"&&ce=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return ce&&(H=ce==400||ce==="normal"?H==="italic"?"italic":"normal":ce!=700&&ce!=="bold"||H!=="normal"?(ce==700?"bold":ce)+""+H:"bold"),H};p.advancedAPI=function(H){var ce=S===E;return ce&&k.call(this),typeof H!="function"||(H(this),ce&&I.call(this)),this},p.compatAPI=function(H){var ce=S===A;return ce&&I.call(this),typeof H!="function"||(H(this),ce&&k.call(this)),this},p.isAdvancedAPI=function(){return S===A};var M,F=function(H){if(S!==A)throw new Error(H+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},j=p.roundToPrecision=p.__private__.roundToPrecision=function(H,ce){var ke=e||ce;if(isNaN(H)||isNaN(ke))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return H.toFixed(ke).replace(/0+$/,"")};M=p.hpf=p.__private__.hpf=typeof u=="number"?function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.hpf");return j(H,u)}:u==="smart"?function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.hpf");return j(H,H>-1&&H<1?16:5)}:function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.hpf");return j(H,16)};var T=p.f2=p.__private__.f2=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.f2");return j(H,2)},L=p.__private__.f3=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.f3");return j(H,3)},$=p.scale=p.__private__.scale=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.scale");return S===E?H*bt:S===A?H:void 0},q=function(H){return $(function(ce){return S===E?vi()-ce:S===A?ce:void 0}(H))};p.__private__.setPrecision=p.setPrecision=function(H){typeof parseInt(H,10)=="number"&&(e=parseInt(H,10))};var J,ae="00000000000000000000000000000000",ie=p.__private__.getFileId=function(){return ae},Z=p.__private__.setFileId=function(H){return ae=H!==void 0&&/^[a-fA-F0-9]{32}$/.test(H)?H.toUpperCase():ae.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),f!==null&&(Zn=new Qh(f.userPermissions,f.userPassword,f.ownerPassword,ae)),ae};p.setFileId=function(H){return Z(H),this},p.getFileId=function(){return ie()};var te=p.__private__.convertDateToPDFDate=function(H){var ce=H.getTimezoneOffset(),ke=ce<0?"+":"-",De=Math.floor(Math.abs(ce/60)),Ge=Math.abs(ce%60),at=[ke,X(De),"'",X(Ge),"'"].join("");return["D:",H.getFullYear(),X(H.getMonth()+1),X(H.getDate()),X(H.getHours()),X(H.getMinutes()),X(H.getSeconds()),at].join("")},V=p.__private__.convertPDFDateToDate=function(H){var ce=parseInt(H.substr(2,4),10),ke=parseInt(H.substr(6,2),10)-1,De=parseInt(H.substr(8,2),10),Ge=parseInt(H.substr(10,2),10),at=parseInt(H.substr(12,2),10),ct=parseInt(H.substr(14,2),10);return new Date(ce,ke,De,Ge,at,ct,0)},B=p.__private__.setCreationDate=function(H){var ce;if(H===void 0&&(H=new Date),H instanceof Date)ce=te(H);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(H))throw new Error("Invalid argument passed to jsPDF.setCreationDate");ce=H}return J=ce},D=p.__private__.getCreationDate=function(H){var ce=J;return H==="jsDate"&&(ce=V(J)),ce};p.setCreationDate=function(H){return B(H),this},p.getCreationDate=function(H){return D(H)};var U,X=p.__private__.padd2=function(H){return("0"+parseInt(H)).slice(-2)},ee=p.__private__.padd2Hex=function(H){return("00"+(H=H.toString())).substr(H.length)},K=0,oe=[],me=[],de=0,ye=[],Te=[],Ce=!1,Ie=me;p.__private__.setCustomOutputDestination=function(H){Ce=!0,Ie=H};var Ee=function(H){Ce||(Ie=H)};p.__private__.resetCustomOutputDestination=function(){Ce=!1,Ie=me};var ge=p.__private__.out=function(H){return H=H.toString(),de+=H.length+1,Ie.push(H),Ie},Re=p.__private__.write=function(H){return ge(arguments.length===1?H.toString():Array.prototype.join.call(arguments," "))},Be=p.__private__.getArrayBuffer=function(H){for(var ce=H.length,ke=new ArrayBuffer(ce),De=new Uint8Array(ke);ce--;)De[ce]=H.charCodeAt(ce);return ke},Oe=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];p.__private__.getStandardFonts=function(){return Oe};var fe=t.fontSize||16;p.__private__.setFontSize=p.setFontSize=function(H){return fe=S===A?H/bt:H,this};var Le,Ne=p.__private__.getFontSize=p.getFontSize=function(){return S===E?fe:fe*bt},ue=t.R2L||!1;p.__private__.setR2L=p.setR2L=function(H){return ue=H,this},p.__private__.getR2L=p.getR2L=function(){return ue};var Ae,Pe=p.__private__.setZoomMode=function(H){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(H))Le=H;else if(isNaN(H)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(H)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+H+'" is not recognized.');Le=H}else Le=parseInt(H,10)};p.__private__.getZoomMode=function(){return Le};var Ue,st=p.__private__.setPageMode=function(H){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(H)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+H+'" is not recognized.');Ae=H};p.__private__.getPageMode=function(){return Ae};var dt=p.__private__.setLayoutMode=function(H){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(H)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+H+'" is not recognized.');Ue=H};p.__private__.getLayoutMode=function(){return Ue},p.__private__.setDisplayMode=p.setDisplayMode=function(H,ce,ke){return Pe(H),dt(ce),st(ke),this};var pt={title:"",subject:"",author:"",keywords:"",creator:""};p.__private__.getDocumentProperty=function(H){if(Object.keys(pt).indexOf(H)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return pt[H]},p.__private__.getDocumentProperties=function(){return pt},p.__private__.setDocumentProperties=p.setProperties=p.setDocumentProperties=function(H){for(var ce in pt)pt.hasOwnProperty(ce)&&H[ce]&&(pt[ce]=H[ce]);return this},p.__private__.setDocumentProperty=function(H,ce){if(Object.keys(pt).indexOf(H)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return pt[H]=ce};var xt,bt,kt,zr,_r,It={},Jt={},Ve=[],qe={},Nt={},Ct={},ir={},Ut=null,xr=0,er=[],pr=new Cw(p),Bi=t.hotfixes||[],oi={},Ei={},Sn=[],Qt=function H(ce,ke,De,Ge,at,ct){if(!(this instanceof H))return new H(ce,ke,De,Ge,at,ct);isNaN(ce)&&(ce=1),isNaN(ke)&&(ke=0),isNaN(De)&&(De=0),isNaN(Ge)&&(Ge=1),isNaN(at)&&(at=0),isNaN(ct)&&(ct=0),this._matrix=[ce,ke,De,Ge,at,ct]};Object.defineProperty(Qt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(H){this._matrix[0]=H}}),Object.defineProperty(Qt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(H){this._matrix[1]=H}}),Object.defineProperty(Qt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(H){this._matrix[2]=H}}),Object.defineProperty(Qt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(H){this._matrix[3]=H}}),Object.defineProperty(Qt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(H){this._matrix[4]=H}}),Object.defineProperty(Qt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(H){this._matrix[5]=H}}),Object.defineProperty(Qt.prototype,"a",{get:function(){return this._matrix[0]},set:function(H){this._matrix[0]=H}}),Object.defineProperty(Qt.prototype,"b",{get:function(){return this._matrix[1]},set:function(H){this._matrix[1]=H}}),Object.defineProperty(Qt.prototype,"c",{get:function(){return this._matrix[2]},set:function(H){this._matrix[2]=H}}),Object.defineProperty(Qt.prototype,"d",{get:function(){return this._matrix[3]},set:function(H){this._matrix[3]=H}}),Object.defineProperty(Qt.prototype,"e",{get:function(){return this._matrix[4]},set:function(H){this._matrix[4]=H}}),Object.defineProperty(Qt.prototype,"f",{get:function(){return this._matrix[5]},set:function(H){this._matrix[5]=H}}),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(H){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(M).join(H)},Qt.prototype.multiply=function(H){var ce=H.sx*this.sx+H.shy*this.shx,ke=H.sx*this.shy+H.shy*this.sy,De=H.shx*this.sx+H.sy*this.shx,Ge=H.shx*this.shy+H.sy*this.sy,at=H.tx*this.sx+H.ty*this.shx+this.tx,ct=H.tx*this.shy+H.ty*this.sy+this.ty;return new Qt(ce,ke,De,Ge,at,ct)},Qt.prototype.decompose=function(){var H=this.sx,ce=this.shy,ke=this.shx,De=this.sy,Ge=this.tx,at=this.ty,ct=Math.sqrt(H*H+ce*ce),Dt=(H/=ct)*ke+(ce/=ct)*De;ke-=H*Dt,De-=ce*Dt;var jt=Math.sqrt(ke*ke+De*De);return Dt/=jt,H*(De/=jt)<ce*(ke/=jt)&&(H=-H,ce=-ce,Dt=-Dt,ct=-ct),{scale:new Qt(ct,0,0,jt,0,0),translate:new Qt(1,0,0,1,Ge,at),rotate:new Qt(H,ce,-ce,H,0,0),skew:new Qt(1,0,Dt,1,0,0)}},Qt.prototype.toString=function(H){return this.join(" ")},Qt.prototype.inversed=function(){var H=this.sx,ce=this.shy,ke=this.shx,De=this.sy,Ge=this.tx,at=this.ty,ct=1/(H*De-ce*ke),Dt=De*ct,jt=-ce*ct,cr=-ke*ct,fr=H*ct;return new Qt(Dt,jt,cr,fr,-Dt*Ge-cr*at,-jt*Ge-fr*at)},Qt.prototype.applyToPoint=function(H){var ce=H.x*this.sx+H.y*this.shx+this.tx,ke=H.x*this.shy+H.y*this.sy+this.ty;return new ko(ce,ke)},Qt.prototype.applyToRectangle=function(H){var ce=this.applyToPoint(H),ke=this.applyToPoint(new ko(H.x+H.w,H.y+H.h));return new dl(ce.x,ce.y,ke.x-ce.x,ke.y-ce.y)},Qt.prototype.clone=function(){var H=this.sx,ce=this.shy,ke=this.shx,De=this.sy,Ge=this.tx,at=this.ty;return new Qt(H,ce,ke,De,Ge,at)},p.Matrix=Qt;var ca=p.matrixMult=function(H,ce){return ce.multiply(H)},Fa=new Qt(1,0,0,1,0,0);p.unitMatrix=p.identityMatrix=Fa;var Kn=function(H,ce){if(!Nt[H]){var ke=(ce instanceof Kf?"Sh":"P")+(Object.keys(qe).length+1).toString(10);ce.id=ke,Nt[H]=ke,qe[ke]=ce,pr.publish("addPattern",ce)}};p.ShadingPattern=Kf,p.TilingPattern=ad,p.addShadingPattern=function(H,ce){return F("addShadingPattern()"),Kn(H,ce),this},p.beginTilingPattern=function(H){F("beginTilingPattern()"),li(H.boundingBox[0],H.boundingBox[1],H.boundingBox[2]-H.boundingBox[0],H.boundingBox[3]-H.boundingBox[1],H.matrix)},p.endTilingPattern=function(H,ce){F("endTilingPattern()"),ce.stream=Te[U].join(`
|
|
491
|
-
`),Kn(H,ce),pr.publish("endTilingPattern",ce),Sn.pop().restore()};var Yi,qr=p.__private__.newObject=function(){var H=En();return Rn(H,!0),H},En=p.__private__.newObjectDeferred=function(){return K++,oe[K]=function(){return de},K},Rn=function(H,ce){return ce=typeof ce=="boolean"&&ce,oe[H]=de,ce&&ge(H+" 0 obj"),H},Sa=p.__private__.newAdditionalObject=function(){var H={objId:En(),content:""};return ye.push(H),H},Ho=En(),Ea=En(),eo=p.__private__.decodeColorString=function(H){var ce=H.split(" ");if(ce.length!==2||ce[1]!=="g"&&ce[1]!=="G")ce.length!==5||ce[4]!=="k"&&ce[4]!=="K"||(ce=[(1-ce[0])*(1-ce[3]),(1-ce[1])*(1-ce[3]),(1-ce[2])*(1-ce[3]),"r"]);else{var ke=parseFloat(ce[0]);ce=[ke,ke,ke,"r"]}for(var De="#",Ge=0;Ge<3;Ge++)De+=("0"+Math.floor(255*parseFloat(ce[Ge])).toString(16)).slice(-2);return De},si=p.__private__.encodeColorString=function(H){var ce;typeof H=="string"&&(H={ch1:H});var ke=H.ch1,De=H.ch2,Ge=H.ch3,at=H.ch4,ct=H.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof ke=="string"&&ke.charAt(0)!=="#"){var Dt=new ex(ke);if(Dt.ok)ke=Dt.toHex();else if(!/^\d*\.?\d*$/.test(ke))throw new Error('Invalid color "'+ke+'" passed to jsPDF.encodeColorString.')}if(typeof ke=="string"&&/^#[0-9A-Fa-f]{3}$/.test(ke)&&(ke="#"+ke[1]+ke[1]+ke[2]+ke[2]+ke[3]+ke[3]),typeof ke=="string"&&/^#[0-9A-Fa-f]{6}$/.test(ke)){var jt=parseInt(ke.substr(1),16);ke=jt>>16&255,De=jt>>8&255,Ge=255&jt}if(De===void 0||at===void 0&&ke===De&&De===Ge)ce=typeof ke=="string"?ke+" "+ct[0]:H.precision===2?T(ke/255)+" "+ct[0]:L(ke/255)+" "+ct[0];else if(at===void 0||Nn(at)==="object"){if(at&&!isNaN(at.a)&&at.a===0)return["1.","1.","1.",ct[1]].join(" ");ce=typeof ke=="string"?[ke,De,Ge,ct[1]].join(" "):H.precision===2?[T(ke/255),T(De/255),T(Ge/255),ct[1]].join(" "):[L(ke/255),L(De/255),L(Ge/255),ct[1]].join(" ")}else ce=typeof ke=="string"?[ke,De,Ge,at,ct[2]].join(" "):H.precision===2?[T(ke),T(De),T(Ge),T(at),ct[2]].join(" "):[L(ke),L(De),L(Ge),L(at),ct[2]].join(" ");return ce},ka=p.__private__.getFilters=function(){return o},Aa=p.__private__.putStream=function(H){var ce=(H=H||{}).data||"",ke=H.filters||ka(),De=H.alreadyAppliedFilters||[],Ge=H.addLength1||!1,at=ce.length,ct=H.objectId,Dt=function(mi){return mi};if(f!==null&&ct===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");f!==null&&(Dt=Zn.encryptor(ct,0));var jt={};ke===!0&&(ke=["FlateEncode"]);var cr=H.additionalKeyValues||[],fr=(jt=tr.API.processDataByFilters!==void 0?tr.API.processDataByFilters(ce,ke):{data:ce,reverseChain:[]}).reverseChain+(Array.isArray(De)?De.join(" "):De.toString());if(jt.data.length!==0&&(cr.push({key:"Length",value:jt.data.length}),Ge===!0&&cr.push({key:"Length1",value:at})),fr.length!=0)if(fr.split("/").length-1==1)cr.push({key:"Filter",value:fr});else{cr.push({key:"Filter",value:"["+fr+"]"});for(var Ur=0;Ur<cr.length;Ur+=1)if(cr[Ur].key==="DecodeParms"){for(var An=[],ui=0;ui<jt.reverseChain.split("/").length-1;ui+=1)An.push("null");An.push(cr[Ur].value),cr[Ur].value="["+An.join(" ")+"]"}}ge("<<");for(var on=0;on<cr.length;on++)ge("/"+cr[on].key+" "+cr[on].value);ge(">>"),jt.data.length!==0&&(ge("stream"),ge(Dt(jt.data)),ge("endstream"))},$o=p.__private__.putPage=function(H){var ce=H.number,ke=H.data,De=H.objId,Ge=H.contentsObjId;Rn(De,!0),ge("<</Type /Page"),ge("/Parent "+H.rootDictionaryObjId+" 0 R"),ge("/Resources "+H.resourceDictionaryObjId+" 0 R"),ge("/MediaBox ["+parseFloat(M(H.mediaBox.bottomLeftX))+" "+parseFloat(M(H.mediaBox.bottomLeftY))+" "+M(H.mediaBox.topRightX)+" "+M(H.mediaBox.topRightY)+"]"),H.cropBox!==null&&ge("/CropBox ["+M(H.cropBox.bottomLeftX)+" "+M(H.cropBox.bottomLeftY)+" "+M(H.cropBox.topRightX)+" "+M(H.cropBox.topRightY)+"]"),H.bleedBox!==null&&ge("/BleedBox ["+M(H.bleedBox.bottomLeftX)+" "+M(H.bleedBox.bottomLeftY)+" "+M(H.bleedBox.topRightX)+" "+M(H.bleedBox.topRightY)+"]"),H.trimBox!==null&&ge("/TrimBox ["+M(H.trimBox.bottomLeftX)+" "+M(H.trimBox.bottomLeftY)+" "+M(H.trimBox.topRightX)+" "+M(H.trimBox.topRightY)+"]"),H.artBox!==null&&ge("/ArtBox ["+M(H.artBox.bottomLeftX)+" "+M(H.artBox.bottomLeftY)+" "+M(H.artBox.topRightX)+" "+M(H.artBox.topRightY)+"]"),typeof H.userUnit=="number"&&H.userUnit!==1&&ge("/UserUnit "+H.userUnit),pr.publish("putPage",{objId:De,pageContext:er[ce],pageNumber:ce,page:ke}),ge("/Contents "+Ge+" 0 R"),ge(">>"),ge("endobj");var at=ke.join(`
|
|
492
|
-
`);return S===A&&(at+=`
|
|
493
|
-
Q`),Rn(Ge,!0),Aa({data:at,filters:ka(),objectId:Ge}),ge("endobj"),De},zi=p.__private__.putPages=function(){var H,ce,ke=[];for(H=1;H<=xr;H++)er[H].objId=En(),er[H].contentsObjId=En();for(H=1;H<=xr;H++)ke.push($o({number:H,data:Te[H],objId:er[H].objId,contentsObjId:er[H].contentsObjId,mediaBox:er[H].mediaBox,cropBox:er[H].cropBox,bleedBox:er[H].bleedBox,trimBox:er[H].trimBox,artBox:er[H].artBox,userUnit:er[H].userUnit,rootDictionaryObjId:Ho,resourceDictionaryObjId:Ea}));Rn(Ho,!0),ge("<</Type /Pages");var De="/Kids [";for(ce=0;ce<xr;ce++)De+=ke[ce]+" 0 R ";ge(De+"]"),ge("/Count "+xr),ge(">>"),ge("endobj"),pr.publish("postPutPages")},to=function(H){pr.publish("putFont",{font:H,out:ge,newObject:qr,putStream:Aa}),H.isAlreadyPutted!==!0&&(H.objectNumber=qr(),ge("<<"),ge("/Type /Font"),ge("/BaseFont /"+Jh(H.postScriptName)),ge("/Subtype /Type1"),typeof H.encoding=="string"&&ge("/Encoding /"+H.encoding),ge("/FirstChar 32"),ge("/LastChar 255"),ge(">>"),ge("endobj"))},Bs=function(H){H.objectNumber=qr();var ce=[];ce.push({key:"Type",value:"/XObject"}),ce.push({key:"Subtype",value:"/Form"}),ce.push({key:"BBox",value:"["+[M(H.x),M(H.y),M(H.x+H.width),M(H.y+H.height)].join(" ")+"]"}),ce.push({key:"Matrix",value:"["+H.matrix.toString()+"]"});var ke=H.pages[1].join(`
|
|
494
|
-
`);Aa({data:ke,additionalKeyValues:ce,objectId:H.objectNumber}),ge("endobj")},is=function(H,ce){ce||(ce=21);var ke=qr(),De=function(ct,Dt){var jt,cr=[],fr=1/(Dt-1);for(jt=0;jt<1;jt+=fr)cr.push(jt);if(cr.push(1),ct[0].offset!=0){var Ur={offset:0,color:ct[0].color};ct.unshift(Ur)}if(ct[ct.length-1].offset!=1){var An={offset:1,color:ct[ct.length-1].color};ct.push(An)}for(var ui="",on=0,mi=0;mi<cr.length;mi++){for(jt=cr[mi];jt>ct[on+1].offset;)on++;var _n=ct[on].offset,Ai=(jt-_n)/(ct[on+1].offset-_n),Po=ct[on].color,Qi=ct[on+1].color;ui+=ee(Math.round((1-Ai)*Po[0]+Ai*Qi[0]).toString(16))+ee(Math.round((1-Ai)*Po[1]+Ai*Qi[1]).toString(16))+ee(Math.round((1-Ai)*Po[2]+Ai*Qi[2]).toString(16))}return ui.trim()}(H.colors,ce),Ge=[];Ge.push({key:"FunctionType",value:"0"}),Ge.push({key:"Domain",value:"[0.0 1.0]"}),Ge.push({key:"Size",value:"["+ce+"]"}),Ge.push({key:"BitsPerSample",value:"8"}),Ge.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Ge.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Aa({data:De,additionalKeyValues:Ge,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:ke}),ge("endobj"),H.objectNumber=qr(),ge("<< /ShadingType "+H.type),ge("/ColorSpace /DeviceRGB");var at="/Coords ["+M(parseFloat(H.coords[0]))+" "+M(parseFloat(H.coords[1]))+" ";H.type===2?at+=M(parseFloat(H.coords[2]))+" "+M(parseFloat(H.coords[3])):at+=M(parseFloat(H.coords[2]))+" "+M(parseFloat(H.coords[3]))+" "+M(parseFloat(H.coords[4]))+" "+M(parseFloat(H.coords[5])),ge(at+="]"),H.matrix&&ge("/Matrix ["+H.matrix.toString()+"]"),ge("/Function "+ke+" 0 R"),ge("/Extend [true true]"),ge(">>"),ge("endobj")},lu=function(H,ce){var ke=En(),De=qr();ce.push({resourcesOid:ke,objectOid:De}),H.objectNumber=De;var Ge=[];Ge.push({key:"Type",value:"/Pattern"}),Ge.push({key:"PatternType",value:"1"}),Ge.push({key:"PaintType",value:"1"}),Ge.push({key:"TilingType",value:"1"}),Ge.push({key:"BBox",value:"["+H.boundingBox.map(M).join(" ")+"]"}),Ge.push({key:"XStep",value:M(H.xStep)}),Ge.push({key:"YStep",value:M(H.yStep)}),Ge.push({key:"Resources",value:ke+" 0 R"}),H.matrix&&Ge.push({key:"Matrix",value:"["+H.matrix.toString()+"]"}),Aa({data:H.stream,additionalKeyValues:Ge,objectId:H.objectNumber}),ge("endobj")},Nf=function(H){for(var ce in H.objectNumber=qr(),ge("<<"),H)switch(ce){case"opacity":ge("/ca "+T(H[ce]));break;case"stroke-opacity":ge("/CA "+T(H[ce]))}ge(">>"),ge("endobj")},kn=function(H){Rn(H.resourcesOid,!0),ge("<<"),ge("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var ce in ge("/Font <<"),It)It.hasOwnProperty(ce)&&(g===!1||g===!0&&v.hasOwnProperty(ce))&&ge("/"+ce+" "+It[ce].objectNumber+" 0 R");ge(">>")}(),function(){if(Object.keys(qe).length>0){for(var ce in ge("/Shading <<"),qe)qe.hasOwnProperty(ce)&&qe[ce]instanceof Kf&&qe[ce].objectNumber>=0&&ge("/"+ce+" "+qe[ce].objectNumber+" 0 R");pr.publish("putShadingPatternDict"),ge(">>")}}(),function(ce){if(Object.keys(qe).length>0){for(var ke in ge("/Pattern <<"),qe)qe.hasOwnProperty(ke)&&qe[ke]instanceof p.TilingPattern&&qe[ke].objectNumber>=0&&qe[ke].objectNumber<ce&&ge("/"+ke+" "+qe[ke].objectNumber+" 0 R");pr.publish("putTilingPatternDict"),ge(">>")}}(H.objectOid),function(){if(Object.keys(Ct).length>0){var ce;for(ce in ge("/ExtGState <<"),Ct)Ct.hasOwnProperty(ce)&&Ct[ce].objectNumber>=0&&ge("/"+ce+" "+Ct[ce].objectNumber+" 0 R");pr.publish("putGStateDict"),ge(">>")}}(),function(){for(var ce in ge("/XObject <<"),oi)oi.hasOwnProperty(ce)&&oi[ce].objectNumber>=0&&ge("/"+ce+" "+oi[ce].objectNumber+" 0 R");pr.publish("putXobjectDict"),ge(">>")}(),ge(">>"),ge("endobj")},uu=function(H){Jt[H.fontName]=Jt[H.fontName]||{},Jt[H.fontName][H.fontStyle]=H.id},as=function(H,ce,ke,De,Ge){var at={id:"F"+(Object.keys(It).length+1).toString(10),postScriptName:H,fontName:ce,fontStyle:ke,encoding:De,isStandardFont:Ge||!1,metadata:{}};return pr.publish("addFont",{font:at,instance:this}),It[at.id]=at,uu(at),at.id},Pa=p.__private__.pdfEscape=p.pdfEscape=function(H,ce){return function(ke,De){var Ge,at,ct,Dt,jt,cr,fr,Ur,An;if(ct=(De=De||{}).sourceEncoding||"Unicode",jt=De.outputEncoding,(De.autoencode||jt)&&It[xt].metadata&&It[xt].metadata[ct]&&It[xt].metadata[ct].encoding&&(Dt=It[xt].metadata[ct].encoding,!jt&&It[xt].encoding&&(jt=It[xt].encoding),!jt&&Dt.codePages&&(jt=Dt.codePages[0]),typeof jt=="string"&&(jt=Dt[jt]),jt)){for(fr=!1,cr=[],Ge=0,at=ke.length;Ge<at;Ge++)(Ur=jt[ke.charCodeAt(Ge)])?cr.push(String.fromCharCode(Ur)):cr.push(ke[Ge]),cr[Ge].charCodeAt(0)>>8&&(fr=!0);ke=cr.join("")}for(Ge=ke.length;fr===void 0&&Ge!==0;)ke.charCodeAt(Ge-1)>>8&&(fr=!0),Ge--;if(!fr)return ke;for(cr=De.noBOM?[]:[254,255],Ge=0,at=ke.length;Ge<at;Ge++){if((An=(Ur=ke.charCodeAt(Ge))>>8)>>8)throw new Error("Character at position "+Ge+" of string '"+ke+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");cr.push(An),cr.push(Ur-(An<<8))}return String.fromCharCode.apply(void 0,cr)}(H,ce).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},os=p.__private__.beginPage=function(H){Te[++xr]=[],er[xr]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(H[0]),topRightY:Number(H[1])}},_o(xr),Ee(Te[U])},Ec=function(H,ce){var ke,De,Ge;switch(r=ce||r,typeof H=="string"&&(ke=b(H.toLowerCase()),Array.isArray(ke)&&(De=ke[0],Ge=ke[1])),Array.isArray(H)&&(De=H[0]*bt,Ge=H[1]*bt),isNaN(De)&&(De=i[0],Ge=i[1]),(De>14400||Ge>14400)&&(Yn.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),De=Math.min(14400,De),Ge=Math.min(14400,Ge)),i=[De,Ge],r.substr(0,1)){case"l":Ge>De&&(i=[Ge,De]);break;case"p":De>Ge&&(i=[Ge,De])}os(i),hl(qa),ge(zs),Ca!==0&&ge(Ca+" J"),ao!==0&&ge(ao+" j"),pr.publish("addPage",{pageNumber:xr})},ll=function(H){H>0&&H<=xr&&(Te.splice(H,1),er.splice(H,1),xr--,U>xr&&(U=xr),this.setPage(U))},_o=function(H){H>0&&H<=xr&&(U=H)},gi=p.__private__.getNumberOfPages=p.getNumberOfPages=function(){return Te.length-1},cn=function(H,ce,ke){var De,Ge=void 0;return ke=ke||{},H=H!==void 0?H:It[xt].fontName,ce=ce!==void 0?ce:It[xt].fontStyle,De=H.toLowerCase(),Jt[De]!==void 0&&Jt[De][ce]!==void 0?Ge=Jt[De][ce]:Jt[H]!==void 0&&Jt[H][ce]!==void 0?Ge=Jt[H][ce]:ke.disableWarning===!1&&Yn.warn("Unable to look up font label for font '"+H+"', '"+ce+"'. Refer to getFontList() for available fonts."),Ge||ke.noFallback||(Ge=Jt.times[ce])==null&&(Ge=Jt.times.normal),Ge},Sr=p.__private__.putInfo=function(){var H=qr(),ce=function(De){return De};for(var ke in f!==null&&(ce=Zn.encryptor(H,0)),ge("<<"),ge("/Producer ("+Pa(ce("jsPDF "+tr.version))+")"),pt)pt.hasOwnProperty(ke)&&pt[ke]&&ge("/"+ke.substr(0,1).toUpperCase()+ke.substr(1)+" ("+Pa(ce(pt[ke]))+")");ge("/CreationDate ("+Pa(ce(J))+")"),ge(">>"),ge("endobj")},ss=p.__private__.putCatalog=function(H){var ce=(H=H||{}).rootDictionaryObjId||Ho;switch(qr(),ge("<<"),ge("/Type /Catalog"),ge("/Pages "+ce+" 0 R"),Le||(Le="fullwidth"),Le){case"fullwidth":ge("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ge("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ge("/OpenAction [3 0 R /Fit]");break;case"original":ge("/OpenAction [3 0 R /XYZ null null 1]");break;default:var ke=""+Le;ke.substr(ke.length-1)==="%"&&(Le=parseInt(Le)/100),typeof Le=="number"&&ge("/OpenAction [3 0 R /XYZ null null "+T(Le)+"]")}switch(Ue||(Ue="continuous"),Ue){case"continuous":ge("/PageLayout /OneColumn");break;case"single":ge("/PageLayout /SinglePage");break;case"two":case"twoleft":ge("/PageLayout /TwoColumnLeft");break;case"tworight":ge("/PageLayout /TwoColumnRight")}Ae&&ge("/PageMode /"+Ae),pr.publish("putCatalog"),ge(">>"),ge("endobj")},Tr=p.__private__.putTrailer=function(){ge("trailer"),ge("<<"),ge("/Size "+(K+1)),ge("/Root "+K+" 0 R"),ge("/Info "+(K-1)+" 0 R"),f!==null&&ge("/Encrypt "+Zn.oid+" 0 R"),ge("/ID [ <"+ae+"> <"+ae+"> ]"),ge(">>")},Xi=p.__private__.putHeader=function(){ge("%PDF-"+y),ge("%ºß¬à")},ro=p.__private__.putXRef=function(){var H="0000000000";ge("xref"),ge("0 "+(K+1)),ge("0000000000 65535 f ");for(var ce=1;ce<=K;ce++)typeof oe[ce]=="function"?ge((H+oe[ce]()).slice(-10)+" 00000 n "):oe[ce]!==void 0?ge((H+oe[ce]).slice(-10)+" 00000 n "):ge("0000000000 00000 n ")},Ki=p.__private__.buildDocument=function(){var H;K=0,de=0,me=[],oe=[],ye=[],Ho=En(),Ea=En(),Ee(me),pr.publish("buildDocument"),Xi(),zi(),function(){pr.publish("putAdditionalObjects");for(var ke=0;ke<ye.length;ke++){var De=ye[ke];Rn(De.objId,!0),ge(De.content),ge("endobj")}pr.publish("postPutAdditionalObjects")}(),H=[],function(){for(var ke in It)It.hasOwnProperty(ke)&&(g===!1||g===!0&&v.hasOwnProperty(ke))&&to(It[ke])}(),function(){var ke;for(ke in Ct)Ct.hasOwnProperty(ke)&&Nf(Ct[ke])}(),function(){for(var ke in oi)oi.hasOwnProperty(ke)&&Bs(oi[ke])}(),function(ke){var De;for(De in qe)qe.hasOwnProperty(De)&&(qe[De]instanceof Kf?is(qe[De]):qe[De]instanceof ad&&lu(qe[De],ke))}(H),pr.publish("putResources"),H.forEach(kn),kn({resourcesOid:Ea,objectOid:Number.MAX_SAFE_INTEGER}),pr.publish("postPutResources"),f!==null&&(Zn.oid=qr(),ge("<<"),ge("/Filter /Standard"),ge("/V "+Zn.v),ge("/R "+Zn.r),ge("/U <"+Zn.toHexString(Zn.U)+">"),ge("/O <"+Zn.toHexString(Zn.O)+">"),ge("/P "+Zn.P),ge(">>"),ge("endobj")),Sr(),ss();var ce=de;return ro(),Tr(),ge("startxref"),ge(""+ce),ge("%%EOF"),Ee(Te[U]),me.join(`
|
|
495
|
-
`)},Mn=p.__private__.getBlob=function(H){return new Blob([Be(H)],{type:"application/pdf"})},Zi=p.output=p.__private__.output=(Yi=function(H,ce){switch(typeof(ce=ce||{})=="string"?ce={filename:ce}:ce.filename=ce.filename||"generated.pdf",H){case void 0:return Ki();case"save":p.save(ce.filename);break;case"arraybuffer":return Be(Ki());case"blob":return Mn(Ki());case"bloburi":case"bloburl":if(yr.URL!==void 0&&typeof yr.URL.createObjectURL=="function")return yr.URL&&yr.URL.createObjectURL(Mn(Ki()))||void 0;Yn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var ke="",De=Ki();try{ke=Aw(De)}catch{ke=Aw(unescape(encodeURIComponent(De)))}return"data:application/pdf;filename="+ce.filename+";base64,"+ke;case"pdfobjectnewwindow":if(Object.prototype.toString.call(yr)==="[object Window]"){var Ge="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",at=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';ce.pdfObjectUrl&&(Ge=ce.pdfObjectUrl,at="");var ct='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+Ge+'"'+at+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(ce)+");<\/script></body></html>",Dt=yr.open();return Dt!==null&&Dt.document.write(ct),Dt}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(yr)==="[object Window]"){var jt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(ce.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+ce.filename+'" width="500px" height="400px" /></body></html>',cr=yr.open();if(cr!==null){cr.document.write(jt);var fr=this;cr.document.documentElement.querySelector("#pdfViewer").onload=function(){cr.document.title=ce.filename,cr.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(fr.output("bloburl"))}}return cr}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(yr)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Ur='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",ce)+'"></iframe></body></html>',An=yr.open();if(An!==null&&(An.document.write(Ur),An.document.title=ce.filename),An||typeof safari>"u")return An;break;case"datauri":case"dataurl":return yr.document.location.href=this.output("datauristring",ce);default:return null}},Yi.foo=function(){try{return Yi.apply(this,arguments)}catch(ke){var H=ke.stack||"";~H.indexOf(" at ")&&(H=H.split(" at ")[1]);var ce="Error in function "+H.split(`
|
|
496
|
-
`)[0].split("<")[0]+": "+ke.message;if(!yr.console)throw new Error(ce);yr.console.error(ce,ke),yr.alert&&alert(ce)}},Yi.foo.bar=Yi,Yi.foo),ul=function(H){return Array.isArray(Bi)===!0&&Bi.indexOf(H)>-1};switch(n){case"pt":bt=1;break;case"mm":bt=72/25.4;break;case"cm":bt=72/2.54;break;case"in":bt=72;break;case"px":bt=ul("px_scaling")==1?.75:96/72;break;case"pc":case"em":bt=12;break;case"ex":bt=6;break;default:if(typeof n!="number")throw new Error("Invalid unit: "+n);bt=n}var Zn=null;B(),Z();var ls=p.__private__.getPageInfo=p.getPageInfo=function(H){if(isNaN(H)||H%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:er[H].objId,pageNumber:H,pageContext:er[H]}},Vu=p.__private__.getPageInfoByObjId=function(H){if(isNaN(H)||H%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var ce in er)if(er[ce].objId===H)break;return ls(ce)},Oa=p.__private__.getCurrentPageInfo=p.getCurrentPageInfo=function(){return{objId:er[U].objId,pageNumber:U,pageContext:er[U]}};p.addPage=function(){return Ec.apply(this,arguments),this},p.setPage=function(){return _o.apply(this,arguments),Ee.call(this,Te[U]),this},p.insertPage=function(H){return this.addPage(),this.movePage(U,H),this},p.movePage=function(H,ce){var ke,De;if(H>ce){ke=Te[H],De=er[H];for(var Ge=H;Ge>ce;Ge--)Te[Ge]=Te[Ge-1],er[Ge]=er[Ge-1];Te[ce]=ke,er[ce]=De,this.setPage(ce)}else if(H<ce){ke=Te[H],De=er[H];for(var at=H;at<ce;at++)Te[at]=Te[at+1],er[at]=er[at+1];Te[ce]=ke,er[ce]=De,this.setPage(ce)}return this},p.deletePage=function(){return ll.apply(this,arguments),this},p.__private__.text=p.text=function(H,ce,ke,De,Ge){var at,ct,Dt,jt,cr,fr,Ur,An,ui,on=(De=De||{}).scope||this;if(typeof H=="number"&&typeof ce=="number"&&(typeof ke=="string"||Array.isArray(ke))){var mi=ke;ke=ce,ce=H,H=mi}if(arguments[3]instanceof Qt==0?(Dt=arguments[4],jt=arguments[5],Nn(Ur=arguments[3])==="object"&&Ur!==null||(typeof Dt=="string"&&(jt=Dt,Dt=null),typeof Ur=="string"&&(jt=Ur,Ur=null),typeof Ur=="number"&&(Dt=Ur,Ur=null),De={flags:Ur,angle:Dt,align:jt})):(F("The transform parameter of text() with a Matrix value"),ui=Ge),isNaN(ce)||isNaN(ke)||H==null)throw new Error("Invalid arguments passed to jsPDF.text");if(H.length===0)return on;var _n,Ai="",Po=typeof De.lineHeightFactor=="number"?De.lineHeightFactor:za,Qi=on.internal.scaleFactor;function Cc(Cr){return Cr=Cr.split(" ").join(Array(De.TabLen||9).join(" ")),Pa(Cr,Ur)}function Oo(Cr){for(var ar,Er=Cr.concat(),Lr=[],Va=Er.length;Va--;)typeof(ar=Er.shift())=="string"?Lr.push(ar):Array.isArray(Cr)&&(ar.length===1||ar[1]===void 0&&ar[2]===void 0)?Lr.push(ar[0]):Lr.push([ar[0],ar[1],ar[2]]);return Lr}function hs(Cr,ar){var Er;if(typeof Cr=="string")Er=ar(Cr)[0];else if(Array.isArray(Cr)){for(var Lr,Va,$s=Cr.concat(),bs=[],Gs=$s.length;Gs--;)typeof(Lr=$s.shift())=="string"?bs.push(ar(Lr)[0]):Array.isArray(Lr)&&typeof Lr[0]=="string"&&(Va=ar(Lr[0],Lr[1],Lr[2]),bs.push([Va[0],Va[1],Va[2]]));Er=bs}return Er}var qs=!1,gl=!0;if(typeof H=="string")qs=!0;else if(Array.isArray(H)){var oo=H.concat();ct=[];for(var vl,Pi=oo.length;Pi--;)(typeof(vl=oo.shift())!="string"||Array.isArray(vl)&&typeof vl[0]!="string")&&(gl=!1);qs=gl}if(qs===!1)throw new Error('Type of text must be string or Array. "'+H+'" is not recognized.');typeof H=="string"&&(H=H.match(/[\r?\n]/)?H.split(/\r\n|\r|\n/g):[H]);var ds=fe/on.internal.scaleFactor,Co=ds*(Po-1);switch(De.baseline){case"bottom":ke-=Co;break;case"top":ke+=ds-Co;break;case"hanging":ke+=ds-2*Co;break;case"middle":ke+=ds/2-Co}if((fr=De.maxWidth||0)>0&&(typeof H=="string"?H=on.splitTextToSize(H,fr):Object.prototype.toString.call(H)==="[object Array]"&&(H=H.reduce(function(Cr,ar){return Cr.concat(on.splitTextToSize(ar,fr))},[]))),at={text:H,x:ce,y:ke,options:De,mutex:{pdfEscape:Pa,activeFontKey:xt,fonts:It,activeFontSize:fe}},pr.publish("preProcessText",at),H=at.text,Dt=(De=at.options).angle,ui instanceof Qt==0&&Dt&&typeof Dt=="number"){Dt*=Math.PI/180,De.rotationDirection===0&&(Dt=-Dt),S===A&&(Dt=-Dt);var Ml=Math.cos(Dt),Il=Math.sin(Dt);ui=new Qt(Ml,Il,-Il,Ml,0,0)}else Dt&&Dt instanceof Qt&&(ui=Dt);S!==A||ui||(ui=Fa),(cr=De.charSpace||Go)!==void 0&&(Ai+=M($(cr))+` Tc
|
|
497
|
-
`,this.setCharSpace(this.getCharSpace()||0)),(An=De.horizontalScale)!==void 0&&(Ai+=M(100*An)+` Tz
|
|
498
|
-
`),De.lang;var zn=-1,so=De.renderingMode!==void 0?De.renderingMode:De.stroke,Lo=on.internal.getCurrentPageInfo().pageContext;switch(so){case 0:case!1:case"fill":zn=0;break;case 1:case!0:case"stroke":zn=1;break;case 2:case"fillThenStroke":zn=2;break;case 3:case"invisible":zn=3;break;case 4:case"fillAndAddForClipping":zn=4;break;case 5:case"strokeAndAddPathForClipping":zn=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":zn=6;break;case 7:case"addToPathForClipping":zn=7}var Us=Lo.usedRenderingMode!==void 0?Lo.usedRenderingMode:-1;zn!==-1?Ai+=zn+` Tr
|
|
499
|
-
`:Us!==-1&&(Ai+=`0 Tr
|
|
500
|
-
`),zn!==-1&&(Lo.usedRenderingMode=zn),jt=De.align||"left";var In,Ga=fe*Po,ml=on.internal.pageSize.getWidth(),jl=It[xt];cr=De.charSpace||Go,fr=De.maxWidth||0,Ur=Object.assign({autoencode:!0,noBOM:!0},De.flags);var qi=[],Oi=function(Cr){return on.getStringUnitWidth(Cr,{font:jl,charSpace:cr,fontSize:fe,doKerning:!1})*fe/Qi};if(Object.prototype.toString.call(H)==="[object Array]"){var Na;ct=Oo(H),jt!=="left"&&(In=ct.map(Oi));var Wa,ha=0;if(jt==="right"){ce-=In[0],H=[],Pi=ct.length;for(var Ji=0;Ji<Pi;Ji++)Ji===0?(Wa=io(ce),Na=wn(ke)):(Wa=$(ha-In[Ji]),Na=-Ga),H.push([ct[Ji],Wa,Na]),ha=In[Ji]}else if(jt==="center"){ce-=In[0]/2,H=[],Pi=ct.length;for(var No=0;No<Pi;No++)No===0?(Wa=io(ce),Na=wn(ke)):(Wa=$((ha-In[No])/2),Na=-Ga),H.push([ct[No],Wa,Na]),ha=In[No]}else if(jt==="left"){H=[],Pi=ct.length;for(var ps=0;ps<Pi;ps++)H.push(ct[ps])}else if(jt==="justify"&&jl.encoding==="Identity-H"){H=[],Pi=ct.length,fr=fr!==0?fr:ml;for(var lo=0,Jn=0;Jn<Pi;Jn++)if(Na=Jn===0?wn(ke):-Ga,Wa=Jn===0?io(ce):lo,Jn<Pi-1){var Wo=$((fr-In[Jn])/(ct[Jn].split(" ").length-1)),ci=ct[Jn].split(" ");H.push([ci[0]+" ",Wa,Na]),lo=0;for(var Ta=1;Ta<ci.length;Ta++){var To=(Oi(ci[Ta-1]+" "+ci[Ta])-Oi(ci[Ta]))*Qi+Wo;Ta==ci.length-1?H.push([ci[Ta],To,0]):H.push([ci[Ta]+" ",To,0]),lo-=To}}else H.push([ct[Jn],Wa,Na]);H.push(["",lo,0])}else{if(jt!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(H=[],Pi=ct.length,fr=fr!==0?fr:ml,Jn=0;Jn<Pi;Jn++){Na=Jn===0?wn(ke):-Ga,Wa=Jn===0?io(ce):0;var da=ct[Jn].split(" ").length-1,yl=da>0?(fr-In[Jn])/da:0;Jn<Pi-1?qi.push(M($(yl))):qi.push(0),H.push([ct[Jn],Wa,Na])}}}(typeof De.R2L=="boolean"?De.R2L:ue)===!0&&(H=hs(H,function(Cr,ar,Er){return[Cr.split("").reverse().join(""),ar,Er]})),at={text:H,x:ce,y:ke,options:De,mutex:{pdfEscape:Pa,activeFontKey:xt,fonts:It,activeFontSize:fe}},pr.publish("postProcessText",at),H=at.text,_n=at.mutex.isHex||!1;var Vo=It[xt].encoding;Vo!=="WinAnsiEncoding"&&Vo!=="StandardEncoding"||(H=hs(H,function(Cr,ar,Er){return[Cc(Cr),ar,Er]})),ct=Oo(H),H=[];for(var gs,vs,en,ms=Array.isArray(ct[0])?1:0,ys="",Hs=function(Cr,ar,Er){var Lr="";return Er instanceof Qt?(Er=typeof De.angle=="number"?ca(Er,new Qt(1,0,0,1,Cr,ar)):ca(new Qt(1,0,0,1,Cr,ar),Er),S===A&&(Er=ca(new Qt(1,0,0,-1,0,0),Er)),Lr=Er.join(" ")+` Tm
|
|
501
|
-
`):Lr=M(Cr)+" "+M(ar)+` Td
|
|
502
|
-
`,Lr},Pn=0;Pn<ct.length;Pn++){switch(ys="",ms){case 1:en=(_n?"<":"(")+ct[Pn][0]+(_n?">":")"),gs=parseFloat(ct[Pn][1]),vs=parseFloat(ct[Pn][2]);break;case 0:en=(_n?"<":"(")+ct[Pn]+(_n?">":")"),gs=io(ce),vs=wn(ke)}qi!==void 0&&qi[Pn]!==void 0&&(ys=qi[Pn]+` Tw
|
|
503
|
-
`),Pn===0?H.push(ys+Hs(gs,vs,ui)+en):ms===0?H.push(ys+en):ms===1&&H.push(ys+Hs(gs,vs,ui)+en)}H=ms===0?H.join(` Tj
|
|
504
|
-
T* `):H.join(` Tj
|
|
505
|
-
`),H+=` Tj
|
|
506
|
-
`;var pa=`BT
|
|
507
|
-
/`;return pa+=xt+" "+fe+` Tf
|
|
508
|
-
`,pa+=M(fe*Po)+` TL
|
|
509
|
-
`,pa+=Ua+`
|
|
510
|
-
`,pa+=Ai,pa+=H,ge(pa+="ET"),v[xt]=!0,on};var Tl=p.__private__.clip=p.clip=function(H){return ge(H==="evenodd"?"W*":"W"),this};p.clipEvenOdd=function(){return Tl("evenodd")},p.__private__.discardPath=p.discardPath=function(){return ge("n"),this};var us=p.__private__.isValidStyle=function(H){var ce=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(H)!==-1&&(ce=!0),ce};p.__private__.setDefaultPathOperation=p.setDefaultPathOperation=function(H){return us(H)&&(h=H),this};var cu=p.__private__.getStyle=p.getStyle=function(H){var ce=h;switch(H){case"D":case"S":ce="S";break;case"F":ce="f";break;case"FD":case"DF":ce="B";break;case"f":case"f*":case"B":case"B*":ce=H}return ce},Rr=p.close=function(){return ge("h"),this};p.stroke=function(){return ge("S"),this},p.fill=function(H){return xo("f",H),this},p.fillEvenOdd=function(H){return xo("f*",H),this},p.fillStroke=function(H){return xo("B",H),this},p.fillStrokeEvenOdd=function(H){return xo("B*",H),this};var xo=function(H,ce){Nn(ce)==="object"?kc(ce,H):ge(H)},cs=function(H){H===null||S===A&&H===void 0||(H=cu(H),ge(H))};function cl(H,ce,ke,De,Ge){var at=new ad(ce||this.boundingBox,ke||this.xStep,De||this.yStep,this.gState,Ge||this.matrix);at.stream=this.stream;var ct=H+"$$"+this.cloneIndex+++"$$";return Kn(ct,at),at}var kc=function(H,ce){var ke=Nt[H.key],De=qe[ke];if(De instanceof Kf)ge("q"),ge(Ac(ce)),De.gState&&p.setGState(De.gState),ge(H.matrix.toString()+" cm"),ge("/"+ke+" sh"),ge("Q");else if(De instanceof ad){var Ge=new Qt(1,0,0,-1,0,vi());H.matrix&&(Ge=Ge.multiply(H.matrix||Fa),ke=cl.call(De,H.key,H.boundingBox,H.xStep,H.yStep,Ge).id),ge("q"),ge("/Pattern cs"),ge("/"+ke+" scn"),De.gState&&p.setGState(De.gState),ge(ce),ge("Q")}},Ac=function(H){switch(H){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},fl=p.moveTo=function(H,ce){return ge(M($(H))+" "+M(q(ce))+" m"),this},fs=p.lineTo=function(H,ce){return ge(M($(H))+" "+M(q(ce))+" l"),this},no=p.curveTo=function(H,ce,ke,De,Ge,at){return ge([M($(H)),M(q(ce)),M($(ke)),M(q(De)),M($(Ge)),M(q(at)),"c"].join(" ")),this};p.__private__.line=p.line=function(H,ce,ke,De,Ge){if(isNaN(H)||isNaN(ce)||isNaN(ke)||isNaN(De)||!us(Ge))throw new Error("Invalid arguments passed to jsPDF.line");return S===E?this.lines([[ke-H,De-ce]],H,ce,[1,1],Ge||"S"):this.lines([[ke-H,De-ce]],H,ce,[1,1]).stroke()},p.__private__.lines=p.lines=function(H,ce,ke,De,Ge,at){var ct,Dt,jt,cr,fr,Ur,An,ui,on,mi,_n,Ai;if(typeof H=="number"&&(Ai=ke,ke=ce,ce=H,H=Ai),De=De||[1,1],at=at||!1,isNaN(ce)||isNaN(ke)||!Array.isArray(H)||!Array.isArray(De)||!us(Ge)||typeof at!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(fl(ce,ke),ct=De[0],Dt=De[1],cr=H.length,mi=ce,_n=ke,jt=0;jt<cr;jt++)(fr=H[jt]).length===2?(mi=fr[0]*ct+mi,_n=fr[1]*Dt+_n,fs(mi,_n)):(Ur=fr[0]*ct+mi,An=fr[1]*Dt+_n,ui=fr[2]*ct+mi,on=fr[3]*Dt+_n,mi=fr[4]*ct+mi,_n=fr[5]*Dt+_n,no(Ur,An,ui,on,mi,_n));return at&&Rr(),cs(Ge),this},p.path=function(H){for(var ce=0;ce<H.length;ce++){var ke=H[ce],De=ke.c;switch(ke.op){case"m":fl(De[0],De[1]);break;case"l":fs(De[0],De[1]);break;case"c":no.apply(this,De);break;case"h":Rr()}}return this},p.__private__.rect=p.rect=function(H,ce,ke,De,Ge){if(isNaN(H)||isNaN(ce)||isNaN(ke)||isNaN(De)||!us(Ge))throw new Error("Invalid arguments passed to jsPDF.rect");return S===E&&(De=-De),ge([M($(H)),M(q(ce)),M($(ke)),M($(De)),"re"].join(" ")),cs(Ge),this},p.__private__.triangle=p.triangle=function(H,ce,ke,De,Ge,at,ct){if(isNaN(H)||isNaN(ce)||isNaN(ke)||isNaN(De)||isNaN(Ge)||isNaN(at)||!us(ct))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[ke-H,De-ce],[Ge-ke,at-De],[H-Ge,ce-at]],H,ce,[1,1],ct,!0),this},p.__private__.roundedRect=p.roundedRect=function(H,ce,ke,De,Ge,at,ct){if(isNaN(H)||isNaN(ce)||isNaN(ke)||isNaN(De)||isNaN(Ge)||isNaN(at)||!us(ct))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var Dt=4/3*(Math.SQRT2-1);return Ge=Math.min(Ge,.5*ke),at=Math.min(at,.5*De),this.lines([[ke-2*Ge,0],[Ge*Dt,0,Ge,at-at*Dt,Ge,at],[0,De-2*at],[0,at*Dt,-Ge*Dt,at,-Ge,at],[2*Ge-ke,0],[-Ge*Dt,0,-Ge,-at*Dt,-Ge,-at],[0,2*at-De],[0,-at*Dt,Ge*Dt,-at,Ge,-at]],H+Ge,ce,[1,1],ct,!0),this},p.__private__.ellipse=p.ellipse=function(H,ce,ke,De,Ge){if(isNaN(H)||isNaN(ce)||isNaN(ke)||isNaN(De)||!us(Ge))throw new Error("Invalid arguments passed to jsPDF.ellipse");var at=4/3*(Math.SQRT2-1)*ke,ct=4/3*(Math.SQRT2-1)*De;return fl(H+ke,ce),no(H+ke,ce-ct,H+at,ce-De,H,ce-De),no(H-at,ce-De,H-ke,ce-ct,H-ke,ce),no(H-ke,ce+ct,H-at,ce+De,H,ce+De),no(H+at,ce+De,H+ke,ce+ct,H+ke,ce),cs(Ge),this},p.__private__.circle=p.circle=function(H,ce,ke,De){if(isNaN(H)||isNaN(ce)||isNaN(ke)||!us(De))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(H,ce,ke,ke,De)},p.setFont=function(H,ce,ke){return ke&&(ce=O(ce,ke)),xt=cn(H,ce,{disableWarning:!1}),this};var Ba=p.__private__.getFont=p.getFont=function(){return It[cn.apply(p,arguments)]};p.__private__.getFontList=p.getFontList=function(){var H,ce,ke={};for(H in Jt)if(Jt.hasOwnProperty(H))for(ce in ke[H]=[],Jt[H])Jt[H].hasOwnProperty(ce)&&ke[H].push(ce);return ke},p.addFont=function(H,ce,ke,De,Ge){var at=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&at.indexOf(arguments[3])!==-1?Ge=arguments[3]:arguments[3]&&at.indexOf(arguments[3])==-1&&(ke=O(ke,De)),as.call(this,H,ce,ke,Ge=Ge||"Identity-H")};var za,qa=t.lineWidth||.200025,Pt=p.__private__.getLineWidth=p.getLineWidth=function(){return qa},hl=p.__private__.setLineWidth=p.setLineWidth=function(H){return qa=H,ge(M($(H))+" w"),this};p.__private__.setLineDash=tr.API.setLineDash=tr.API.setLineDashPattern=function(H,ce){if(H=H||[],ce=ce||0,isNaN(ce)||!Array.isArray(H))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return H=H.map(function(ke){return M($(ke))}).join(" "),ce=M($(ce)),ge("["+H+"] "+ce+" d"),this};var So=p.__private__.getLineHeight=p.getLineHeight=function(){return fe*za};p.__private__.getLineHeight=p.getLineHeight=function(){return fe*za};var Pc=p.__private__.setLineHeightFactor=p.setLineHeightFactor=function(H){return typeof(H=H||1.15)=="number"&&(za=H),this},Oc=p.__private__.getLineHeightFactor=p.getLineHeightFactor=function(){return za};Pc(t.lineHeight);var io=p.__private__.getHorizontalCoordinate=function(H){return $(H)},wn=p.__private__.getVerticalCoordinate=function(H){return S===A?H:er[U].mediaBox.topRightY-er[U].mediaBox.bottomLeftY-$(H)},fu=p.__private__.getHorizontalCoordinateString=p.getHorizontalCoordinateString=function(H){return M(io(H))},hu=p.__private__.getVerticalCoordinateString=p.getVerticalCoordinateString=function(H){return M(wn(H))},zs=t.strokeColor||"0 G";p.__private__.getStrokeColor=p.getDrawColor=function(){return eo(zs)},p.__private__.setStrokeColor=p.setDrawColor=function(H,ce,ke,De){return zs=si({ch1:H,ch2:ce,ch3:ke,ch4:De,pdfColorType:"draw",precision:2}),ge(zs),this};var Yu=t.fillColor||"0 g";p.__private__.getFillColor=p.getFillColor=function(){return eo(Yu)},p.__private__.setFillColor=p.setFillColor=function(H,ce,ke,De){return Yu=si({ch1:H,ch2:ce,ch3:ke,ch4:De,pdfColorType:"fill",precision:2}),ge(Yu),this};var Ua=t.textColor||"0 g",ki=p.__private__.getTextColor=p.getTextColor=function(){return eo(Ua)};p.__private__.setTextColor=p.setTextColor=function(H,ce,ke,De){return Ua=si({ch1:H,ch2:ce,ch3:ke,ch4:De,pdfColorType:"text",precision:3}),this};var Go=t.charSpace,du=p.__private__.getCharSpace=p.getCharSpace=function(){return parseFloat(Go||0)};p.__private__.setCharSpace=p.setCharSpace=function(H){if(isNaN(H))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Go=H,this};var Ca=0;p.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},p.__private__.setLineCap=p.setLineCap=function(H){var ce=p.CapJoinStyles[H];if(ce===void 0)throw new Error("Line cap style of '"+H+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Ca=ce,ge(ce+" J"),this};var ao=0;p.__private__.setLineJoin=p.setLineJoin=function(H){var ce=p.CapJoinStyles[H];if(ce===void 0)throw new Error("Line join style of '"+H+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return ao=ce,ge(ce+" j"),this},p.__private__.setLineMiterLimit=p.__private__.setMiterLimit=p.setLineMiterLimit=p.setMiterLimit=function(H){if(H=H||0,isNaN(H))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return ge(M($(H))+" M"),this},p.GState=A0,p.setGState=function(H){(H=typeof H=="string"?Ct[ir[H]]:Eo(null,H)).equals(Ut)||(ge("/"+H.id+" gs"),Ut=H)};var Eo=function(H,ce){if(!H||!ir[H]){var ke=!1;for(var De in Ct)if(Ct.hasOwnProperty(De)&&Ct[De].equals(ce)){ke=!0;break}if(ke)ce=Ct[De];else{var Ge="GS"+(Object.keys(Ct).length+1).toString(10);Ct[Ge]=ce,ce.id=Ge}return H&&(ir[H]=ce.id),pr.publish("addGState",ce),ce}};p.addGState=function(H,ce){return Eo(H,ce),this},p.saveGraphicsState=function(){return ge("q"),Ve.push({key:xt,size:fe,color:Ua}),this},p.restoreGraphicsState=function(){ge("Q");var H=Ve.pop();return xt=H.key,fe=H.size,Ua=H.color,Ut=null,this},p.setCurrentTransformationMatrix=function(H){return ge(H.toString()+" cm"),this},p.comment=function(H){return ge("#"+H),this};var ko=function(H,ce){var ke=H||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return ke},set:function(at){isNaN(at)||(ke=parseFloat(at))}});var De=ce||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return De},set:function(at){isNaN(at)||(De=parseFloat(at))}});var Ge="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return Ge},set:function(at){Ge=at.toString()}}),this},dl=function(H,ce,ke,De){ko.call(this,H,ce),this.type="rect";var Ge=ke||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return Ge},set:function(ct){isNaN(ct)||(Ge=parseFloat(ct))}});var at=De||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return at},set:function(ct){isNaN(ct)||(at=parseFloat(ct))}}),this},Rl=function(){this.page=xr,this.currentPage=U,this.pages=Te.slice(0),this.pagesContext=er.slice(0),this.x=kt,this.y=zr,this.matrix=_r,this.width=Ao(U),this.height=La(U),this.outputDestination=Ie,this.id="",this.objectNumber=-1};Rl.prototype.restore=function(){xr=this.page,U=this.currentPage,er=this.pagesContext,Te=this.pages,kt=this.x,zr=this.y,_r=this.matrix,pl(U,this.width),Bn(U,this.height),Ie=this.outputDestination};var li=function(H,ce,ke,De,Ge){Sn.push(new Rl),xr=U=0,Te=[],kt=H,zr=ce,_r=Ge,os([ke,De])};for(var Ha in p.beginFormObject=function(H,ce,ke,De,Ge){return li(H,ce,ke,De,Ge),this},p.endFormObject=function(H){return function(ce){if(Ei[ce])Sn.pop().restore();else{var ke=new Rl,De="Xo"+(Object.keys(oi).length+1).toString(10);ke.id=De,Ei[ce]=De,oi[De]=ke,pr.publish("addFormObject",ke),Sn.pop().restore()}}(H),this},p.doFormObject=function(H,ce){var ke=oi[Ei[H]];return ge("q"),ge(ce.toString()+" cm"),ge("/"+ke.id+" Do"),ge("Q"),this},p.getFormObject=function(H){var ce=oi[Ei[H]];return{x:ce.x,y:ce.y,width:ce.width,height:ce.height,matrix:ce.matrix}},p.save=function(H,ce){return H=H||"generated.pdf",(ce=ce||{}).returnPromise=ce.returnPromise||!1,ce.returnPromise===!1?(Xf(Mn(Ki()),H),typeof Xf.unload=="function"&&yr.setTimeout&&setTimeout(Xf.unload,911),this):new Promise(function(ke,De){try{var Ge=Xf(Mn(Ki()),H);typeof Xf.unload=="function"&&yr.setTimeout&&setTimeout(Xf.unload,911),ke(Ge)}catch(at){De(at.message)}})},tr.API)tr.API.hasOwnProperty(Ha)&&(Ha==="events"&&tr.API.events.length?function(H,ce){var ke,De,Ge;for(Ge=ce.length-1;Ge!==-1;Ge--)ke=ce[Ge][0],De=ce[Ge][1],H.subscribe.apply(H,[ke].concat(typeof De=="function"?[De]:De))}(pr,tr.API.events):p[Ha]=tr.API[Ha]);function Ao(H){return er[H].mediaBox.topRightX-er[H].mediaBox.bottomLeftX}function pl(H,ce){er[H].mediaBox.topRightX=ce+er[H].mediaBox.bottomLeftX}function La(H){return er[H].mediaBox.topRightY-er[H].mediaBox.bottomLeftY}function Bn(H,ce){er[H].mediaBox.topRightY=ce+er[H].mediaBox.bottomLeftY}var fa=p.getPageWidth=function(H){return Ao(H=H||U)/bt},Qn=p.setPageWidth=function(H,ce){pl(H,ce*bt)},vi=p.getPageHeight=function(H){return La(H=H||U)/bt},$a=p.setPageHeight=function(H,ce){Bn(H,ce*bt)};return p.internal={pdfEscape:Pa,getStyle:cu,getFont:Ba,getFontSize:Ne,getCharSpace:du,getTextColor:ki,getLineHeight:So,getLineHeightFactor:Oc,getLineWidth:Pt,write:Re,getHorizontalCoordinate:io,getVerticalCoordinate:wn,getCoordinateString:fu,getVerticalCoordinateString:hu,collections:{},newObject:qr,newAdditionalObject:Sa,newObjectDeferred:En,newObjectDeferredBegin:Rn,getFilters:ka,putStream:Aa,events:pr,scaleFactor:bt,pageSize:{getWidth:function(){return fa(U)},setWidth:function(H){Qn(U,H)},getHeight:function(){return vi(U)},setHeight:function(H){$a(U,H)}},encryptionOptions:f,encryption:Zn,getEncryptor:function(H){return f!==null?Zn.encryptor(H,0):function(ce){return ce}},output:Zi,getNumberOfPages:gi,pages:Te,out:ge,f2:T,f3:L,getPageInfo:ls,getPageInfoByObjId:Vu,getCurrentPageInfo:Oa,getPDFVersion:_,Point:ko,Rectangle:dl,Matrix:Qt,hasHotfix:ul},Object.defineProperty(p.internal.pageSize,"width",{get:function(){return fa(U)},set:function(H){Qn(U,H)},enumerable:!0,configurable:!0}),Object.defineProperty(p.internal.pageSize,"height",{get:function(){return vi(U)},set:function(H){$a(U,H)},enumerable:!0,configurable:!0}),(function(H){for(var ce=0,ke=Oe.length;ce<ke;ce++){var De=as.call(this,H[ce][0],H[ce][1],H[ce][2],Oe[ce][3],!0);g===!1&&(v[De]=!0);var Ge=H[ce][0].split("-");uu({id:De,fontName:Ge[0],fontStyle:Ge[1]||""})}pr.publish("addFonts",{fonts:It,dictionary:Jt})}).call(p,Oe),xt="F1",Ec(i,r),pr.publish("initialized"),p}Qh.prototype.lsbFirstWord=function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)},Qh.prototype.toHexString=function(t){return t.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},Qh.prototype.hexToBytes=function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(String.fromCharCode(parseInt(t.substr(r,2),16)));return e.join("")},Qh.prototype.processOwnerPassword=function(t,e){return Tm(Nm(e).substr(0,5),t)},Qh.prototype.encryptor=function(t,e){var r=Nm(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&e,e>>8&255)).substr(0,10);return function(n){return Tm(r,n)}},A0.prototype.equals=function(t){var e,r="id,objectNumber,equals";if(!t||Nn(t)!==Nn(this))return!1;var n=0;for(e in this)if(!(r.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!t.hasOwnProperty(e)||this[e]!==t[e])return!1;n++}for(e in t)t.hasOwnProperty(e)&&r.indexOf(e)<0&&n--;return n===0},tr.API={events:[]},tr.version="3.0.3";var Vi=tr.API,Ey=1,kh=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Yh=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Ar=function(t){return t.toFixed(2)},af=function(t){return t.toFixed(5)};Vi.__acroform__={};var Fs=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},Lw=function(t){return t*Ey},Lu=function(t){var e=new ix,r=Yt.internal.getHeight(t)||0,n=Yt.internal.getWidth(t)||0;return e.BBox=[0,0,Number(Ar(n)),Number(Ar(r))],e},DI=Vi.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<e},FI=Vi.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<e)},BI=Vi.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return t&1<<e?1:0},sa=Vi.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return BI(t,e-1)},la=Vi.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return DI(t,e-1)},ua=Vi.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return FI(t,e-1)},zI=Vi.__acroform__.calculateCoordinates=function(t,e){var r=e.internal.getHorizontalCoordinate,n=e.internal.getVerticalCoordinate,i=t[0],a=t[1],o=t[2],s=t[3],u={};return u.lowerLeft_X=r(i)||0,u.lowerLeft_Y=n(a+s)||0,u.upperRight_X=r(i+o)||0,u.upperRight_Y=n(a)||0,[Number(Ar(u.lowerLeft_X)),Number(Ar(u.lowerLeft_Y)),Number(Ar(u.upperRight_X)),Number(Ar(u.upperRight_Y))]},qI=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],r=t._V||t.DV,n=Rm(t,r),i=t.scope.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(t.scope.__private__.encodeColorString(t.color)),e.push("/"+i+" "+Ar(n.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(n.text),e.push("ET"),e.push("Q"),e.push("EMC");var a=Lu(t);return a.scope=t.scope,a.stream=e.join(`
|
|
511
|
-
`),a}},Rm=function(t,e){var r=t.fontSize===0?t.maxFontSize:t.fontSize,n={text:"",fontSize:""},i=(e=(e=e.substr(0,1)=="("?e.substr(1):e).substr(e.length-1)==")"?e.substr(0,e.length-1):e).split(" ");i=t.multiline?i.map(function(T){return T.split(`
|
|
512
|
-
`)}):i.map(function(T){return[T]});var a=r,o=Yt.internal.getHeight(t)||0;o=o<0?-o:o;var s=Yt.internal.getWidth(t)||0;s=s<0?-s:s;var u=function(T,L,$){if(T+1<i.length){var q=L+" "+i[T+1][0];return B1(q,t,$).width<=s-4}return!1};a++;e:for(;a>0;){e="",a--;var h,f,g=B1("3",t,a).height,v=t.multiline?o-a:(o-g)/2,p=v+=2,y=0,_=0,x=0;if(a<=0){e=`(...) Tj
|
|
513
|
-
`,e+="% Width of Text: "+B1(e,t,a=12).width+", FieldWidth:"+s+`
|
|
514
|
-
`;break}for(var b="",E=0,A=0;A<i.length;A++)if(i.hasOwnProperty(A)){var S=!1;if(i[A].length!==1&&x!==i[A].length-1){if((g+2)*(E+2)+2>o)continue e;b+=i[A][x],S=!0,_=A,A--}else{b=(b+=i[A][x]+" ").substr(b.length-1)==" "?b.substr(0,b.length-1):b;var k=parseInt(A),I=u(k,b,a),O=A>=i.length-1;if(I&&!O){b+=" ",x=0;continue}if(I||O){if(O)_=k;else if(t.multiline&&(g+2)*(E+2)+2>o)continue e}else{if(!t.multiline||(g+2)*(E+2)+2>o)continue e;_=k}}for(var M="",F=y;F<=_;F++){var j=i[F];if(t.multiline){if(F===_){M+=j[x]+" ",x=(x+1)%j.length;continue}if(F===y){M+=j[j.length-1]+" ";continue}}M+=j[0]+" "}switch(M=M.substr(M.length-1)==" "?M.substr(0,M.length-1):M,f=B1(M,t,a).width,t.textAlign){case"right":h=s-f-2;break;case"center":h=(s-f)/2;break;default:h=2}e+=Ar(h)+" "+Ar(p)+` Td
|
|
515
|
-
`,e+="("+kh(M)+`) Tj
|
|
516
|
-
`,e+=-Ar(h)+` 0 Td
|
|
517
|
-
`,p=-(a+2),f=0,y=S?_:_+1,E++,b=""}break}return n.text=e,n.fontSize=a,n},B1=function(t,e,r){var n=e.scope.internal.getFont(e.fontName,e.fontStyle),i=e.scope.getStringUnitWidth(t,{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r);return{height:e.scope.getStringUnitWidth("3",{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r)*1.5,width:i}},UI={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},HI=function(t,e){var r={type:"reference",object:t};e.internal.getPageInfo(t.page).pageContext.annotations.find(function(n){return n.type===r.type&&n.object===r.object})===void 0&&e.internal.getPageInfo(t.page).pageContext.annotations.push(r)},$I=function(t,e){if(e.scope=t,t.internal!==void 0&&(t.internal.acroformPlugin===void 0||t.internal.acroformPlugin.isInitialized===!1)){if(ou.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(UI)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");Ey=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new ax,t.internal.acroformPlugin.acroFormDictionaryRoot.scope=t,t.internal.acroformPlugin.acroFormDictionaryRoot._eventID=t.internal.events.subscribe("postPutResources",function(){(function(r){r.internal.events.unsubscribe(r.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete r.internal.acroformPlugin.acroFormDictionaryRoot._eventID,r.internal.acroformPlugin.printedOut=!0})(t)}),t.internal.events.subscribe("buildDocument",function(){(function(r){r.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var n=r.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var i in n)if(n.hasOwnProperty(i)){var a=n[i];a.objId=void 0,a.hasAnnotation&&HI(a,r)}})(t)}),t.internal.events.subscribe("putCatalog",function(){(function(r){if(r.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");r.internal.write("/AcroForm "+r.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(t)}),t.internal.events.subscribe("postPutPages",function(r){(function(n,i){var a=!n;for(var o in n||(i.internal.newObjectDeferredBegin(i.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),i.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),n=n||i.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(n.hasOwnProperty(o)){var s=n[o],u=[],h=s.Rect;if(s.Rect&&(s.Rect=zI(s.Rect,i)),i.internal.newObjectDeferredBegin(s.objId,!0),s.DA=Yt.createDefaultAppearanceStream(s),Nn(s)==="object"&&typeof s.getKeyValueListForStream=="function"&&(u=s.getKeyValueListForStream()),s.Rect=h,s.hasAppearanceStream&&!s.appearanceStreamContent){var f=qI(s);u.push({key:"AP",value:"<</N "+f+">>"}),i.internal.acroformPlugin.xForms.push(f)}if(s.appearanceStreamContent){var g="";for(var v in s.appearanceStreamContent)if(s.appearanceStreamContent.hasOwnProperty(v)){var p=s.appearanceStreamContent[v];if(g+="/"+v+" ",g+="<<",Object.keys(p).length>=1||Array.isArray(p)){for(var o in p)if(p.hasOwnProperty(o)){var y=p[o];typeof y=="function"&&(y=y.call(i,s)),g+="/"+o+" "+y+" ",i.internal.acroformPlugin.xForms.indexOf(y)>=0||i.internal.acroformPlugin.xForms.push(y)}}else typeof(y=p)=="function"&&(y=y.call(i,s)),g+="/"+o+" "+y,i.internal.acroformPlugin.xForms.indexOf(y)>=0||i.internal.acroformPlugin.xForms.push(y);g+=">>"}u.push({key:"AP",value:`<<
|
|
518
|
-
`+g+">>"})}i.internal.putStream({additionalKeyValues:u,objectId:s.objId}),i.internal.out("endobj")}a&&function(_,x){for(var b in _)if(_.hasOwnProperty(b)){var E=b,A=_[b];x.internal.newObjectDeferredBegin(A.objId,!0),Nn(A)==="object"&&typeof A.putStream=="function"&&A.putStream(),delete _[E]}}(i.internal.acroformPlugin.xForms,i)})(r,t)}),t.internal.acroformPlugin.isInitialized=!0}},nx=Vi.__acroform__.arrayToPdfArray=function(t,e,r){var n=function(o){return o};if(Array.isArray(t)){for(var i="[",a=0;a<t.length;a++)switch(a!==0&&(i+=" "),Nn(t[a])){case"boolean":case"number":case"object":i+=t[a].toString();break;case"string":t[a].substr(0,1)!=="/"?(e!==void 0&&r&&(n=r.internal.getEncryptor(e)),i+="("+kh(n(t[a].toString()))+")"):i+=t[a].toString()}return i+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},Bv=function(t,e,r){var n=function(i){return i};return e!==void 0&&r&&(n=r.internal.getEncryptor(e)),(t=t||"").toString(),"("+kh(n(t))+")"},Mu=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(t){this._objId=t}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};Mu.prototype.toString=function(){return this.objId+" 0 R"},Mu.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out("endobj")},Mu.prototype.getKeyValueListForStream=function(){var t=[],e=Object.getOwnPropertyNames(this).filter(function(a){return a!="content"&&a!="appearanceStreamContent"&&a!="scope"&&a!="objId"&&a.substring(0,1)!="_"});for(var r in e)if(Object.getOwnPropertyDescriptor(this,e[r]).configurable===!1){var n=e[r],i=this[n];i&&(Array.isArray(i)?t.push({key:n,value:nx(i,this.objId,this.scope)}):i instanceof Mu?(i.scope=this.scope,t.push({key:n,value:i.objId+" 0 R"})):typeof i!="function"&&t.push({key:n,value:i}))}return t};var ix=function(){Mu.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var t,e=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return e},set:function(r){e=r}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(r){t=r.trim()},get:function(){return t||null}})};Fs(ix,Mu);var ax=function(){Mu.call(this);var t,e=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t){var r=function(n){return n};return this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),"("+kh(r(t))+")"}},set:function(r){t=r}})};Fs(ax,Mu);var ou=function t(){Mu.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(b){if(isNaN(b))throw new Error('Invalid value "'+b+'" for attribute F supplied.');e=b}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!sa(e,3)},set:function(b){b?this.F=la(e,3):this.F=ua(e,3)}});var r=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return r},set:function(b){if(isNaN(b))throw new Error('Invalid value "'+b+'" for attribute Ff supplied.');r=b}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(n.length!==0)return n},set:function(b){n=b!==void 0?b:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:n[0]},set:function(b){n[0]=b}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:n[1]},set:function(b){n[1]=b}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:n[2]},set:function(b){n[2]=b}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:n[3]},set:function(b){n[3]=b}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(b){switch(b){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=b;break;default:throw new Error('Invalid value "'+b+'" for attribute FT supplied.')}}});var a=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof P0)return;a="FieldObject"+t.FieldNum++}var b=function(E){return E};return this.scope&&(b=this.scope.internal.getEncryptor(this.objId)),"("+kh(b(a))+")"},set:function(b){a=b.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return a},set:function(b){a=b}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(b){o=b}});var s="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return s},set:function(b){s=b}});var u=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return u},set:function(b){u=b}});var h=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return h===void 0?50/Ey:h},set:function(b){h=b}});var f="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return f},set:function(b){f=b}});var g="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!g||this instanceof P0||this instanceof ih))return Bv(g,this.objId,this.scope)},set:function(b){b=b.toString(),g=b}});var v=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(v)return this instanceof Ja==0?Bv(v,this.objId,this.scope):v},set:function(b){b=b.toString(),v=this instanceof Ja==0?b.substr(0,1)==="("?Yh(b.substr(1,b.length-2)):Yh(b):b}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ja==1?Yh(v.substr(1,v.length-1)):v},set:function(b){b=b.toString(),v=this instanceof Ja==1?"/"+b:b}});var p=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(p)return p},set:function(b){this.V=b}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(p)return this instanceof Ja==0?Bv(p,this.objId,this.scope):p},set:function(b){b=b.toString(),p=this instanceof Ja==0?b.substr(0,1)==="("?Yh(b.substr(1,b.length-2)):Yh(b):b}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ja==1?Yh(p.substr(1,p.length-1)):p},set:function(b){b=b.toString(),p=this instanceof Ja==1?"/"+b:b}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var y,_=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return _},set:function(b){b=!!b,_=b}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(y)return y},set:function(b){y=b}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,1)},set:function(b){b?this.Ff=la(this.Ff,1):this.Ff=ua(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,2)},set:function(b){b?this.Ff=la(this.Ff,2):this.Ff=ua(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,3)},set:function(b){b?this.Ff=la(this.Ff,3):this.Ff=ua(this.Ff,3)}});var x=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(x!==null)return x},set:function(b){if([0,1,2].indexOf(b)===-1)throw new Error('Invalid value "'+b+'" for attribute Q supplied.');x=b}}),Object.defineProperty(this,"textAlign",{get:function(){var b;switch(x){case 0:default:b="left";break;case 1:b="center";break;case 2:b="right"}return b},configurable:!0,enumerable:!0,set:function(b){switch(b){case"right":case 2:x=2;break;case"center":case 1:x=1;break;default:x=0}}})};Fs(ou,Mu);var od=function(){ou.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(r){t=r}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(r){t=r}});var e=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return nx(e,this.objId,this.scope)},set:function(r){var n,i;i=[],typeof(n=r)=="string"&&(i=function(a,o,s){s||(s=1);for(var u,h=[];u=o.exec(a);)h.push(u[s]);return h}(n,/\((.*?)\)/g)),e=i}}),this.getOptions=function(){return e},this.setOptions=function(r){e=r,this.sort&&e.sort()},this.addOption=function(r){r=(r=r||"").toString(),e.push(r),this.sort&&e.sort()},this.removeOption=function(r,n){for(n=n||!1,r=(r=r||"").toString();e.indexOf(r)!==-1&&(e.splice(e.indexOf(r),1),n!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,18)},set:function(r){r?this.Ff=la(this.Ff,18):this.Ff=ua(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,19)},set:function(r){this.combo===!0&&(r?this.Ff=la(this.Ff,19):this.Ff=ua(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,20)},set:function(r){r?(this.Ff=la(this.Ff,20),e.sort()):this.Ff=ua(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,22)},set:function(r){r?this.Ff=la(this.Ff,22):this.Ff=ua(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,23)},set:function(r){r?this.Ff=la(this.Ff,23):this.Ff=ua(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,27)},set:function(r){r?this.Ff=la(this.Ff,27):this.Ff=ua(this.Ff,27)}}),this.hasAppearanceStream=!1};Fs(od,ou);var sd=function(){od.call(this),this.fontName="helvetica",this.combo=!1};Fs(sd,od);var ld=function(){sd.call(this),this.combo=!0};Fs(ld,sd);var e0=function(){ld.call(this),this.edit=!0};Fs(e0,ld);var Ja=function(){ou.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,15)},set:function(r){r?this.Ff=la(this.Ff,15):this.Ff=ua(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,16)},set:function(r){r?this.Ff=la(this.Ff,16):this.Ff=ua(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,17)},set:function(r){r?this.Ff=la(this.Ff,17):this.Ff=ua(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,26)},set:function(r){r?this.Ff=la(this.Ff,26):this.Ff=ua(this.Ff,26)}});var t,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var r=function(a){return a};if(this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),Object.keys(e).length!==0){var n,i=[];for(n in i.push("<<"),e)i.push("/"+n+" ("+kh(r(e[n]))+")");return i.push(">>"),i.join(`
|
|
519
|
-
`)}},set:function(r){Nn(r)==="object"&&(e=r)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(r){typeof r=="string"&&(e.CA=r)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(r){t=r}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(r){t="/"+r}})};Fs(Ja,ou);var t0=function(){Ja.call(this),this.pushButton=!0};Fs(t0,Ja);var ud=function(){Ja.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e!==void 0?e:[]}})};Fs(ud,Ja);var P0=function(){var t,e;ou.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(i){t=i}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(i){e=i}});var r,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var i=function(s){return s};this.scope&&(i=this.scope.internal.getEncryptor(this.objId));var a,o=[];for(a in o.push("<<"),n)o.push("/"+a+" ("+kh(i(n[a]))+")");return o.push(">>"),o.join(`
|
|
520
|
-
`)},set:function(i){Nn(i)==="object"&&(n=i)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(i){typeof i=="string"&&(n.CA=i)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(i){r=i}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(i){r="/"+i}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Yt.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Fs(P0,ou),ud.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var r=this.Kids[e];r.appearanceStreamContent=t.createAppearanceStream(r.optionName),r.caption=t.getCA()}},ud.prototype.createOption=function(t){var e=new P0;return e.Parent=this,e.optionName=t,this.Kids.push(e),GI.call(this.scope,e),e};var r0=function(){Ja.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Yt.CheckBox.createAppearanceStream()};Fs(r0,Ja);var ih=function(){ou.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,13)},set:function(e){e?this.Ff=la(this.Ff,13):this.Ff=ua(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,21)},set:function(e){e?this.Ff=la(this.Ff,21):this.Ff=ua(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,23)},set:function(e){e?this.Ff=la(this.Ff,23):this.Ff=ua(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,24)},set:function(e){e?this.Ff=la(this.Ff,24):this.Ff=ua(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,25)},set:function(e){e?this.Ff=la(this.Ff,25):this.Ff=ua(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,26)},set:function(e){e?this.Ff=la(this.Ff,26):this.Ff=ua(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Fs(ih,ou);var n0=function(){ih.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!sa(this.Ff,14)},set:function(t){t?this.Ff=la(this.Ff,14):this.Ff=ua(this.Ff,14)}}),this.password=!0};Fs(n0,ih);var Yt={CheckBox:{createAppearanceStream:function(){return{N:{On:Yt.CheckBox.YesNormal},D:{On:Yt.CheckBox.YesPushDown,Off:Yt.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=Lu(t);e.scope=t.scope;var r=[],n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,i=t.scope.__private__.encodeColorString(t.color),a=Rm(t,t.caption);return r.push("0.749023 g"),r.push("0 0 "+Ar(Yt.internal.getWidth(t))+" "+Ar(Yt.internal.getHeight(t))+" re"),r.push("f"),r.push("BMC"),r.push("q"),r.push("0 0 1 rg"),r.push("/"+n+" "+Ar(a.fontSize)+" Tf "+i),r.push("BT"),r.push(a.text),r.push("ET"),r.push("Q"),r.push("EMC"),e.stream=r.join(`
|
|
521
|
-
`),e},YesNormal:function(t){var e=Lu(t);e.scope=t.scope;var r=t.scope.internal.getFont(t.fontName,t.fontStyle).id,n=t.scope.__private__.encodeColorString(t.color),i=[],a=Yt.internal.getHeight(t),o=Yt.internal.getWidth(t),s=Rm(t,t.caption);return i.push("1 g"),i.push("0 0 "+Ar(o)+" "+Ar(a)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+Ar(o-1)+" "+Ar(a-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+r+" "+Ar(s.fontSize)+" Tf "+n),i.push(s.text),i.push("ET"),i.push("Q"),e.stream=i.join(`
|
|
522
|
-
`),e},OffPushDown:function(t){var e=Lu(t);e.scope=t.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+Ar(Yt.internal.getWidth(t))+" "+Ar(Yt.internal.getHeight(t))+" re"),r.push("f"),e.stream=r.join(`
|
|
523
|
-
`),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:Yt.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=Yt.RadioButton.Circle.YesNormal,e.D[t]=Yt.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=Lu(t);e.scope=t.scope;var r=[],n=Yt.internal.getWidth(t)<=Yt.internal.getHeight(t)?Yt.internal.getWidth(t)/4:Yt.internal.getHeight(t)/4;n=Number((.9*n).toFixed(5));var i=Yt.internal.Bezier_C,a=Number((n*i).toFixed(5));return r.push("q"),r.push("1 0 0 1 "+af(Yt.internal.getWidth(t)/2)+" "+af(Yt.internal.getHeight(t)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+a+" "+a+" "+n+" 0 "+n+" c"),r.push("-"+a+" "+n+" -"+n+" "+a+" -"+n+" 0 c"),r.push("-"+n+" -"+a+" -"+a+" -"+n+" 0 -"+n+" c"),r.push(a+" -"+n+" "+n+" -"+a+" "+n+" 0 c"),r.push("f"),r.push("Q"),e.stream=r.join(`
|
|
524
|
-
`),e},YesPushDown:function(t){var e=Lu(t);e.scope=t.scope;var r=[],n=Yt.internal.getWidth(t)<=Yt.internal.getHeight(t)?Yt.internal.getWidth(t)/4:Yt.internal.getHeight(t)/4;n=Number((.9*n).toFixed(5));var i=Number((2*n).toFixed(5)),a=Number((i*Yt.internal.Bezier_C).toFixed(5)),o=Number((n*Yt.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+af(Yt.internal.getWidth(t)/2)+" "+af(Yt.internal.getHeight(t)/2)+" cm"),r.push(i+" 0 m"),r.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),r.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),r.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),r.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),r.push("f"),r.push("Q"),r.push("0 g"),r.push("q"),r.push("1 0 0 1 "+af(Yt.internal.getWidth(t)/2)+" "+af(Yt.internal.getHeight(t)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+o+" "+o+" "+n+" 0 "+n+" c"),r.push("-"+o+" "+n+" -"+n+" "+o+" -"+n+" 0 c"),r.push("-"+n+" -"+o+" -"+o+" -"+n+" 0 -"+n+" c"),r.push(o+" -"+n+" "+n+" -"+o+" "+n+" 0 c"),r.push("f"),r.push("Q"),e.stream=r.join(`
|
|
525
|
-
`),e},OffPushDown:function(t){var e=Lu(t);e.scope=t.scope;var r=[],n=Yt.internal.getWidth(t)<=Yt.internal.getHeight(t)?Yt.internal.getWidth(t)/4:Yt.internal.getHeight(t)/4;n=Number((.9*n).toFixed(5));var i=Number((2*n).toFixed(5)),a=Number((i*Yt.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+af(Yt.internal.getWidth(t)/2)+" "+af(Yt.internal.getHeight(t)/2)+" cm"),r.push(i+" 0 m"),r.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),r.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),r.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),r.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),r.push("f"),r.push("Q"),e.stream=r.join(`
|
|
526
|
-
`),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:Yt.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=Yt.RadioButton.Cross.YesNormal,e.D[t]=Yt.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=Lu(t);e.scope=t.scope;var r=[],n=Yt.internal.calculateCross(t);return r.push("q"),r.push("1 1 "+Ar(Yt.internal.getWidth(t)-2)+" "+Ar(Yt.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(Ar(n.x1.x)+" "+Ar(n.x1.y)+" m"),r.push(Ar(n.x2.x)+" "+Ar(n.x2.y)+" l"),r.push(Ar(n.x4.x)+" "+Ar(n.x4.y)+" m"),r.push(Ar(n.x3.x)+" "+Ar(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join(`
|
|
527
|
-
`),e},YesPushDown:function(t){var e=Lu(t);e.scope=t.scope;var r=Yt.internal.calculateCross(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+Ar(Yt.internal.getWidth(t))+" "+Ar(Yt.internal.getHeight(t))+" re"),n.push("f"),n.push("q"),n.push("1 1 "+Ar(Yt.internal.getWidth(t)-2)+" "+Ar(Yt.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(Ar(r.x1.x)+" "+Ar(r.x1.y)+" m"),n.push(Ar(r.x2.x)+" "+Ar(r.x2.y)+" l"),n.push(Ar(r.x4.x)+" "+Ar(r.x4.y)+" m"),n.push(Ar(r.x3.x)+" "+Ar(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join(`
|
|
528
|
-
`),e},OffPushDown:function(t){var e=Lu(t);e.scope=t.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+Ar(Yt.internal.getWidth(t))+" "+Ar(Yt.internal.getHeight(t))+" re"),r.push("f"),e.stream=r.join(`
|
|
529
|
-
`),e}}},createDefaultAppearanceStream:function(t){var e=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+r}};Yt.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=Yt.internal.getWidth(t),r=Yt.internal.getHeight(t),n=Math.min(e,r);return{x1:{x:(e-n)/2,y:(r-n)/2+n},x2:{x:(e-n)/2+n,y:(r-n)/2},x3:{x:(e-n)/2,y:(r-n)/2},x4:{x:(e-n)/2+n,y:(r-n)/2+n}}}},Yt.internal.getWidth=function(t){var e=0;return Nn(t)==="object"&&(e=Lw(t.Rect[2])),e},Yt.internal.getHeight=function(t){var e=0;return Nn(t)==="object"&&(e=Lw(t.Rect[3])),e};var GI=Vi.addField=function(t){if($I(this,t),!(t instanceof ou))throw new Error("Invalid argument passed to jsPDF.addField.");var e;return(e=t).scope.internal.acroformPlugin.printedOut&&(e.scope.internal.acroformPlugin.printedOut=!1,e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};Vi.AcroFormChoiceField=od,Vi.AcroFormListBox=sd,Vi.AcroFormComboBox=ld,Vi.AcroFormEditBox=e0,Vi.AcroFormButton=Ja,Vi.AcroFormPushButton=t0,Vi.AcroFormRadioButton=ud,Vi.AcroFormCheckBox=r0,Vi.AcroFormTextField=ih,Vi.AcroFormPasswordField=n0,Vi.AcroFormAppearance=Yt,Vi.AcroForm={ChoiceField:od,ListBox:sd,ComboBox:ld,EditBox:e0,Button:Ja,PushButton:t0,RadioButton:ud,CheckBox:r0,TextField:ih,PasswordField:n0,Appearance:Yt},tr.AcroForm={ChoiceField:od,ListBox:sd,ComboBox:ld,EditBox:e0,Button:Ja,PushButton:t0,RadioButton:ud,CheckBox:r0,TextField:ih,PasswordField:n0,Appearance:Yt};tr.AcroForm;function ox(t){return t.reduce(function(e,r,n){return e[r]=n,e},{})}(function(t){var e="addImage_";t.__addimage__={};var r="UNKNOWN",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},i=t.__addimage__.getImageFileTypeByImageData=function(T,L){var $,q,J,ae,ie,Z=r;if((L=L||r)==="RGBA"||T.data!==void 0&&T.data instanceof Uint8ClampedArray&&"height"in T&&"width"in T)return"RGBA";if(I(T))for(ie in n)for(J=n[ie],$=0;$<J.length;$+=1){for(ae=!0,q=0;q<J[$].length;q+=1)if(J[$][q]!==void 0&&J[$][q]!==T[q]){ae=!1;break}if(ae===!0){Z=ie;break}}else for(ie in n)for(J=n[ie],$=0;$<J.length;$+=1){for(ae=!0,q=0;q<J[$].length;q+=1)if(J[$][q]!==void 0&&J[$][q]!==T.charCodeAt(q)){ae=!1;break}if(ae===!0){Z=ie;break}}return Z===r&&L!==r&&(Z=L),Z},a=function T(L){for(var $=this.internal.write,q=this.internal.putStream,J=(0,this.internal.getFilters)();J.indexOf("FlateEncode")!==-1;)J.splice(J.indexOf("FlateEncode"),1);L.objectId=this.internal.newObject();var ae=[];if(ae.push({key:"Type",value:"/XObject"}),ae.push({key:"Subtype",value:"/Image"}),ae.push({key:"Width",value:L.width}),ae.push({key:"Height",value:L.height}),L.colorSpace===b.INDEXED?ae.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]"}):(ae.push({key:"ColorSpace",value:"/"+L.colorSpace}),L.colorSpace===b.DEVICE_CMYK&&ae.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),ae.push({key:"BitsPerComponent",value:L.bitsPerComponent}),"decodeParameters"in L&&L.decodeParameters!==void 0&&ae.push({key:"DecodeParms",value:"<<"+L.decodeParameters+">>"}),"transparency"in L&&Array.isArray(L.transparency)&&L.transparency.length>0){for(var ie="",Z=0,te=L.transparency.length;Z<te;Z++)ie+=L.transparency[Z]+" "+L.transparency[Z]+" ";ae.push({key:"Mask",value:"["+ie+"]"})}L.sMask!==void 0&&ae.push({key:"SMask",value:L.objectId+1+" 0 R"});var V=L.filter!==void 0?["/"+L.filter]:void 0;if(q({data:L.data,additionalKeyValues:ae,alreadyAppliedFilters:V,objectId:L.objectId}),$("endobj"),"sMask"in L&&L.sMask!==void 0){var B,D=(B=L.sMaskBitsPerComponent)!==null&&B!==void 0?B:L.bitsPerComponent,U={width:L.width,height:L.height,colorSpace:"DeviceGray",bitsPerComponent:D,data:L.sMask};"filter"in L&&(U.decodeParameters="/Predictor ".concat(L.predictor," /Colors 1 /BitsPerComponent ").concat(D," /Columns ").concat(L.width),U.filter=L.filter),T.call(this,U)}if(L.colorSpace===b.INDEXED){var X=this.internal.newObject();q({data:M(new Uint8Array(L.palette)),objectId:X}),$("endobj")}},o=function(){var T=this.internal.collections[e+"images"];for(var L in T)a.call(this,T[L])},s=function(){var T,L=this.internal.collections[e+"images"],$=this.internal.write;for(var q in L)$("/I"+(T=L[q]).index,T.objectId,"0","R")},u=function(){this.internal.collections[e+"images"]||(this.internal.collections[e+"images"]={},this.internal.events.subscribe("putResources",o),this.internal.events.subscribe("putXobjectDict",s))},h=function(){var T=this.internal.collections[e+"images"];return u.call(this),T},f=function(){return Object.keys(this.internal.collections[e+"images"]).length},g=function(T){return typeof t["process"+T.toUpperCase()]=="function"},v=function(T){return Nn(T)==="object"&&T.nodeType===1},p=function(T,L){if(T.nodeName==="IMG"&&T.hasAttribute("src")){var $=""+T.getAttribute("src");if($.indexOf("data:image/")===0)return J1(unescape($).split("base64,").pop());var q=t.loadFile($,!0);if(q!==void 0)return q}if(T.nodeName==="CANVAS"){if(T.width===0||T.height===0)throw new Error("Given canvas must have data. Canvas width: "+T.width+", height: "+T.height);var J;switch(L){case"PNG":J="image/png";break;case"WEBP":J="image/webp";break;default:J="image/jpeg"}return J1(T.toDataURL(J,1).split("base64,").pop())}},y=function(T){var L=this.internal.collections[e+"images"];if(L){for(var $ in L)if(T===L[$].alias)return L[$]}},_=function(T,L,$){return T||L||(T=-96,L=-96),T<0&&(T=-1*$.width*72/T/this.internal.scaleFactor),L<0&&(L=-1*$.height*72/L/this.internal.scaleFactor),T===0&&(T=L*$.width/$.height),L===0&&(L=T*$.height/$.width),[T,L]},x=function(T,L,$,q,J,ae){var ie=_.call(this,$,q,J),Z=this.internal.getCoordinateString,te=this.internal.getVerticalCoordinateString,V=h.call(this);if($=ie[0],q=ie[1],V[J.index]=J,ae){ae*=Math.PI/180;var B=Math.cos(ae),D=Math.sin(ae),U=function(ee){return ee.toFixed(4)},X=[U(B),U(D),U(-1*D),U(B),0,0,"cm"]}this.internal.write("q"),ae?(this.internal.write([1,"0","0",1,Z(T),te(L+q),"cm"].join(" ")),this.internal.write(X.join(" ")),this.internal.write([Z($),"0","0",Z(q),"0","0","cm"].join(" "))):this.internal.write([Z($),"0","0",Z(q),Z(T),te(L+q),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+J.index+" Do"),this.internal.write("Q")},b=t.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};t.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var E=t.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},A=t.__addimage__.sHashCode=function(T){var L,$,q=0;if(typeof T=="string")for($=T.length,L=0;L<$;L++)q=(q<<5)-q+T.charCodeAt(L),q|=0;else if(I(T))for($=T.byteLength/2,L=0;L<$;L++)q=(q<<5)-q+T[L],q|=0;return q},S=t.__addimage__.validateStringAsBase64=function(T){(T=T||"").toString().trim();var L=!0;return T.length===0&&(L=!1),T.length%4!=0&&(L=!1),/^[A-Za-z0-9+/]+$/.test(T.substr(0,T.length-2))===!1&&(L=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(T.substr(-2))===!1&&(L=!1),L},k=t.__addimage__.extractImageFromDataUrl=function(T){if(T==null||!(T=T.trim()).startsWith("data:"))return null;var L=T.indexOf(",");return L<0?null:T.substring(0,L).trim().endsWith("base64")?T.substring(L+1):null};t.__addimage__.isArrayBuffer=function(T){return T instanceof ArrayBuffer};var I=t.__addimage__.isArrayBufferView=function(T){return T instanceof Int8Array||T instanceof Uint8Array||T instanceof Uint8ClampedArray||T instanceof Int16Array||T instanceof Uint16Array||T instanceof Int32Array||T instanceof Uint32Array||T instanceof Float32Array||T instanceof Float64Array},O=t.__addimage__.binaryStringToUint8Array=function(T){for(var L=T.length,$=new Uint8Array(L),q=0;q<L;q++)$[q]=T.charCodeAt(q);return $},M=t.__addimage__.arrayBufferToBinaryString=function(T){for(var L="",$=I(T)?T:new Uint8Array(T),q=0;q<$.length;q+=8192)L+=String.fromCharCode.apply(null,$.subarray(q,q+8192));return L};t.addImage=function(){var T,L,$,q,J,ae,ie,Z,te;if(typeof arguments[1]=="number"?(L=r,$=arguments[1],q=arguments[2],J=arguments[3],ae=arguments[4],ie=arguments[5],Z=arguments[6],te=arguments[7]):(L=arguments[1],$=arguments[2],q=arguments[3],J=arguments[4],ae=arguments[5],ie=arguments[6],Z=arguments[7],te=arguments[8]),Nn(T=arguments[0])==="object"&&!v(T)&&"imageData"in T){var V=T;T=V.imageData,L=V.format||L||r,$=V.x||$||0,q=V.y||q||0,J=V.w||V.width||J,ae=V.h||V.height||ae,ie=V.alias||ie,Z=V.compression||Z,te=V.rotation||V.angle||te}var B=this.internal.getFilters();if(Z===void 0&&B.indexOf("FlateEncode")!==-1&&(Z="SLOW"),isNaN($)||isNaN(q))throw new Error("Invalid coordinates passed to jsPDF.addImage");u.call(this);var D=F.call(this,T,L,ie,Z);return x.call(this,$,q,J,ae,D,te),this};var F=function(T,L,$,q){var J,ae,ie;if(typeof T=="string"&&i(T)===r){T=unescape(T);var Z=j(T,!1);(Z!==""||(Z=t.loadFile(T,!0))!==void 0)&&(T=Z)}if(v(T)&&(T=p(T,L)),L=i(T,L),!g(L))throw new Error("addImage does not support files of type '"+L+"', please ensure that a plugin for '"+L+"' support is added.");if(((ie=$)==null||ie.length===0)&&($=function(te){return typeof te=="string"||I(te)?A(te):I(te.data)?A(te.data):null}(T)),(J=y.call(this,$))||(T instanceof Uint8Array||L==="RGBA"||(ae=T,T=O(T)),J=this["process"+L.toUpperCase()](T,f.call(this),$,function(te){return te&&typeof te=="string"&&(te=te.toUpperCase()),te in t.image_compression?te:E.NONE}(q),ae)),!J)throw new Error("An unknown error occurred whilst processing the image.");return J},j=t.__addimage__.convertBase64ToBinaryString=function(T,L){L=typeof L!="boolean"||L;var $,q="";if(typeof T=="string"){var J;$=(J=k(T))!==null&&J!==void 0?J:T;try{q=J1($)}catch(ae){if(L)throw S($)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+ae.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return q};t.getImageProperties=function(T){var L,$,q="";if(v(T)&&(T=p(T)),typeof T=="string"&&i(T)===r&&((q=j(T,!1))===""&&(q=t.loadFile(T)||""),T=q),$=i(T),!g($))throw new Error("addImage does not support files of type '"+$+"', please ensure that a plugin for '"+$+"' support is added.");if(T instanceof Uint8Array||(T=O(T)),!(L=this["process"+$.toUpperCase()](T)))throw new Error("An unknown error occurred whilst processing the image");return L.fileType=$,L}})(tr.API),function(t){var e=function(r){if(r!==void 0&&r!="")return!0};tr.API.events.push(["addPage",function(r){this.internal.getPageInfo(r.pageNumber).pageContext.annotations=[]}]),t.events.push(["putPage",function(r){for(var n,i,a,o=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString,u=this.internal.getPageInfoByObjId(r.objId),h=r.pageContext.annotations,f=!1,g=0;g<h.length&&!f;g++)switch((n=h[g]).type){case"link":(e(n.options.url)||e(n.options.pageNumber))&&(f=!0);break;case"reference":case"text":case"freetext":f=!0}if(f!=0){this.internal.write("/Annots [");for(var v=0;v<h.length;v++){n=h[v];var p=this.internal.pdfEscape,y=this.internal.getEncryptor(r.objId);switch(n.type){case"reference":this.internal.write(" "+n.object.objId+" 0 R ");break;case"text":var _=this.internal.newAdditionalObject(),x=this.internal.newAdditionalObject(),b=this.internal.getEncryptor(_.objId),E=n.title||"Note";a="<</Type /Annot /Subtype /Text "+(i="/Rect ["+o(n.bounds.x)+" "+s(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y)+"] ")+"/Contents ("+p(b(n.contents))+")",a+=" /Popup "+x.objId+" 0 R",a+=" /P "+u.objId+" 0 R",a+=" /T ("+p(b(E))+") >>",_.content=a;var A=_.objId+" 0 R";a="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+o(n.bounds.x+30)+" "+s(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w+30)+" "+s(n.bounds.y)+"] ")+" /Parent "+A,n.open&&(a+=" /Open true"),a+=" >>",x.content=a,this.internal.write(_.objId,"0 R",x.objId,"0 R");break;case"freetext":i="/Rect ["+o(n.bounds.x)+" "+s(n.bounds.y)+" "+o(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y+n.bounds.h)+"] ";var S=n.color||"#000000";a="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+p(y(n.contents))+")",a+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+S+")",a+=" /Border [0 0 0]",a+=" >>",this.internal.write(a);break;case"link":if(n.options.name){var k=this.annotations._nameMap[n.options.name];n.options.pageNumber=k.page,n.options.top=k.y}else n.options.top||(n.options.top=0);if(i="/Rect ["+n.finalBounds.x+" "+n.finalBounds.y+" "+n.finalBounds.w+" "+n.finalBounds.h+"] ",a="",n.options.url)a="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+p(y(n.options.url))+") >>";else if(n.options.pageNumber)switch(a="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(n.options.pageNumber).objId+" 0 R",n.options.magFactor=n.options.magFactor||"XYZ",n.options.magFactor){case"Fit":a+=" /Fit]";break;case"FitH":a+=" /FitH "+n.options.top+"]";break;case"FitV":n.options.left=n.options.left||0,a+=" /FitV "+n.options.left+"]";break;default:var I=s(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),a+=" /XYZ "+n.options.left+" "+I+" "+n.options.zoom+"]"}a!=""&&(a+=" >>",this.internal.write(a))}}this.internal.write("]")}}]),t.createAnnotation=function(r){var n=this.internal.getCurrentPageInfo();switch(r.type){case"link":this.link(r.bounds.x,r.bounds.y,r.bounds.w,r.bounds.h,r);break;case"text":case"freetext":n.pageContext.annotations.push(r)}},t.link=function(r,n,i,a,o){var s=this.internal.getCurrentPageInfo(),u=this.internal.getCoordinateString,h=this.internal.getVerticalCoordinateString;s.pageContext.annotations.push({finalBounds:{x:u(r),y:h(n),w:u(r+i),h:h(n+a)},options:o,type:"link"})},t.textWithLink=function(r,n,i,a){var o,s,u=this.getTextWidth(r),h=this.internal.getLineHeight()/this.internal.scaleFactor;if(a.maxWidth!==void 0){s=a.maxWidth;var f=this.splitTextToSize(r,s).length;o=Math.ceil(h*f)}else s=u,o=h;return this.text(r,n,i,a),i+=.2*h,a.align==="center"&&(n-=u/2),a.align==="right"&&(n-=u),this.link(n,i-h,s,o,a),u},t.getTextWidth=function(r){var n=this.internal.getFontSize();return this.getStringUnitWidth(r)*n/this.internal.scaleFactor}}(tr.API),function(t){var e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},r={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},n={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];t.__arabicParser__={};var a=t.__arabicParser__.isInArabicSubstitutionA=function(_){return e[_.charCodeAt(0)]!==void 0},o=t.__arabicParser__.isArabicLetter=function(_){return typeof _=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(_)},s=t.__arabicParser__.isArabicEndLetter=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length<=2},u=t.__arabicParser__.isArabicAlfLetter=function(_){return o(_)&&i.indexOf(_.charCodeAt(0))>=0};t.__arabicParser__.arabicLetterHasIsolatedForm=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length>=1};var h=t.__arabicParser__.arabicLetterHasFinalForm=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length>=2};t.__arabicParser__.arabicLetterHasInitialForm=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length>=3};var f=t.__arabicParser__.arabicLetterHasMedialForm=function(_){return o(_)&&a(_)&&e[_.charCodeAt(0)].length==4},g=t.__arabicParser__.resolveLigatures=function(_){var x=0,b=r,E="",A=0;for(x=0;x<_.length;x+=1)b[_.charCodeAt(x)]!==void 0?(A++,typeof(b=b[_.charCodeAt(x)])=="number"&&(E+=String.fromCharCode(b),b=r,A=0),x===_.length-1&&(b=r,E+=_.charAt(x-(A-1)),x-=A-1,A=0)):(b=r,E+=_.charAt(x-A),x-=A,A=0);return E};t.__arabicParser__.isArabicDiacritic=function(_){return _!==void 0&&n[_.charCodeAt(0)]!==void 0};var v=t.__arabicParser__.getCorrectForm=function(_,x,b){return o(_)?a(_)===!1?-1:!h(_)||!o(x)&&!o(b)||!o(b)&&s(x)||s(_)&&!o(x)||s(_)&&u(x)||s(_)&&s(x)?0:f(_)&&o(x)&&!s(x)&&o(b)&&h(b)?3:s(_)||!o(b)?1:2:-1},p=function(_){var x=0,b=0,E=0,A="",S="",k="",I=(_=_||"").split("\\s+"),O=[];for(x=0;x<I.length;x+=1){for(O.push(""),b=0;b<I[x].length;b+=1)A=I[x][b],S=I[x][b-1],k=I[x][b+1],o(A)?(E=v(A,S,k),O[x]+=E!==-1?String.fromCharCode(e[A.charCodeAt(0)][E]):A):O[x]+=A;O[x]=g(O[x])}return O.join(" ")},y=t.__arabicParser__.processArabic=t.processArabic=function(){var _,x=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,b=[];if(Array.isArray(x)){var E=0;for(b=[],E=0;E<x.length;E+=1)Array.isArray(x[E])?b.push([p(x[E][0]),x[E][1],x[E][2]]):b.push([p(x[E])]);_=b}else _=p(x);return typeof arguments[0]=="string"?_:(arguments[0].text=_,arguments[0])};t.events.push(["preProcessText",y])}(tr.API),tr.API.autoPrint=function(t){var e;return(t=t||{}).variant=t.variant||"non-conform",t.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})),this},function(t){var e=function(){var r=void 0;Object.defineProperty(this,"pdf",{get:function(){return r},set:function(s){r=s}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(s){n=isNaN(s)||Number.isInteger(s)===!1||s<0?150:s,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(s){i=isNaN(s)||Number.isInteger(s)===!1||s<0?300:s,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var a=[];Object.defineProperty(this,"childNodes",{get:function(){return a},set:function(s){a=s}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(s){o=s}}),Object.defineProperty(this,"parentNode",{})};e.prototype.getContext=function(r,n){var i;if((r=r||"2d")!=="2d")return null;for(i in n)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=n[i]);return this.pdf.context2d._canvas=this,this.pdf.context2d},e.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},t.events.push(["initialized",function(){this.canvas=new e,this.canvas.pdf=this}])}(tr.API),function(t){var e={left:0,top:0,bottom:0,right:0},r=!1,n=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},e),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new a,this.internal.__cell__.pages=1},a=function(){var u=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return u},set:function(_){u=_}});var h=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return h},set:function(_){h=_}});var f=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return f},set:function(_){f=_}});var g=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return g},set:function(_){g=_}});var v=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return v},set:function(_){v=_}});var p=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return p},set:function(_){p=_}});var y=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return y},set:function(_){y=_}}),this};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},a.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},t.setHeaderFunction=function(u){return n.call(this),this.internal.__cell__.headerFunction=typeof u=="function"?u:void 0,this},t.getTextDimensions=function(u,h){n.call(this);var f=(h=h||{}).fontSize||this.getFontSize(),g=h.font||this.getFont(),v=h.scaleFactor||this.internal.scaleFactor,p=0,y=0,_=0,x=this;if(!Array.isArray(u)&&typeof u!="string"){if(typeof u!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");u=String(u)}var b=h.maxWidth;b>0?typeof u=="string"?u=this.splitTextToSize(u,b):Object.prototype.toString.call(u)==="[object Array]"&&(u=u.reduce(function(A,S){return A.concat(x.splitTextToSize(S,b))},[])):u=Array.isArray(u)?u:[u];for(var E=0;E<u.length;E++)p<(_=this.getStringUnitWidth(u[E],{font:g})*f)&&(p=_);return p!==0&&(y=u.length),{w:p/=v,h:Math.max((y*f*this.getLineHeightFactor()-f*(this.getLineHeightFactor()-1))/v,0)}},t.cellAddPage=function(){n.call(this),this.addPage();var u=this.internal.__cell__.margins||e;return this.internal.__cell__.lastCell=new a(u.left,u.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var o=t.cell=function(){var u;u=arguments[0]instanceof a?arguments[0]:new a(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),n.call(this);var h=this.internal.__cell__.lastCell,f=this.internal.__cell__.padding,g=this.internal.__cell__.margins||e,v=this.internal.__cell__.tableHeaderRow,p=this.internal.__cell__.printHeaders;return h.lineNumber!==void 0&&(h.lineNumber===u.lineNumber?(u.x=(h.x||0)+(h.width||0),u.y=h.y||0):h.y+h.height+u.height+g.bottom>this.getPageHeight()?(this.cellAddPage(),u.y=g.top,p&&v&&(this.printHeaderRow(u.lineNumber,!0),u.y+=v[0].height)):u.y=h.y+h.height||u.y),u.text[0]!==void 0&&(this.rect(u.x,u.y,u.width,u.height,r===!0?"FD":void 0),u.align==="right"?this.text(u.text,u.x+u.width-f,u.y+f,{align:"right",baseline:"top"}):u.align==="center"?this.text(u.text,u.x+u.width/2,u.y+f,{align:"center",baseline:"top",maxWidth:u.width-f-f}):this.text(u.text,u.x+f,u.y+f,{align:"left",baseline:"top",maxWidth:u.width-f-f})),this.internal.__cell__.lastCell=u,this};t.table=function(u,h,f,g,v){if(n.call(this),!f)throw new Error("No data for PDF table.");var p,y,_,x,b=[],E=[],A=[],S={},k={},I=[],O=[],M=(v=v||{}).autoSize||!1,F=v.printHeaders!==!1,j=v.css&&v.css["font-size"]!==void 0?16*v.css["font-size"]:v.fontSize||12,T=v.margins||Object.assign({width:this.getPageWidth()},e),L=typeof v.padding=="number"?v.padding:3,$=v.headerBackgroundColor||"#c8c8c8",q=v.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=F,this.internal.__cell__.margins=T,this.internal.__cell__.table_font_size=j,this.internal.__cell__.padding=L,this.internal.__cell__.headerBackgroundColor=$,this.internal.__cell__.headerTextColor=q,this.setFontSize(j),g==null)E=b=Object.keys(f[0]),A=b.map(function(){return"left"});else if(Array.isArray(g)&&Nn(g[0])==="object")for(b=g.map(function(V){return V.name}),E=g.map(function(V){return V.prompt||V.name||""}),A=g.map(function(V){return V.align||"left"}),p=0;p<g.length;p+=1)k[g[p].name]=.7499990551181103*g[p].width;else Array.isArray(g)&&typeof g[0]=="string"&&(E=b=g,A=b.map(function(){return"left"}));if(M||Array.isArray(g)&&typeof g[0]=="string")for(p=0;p<b.length;p+=1){for(S[x=b[p]]=f.map(function(V){return V[x]}),this.setFont(void 0,"bold"),I.push(this.getTextDimensions(E[p],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),y=S[x],this.setFont(void 0,"normal"),_=0;_<y.length;_+=1)I.push(this.getTextDimensions(y[_],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);k[x]=Math.max.apply(null,I)+L+L,I=[]}if(F){var J={};for(p=0;p<b.length;p+=1)J[b[p]]={},J[b[p]].text=E[p],J[b[p]].align=A[p];var ae=s.call(this,J,k);O=b.map(function(V){return new a(u,h,k[V],ae,J[V].text,void 0,J[V].align)}),this.setTableHeaderRow(O),this.printHeaderRow(1,!1)}var ie=g.reduce(function(V,B){return V[B.name]=B.align,V},{});for(p=0;p<f.length;p+=1){"rowStart"in v&&v.rowStart instanceof Function&&v.rowStart({row:p,data:f[p]},this);var Z=s.call(this,f[p],k);for(_=0;_<b.length;_+=1){var te=f[p][b[_]];"cellStart"in v&&v.cellStart instanceof Function&&v.cellStart({row:p,col:_,data:te},this),o.call(this,new a(u,h,k[b[_]],Z,te,p+2,ie[b[_]]))}}return this.internal.__cell__.table_x=u,this.internal.__cell__.table_y=h,this};var s=function(u,h){var f=this.internal.__cell__.padding,g=this.internal.__cell__.table_font_size,v=this.internal.scaleFactor;return Object.keys(u).map(function(p){var y=u[p];return this.splitTextToSize(y.hasOwnProperty("text")?y.text:y,h[p]-f-f)},this).map(function(p){return this.getLineHeightFactor()*p.length*g/v+f+f},this).reduce(function(p,y){return Math.max(p,y)},0)};t.setTableHeaderRow=function(u){n.call(this),this.internal.__cell__.tableHeaderRow=u},t.printHeaderRow=function(u,h){if(n.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var f;if(r=!0,typeof this.internal.__cell__.headerFunction=="function"){var g=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new a(g[0],g[1],g[2],g[3],void 0,-1)}this.setFont(void 0,"bold");for(var v=[],p=0;p<this.internal.__cell__.tableHeaderRow.length;p+=1){f=this.internal.__cell__.tableHeaderRow[p].clone(),h&&(f.y=this.internal.__cell__.margins.top||0,v.push(f)),f.lineNumber=u;var y=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),o.call(this,f),this.setTextColor(y)}v.length>0&&this.setTableHeaderRow(v),this.setFont(void 0,"normal"),r=!1}}(tr.API);var sx={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},lx=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Mm=ox(lx),ux=[100,200,300,400,500,600,700,800,900],WI=ox(ux);function zv(t){var e=t.family.replace(/"|'/g,"").toLowerCase(),r=function(a){return sx[a=a||"normal"]?a:"normal"}(t.style),n=function(a){return a?typeof a=="number"?a>=100&&a<=900&&a%100==0?a:400:/^\d00$/.test(a)?parseInt(a):a==="bold"?700:400:400}(t.weight),i=function(a){return typeof Mm[a=a||"normal"]=="number"?a:"normal"}(t.stretch);return{family:e,style:r,weight:n,stretch:i,src:t.src||[],ref:t.ref||{name:e,style:[i,r,n].join(" ")}}}function Nw(t,e,r,n){var i;for(i=r;i>=0&&i<e.length;i+=n)if(t[e[i]])return t[e[i]];for(i=r;i>=0&&i<e.length;i-=n)if(t[e[i]])return t[e[i]]}var VI={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Tw={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Rw(t){return[t.stretch,t.style,t.weight,t.family].join(" ")}function Mw(t){return t.trimLeft()}function YI(t,e){for(var r=0;r<t.length;){if(t.charAt(r)===e)return[t.substring(0,r),t.substring(r+1)];r+=1}return null}function XI(t){var e=t.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return e===null?null:[e[0],t.substring(e[0].length)]}var z1,Iw,jw,Xh,q1,Dw,Fw,Bw,qv=["times"];function zw(t,e,r,n,i){var a=4,o=Uw;switch(i){case tr.API.image_compression.FAST:a=1,o=qw;break;case tr.API.image_compression.MEDIUM:a=6,o=Hw;break;case tr.API.image_compression.SLOW:a=9,o=$w}t=function(u,h,f,g){for(var v,p=u.length/h,y=new Uint8Array(u.length+p),_=[KI,qw,Uw,Hw,$w],x=0;x<p;x+=1){var b=x*h,E=u.subarray(b,b+h);if(g)y.set(g(E,f,v),b+x);else{for(var A=_.length,S=[],k=0;k<A;k+=1)S[k]=_[k](E,f,v);var I=QI(S.concat());y.set(S[I],b+x)}v=E}return y}(t,e,Math.ceil(r*n/8),o);var s=Pm(t,{level:a});return tr.API.__addimage__.arrayBufferToBinaryString(s)}function KI(t){var e=Array.apply([],t);return e.unshift(0),e}function qw(t,e){var r=t.length,n=[];n[0]=1;for(var i=0;i<r;i+=1){var a=t[i-e]||0;n[i+1]=t[i]-a+256&255}return n}function Uw(t,e,r){var n=t.length,i=[];i[0]=2;for(var a=0;a<n;a+=1){var o=r&&r[a]||0;i[a+1]=t[a]-o+256&255}return i}function Hw(t,e,r){var n=t.length,i=[];i[0]=3;for(var a=0;a<n;a+=1){var o=t[a-e]||0,s=r&&r[a]||0;i[a+1]=t[a]+256-(o+s>>>1)&255}return i}function $w(t,e,r){var n=t.length,i=[];i[0]=4;for(var a=0;a<n;a+=1){var o=ZI(t[a-e]||0,r&&r[a]||0,r&&r[a-e]||0);i[a+1]=t[a]-o+256&255}return i}function ZI(t,e,r){if(t===e&&e===r)return t;var n=Math.abs(e-r),i=Math.abs(t-r),a=Math.abs(t+e-r-r);return n<=i&&n<=a?t:i<=a?e:r}function QI(t){var e=t.map(function(r){return r.reduce(function(n,i){return n+Math.abs(i)},0)});return e.indexOf(Math.min.apply(null,e))}function Uv(t,e,r){var n=e*r,i=Math.floor(n/8),a=16-(n-8*i+r),o=(1<<r)-1;return cx(t,i)>>a&o}function Gw(t,e,r,n){var i=r*n,a=Math.floor(i/8),o=16-(i-8*a+n),s=(1<<n)-1,u=(e&s)<<o;(function(h,f,g){if(f+1<h.byteLength)h.setUint16(f,g,!1);else{var v=g>>8&255;h.setUint8(f,v)}})(t,a,cx(t,a)&~(s<<o)&65535|u)}function cx(t,e){return e+1<t.byteLength?t.getUint16(e,!1):t.getUint8(e)<<8}function JI(t){var e=0;if(t[e++]!==71||t[e++]!==73||t[e++]!==70||t[e++]!==56||(t[e++]+1&253)!=56||t[e++]!==97)throw new Error("Invalid GIF 87a/89a header.");var r=t[e++]|t[e++]<<8,n=t[e++]|t[e++]<<8,i=t[e++],a=i>>7,o=1<<1+(7&i);t[e++],t[e++];var s=null,u=null;a&&(s=e,u=o,e+=3*o);var h=!0,f=[],g=0,v=null,p=0,y=null;for(this.width=r,this.height=n;h&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(t[e]!==11||t[e+1]==78&&t[e+2]==69&&t[e+3]==84&&t[e+4]==83&&t[e+5]==67&&t[e+6]==65&&t[e+7]==80&&t[e+8]==69&&t[e+9]==50&&t[e+10]==46&&t[e+11]==48&&t[e+12]==3&&t[e+13]==1&&t[e+16]==0)e+=14,y=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((T=t[e++])>=0))throw Error("Invalid block size");if(T===0)break;e+=T}break;case 249:if(t[e++]!==4||t[e+4]!==0)throw new Error("Invalid graphics extension block.");var _=t[e++];g=t[e++]|t[e++]<<8,v=t[e++],1&_||(v=null),p=_>>2&7,e++;break;case 254:for(;;){if(!((T=t[e++])>=0))throw Error("Invalid block size");if(T===0)break;e+=T}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var x=t[e++]|t[e++]<<8,b=t[e++]|t[e++]<<8,E=t[e++]|t[e++]<<8,A=t[e++]|t[e++]<<8,S=t[e++],k=S>>6&1,I=1<<1+(7&S),O=s,M=u,F=!1;S>>7&&(F=!0,O=e,M=I,e+=3*I);var j=e;for(e++;;){var T;if(!((T=t[e++])>=0))throw Error("Invalid block size");if(T===0)break;e+=T}f.push({x,y:b,width:E,height:A,has_local_palette:F,palette_offset:O,palette_size:M,data_offset:j,data_length:e-j,transparent_index:v,interlaced:!!k,delay:g,disposal:p});break;case 59:h=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return f.length},this.loopCount=function(){return y},this.frameInfo=function(L){if(L<0||L>=f.length)throw new Error("Frame index out of range.");return f[L]},this.decodeAndBlitFrameBGRA=function(L,$){var q=this.frameInfo(L),J=q.width*q.height,ae=new Uint8Array(J);Ww(t,q.data_offset,ae,J);var ie=q.palette_offset,Z=q.transparent_index;Z===null&&(Z=256);var te=q.width,V=r-te,B=te,D=4*(q.y*r+q.x),U=4*((q.y+q.height)*r+q.x),X=D,ee=4*V;q.interlaced===!0&&(ee+=4*r*7);for(var K=8,oe=0,me=ae.length;oe<me;++oe){var de=ae[oe];if(B===0&&(B=te,(X+=ee)>=U&&(ee=4*V+4*r*(K-1),X=D+(te+V)*(K<<1),K>>=1)),de===Z)X+=4;else{var ye=t[ie+3*de],Te=t[ie+3*de+1],Ce=t[ie+3*de+2];$[X++]=Ce,$[X++]=Te,$[X++]=ye,$[X++]=255}--B}},this.decodeAndBlitFrameRGBA=function(L,$){var q=this.frameInfo(L),J=q.width*q.height,ae=new Uint8Array(J);Ww(t,q.data_offset,ae,J);var ie=q.palette_offset,Z=q.transparent_index;Z===null&&(Z=256);var te=q.width,V=r-te,B=te,D=4*(q.y*r+q.x),U=4*((q.y+q.height)*r+q.x),X=D,ee=4*V;q.interlaced===!0&&(ee+=4*r*7);for(var K=8,oe=0,me=ae.length;oe<me;++oe){var de=ae[oe];if(B===0&&(B=te,(X+=ee)>=U&&(ee=4*V+4*r*(K-1),X=D+(te+V)*(K<<1),K>>=1)),de===Z)X+=4;else{var ye=t[ie+3*de],Te=t[ie+3*de+1],Ce=t[ie+3*de+2];$[X++]=ye,$[X++]=Te,$[X++]=Ce,$[X++]=255}--B}}}function Ww(t,e,r,n){for(var i=t[e++],a=1<<i,o=a+1,s=o+1,u=i+1,h=(1<<u)-1,f=0,g=0,v=0,p=t[e++],y=new Int32Array(4096),_=null;;){for(;f<16&&p!==0;)g|=t[e++]<<f,f+=8,p===1?p=t[e++]:--p;if(f<u)break;var x=g&h;if(g>>=u,f-=u,x!==a){if(x===o)break;for(var b=x<s?x:_,E=0,A=b;A>a;)A=y[A]>>8,++E;var S=A;if(v+E+(b!==x?1:0)>n)return void Yn.log("Warning, gif stream longer than expected.");r[v++]=S;var k=v+=E;for(b!==x&&(r[v++]=S),A=b;E--;)A=y[A],r[--k]=255&A,A>>=8;_!==null&&s<4096&&(y[s++]=_<<8|S,s>=h+1&&u<12&&(++u,h=h<<1|1)),_=x}else s=o+1,h=(1<<(u=i+1))-1,_=null}return v!==n&&Yn.log("Warning, gif stream shorter than expected."),r}/**
|
|
530
|
-
* @license
|
|
531
|
-
Copyright (c) 2008, Adobe Systems Incorporated
|
|
532
|
-
All rights reserved.
|
|
533
|
-
|
|
534
|
-
Redistribution and use in source and binary forms, with or without
|
|
535
|
-
modification, are permitted provided that the following conditions are
|
|
536
|
-
met:
|
|
537
|
-
|
|
538
|
-
* Redistributions of source code must retain the above copyright notice,
|
|
539
|
-
this list of conditions and the following disclaimer.
|
|
540
|
-
|
|
541
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
542
|
-
notice, this list of conditions and the following disclaimer in the
|
|
543
|
-
documentation and/or other materials provided with the distribution.
|
|
544
|
-
|
|
545
|
-
* Neither the name of Adobe Systems Incorporated nor the names of its
|
|
546
|
-
contributors may be used to endorse or promote products derived from
|
|
547
|
-
this software without specific prior written permission.
|
|
548
|
-
|
|
549
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
|
550
|
-
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
551
|
-
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
552
|
-
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
553
|
-
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
554
|
-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
555
|
-
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
556
|
-
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
557
|
-
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
558
|
-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
559
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
560
|
-
*/function Hv(t){var e,r,n,i,a,o=Math.floor,s=new Array(64),u=new Array(64),h=new Array(64),f=new Array(64),g=new Array(65535),v=new Array(65535),p=new Array(64),y=new Array(64),_=[],x=0,b=7,E=new Array(64),A=new Array(64),S=new Array(64),k=new Array(256),I=new Array(2048),O=[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],M=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],F=[0,1,2,3,4,5,6,7,8,9,10,11],j=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],T=[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],$=[0,1,2,3,4,5,6,7,8,9,10,11],q=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],J=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function ae(D,U){for(var X=0,ee=0,K=new Array,oe=1;oe<=16;oe++){for(var me=1;me<=D[oe];me++)K[U[ee]]=[],K[U[ee]][0]=X,K[U[ee]][1]=oe,ee++,X++;X*=2}return K}function ie(D){for(var U=D[0],X=D[1]-1;X>=0;)U&1<<X&&(x|=1<<b),X--,--b<0&&(x==255?(Z(255),Z(0)):Z(x),b=7,x=0)}function Z(D){_.push(D)}function te(D){Z(D>>8&255),Z(255&D)}function V(D,U,X,ee,K){for(var oe,me=K[0],de=K[240],ye=function(fe,Le){var Ne,ue,Ae,Pe,Ue,st,dt,pt,xt,bt,kt=0;for(xt=0;xt<8;++xt){Ne=fe[kt],ue=fe[kt+1],Ae=fe[kt+2],Pe=fe[kt+3],Ue=fe[kt+4],st=fe[kt+5],dt=fe[kt+6];var zr=Ne+(pt=fe[kt+7]),_r=Ne-pt,It=ue+dt,Jt=ue-dt,Ve=Ae+st,qe=Ae-st,Nt=Pe+Ue,Ct=Pe-Ue,ir=zr+Nt,Ut=zr-Nt,xr=It+Ve,er=It-Ve;fe[kt]=ir+xr,fe[kt+4]=ir-xr;var pr=.707106781*(er+Ut);fe[kt+2]=Ut+pr,fe[kt+6]=Ut-pr;var Bi=.382683433*((ir=Ct+qe)-(er=Jt+_r)),oi=.5411961*ir+Bi,Ei=1.306562965*er+Bi,Sn=.707106781*(xr=qe+Jt),Qt=_r+Sn,ca=_r-Sn;fe[kt+5]=ca+oi,fe[kt+3]=ca-oi,fe[kt+1]=Qt+Ei,fe[kt+7]=Qt-Ei,kt+=8}for(kt=0,xt=0;xt<8;++xt){Ne=fe[kt],ue=fe[kt+8],Ae=fe[kt+16],Pe=fe[kt+24],Ue=fe[kt+32],st=fe[kt+40],dt=fe[kt+48];var Fa=Ne+(pt=fe[kt+56]),Kn=Ne-pt,Yi=ue+dt,qr=ue-dt,En=Ae+st,Rn=Ae-st,Sa=Pe+Ue,Ho=Pe-Ue,Ea=Fa+Sa,eo=Fa-Sa,si=Yi+En,ka=Yi-En;fe[kt]=Ea+si,fe[kt+32]=Ea-si;var Aa=.707106781*(ka+eo);fe[kt+16]=eo+Aa,fe[kt+48]=eo-Aa;var $o=.382683433*((Ea=Ho+Rn)-(ka=qr+Kn)),zi=.5411961*Ea+$o,to=1.306562965*ka+$o,Bs=.707106781*(si=Rn+qr),is=Kn+Bs,lu=Kn-Bs;fe[kt+40]=lu+zi,fe[kt+24]=lu-zi,fe[kt+8]=is+to,fe[kt+56]=is-to,kt++}for(xt=0;xt<64;++xt)bt=fe[xt]*Le[xt],p[xt]=bt>0?bt+.5|0:bt-.5|0;return p}(D,U),Te=0;Te<64;++Te)y[O[Te]]=ye[Te];var Ce=y[0]-X;X=y[0],Ce==0?ie(ee[0]):(ie(ee[v[oe=32767+Ce]]),ie(g[oe]));for(var Ie=63;Ie>0&&y[Ie]==0;)Ie--;if(Ie==0)return ie(me),X;for(var Ee,ge=1;ge<=Ie;){for(var Re=ge;y[ge]==0&&ge<=Ie;)++ge;var Be=ge-Re;if(Be>=16){Ee=Be>>4;for(var Oe=1;Oe<=Ee;++Oe)ie(de);Be&=15}oe=32767+y[ge],ie(K[(Be<<4)+v[oe]]),ie(g[oe]),ge++}return Ie!=63&&ie(me),X}function B(D){D=Math.min(Math.max(D,1),100),a!=D&&(function(U){for(var X=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],ee=0;ee<64;ee++){var K=o((X[ee]*U+50)/100);K=Math.min(Math.max(K,1),255),s[O[ee]]=K}for(var oe=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],me=0;me<64;me++){var de=o((oe[me]*U+50)/100);de=Math.min(Math.max(de,1),255),u[O[me]]=de}for(var ye=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Te=0,Ce=0;Ce<8;Ce++)for(var Ie=0;Ie<8;Ie++)h[Te]=1/(s[O[Te]]*ye[Ce]*ye[Ie]*8),f[Te]=1/(u[O[Te]]*ye[Ce]*ye[Ie]*8),Te++}(D<50?Math.floor(5e3/D):Math.floor(200-2*D)),a=D)}this.encode=function(D,U){U&&B(U),_=new Array,x=0,b=7,te(65496),te(65504),te(16),Z(74),Z(70),Z(73),Z(70),Z(0),Z(1),Z(1),Z(0),te(1),te(1),Z(0),Z(0),function(){te(65499),te(132),Z(0);for(var ue=0;ue<64;ue++)Z(s[ue]);Z(1);for(var Ae=0;Ae<64;Ae++)Z(u[Ae])}(),function(ue,Ae){te(65472),te(17),Z(8),te(Ae),te(ue),Z(3),Z(1),Z(17),Z(0),Z(2),Z(17),Z(1),Z(3),Z(17),Z(1)}(D.width,D.height),function(){te(65476),te(418),Z(0);for(var ue=0;ue<16;ue++)Z(M[ue+1]);for(var Ae=0;Ae<=11;Ae++)Z(F[Ae]);Z(16);for(var Pe=0;Pe<16;Pe++)Z(j[Pe+1]);for(var Ue=0;Ue<=161;Ue++)Z(T[Ue]);Z(1);for(var st=0;st<16;st++)Z(L[st+1]);for(var dt=0;dt<=11;dt++)Z($[dt]);Z(17);for(var pt=0;pt<16;pt++)Z(q[pt+1]);for(var xt=0;xt<=161;xt++)Z(J[xt])}(),te(65498),te(12),Z(3),Z(1),Z(0),Z(2),Z(17),Z(3),Z(17),Z(0),Z(63),Z(0);var X=0,ee=0,K=0;x=0,b=7,this.encode.displayName="_encode_";for(var oe,me,de,ye,Te,Ce,Ie,Ee,ge,Re=D.data,Be=D.width,Oe=D.height,fe=4*Be,Le=0;Le<Oe;){for(oe=0;oe<fe;){for(Te=fe*Le+oe,Ie=-1,Ee=0,ge=0;ge<64;ge++)Ce=Te+(Ee=ge>>3)*fe+(Ie=4*(7&ge)),Le+Ee>=Oe&&(Ce-=fe*(Le+1+Ee-Oe)),oe+Ie>=fe&&(Ce-=oe+Ie-fe+4),me=Re[Ce++],de=Re[Ce++],ye=Re[Ce++],E[ge]=(I[me]+I[de+256|0]+I[ye+512|0]>>16)-128,A[ge]=(I[me+768|0]+I[de+1024|0]+I[ye+1280|0]>>16)-128,S[ge]=(I[me+1280|0]+I[de+1536|0]+I[ye+1792|0]>>16)-128;X=V(E,h,X,e,n),ee=V(A,f,ee,r,i),K=V(S,f,K,r,i),oe+=32}Le+=8}if(b>=0){var Ne=[];Ne[1]=b+1,Ne[0]=(1<<b+1)-1,ie(Ne)}return te(65497),new Uint8Array(_)},t=t||50,function(){for(var D=String.fromCharCode,U=0;U<256;U++)k[U]=D(U)}(),e=ae(M,F),r=ae(L,$),n=ae(j,T),i=ae(q,J),function(){for(var D=1,U=2,X=1;X<=15;X++){for(var ee=D;ee<U;ee++)v[32767+ee]=X,g[32767+ee]=[],g[32767+ee][1]=X,g[32767+ee][0]=ee;for(var K=-(U-1);K<=-D;K++)v[32767+K]=X,g[32767+K]=[],g[32767+K][1]=X,g[32767+K][0]=U-1+K;D<<=1,U<<=1}}(),function(){for(var D=0;D<256;D++)I[D]=19595*D,I[D+256|0]=38470*D,I[D+512|0]=7471*D+32768,I[D+768|0]=-11059*D,I[D+1024|0]=-21709*D,I[D+1280|0]=32768*D+8421375,I[D+1536|0]=-27439*D,I[D+1792|0]=-5329*D}(),B(t)}/**
|
|
561
|
-
* @license
|
|
562
|
-
* Copyright (c) 2017 Aras Abbasi
|
|
563
|
-
*
|
|
564
|
-
* Licensed under the MIT License.
|
|
565
|
-
* http://opensource.org/licenses/mit-license
|
|
566
|
-
*/function Zl(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function Vw(t){function e(F){if(!F)throw Error("assert :P")}function r(F,j,T){for(var L=0;4>L;L++)if(F[j+L]!=T.charCodeAt(L))return!0;return!1}function n(F,j,T,L,$){for(var q=0;q<$;q++)F[j+q]=T[L+q]}function i(F,j,T,L){for(var $=0;$<L;$++)F[j+$]=T}function a(F){return new Int32Array(F)}function o(F,j){for(var T=[],L=0;L<F;L++)T.push(new j);return T}function s(F,j){var T=[];return function L($,q,J){for(var ae=J[q],ie=0;ie<ae&&($.push(J.length>q+1?[]:new j),!(J.length<q+1));ie++)L($[ie],q+1,J)}(T,0,F),T}var u=function(){var F=this;function j(P,R){for(var Y=1<<R-1>>>0;P&Y;)Y>>>=1;return Y?(P&Y-1)+Y:P}function T(P,R,Y,re,le){e(!(re%Y));do P[R+(re-=Y)]=le;while(0<re)}function L(P,R,Y,re,le){if(e(2328>=le),512>=le)var pe=a(512);else if((pe=a(le))==null)return 0;return function(ve,be,we,Se,Fe,Je){var xe,$e,Qe=be,lt=1<<we,Xe=a(16),ot=a(16);for(e(Fe!=0),e(Se!=null),e(ve!=null),e(0<we),$e=0;$e<Fe;++$e){if(15<Se[$e])return 0;++Xe[Se[$e]]}if(Xe[0]==Fe)return 0;for(ot[1]=0,xe=1;15>xe;++xe){if(Xe[xe]>1<<xe)return 0;ot[xe+1]=ot[xe]+Xe[xe]}for($e=0;$e<Fe;++$e)xe=Se[$e],0<Se[$e]&&(Je[ot[xe]++]=$e);if(ot[15]==1)return(Se=new $).g=0,Se.value=Je[0],T(ve,Qe,1,lt,Se),lt;var He,ft=-1,ht=lt-1,Wt=0,Bt=1,hr=1,zt=1<<we;for($e=0,xe=1,Fe=2;xe<=we;++xe,Fe<<=1){if(Bt+=hr<<=1,0>(hr-=Xe[xe]))return 0;for(;0<Xe[xe];--Xe[xe])(Se=new $).g=xe,Se.value=Je[$e++],T(ve,Qe+Wt,Fe,zt,Se),Wt=j(Wt,xe)}for(xe=we+1,Fe=2;15>=xe;++xe,Fe<<=1){if(Bt+=hr<<=1,0>(hr-=Xe[xe]))return 0;for(;0<Xe[xe];--Xe[xe]){if(Se=new $,(Wt&ht)!=ft){for(Qe+=zt,He=1<<(ft=xe)-we;15>ft&&!(0>=(He-=Xe[ft]));)++ft,He<<=1;lt+=zt=1<<(He=ft-we),ve[be+(ft=Wt&ht)].g=He+we,ve[be+ft].value=Qe-be-ft}Se.g=xe-we,Se.value=Je[$e++],T(ve,Qe+(Wt>>we),Fe,zt,Se),Wt=j(Wt,xe)}}return Bt!=2*ot[15]-1?0:lt}(P,R,Y,re,le,pe)}function $(){this.value=this.g=0}function q(){this.value=this.g=0}function J(){this.G=o(5,$),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(Oi,q)}function ae(P,R,Y,re){e(P!=null),e(R!=null),e(2147483648>re),P.Ca=254,P.I=0,P.b=-8,P.Ka=0,P.oa=R,P.pa=Y,P.Jd=R,P.Yc=Y+re,P.Zc=4<=re?Y+re-4+1:Y,me(P)}function ie(P,R){for(var Y=0;0<R--;)Y|=ye(P,128)<<R;return Y}function Z(P,R){var Y=ie(P,R);return de(P)?-Y:Y}function te(P,R,Y,re){var le,pe=0;for(e(P!=null),e(R!=null),e(4294967288>re),P.Sb=re,P.Ra=0,P.u=0,P.h=0,4<re&&(re=4),le=0;le<re;++le)pe+=R[Y+le]<<8*le;P.Ra=pe,P.bb=re,P.oa=R,P.pa=Y}function V(P){for(;8<=P.u&&P.bb<P.Sb;)P.Ra>>>=8,P.Ra+=P.oa[P.pa+P.bb]<<ha-8>>>0,++P.bb,P.u-=8;ee(P)&&(P.h=1,P.u=0)}function B(P,R){if(e(0<=R),!P.h&&R<=Wa){var Y=X(P)&Na[R];return P.u+=R,V(P),Y}return P.h=1,P.u=0}function D(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function U(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function X(P){return P.Ra>>>(P.u&ha-1)>>>0}function ee(P){return e(P.bb<=P.Sb),P.h||P.bb==P.Sb&&P.u>ha}function K(P,R){P.u=R,P.h=ee(P)}function oe(P){P.u>=Ji&&(e(P.u>=Ji),V(P))}function me(P){e(P!=null&&P.oa!=null),P.pa<P.Zc?(P.I=(P.oa[P.pa++]|P.I<<8)>>>0,P.b+=8):(e(P!=null&&P.oa!=null),P.pa<P.Yc?(P.b+=8,P.I=P.oa[P.pa++]|P.I<<8):P.Ka?P.b=0:(P.I<<=8,P.b+=8,P.Ka=1))}function de(P){return ie(P,1)}function ye(P,R){var Y=P.Ca;0>P.b&&me(P);var re=P.b,le=Y*R>>>8,pe=(P.I>>>re>le)+0;for(pe?(Y-=le,P.I-=le+1<<re>>>0):Y=le+1,re=Y,le=0;256<=re;)le+=8,re>>=8;return re=7^le+No[re],P.b-=re,P.Ca=(Y<<re)-1,pe}function Te(P,R,Y){P[R+0]=Y>>24&255,P[R+1]=Y>>16&255,P[R+2]=Y>>8&255,P[R+3]=255&Y}function Ce(P,R){return P[R+0]|P[R+1]<<8}function Ie(P,R){return Ce(P,R)|P[R+2]<<16}function Ee(P,R){return Ce(P,R)|Ce(P,R+2)<<16}function ge(P,R){var Y=1<<R;return e(P!=null),e(0<R),P.X=a(Y),P.X==null?0:(P.Mb=32-R,P.Xa=R,1)}function Re(P,R){e(P!=null),e(R!=null),e(P.Xa==R.Xa),n(R.X,0,P.X,0,1<<R.Xa)}function Be(){this.X=[],this.Xa=this.Mb=0}function Oe(P,R,Y,re){e(Y!=null),e(re!=null);var le=Y[0],pe=re[0];return le==0&&(le=(P*pe+R/2)/R),pe==0&&(pe=(R*le+P/2)/P),0>=le||0>=pe?0:(Y[0]=le,re[0]=pe,1)}function fe(P,R){return P+(1<<R)-1>>>R}function Le(P,R){return((4278255360&P)+(4278255360&R)>>>0&4278255360)+((16711935&P)+(16711935&R)>>>0&16711935)>>>0}function Ne(P,R){F[R]=function(Y,re,le,pe,ve,be,we){var Se;for(Se=0;Se<ve;++Se){var Fe=F[P](be[we+Se-1],le,pe+Se);be[we+Se]=Le(Y[re+Se],Fe)}}}function ue(){this.ud=this.hd=this.jd=0}function Ae(P,R){return((4278124286&(P^R))>>>1)+(P&R)>>>0}function Pe(P){return 0<=P&&256>P?P:0>P?0:255<P?255:void 0}function Ue(P,R){return Pe(P+(P-R+.5>>1))}function st(P,R,Y){return Math.abs(R-Y)-Math.abs(P-Y)}function dt(P,R,Y,re,le,pe,ve){for(re=pe[ve-1],Y=0;Y<le;++Y)pe[ve+Y]=re=Le(P[R+Y],re)}function pt(P,R,Y,re,le){var pe;for(pe=0;pe<Y;++pe){var ve=P[R+pe],be=ve>>8&255,we=16711935&(we=(we=16711935&ve)+((be<<16)+be));re[le+pe]=(4278255360&ve)+we>>>0}}function xt(P,R){R.jd=255&P,R.hd=P>>8&255,R.ud=P>>16&255}function bt(P,R,Y,re,le,pe){var ve;for(ve=0;ve<re;++ve){var be=R[Y+ve],we=be>>>8,Se=be,Fe=255&(Fe=(Fe=be>>>16)+((P.jd<<24>>24)*(we<<24>>24)>>>5));Se=255&(Se=(Se+=(P.hd<<24>>24)*(we<<24>>24)>>>5)+((P.ud<<24>>24)*(Fe<<24>>24)>>>5)),le[pe+ve]=(4278255360&be)+(Fe<<16)+Se}}function kt(P,R,Y,re,le){F[R]=function(pe,ve,be,we,Se,Fe,Je,xe,$e){for(we=Je;we<xe;++we)for(Je=0;Je<$e;++Je)Se[Fe++]=le(be[re(pe[ve++])])},F[P]=function(pe,ve,be,we,Se,Fe,Je){var xe=8>>pe.b,$e=pe.Ea,Qe=pe.K[0],lt=pe.w;if(8>xe)for(pe=(1<<pe.b)-1,lt=(1<<xe)-1;ve<be;++ve){var Xe,ot=0;for(Xe=0;Xe<$e;++Xe)Xe&pe||(ot=re(we[Se++])),Fe[Je++]=le(Qe[ot<]),ot>>=xe}else F["VP8LMapColor"+Y](we,Se,Qe,lt,Fe,Je,ve,be,$e)}}function zr(P,R,Y,re,le){for(Y=R+Y;R<Y;){var pe=P[R++];re[le++]=pe>>16&255,re[le++]=pe>>8&255,re[le++]=255&pe}}function _r(P,R,Y,re,le){for(Y=R+Y;R<Y;){var pe=P[R++];re[le++]=pe>>16&255,re[le++]=pe>>8&255,re[le++]=255&pe,re[le++]=pe>>24&255}}function It(P,R,Y,re,le){for(Y=R+Y;R<Y;){var pe=(ve=P[R++])>>16&240|ve>>12&15,ve=240&ve|ve>>28&15;re[le++]=pe,re[le++]=ve}}function Jt(P,R,Y,re,le){for(Y=R+Y;R<Y;){var pe=(ve=P[R++])>>16&248|ve>>13&7,ve=ve>>5&224|ve>>3&31;re[le++]=pe,re[le++]=ve}}function Ve(P,R,Y,re,le){for(Y=R+Y;R<Y;){var pe=P[R++];re[le++]=255&pe,re[le++]=pe>>8&255,re[le++]=pe>>16&255}}function qe(P,R,Y,re,le,pe){if(pe==0)for(Y=R+Y;R<Y;)Te(re,((pe=P[R++])[0]>>24|pe[1]>>8&65280|pe[2]<<8&16711680|pe[3]<<24)>>>0),le+=32;else n(re,le,P,R,Y)}function Nt(P,R){F[R][0]=F[P+"0"],F[R][1]=F[P+"1"],F[R][2]=F[P+"2"],F[R][3]=F[P+"3"],F[R][4]=F[P+"4"],F[R][5]=F[P+"5"],F[R][6]=F[P+"6"],F[R][7]=F[P+"7"],F[R][8]=F[P+"8"],F[R][9]=F[P+"9"],F[R][10]=F[P+"10"],F[R][11]=F[P+"11"],F[R][12]=F[P+"12"],F[R][13]=F[P+"13"],F[R][14]=F[P+"0"],F[R][15]=F[P+"0"]}function Ct(P){return P==ql||P==Ws||P==vu||P==mu}function ir(){this.eb=[],this.size=this.A=this.fb=0}function Ut(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function xr(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new ir,this.f.kb=new Ut,this.sd=null}function er(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function pr(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function Bi(P){return alert("todo:WebPSamplerProcessPlane"),P.T}function oi(P,R){var Y=P.T,re=R.ba.f.RGBA,le=re.eb,pe=re.fb+P.ka*re.A,ve=Ra[R.ba.S],be=P.y,we=P.O,Se=P.f,Fe=P.N,Je=P.ea,xe=P.W,$e=R.cc,Qe=R.dc,lt=R.Mc,Xe=R.Nc,ot=P.ka,He=P.ka+P.T,ft=P.U,ht=ft+1>>1;for(ot==0?ve(be,we,null,null,Se,Fe,Je,xe,Se,Fe,Je,xe,le,pe,null,null,ft):(ve(R.ec,R.fc,be,we,$e,Qe,lt,Xe,Se,Fe,Je,xe,le,pe-re.A,le,pe,ft),++Y);ot+2<He;ot+=2)$e=Se,Qe=Fe,lt=Je,Xe=xe,Fe+=P.Rc,xe+=P.Rc,pe+=2*re.A,ve(be,(we+=2*P.fa)-P.fa,be,we,$e,Qe,lt,Xe,Se,Fe,Je,xe,le,pe-re.A,le,pe,ft);return we+=P.fa,P.j+He<P.o?(n(R.ec,R.fc,be,we,ft),n(R.cc,R.dc,Se,Fe,ht),n(R.Mc,R.Nc,Je,xe,ht),Y--):1&He||ve(be,we,null,null,Se,Fe,Je,xe,Se,Fe,Je,xe,le,pe+re.A,null,null,ft),Y}function Ei(P,R,Y){var re=P.F,le=[P.J];if(re!=null){var pe=P.U,ve=R.ba.S,be=ve==gu||ve==vu;R=R.ba.f.RGBA;var we=[0],Se=P.ka;we[0]=P.T,P.Kb&&(Se==0?--we[0]:(--Se,le[0]-=P.width),P.j+P.ka+P.T==P.o&&(we[0]=P.o-P.j-Se));var Fe=R.eb;Se=R.fb+Se*R.A,P=Dl(re,le[0],P.width,pe,we,Fe,Se+(be?0:3),R.A),e(Y==we),P&&Ct(ve)&&Yo(Fe,Se,be,pe,we,R.A)}return 0}function Sn(P){var R=P.ma,Y=R.ba.S,re=11>Y,le=Y==Ko||Y==zl||Y==gu||Y==fn||Y==12||Ct(Y);if(R.memory=null,R.Ib=null,R.Jb=null,R.Nd=null,!ml(R.Oa,P,le?11:12))return 0;if(le&&Ct(Y)&&Cc(),P.da)alert("todo:use_scaling");else{if(re){if(R.Ib=Bi,P.Kb){if(Y=P.U+1>>1,R.memory=a(P.U+2*Y),R.memory==null)return 0;R.ec=R.memory,R.fc=0,R.cc=R.ec,R.dc=R.fc+P.U,R.Mc=R.cc,R.Nc=R.dc+Y,R.Ib=oi,Cc()}}else alert("todo:EmitYUV");le&&(R.Jb=Ei,re&&Po())}if(re&&!Hi){for(P=0;256>P;++P)va[P]=89858*(P-128)+Mo>>ws,ma[P]=-22014*(P-128)+Mo,Hl[P]=-45773*(P-128),_l[P]=113618*(P-128)+Mo>>ws;for(P=tn;P<sn;++P)R=76283*(P-16)+Mo>>ws,_u[P-tn]=zn(R,255),If[P-tn]=zn(R+8>>4,15);Hi=1}return 1}function Qt(P){var R=P.ma,Y=P.U,re=P.T;return e(!(1&P.ka)),0>=Y||0>=re?0:(Y=R.Ib(P,R),R.Jb!=null&&R.Jb(P,R,Y),R.Dc+=Y,1)}function ca(P){P.ma.memory=null}function Fa(P,R,Y,re){return B(P,8)!=47?0:(R[0]=B(P,14)+1,Y[0]=B(P,14)+1,re[0]=B(P,1),B(P,3)!=0?0:!P.h)}function Kn(P,R){if(4>P)return P+1;var Y=P-2>>1;return(2+(1&P)<<Y)+B(R,Y)+1}function Yi(P,R){return 120<R?R-120:1<=(Y=((Y=Ph[R-1])>>4)*P+(8-(15&Y)))?Y:1;var Y}function qr(P,R,Y){var re=X(Y),le=P[R+=255&re].g-8;return 0<le&&(K(Y,Y.u+8),re=X(Y),R+=P[R].value,R+=re&(1<<le)-1),K(Y,Y.u+P[R].g),P[R].value}function En(P,R,Y){return Y.g+=P.g,Y.value+=P.value<<R>>>0,e(8>=Y.g),P.g}function Rn(P,R,Y){var re=P.xc;return e((R=re==0?0:P.vc[P.md*(Y>>re)+(R>>re)])<P.Wb),P.Ya[R]}function Sa(P,R,Y,re){var le=P.ab,pe=P.c*R,ve=P.C;R=ve+R;var be=Y,we=re;for(re=P.Ta,Y=P.Ua;0<le--;){var Se=P.gc[le],Fe=ve,Je=R,xe=be,$e=we,Qe=(we=re,be=Y,Se.Ea);switch(e(Fe<Je),e(Je<=Se.nc),Se.hc){case 2:Jn(xe,$e,(Je-Fe)*Qe,we,be);break;case 0:var lt=Fe,Xe=Je,ot=we,He=be,ft=(zt=Se).Ea;lt==0&&(ps(xe,$e,null,null,1,ot,He),dt(xe,$e+1,0,0,ft-1,ot,He+1),$e+=ft,He+=ft,++lt);for(var ht=1<<zt.b,Wt=ht-1,Bt=fe(ft,zt.b),hr=zt.K,zt=zt.w+(lt>>zt.b)*Bt;lt<Xe;){var Pr=hr,qn=zt,vr=1;for(lo(xe,$e,ot,He-ft,1,ot,He);vr<ft;){var Ft=(vr&~Wt)+ht;Ft>ft&&(Ft=ft),(0,da[Pr[qn++]>>8&15])(xe,$e+ +vr,ot,He+vr-ft,Ft-vr,ot,He+vr),vr=Ft}$e+=ft,He+=ft,++lt&Wt||(zt+=Bt)}Je!=Se.nc&&n(we,be-Qe,we,be+(Je-Fe-1)*Qe,Qe);break;case 1:for(Qe=xe,Xe=$e,ft=(xe=Se.Ea)-(He=xe&~(ot=($e=1<<Se.b)-1)),lt=fe(xe,Se.b),ht=Se.K,Se=Se.w+(Fe>>Se.b)*lt;Fe<Je;){for(Wt=ht,Bt=Se,hr=new ue,zt=Xe+He,Pr=Xe+xe;Xe<zt;)xt(Wt[Bt++],hr),yl(hr,Qe,Xe,$e,we,be),Xe+=$e,be+=$e;Xe<Pr&&(xt(Wt[Bt++],hr),yl(hr,Qe,Xe,ft,we,be),Xe+=ft,be+=ft),++Fe&ot||(Se+=lt)}break;case 3:if(xe==we&&$e==be&&0<Se.b){for(Xe=we,xe=Qe=be+(Je-Fe)*Qe-(He=(Je-Fe)*fe(Se.Ea,Se.b)),$e=we,ot=be,lt=[],He=(ft=He)-1;0<=He;--He)lt[He]=$e[ot+He];for(He=ft-1;0<=He;--He)Xe[xe+He]=lt[He];Wo(Se,Fe,Je,we,Qe,we,be)}else Wo(Se,Fe,Je,xe,$e,we,be)}be=re,we=Y}we!=Y&&n(re,Y,be,we,pe)}function Ho(P,R){var Y=P.V,re=P.Ba+P.c*P.C,le=R-P.C;if(e(R<=P.l.o),e(16>=le),0<le){var pe=P.l,ve=P.Ta,be=P.Ua,we=pe.width;if(Sa(P,le,Y,re),le=be=[be],e((Y=P.C)<(re=R)),e(pe.v<pe.va),re>pe.o&&(re=pe.o),Y<pe.j){var Se=pe.j-Y;Y=pe.j,le[0]+=Se*we}if(Y>=re?Y=0:(le[0]+=4*pe.v,pe.ka=Y-pe.j,pe.U=pe.va-pe.v,pe.T=re-Y,Y=1),Y){if(be=be[0],11>(Y=P.ca).S){var Fe=Y.f.RGBA,Je=(re=Y.S,le=pe.U,pe=pe.T,Se=Fe.eb,Fe.A),xe=pe;for(Fe=Fe.fb+P.Ma*Fe.A;0<xe--;){var $e=ve,Qe=be,lt=le,Xe=Se,ot=Fe;switch(re){case Bl:Vo($e,Qe,lt,Xe,ot);break;case Ko:gs($e,Qe,lt,Xe,ot);break;case ql:gs($e,Qe,lt,Xe,ot),Yo(Xe,ot,0,lt,1,0);break;case Tf:ms($e,Qe,lt,Xe,ot);break;case zl:qe($e,Qe,lt,Xe,ot,1);break;case Ws:qe($e,Qe,lt,Xe,ot,1),Yo(Xe,ot,0,lt,1,0);break;case gu:qe($e,Qe,lt,Xe,ot,0);break;case vu:qe($e,Qe,lt,Xe,ot,0),Yo(Xe,ot,1,lt,1,0);break;case fn:vs($e,Qe,lt,Xe,ot);break;case mu:vs($e,Qe,lt,Xe,ot),Ku(Xe,ot,lt,1,0);break;case Zu:en($e,Qe,lt,Xe,ot);break;default:e(0)}be+=we,Fe+=Je}P.Ma+=pe}else alert("todo:EmitRescaledRowsYUVA");e(P.Ma<=Y.height)}}P.C=R,e(P.C<=P.i)}function Ea(P){var R;if(0<P.ua)return 0;for(R=0;R<P.Wb;++R){var Y=P.Ya[R].G,re=P.Ya[R].H;if(0<Y[1][re[1]+0].g||0<Y[2][re[2]+0].g||0<Y[3][re[3]+0].g)return 0}return 1}function eo(P,R,Y,re,le,pe){if(P.Z!=0){var ve=P.qd,be=P.rd;for(e(ra[P.Z]!=null);R<Y;++R)ra[P.Z](ve,be,re,le,re,le,pe),ve=re,be=le,le+=pe;P.qd=ve,P.rd=be}}function si(P,R){var Y=P.l.ma,re=Y.Z==0||Y.Z==1?P.l.j:P.C;if(re=P.C<re?re:P.C,e(R<=P.l.o),R>re){var le=P.l.width,pe=Y.ca,ve=Y.tb+le*re,be=P.V,we=P.Ba+P.c*re,Se=P.gc;e(P.ab==1),e(Se[0].hc==3),Ta(Se[0],re,R,be,we,pe,ve),eo(Y,re,R,pe,ve,le)}P.C=P.Ma=R}function ka(P,R,Y,re,le,pe,ve){var be=P.$/re,we=P.$%re,Se=P.m,Fe=P.s,Je=Y+P.$,xe=Je;le=Y+re*le;var $e=Y+re*pe,Qe=280+Fe.ua,lt=P.Pb?be:16777216,Xe=0<Fe.ua?Fe.Wa:null,ot=Fe.wc,He=Je<$e?Rn(Fe,we,be):null;e(P.C<pe),e($e<=le);var ft=!1;e:for(;;){for(;ft||Je<$e;){var ht=0;if(be>=lt){var Wt=Je-Y;e((lt=P).Pb),lt.wd=lt.m,lt.xd=Wt,0<lt.s.ua&&Re(lt.s.Wa,lt.s.vb),lt=be+Qu}if(we&ot||(He=Rn(Fe,we,be)),e(He!=null),He.Qb&&(R[Je]=He.qb,ft=!0),!ft)if(oe(Se),He.jc){ht=Se,Wt=R;var Bt=Je,hr=He.pd[X(ht)&Oi-1];e(He.jc),256>hr.g?(K(ht,ht.u+hr.g),Wt[Bt]=hr.value,ht=0):(K(ht,ht.u+hr.g-256),e(256<=hr.value),ht=hr.value),ht==0&&(ft=!0)}else ht=qr(He.G[0],He.H[0],Se);if(Se.h)break;if(ft||256>ht){if(!ft)if(He.nd)R[Je]=(He.qb|ht<<8)>>>0;else{if(oe(Se),ft=qr(He.G[1],He.H[1],Se),oe(Se),Wt=qr(He.G[2],He.H[2],Se),Bt=qr(He.G[3],He.H[3],Se),Se.h)break;R[Je]=(Bt<<24|ft<<16|ht<<8|Wt)>>>0}if(ft=!1,++Je,++we>=re&&(we=0,++be,ve!=null&&be<=pe&&!(be%16)&&ve(P,be),Xe!=null))for(;xe<Je;)ht=R[xe++],Xe.X[(506832829*ht&4294967295)>>>Xe.Mb]=ht}else if(280>ht){if(ht=Kn(ht-256,Se),Wt=qr(He.G[4],He.H[4],Se),oe(Se),Wt=Yi(re,Wt=Kn(Wt,Se)),Se.h)break;if(Je-Y<Wt||le-Je<ht)break e;for(Bt=0;Bt<ht;++Bt)R[Je+Bt]=R[Je+Bt-Wt];for(Je+=ht,we+=ht;we>=re;)we-=re,++be,ve!=null&&be<=pe&&!(be%16)&&ve(P,be);if(e(Je<=le),we&ot&&(He=Rn(Fe,we,be)),Xe!=null)for(;xe<Je;)ht=R[xe++],Xe.X[(506832829*ht&4294967295)>>>Xe.Mb]=ht}else{if(!(ht<Qe))break e;for(ft=ht-280,e(Xe!=null);xe<Je;)ht=R[xe++],Xe.X[(506832829*ht&4294967295)>>>Xe.Mb]=ht;ht=Je,e(!(ft>>>(Wt=Xe).Xa)),R[ht]=Wt.X[ft],ft=!0}ft||e(Se.h==ee(Se))}if(P.Pb&&Se.h&&Je<le)e(P.m.h),P.a=5,P.m=P.wd,P.$=P.xd,0<P.s.ua&&Re(P.s.vb,P.s.Wa);else{if(Se.h)break e;ve?.(P,be>pe?pe:be),P.a=0,P.$=Je-Y}return 1}return P.a=3,0}function Aa(P){e(P!=null),P.vc=null,P.yc=null,P.Ya=null;var R=P.Wa;R!=null&&(R.X=null),P.vb=null,e(P!=null)}function $o(){var P=new jt;return P==null?null:(P.a=0,P.xb=bu,Nt("Predictor","VP8LPredictors"),Nt("Predictor","VP8LPredictors_C"),Nt("PredictorAdd","VP8LPredictorsAdd"),Nt("PredictorAdd","VP8LPredictorsAdd_C"),Jn=pt,yl=bt,Vo=zr,gs=_r,vs=It,en=Jt,ms=Ve,F.VP8LMapColor32b=ci,F.VP8LMapColor8b=To,P)}function zi(P,R,Y,re,le){var pe=1,ve=[P],be=[R],we=re.m,Se=re.s,Fe=null,Je=0;e:for(;;){if(Y)for(;pe&&B(we,1);){var xe=ve,$e=be,Qe=re,lt=1,Xe=Qe.m,ot=Qe.gc[Qe.ab],He=B(Xe,2);if(Qe.Oc&1<<He)pe=0;else{switch(Qe.Oc|=1<<He,ot.hc=He,ot.Ea=xe[0],ot.nc=$e[0],ot.K=[null],++Qe.ab,e(4>=Qe.ab),He){case 0:case 1:ot.b=B(Xe,3)+2,lt=zi(fe(ot.Ea,ot.b),fe(ot.nc,ot.b),0,Qe,ot.K),ot.K=ot.K[0];break;case 3:var ft,ht=B(Xe,8)+1,Wt=16<ht?0:4<ht?1:2<ht?2:3;if(xe[0]=fe(ot.Ea,Wt),ot.b=Wt,ft=lt=zi(ht,1,0,Qe,ot.K)){var Bt,hr=ht,zt=ot,Pr=1<<(8>>zt.b),qn=a(Pr);if(qn==null)ft=0;else{var vr=zt.K[0],Ft=zt.w;for(qn[0]=zt.K[0][0],Bt=1;Bt<1*hr;++Bt)qn[Bt]=Le(vr[Ft+Bt],qn[Bt-1]);for(;Bt<4*Pr;++Bt)qn[Bt]=0;zt.K[0]=null,zt.K[0]=qn,ft=1}}lt=ft;break;case 2:break;default:e(0)}pe=lt}}if(ve=ve[0],be=be[0],pe&&B(we,1)&&!(pe=1<=(Je=B(we,4))&&11>=Je)){re.a=3;break e}var St;if(St=pe)t:{var Un,Ht,dr,Mr=re,bi=ve,fi=be,Hr=Je,wi=Y,vn=Mr.m,jn=Mr.s,Nr=[null],Gr=1,On=0,Wr=Rf[Hr];r:for(;;){if(wi&&B(vn,1)){var Cn=B(vn,3)+2,Ln=fe(bi,Cn),rn=fe(fi,Cn),Ti=Ln*rn;if(!zi(Ln,rn,0,Mr,Nr))break r;for(Nr=Nr[0],jn.xc=Cn,Un=0;Un<Ti;++Un){var Kr=Nr[Un]>>8&65535;Nr[Un]=Kr,Kr>=Gr&&(Gr=Kr+1)}}if(vn.h)break r;for(Ht=0;5>Ht;++Ht){var Zr=wl[Ht];!Ht&&0<Hr&&(Zr+=1<<Hr),On<Zr&&(On=Zr)}var ei=o(Gr*Wr,$),Ri=Gr,ya=o(Ri,J);if(ya==null)var ti=null;else e(65536>=Ri),ti=ya;var Hn=a(On);if(ti==null||Hn==null||ei==null){Mr.a=1;break r}var ba=ei;for(Un=dr=0;Un<Gr;++Un){var nn=ti[Un],$i=nn.G,Vr=nn.H,sr=0,Ir=1,kr=0;for(Ht=0;5>Ht;++Ht){Zr=wl[Ht],$i[Ht]=ba,Vr[Ht]=dr,!Ht&&0<Hr&&(Zr+=1<<Hr);i:{var Dn,hi=Zr,Zo=Mr,hn=Hn,xu=ba,Xs=dr,dn=0,fo=Zo.m,Gl=B(fo,1);if(i(hn,0,0,hi),Gl){var wa=B(fo,1)+1,Su=B(fo,1),Eu=B(fo,Su==0?1:8);hn[Eu]=1,wa==2&&(hn[Eu=B(fo,8)]=1);var Gi=1}else{var ln=a(19),$n=B(fo,4)+4;if(19<$n){Zo.a=3;var Gn=0;break i}for(Dn=0;Dn<$n;++Dn)ln[Pd[Dn]]=B(fo,3);var ho=void 0,Io=void 0,po=Zo,zc=ln,Wn=hi,ku=hn,xl=0,go=po.m,xn=8,_i=o(128,$);n:for(;L(_i,0,7,zc,19);){if(B(go,1)){var _a=2+2*B(go,3);if((ho=2+B(go,_a))>Wn)break n}else ho=Wn;for(Io=0;Io<Wn&&ho--;){oe(go);var na=_i[0+(127&X(go))];K(go,go.u+na.g);var Ks=na.value;if(16>Ks)ku[Io++]=Ks,Ks!=0&&(xn=Ks);else{var qc=Ks==16,rc=Ks-16,Rh=jc[rc],Es=B(go,yu[rc])+Rh;if(Io+Es>Wn)break n;for(var jf=qc?xn:0;0<Es--;)ku[Io++]=jf}}xl=1;break n}xl||(po.a=3),Gi=xl}(Gi=Gi&&!fo.h)&&(dn=L(xu,Xs,8,hn,hi)),Gi&&dn!=0?Gn=dn:(Zo.a=3,Gn=0)}if(Gn==0)break r;if(Ir&&Ah[Ht]==1&&(Ir=ba[dr].g==0),sr+=ba[dr].g,dr+=Gn,3>=Ht){var Wl,Au=Hn[0];for(Wl=1;Wl<Zr;++Wl)Hn[Wl]>Au&&(Au=Hn[Wl]);kr+=Au}}if(nn.nd=Ir,nn.Qb=0,Ir&&(nn.qb=($i[3][Vr[3]+0].value<<24|$i[1][Vr[1]+0].value<<16|$i[2][Vr[2]+0].value)>>>0,sr==0&&256>$i[0][Vr[0]+0].value&&(nn.Qb=1,nn.qb+=$i[0][Vr[0]+0].value<<8)),nn.jc=!nn.Qb&&6>kr,nn.jc){var Qo,Xa=nn;for(Qo=0;Qo<Oi;++Qo){var ks=Qo,vo=Xa.pd[ks],As=Xa.G[0][Xa.H[0]+ks];256<=As.value?(vo.g=As.g+256,vo.value=As.value):(vo.g=0,vo.value=0,ks>>=En(As,8,vo),ks>>=En(Xa.G[1][Xa.H[1]+ks],16,vo),ks>>=En(Xa.G[2][Xa.H[2]+ks],0,vo),En(Xa.G[3][Xa.H[3]+ks],24,vo))}}}jn.vc=Nr,jn.Wb=Gr,jn.Ya=ti,jn.yc=ei,St=1;break t}St=0}if(!(pe=St)){re.a=3;break e}if(0<Je){if(Se.ua=1<<Je,!ge(Se.Wa,Je)){re.a=1,pe=0;break e}}else Se.ua=0;var Uc=re,Hc=ve,Df=be,nc=Uc.s,Ps=nc.xc;if(Uc.c=Hc,Uc.i=Df,nc.md=fe(Hc,Ps),nc.wc=Ps==0?-1:(1<<Ps)-1,Y){re.xb=Ro;break e}if((Fe=a(ve*be))==null){re.a=1,pe=0;break e}pe=(pe=ka(re,Fe,0,ve,be,be,null))&&!we.h;break e}return pe?(le!=null?le[0]=Fe:(e(Fe==null),e(Y)),re.$=0,Y||Aa(Se)):Aa(Se),pe}function to(P,R){var Y=P.c*P.i,re=Y+R+16*R;return e(P.c<=R),P.V=a(re),P.V==null?(P.Ta=null,P.Ua=0,P.a=1,0):(P.Ta=P.V,P.Ua=P.Ba+Y+R,1)}function Bs(P,R){var Y=P.C,re=R-Y,le=P.V,pe=P.Ba+P.c*Y;for(e(R<=P.l.o);0<re;){var ve=16<re?16:re,be=P.l.ma,we=P.l.width,Se=we*ve,Fe=be.ca,Je=be.tb+we*Y,xe=P.Ta,$e=P.Ua;Sa(P,ve,le,pe),Lc(xe,$e,Fe,Je,Se),eo(be,Y,Y+ve,Fe,Je,we),re-=ve,le+=ve*P.c,Y+=ve}e(Y==R),P.C=P.Ma=R}function is(){this.ub=this.yd=this.td=this.Rb=0}function lu(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Nf(){this.Fb=this.Bb=this.Cb=0,this.Zb=a(4),this.Lb=a(4)}function kn(){this.Yb=function(){var P=[];return function R(Y,re,le){for(var pe=le[re],ve=0;ve<pe&&(Y.push(le.length>re+1?[]:0),!(le.length<re+1));ve++)R(Y[ve],re+1,le)}(P,0,[3,11]),P}()}function uu(){this.jb=a(3),this.Wc=s([4,8],kn),this.Xc=s([4,17],kn)}function as(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new a(4),this.od=new a(4)}function Pa(){this.ld=this.La=this.dd=this.tc=0}function os(){this.Na=this.la=0}function Ec(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function ll(){this.ad=a(384),this.Za=0,this.Ob=a(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function _o(){this.uc=this.M=this.Nb=0,this.wa=Array(new Pa),this.Y=0,this.ya=Array(new ll),this.aa=0,this.l=new Sr}function gi(){this.y=a(16),this.f=a(8),this.ea=a(8)}function cn(){this.cb=this.a=0,this.sc="",this.m=new D,this.Od=new is,this.Kc=new lu,this.ed=new as,this.Qa=new Nf,this.Ic=this.$c=this.Aa=0,this.D=new _o,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,D),this.ia=0,this.pb=o(4,Ec),this.Pa=new uu,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new gi),this.Hd=0,this.rb=Array(new os),this.sb=0,this.wa=Array(new Pa),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new ll),this.L=this.aa=0,this.gd=s([4,2],Pa),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Sr(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function ss(){var P=new cn;return P!=null&&(P.a=0,P.sc="OK",P.cb=0,P.Xb=0,Ul||(Ul=Ki)),P}function Tr(P,R,Y){return P.a==0&&(P.a=R,P.sc=Y,P.cb=0),0}function Xi(P,R,Y){return 3<=Y&&P[R+0]==157&&P[R+1]==1&&P[R+2]==42}function ro(P,R){if(P==null)return 0;if(P.a=0,P.sc="OK",R==null)return Tr(P,2,"null VP8Io passed to VP8GetHeaders()");var Y=R.data,re=R.w,le=R.ha;if(4>le)return Tr(P,7,"Truncated header.");var pe=Y[re+0]|Y[re+1]<<8|Y[re+2]<<16,ve=P.Od;if(ve.Rb=!(1&pe),ve.td=pe>>1&7,ve.yd=pe>>4&1,ve.ub=pe>>5,3<ve.td)return Tr(P,3,"Incorrect keyframe parameters.");if(!ve.yd)return Tr(P,4,"Frame not displayable.");re+=3,le-=3;var be=P.Kc;if(ve.Rb){if(7>le)return Tr(P,7,"cannot parse picture header");if(!Xi(Y,re,le))return Tr(P,3,"Bad code word");be.c=16383&(Y[re+4]<<8|Y[re+3]),be.Td=Y[re+4]>>6,be.i=16383&(Y[re+6]<<8|Y[re+5]),be.Ud=Y[re+6]>>6,re+=7,le-=7,P.za=be.c+15>>4,P.Ub=be.i+15>>4,R.width=be.c,R.height=be.i,R.Da=0,R.j=0,R.v=0,R.va=R.width,R.o=R.height,R.da=0,R.ib=R.width,R.hb=R.height,R.U=R.width,R.T=R.height,i((pe=P.Pa).jb,0,255,pe.jb.length),e((pe=P.Qa)!=null),pe.Cb=0,pe.Bb=0,pe.Fb=1,i(pe.Zb,0,0,pe.Zb.length),i(pe.Lb,0,0,pe.Lb)}if(ve.ub>le)return Tr(P,7,"bad partition length");ae(pe=P.m,Y,re,ve.ub),re+=ve.ub,le-=ve.ub,ve.Rb&&(be.Ld=de(pe),be.Kd=de(pe)),be=P.Qa;var we,Se=P.Pa;if(e(pe!=null),e(be!=null),be.Cb=de(pe),be.Cb){if(be.Bb=de(pe),de(pe)){for(be.Fb=de(pe),we=0;4>we;++we)be.Zb[we]=de(pe)?Z(pe,7):0;for(we=0;4>we;++we)be.Lb[we]=de(pe)?Z(pe,6):0}if(be.Bb)for(we=0;3>we;++we)Se.jb[we]=de(pe)?ie(pe,8):255}else be.Bb=0;if(pe.Ka)return Tr(P,3,"cannot parse segment header");if((be=P.ed).zd=de(pe),be.Tb=ie(pe,6),be.wb=ie(pe,3),be.Pc=de(pe),be.Pc&&de(pe)){for(Se=0;4>Se;++Se)de(pe)&&(be.vd[Se]=Z(pe,6));for(Se=0;4>Se;++Se)de(pe)&&(be.od[Se]=Z(pe,6))}if(P.L=be.Tb==0?0:be.zd?1:2,pe.Ka)return Tr(P,3,"cannot parse filter header");var Fe=le;if(le=we=re,re=we+Fe,be=Fe,P.Xb=(1<<ie(P.m,2))-1,Fe<3*(Se=P.Xb))Y=7;else{for(we+=3*Se,be-=3*Se,Fe=0;Fe<Se;++Fe){var Je=Y[le+0]|Y[le+1]<<8|Y[le+2]<<16;Je>be&&(Je=be),ae(P.Jc[+Fe],Y,we,Je),we+=Je,be-=Je,le+=3}ae(P.Jc[+Se],Y,we,be),Y=we<re?0:5}if(Y!=0)return Tr(P,Y,"cannot parse partitions");for(Y=ie(we=P.m,7),le=de(we)?Z(we,4):0,re=de(we)?Z(we,4):0,be=de(we)?Z(we,4):0,Se=de(we)?Z(we,4):0,we=de(we)?Z(we,4):0,Fe=P.Qa,Je=0;4>Je;++Je){if(Fe.Cb){var xe=Fe.Zb[Je];Fe.Fb||(xe+=Y)}else{if(0<Je){P.pb[Je]=P.pb[0];continue}xe=Y}var $e=P.pb[Je];$e.Sc[0]=Vs[zn(xe+le,127)],$e.Sc[1]=Ju[zn(xe+0,127)],$e.Eb[0]=2*Vs[zn(xe+re,127)],$e.Eb[1]=101581*Ju[zn(xe+be,127)]>>16,8>$e.Eb[1]&&($e.Eb[1]=8),$e.Qc[0]=Vs[zn(xe+Se,117)],$e.Qc[1]=Ju[zn(xe+we,127)],$e.lc=xe+we}if(!ve.Rb)return Tr(P,4,"Not a key frame.");for(de(pe),ve=P.Pa,Y=0;4>Y;++Y){for(le=0;8>le;++le)for(re=0;3>re;++re)for(be=0;11>be;++be)Se=ye(pe,Ch[Y][le][re][be])?ie(pe,8):ec[Y][le][re][be],ve.Wc[Y][le].Yb[re][be]=Se;for(le=0;17>le;++le)ve.Xc[Y][le]=ve.Wc[Y][Fc[le]]}return P.kc=de(pe),P.kc&&(P.Bd=ie(pe,8)),P.cb=1}function Ki(P,R,Y,re,le,pe,ve){var be=R[le].Yb[Y];for(Y=0;16>le;++le){if(!ye(P,be[Y+0]))return le;for(;!ye(P,be[Y+1]);)if(be=R[++le].Yb[0],Y=0,le==16)return 16;var we=R[le+1].Yb;if(ye(P,be[Y+2])){var Se=P,Fe=0;if(ye(Se,(xe=be)[(Je=Y)+3]))if(ye(Se,xe[Je+6])){for(be=0,Je=2*(Fe=ye(Se,xe[Je+8]))+(xe=ye(Se,xe[Je+9+Fe])),Fe=0,xe=Mf[Je];xe[be];++be)Fe+=Fe+ye(Se,xe[be]);Fe+=3+(8<<Je)}else ye(Se,xe[Je+7])?(Fe=7+2*ye(Se,165),Fe+=ye(Se,145)):Fe=5+ye(Se,159);else Fe=ye(Se,xe[Je+4])?3+ye(Se,xe[Je+5]):2;be=we[2]}else Fe=1,be=we[1];we=ve+co[le],0>(Se=P).b&&me(Se);var Je,xe=Se.b,$e=(Je=Se.Ca>>1)-(Se.I>>xe)>>31;--Se.b,Se.Ca+=$e,Se.Ca|=1,Se.I-=(Je+1&$e)<<xe,pe[we]=((Fe^$e)-$e)*re[(0<le)+0]}return 16}function Mn(P){var R=P.rb[P.sb-1];R.la=0,R.Na=0,i(P.zc,0,0,P.zc.length),P.ja=0}function Zi(P,R,Y,re,le){le=P[R+Y+32*re]+(le>>3),P[R+Y+32*re]=-256&le?0>le?0:255:le}function ul(P,R,Y,re,le,pe){Zi(P,R,0,Y,re+le),Zi(P,R,1,Y,re+pe),Zi(P,R,2,Y,re-pe),Zi(P,R,3,Y,re-le)}function Zn(P){return(20091*P>>16)+P}function ls(P,R,Y,re){var le,pe=0,ve=a(16);for(le=0;4>le;++le){var be=P[R+0]+P[R+8],we=P[R+0]-P[R+8],Se=(35468*P[R+4]>>16)-Zn(P[R+12]),Fe=Zn(P[R+4])+(35468*P[R+12]>>16);ve[pe+0]=be+Fe,ve[pe+1]=we+Se,ve[pe+2]=we-Se,ve[pe+3]=be-Fe,pe+=4,R++}for(le=pe=0;4>le;++le)be=(P=ve[pe+0]+4)+ve[pe+8],we=P-ve[pe+8],Se=(35468*ve[pe+4]>>16)-Zn(ve[pe+12]),Zi(Y,re,0,0,be+(Fe=Zn(ve[pe+4])+(35468*ve[pe+12]>>16))),Zi(Y,re,1,0,we+Se),Zi(Y,re,2,0,we-Se),Zi(Y,re,3,0,be-Fe),pe++,re+=32}function Vu(P,R,Y,re){var le=P[R+0]+4,pe=35468*P[R+4]>>16,ve=Zn(P[R+4]),be=35468*P[R+1]>>16;ul(Y,re,0,le+ve,P=Zn(P[R+1]),be),ul(Y,re,1,le+pe,P,be),ul(Y,re,2,le-pe,P,be),ul(Y,re,3,le-ve,P,be)}function Oa(P,R,Y,re,le){ls(P,R,Y,re),le&&ls(P,R+16,Y,re+4)}function Tl(P,R,Y,re){Hs(P,R+0,Y,re,1),Hs(P,R+32,Y,re+128,1)}function us(P,R,Y,re){var le;for(P=P[R+0]+4,le=0;4>le;++le)for(R=0;4>R;++R)Zi(Y,re,R,le,P)}function cu(P,R,Y,re){P[R+0]&&Cr(P,R+0,Y,re),P[R+16]&&Cr(P,R+16,Y,re+4),P[R+32]&&Cr(P,R+32,Y,re+128),P[R+48]&&Cr(P,R+48,Y,re+128+4)}function Rr(P,R,Y,re){var le,pe=a(16);for(le=0;4>le;++le){var ve=P[R+0+le]+P[R+12+le],be=P[R+4+le]+P[R+8+le],we=P[R+4+le]-P[R+8+le],Se=P[R+0+le]-P[R+12+le];pe[0+le]=ve+be,pe[8+le]=ve-be,pe[4+le]=Se+we,pe[12+le]=Se-we}for(le=0;4>le;++le)ve=(P=pe[0+4*le]+3)+pe[3+4*le],be=pe[1+4*le]+pe[2+4*le],we=pe[1+4*le]-pe[2+4*le],Se=P-pe[3+4*le],Y[re+0]=ve+be>>3,Y[re+16]=Se+we>>3,Y[re+32]=ve-be>>3,Y[re+48]=Se-we>>3,re+=64}function xo(P,R,Y){var re,le=R-32,pe=Li,ve=255-P[le-1];for(re=0;re<Y;++re){var be,we=pe,Se=ve+P[R-1];for(be=0;be<Y;++be)P[R+be]=we[Se+P[le+be]];R+=32}}function cs(P,R){xo(P,R,4)}function cl(P,R){xo(P,R,8)}function kc(P,R){xo(P,R,16)}function Ac(P,R){var Y;for(Y=0;16>Y;++Y)n(P,R+32*Y,P,R-32,16)}function fl(P,R){var Y;for(Y=16;0<Y;--Y)i(P,R,P[R-1],16),R+=32}function fs(P,R,Y){var re;for(re=0;16>re;++re)i(R,Y+32*re,P,16)}function no(P,R){var Y,re=16;for(Y=0;16>Y;++Y)re+=P[R-1+32*Y]+P[R+Y-32];fs(re>>5,P,R)}function Ba(P,R){var Y,re=8;for(Y=0;16>Y;++Y)re+=P[R-1+32*Y];fs(re>>4,P,R)}function za(P,R){var Y,re=8;for(Y=0;16>Y;++Y)re+=P[R+Y-32];fs(re>>4,P,R)}function qa(P,R){fs(128,P,R)}function Pt(P,R,Y){return P+2*R+Y+2>>2}function hl(P,R){var Y,re=R-32;for(re=new Uint8Array([Pt(P[re-1],P[re+0],P[re+1]),Pt(P[re+0],P[re+1],P[re+2]),Pt(P[re+1],P[re+2],P[re+3]),Pt(P[re+2],P[re+3],P[re+4])]),Y=0;4>Y;++Y)n(P,R+32*Y,re,0,re.length)}function So(P,R){var Y=P[R-1],re=P[R-1+32],le=P[R-1+64],pe=P[R-1+96];Te(P,R+0,16843009*Pt(P[R-1-32],Y,re)),Te(P,R+32,16843009*Pt(Y,re,le)),Te(P,R+64,16843009*Pt(re,le,pe)),Te(P,R+96,16843009*Pt(le,pe,pe))}function Pc(P,R){var Y,re=4;for(Y=0;4>Y;++Y)re+=P[R+Y-32]+P[R-1+32*Y];for(re>>=3,Y=0;4>Y;++Y)i(P,R+32*Y,re,4)}function Oc(P,R){var Y=P[R-1+0],re=P[R-1+32],le=P[R-1+64],pe=P[R-1-32],ve=P[R+0-32],be=P[R+1-32],we=P[R+2-32],Se=P[R+3-32];P[R+0+96]=Pt(re,le,P[R-1+96]),P[R+1+96]=P[R+0+64]=Pt(Y,re,le),P[R+2+96]=P[R+1+64]=P[R+0+32]=Pt(pe,Y,re),P[R+3+96]=P[R+2+64]=P[R+1+32]=P[R+0+0]=Pt(ve,pe,Y),P[R+3+64]=P[R+2+32]=P[R+1+0]=Pt(be,ve,pe),P[R+3+32]=P[R+2+0]=Pt(we,be,ve),P[R+3+0]=Pt(Se,we,be)}function io(P,R){var Y=P[R+1-32],re=P[R+2-32],le=P[R+3-32],pe=P[R+4-32],ve=P[R+5-32],be=P[R+6-32],we=P[R+7-32];P[R+0+0]=Pt(P[R+0-32],Y,re),P[R+1+0]=P[R+0+32]=Pt(Y,re,le),P[R+2+0]=P[R+1+32]=P[R+0+64]=Pt(re,le,pe),P[R+3+0]=P[R+2+32]=P[R+1+64]=P[R+0+96]=Pt(le,pe,ve),P[R+3+32]=P[R+2+64]=P[R+1+96]=Pt(pe,ve,be),P[R+3+64]=P[R+2+96]=Pt(ve,be,we),P[R+3+96]=Pt(be,we,we)}function wn(P,R){var Y=P[R-1+0],re=P[R-1+32],le=P[R-1+64],pe=P[R-1-32],ve=P[R+0-32],be=P[R+1-32],we=P[R+2-32],Se=P[R+3-32];P[R+0+0]=P[R+1+64]=pe+ve+1>>1,P[R+1+0]=P[R+2+64]=ve+be+1>>1,P[R+2+0]=P[R+3+64]=be+we+1>>1,P[R+3+0]=we+Se+1>>1,P[R+0+96]=Pt(le,re,Y),P[R+0+64]=Pt(re,Y,pe),P[R+0+32]=P[R+1+96]=Pt(Y,pe,ve),P[R+1+32]=P[R+2+96]=Pt(pe,ve,be),P[R+2+32]=P[R+3+96]=Pt(ve,be,we),P[R+3+32]=Pt(be,we,Se)}function fu(P,R){var Y=P[R+0-32],re=P[R+1-32],le=P[R+2-32],pe=P[R+3-32],ve=P[R+4-32],be=P[R+5-32],we=P[R+6-32],Se=P[R+7-32];P[R+0+0]=Y+re+1>>1,P[R+1+0]=P[R+0+64]=re+le+1>>1,P[R+2+0]=P[R+1+64]=le+pe+1>>1,P[R+3+0]=P[R+2+64]=pe+ve+1>>1,P[R+0+32]=Pt(Y,re,le),P[R+1+32]=P[R+0+96]=Pt(re,le,pe),P[R+2+32]=P[R+1+96]=Pt(le,pe,ve),P[R+3+32]=P[R+2+96]=Pt(pe,ve,be),P[R+3+64]=Pt(ve,be,we),P[R+3+96]=Pt(be,we,Se)}function hu(P,R){var Y=P[R-1+0],re=P[R-1+32],le=P[R-1+64],pe=P[R-1+96];P[R+0+0]=Y+re+1>>1,P[R+2+0]=P[R+0+32]=re+le+1>>1,P[R+2+32]=P[R+0+64]=le+pe+1>>1,P[R+1+0]=Pt(Y,re,le),P[R+3+0]=P[R+1+32]=Pt(re,le,pe),P[R+3+32]=P[R+1+64]=Pt(le,pe,pe),P[R+3+64]=P[R+2+64]=P[R+0+96]=P[R+1+96]=P[R+2+96]=P[R+3+96]=pe}function zs(P,R){var Y=P[R-1+0],re=P[R-1+32],le=P[R-1+64],pe=P[R-1+96],ve=P[R-1-32],be=P[R+0-32],we=P[R+1-32],Se=P[R+2-32];P[R+0+0]=P[R+2+32]=Y+ve+1>>1,P[R+0+32]=P[R+2+64]=re+Y+1>>1,P[R+0+64]=P[R+2+96]=le+re+1>>1,P[R+0+96]=pe+le+1>>1,P[R+3+0]=Pt(be,we,Se),P[R+2+0]=Pt(ve,be,we),P[R+1+0]=P[R+3+32]=Pt(Y,ve,be),P[R+1+32]=P[R+3+64]=Pt(re,Y,ve),P[R+1+64]=P[R+3+96]=Pt(le,re,Y),P[R+1+96]=Pt(pe,le,re)}function Yu(P,R){var Y;for(Y=0;8>Y;++Y)n(P,R+32*Y,P,R-32,8)}function Ua(P,R){var Y;for(Y=0;8>Y;++Y)i(P,R,P[R-1],8),R+=32}function ki(P,R,Y){var re;for(re=0;8>re;++re)i(R,Y+32*re,P,8)}function Go(P,R){var Y,re=8;for(Y=0;8>Y;++Y)re+=P[R+Y-32]+P[R-1+32*Y];ki(re>>4,P,R)}function du(P,R){var Y,re=4;for(Y=0;8>Y;++Y)re+=P[R+Y-32];ki(re>>3,P,R)}function Ca(P,R){var Y,re=4;for(Y=0;8>Y;++Y)re+=P[R-1+32*Y];ki(re>>3,P,R)}function ao(P,R){ki(128,P,R)}function Eo(P,R,Y){var re=P[R-Y],le=P[R+0],pe=3*(le-re)+Xo[1020+P[R-2*Y]-P[R+Y]],ve=Fl[112+(pe+4>>3)];P[R-Y]=Li[255+re+Fl[112+(pe+3>>3)]],P[R+0]=Li[255+le-ve]}function ko(P,R,Y,re){var le=P[R+0],pe=P[R+Y];return uo[255+P[R-2*Y]-P[R-Y]]>re||uo[255+pe-le]>re}function dl(P,R,Y,re){return 4*uo[255+P[R-Y]-P[R+0]]+uo[255+P[R-2*Y]-P[R+Y]]<=re}function Rl(P,R,Y,re,le){var pe=P[R-3*Y],ve=P[R-2*Y],be=P[R-Y],we=P[R+0],Se=P[R+Y],Fe=P[R+2*Y],Je=P[R+3*Y];return 4*uo[255+be-we]+uo[255+ve-Se]>re?0:uo[255+P[R-4*Y]-pe]<=le&&uo[255+pe-ve]<=le&&uo[255+ve-be]<=le&&uo[255+Je-Fe]<=le&&uo[255+Fe-Se]<=le&&uo[255+Se-we]<=le}function li(P,R,Y,re){var le=2*re+1;for(re=0;16>re;++re)dl(P,R+re,Y,le)&&Eo(P,R+re,Y)}function Ha(P,R,Y,re){var le=2*re+1;for(re=0;16>re;++re)dl(P,R+re*Y,1,le)&&Eo(P,R+re*Y,1)}function Ao(P,R,Y,re){var le;for(le=3;0<le;--le)li(P,R+=4*Y,Y,re)}function pl(P,R,Y,re){var le;for(le=3;0<le;--le)Ha(P,R+=4,Y,re)}function La(P,R,Y,re,le,pe,ve,be){for(pe=2*pe+1;0<le--;){if(Rl(P,R,Y,pe,ve))if(ko(P,R,Y,be))Eo(P,R,Y);else{var we=P,Se=R,Fe=Y,Je=we[Se-2*Fe],xe=we[Se-Fe],$e=we[Se+0],Qe=we[Se+Fe],lt=we[Se+2*Fe],Xe=27*(He=Xo[1020+3*($e-xe)+Xo[1020+Je-Qe]])+63>>7,ot=18*He+63>>7,He=9*He+63>>7;we[Se-3*Fe]=Li[255+we[Se-3*Fe]+He],we[Se-2*Fe]=Li[255+Je+ot],we[Se-Fe]=Li[255+xe+Xe],we[Se+0]=Li[255+$e-Xe],we[Se+Fe]=Li[255+Qe-ot],we[Se+2*Fe]=Li[255+lt-He]}R+=re}}function Bn(P,R,Y,re,le,pe,ve,be){for(pe=2*pe+1;0<le--;){if(Rl(P,R,Y,pe,ve))if(ko(P,R,Y,be))Eo(P,R,Y);else{var we=P,Se=R,Fe=Y,Je=we[Se-Fe],xe=we[Se+0],$e=we[Se+Fe],Qe=Fl[112+(4+(lt=3*(xe-Je))>>3)],lt=Fl[112+(lt+3>>3)],Xe=Qe+1>>1;we[Se-2*Fe]=Li[255+we[Se-2*Fe]+Xe],we[Se-Fe]=Li[255+Je+lt],we[Se+0]=Li[255+xe-Qe],we[Se+Fe]=Li[255+$e-Xe]}R+=re}}function fa(P,R,Y,re,le,pe){La(P,R,Y,1,16,re,le,pe)}function Qn(P,R,Y,re,le,pe){La(P,R,1,Y,16,re,le,pe)}function vi(P,R,Y,re,le,pe){var ve;for(ve=3;0<ve;--ve)Bn(P,R+=4*Y,Y,1,16,re,le,pe)}function $a(P,R,Y,re,le,pe){var ve;for(ve=3;0<ve;--ve)Bn(P,R+=4,1,Y,16,re,le,pe)}function H(P,R,Y,re,le,pe,ve,be){La(P,R,le,1,8,pe,ve,be),La(Y,re,le,1,8,pe,ve,be)}function ce(P,R,Y,re,le,pe,ve,be){La(P,R,1,le,8,pe,ve,be),La(Y,re,1,le,8,pe,ve,be)}function ke(P,R,Y,re,le,pe,ve,be){Bn(P,R+4*le,le,1,8,pe,ve,be),Bn(Y,re+4*le,le,1,8,pe,ve,be)}function De(P,R,Y,re,le,pe,ve,be){Bn(P,R+4,1,le,8,pe,ve,be),Bn(Y,re+4,1,le,8,pe,ve,be)}function Ge(){this.ba=new xr,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new pr,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function at(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function ct(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Dt(){this.ua=0,this.Wa=new Be,this.vb=new Be,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new J,this.yc=new $}function jt(){this.xb=this.a=0,this.l=new Sr,this.ca=new xr,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new U,this.Pb=0,this.wd=new U,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Dt,this.ab=0,this.gc=o(4,ct),this.Oc=0}function cr(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Sr,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function fr(P,R,Y,re,le,pe,ve){for(P=P==null?0:P[R+0],R=0;R<ve;++R)le[pe+R]=P+Y[re+R]&255,P=le[pe+R]}function Ur(P,R,Y,re,le,pe,ve){var be;if(P==null)fr(null,null,Y,re,le,pe,ve);else for(be=0;be<ve;++be)le[pe+be]=P[R+be]+Y[re+be]&255}function An(P,R,Y,re,le,pe,ve){if(P==null)fr(null,null,Y,re,le,pe,ve);else{var be,we=P[R+0],Se=we,Fe=we;for(be=0;be<ve;++be)Se=Fe+(we=P[R+be])-Se,Fe=Y[re+be]+(-256&Se?0>Se?0:255:Se)&255,Se=we,le[pe+be]=Fe}}function ui(P,R,Y,re){var le=R.width,pe=R.o;if(e(P!=null&&R!=null),0>Y||0>=re||Y+re>pe)return null;if(!P.Cc){if(P.ga==null){var ve;if(P.ga=new cr,(ve=P.ga==null)||(ve=R.width*R.o,e(P.Gb.length==0),P.Gb=a(ve),P.Uc=0,P.Gb==null?ve=0:(P.mb=P.Gb,P.nb=P.Uc,P.rc=null,ve=1),ve=!ve),!ve){ve=P.ga;var be=P.Fa,we=P.P,Se=P.qc,Fe=P.mb,Je=P.nb,xe=we+1,$e=Se-1,Qe=ve.l;if(e(be!=null&&Fe!=null&&R!=null),ra[0]=null,ra[1]=fr,ra[2]=Ur,ra[3]=An,ve.ca=Fe,ve.tb=Je,ve.c=R.width,ve.i=R.height,e(0<ve.c&&0<ve.i),1>=Se)R=0;else if(ve.$a=3&be[we+0],ve.Z=be[we+0]>>2&3,ve.Lc=be[we+0]>>4&3,we=be[we+0]>>6&3,0>ve.$a||1<ve.$a||4<=ve.Z||1<ve.Lc||we)R=0;else if(Qe.put=Qt,Qe.ac=Sn,Qe.bc=ca,Qe.ma=ve,Qe.width=R.width,Qe.height=R.height,Qe.Da=R.Da,Qe.v=R.v,Qe.va=R.va,Qe.j=R.j,Qe.o=R.o,ve.$a)e:{e(ve.$a==1),R=$o();t:for(;;){if(R==null){R=0;break e}if(e(ve!=null),ve.mc=R,R.c=ve.c,R.i=ve.i,R.l=ve.l,R.l.ma=ve,R.l.width=ve.c,R.l.height=ve.i,R.a=0,te(R.m,be,xe,$e),!zi(ve.c,ve.i,1,R,null)||(R.ab==1&&R.gc[0].hc==3&&Ea(R.s)?(ve.ic=1,be=R.c*R.i,R.Ta=null,R.Ua=0,R.V=a(be),R.Ba=0,R.V==null?(R.a=1,R=0):R=1):(ve.ic=0,R=to(R,ve.c)),!R))break t;R=1;break e}ve.mc=null,R=0}else R=$e>=ve.c*ve.i;ve=!R}if(ve)return null;P.ga.Lc!=1?P.Ga=0:re=pe-Y}e(P.ga!=null),e(Y+re<=pe);e:{if(R=(be=P.ga).c,pe=be.l.o,be.$a==0){if(xe=P.rc,$e=P.Vc,Qe=P.Fa,we=P.P+1+Y*R,Se=P.mb,Fe=P.nb+Y*R,e(we<=P.P+P.qc),be.Z!=0)for(e(ra[be.Z]!=null),ve=0;ve<re;++ve)ra[be.Z](xe,$e,Qe,we,Se,Fe,R),xe=Se,$e=Fe,Fe+=R,we+=R;else for(ve=0;ve<re;++ve)n(Se,Fe,Qe,we,R),xe=Se,$e=Fe,Fe+=R,we+=R;P.rc=xe,P.Vc=$e}else{if(e(be.mc!=null),R=Y+re,e((ve=be.mc)!=null),e(R<=ve.i),ve.C>=R)R=1;else if(be.ic||Po(),be.ic){be=ve.V,xe=ve.Ba,$e=ve.c;var lt=ve.i,Xe=(Qe=1,we=ve.$/$e,Se=ve.$%$e,Fe=ve.m,Je=ve.s,ve.$),ot=$e*lt,He=$e*R,ft=Je.wc,ht=Xe<He?Rn(Je,Se,we):null;e(Xe<=ot),e(R<=lt),e(Ea(Je));t:for(;;){for(;!Fe.h&&Xe<He;){if(Se&ft||(ht=Rn(Je,Se,we)),e(ht!=null),oe(Fe),256>(lt=qr(ht.G[0],ht.H[0],Fe)))be[xe+Xe]=lt,++Xe,++Se>=$e&&(Se=0,++we<=R&&!(we%16)&&si(ve,we));else{if(!(280>lt)){Qe=0;break t}lt=Kn(lt-256,Fe);var Wt,Bt=qr(ht.G[4],ht.H[4],Fe);if(oe(Fe),!(Xe>=(Bt=Yi($e,Bt=Kn(Bt,Fe)))&&ot-Xe>=lt)){Qe=0;break t}for(Wt=0;Wt<lt;++Wt)be[xe+Xe+Wt]=be[xe+Xe+Wt-Bt];for(Xe+=lt,Se+=lt;Se>=$e;)Se-=$e,++we<=R&&!(we%16)&&si(ve,we);Xe<He&&Se&ft&&(ht=Rn(Je,Se,we))}e(Fe.h==ee(Fe))}si(ve,we>R?R:we);break t}!Qe||Fe.h&&Xe<ot?(Qe=0,ve.a=Fe.h?5:3):ve.$=Xe,R=Qe}else R=ka(ve,ve.V,ve.Ba,ve.c,ve.i,R,Bs);if(!R){re=0;break e}}Y+re>=pe&&(P.Cc=1),re=1}if(!re)return null;if(P.Cc&&((re=P.ga)!=null&&(re.mc=null),P.ga=null,0<P.Ga))return alert("todo:WebPDequantizeLevels"),null}return P.nb+Y*le}function on(P,R,Y,re,le,pe){for(;0<le--;){var ve,be=P,we=R+(Y?1:0),Se=P,Fe=R+(Y?0:3);for(ve=0;ve<re;++ve){var Je=Se[Fe+4*ve];Je!=255&&(Je*=32897,be[we+4*ve+0]=be[we+4*ve+0]*Je>>23,be[we+4*ve+1]=be[we+4*ve+1]*Je>>23,be[we+4*ve+2]=be[we+4*ve+2]*Je>>23)}R+=pe}}function mi(P,R,Y,re,le){for(;0<re--;){var pe;for(pe=0;pe<Y;++pe){var ve=P[R+2*pe+0],be=15&(Se=P[R+2*pe+1]),we=4369*be,Se=(240&Se|Se>>4)*we>>16;P[R+2*pe+0]=(240&ve|ve>>4)*we>>16&240|(15&ve|ve<<4)*we>>16>>4&15,P[R+2*pe+1]=240&Se|be}R+=le}}function _n(P,R,Y,re,le,pe,ve,be){var we,Se,Fe=255;for(Se=0;Se<le;++Se){for(we=0;we<re;++we){var Je=P[R+we];pe[ve+4*we]=Je,Fe&=Je}R+=Y,ve+=be}return Fe!=255}function Ai(P,R,Y,re,le){var pe;for(pe=0;pe<le;++pe)Y[re+pe]=P[R+pe]>>8}function Po(){Yo=on,Ku=mi,Dl=_n,Lc=Ai}function Qi(P,R,Y){F[P]=function(re,le,pe,ve,be,we,Se,Fe,Je,xe,$e,Qe,lt,Xe,ot,He,ft){var ht,Wt=ft-1>>1,Bt=be[we+0]|Se[Fe+0]<<16,hr=Je[xe+0]|$e[Qe+0]<<16;e(re!=null);var zt=3*Bt+hr+131074>>2;for(R(re[le+0],255&zt,zt>>16,lt,Xe),pe!=null&&(zt=3*hr+Bt+131074>>2,R(pe[ve+0],255&zt,zt>>16,ot,He)),ht=1;ht<=Wt;++ht){var Pr=be[we+ht]|Se[Fe+ht]<<16,qn=Je[xe+ht]|$e[Qe+ht]<<16,vr=Bt+Pr+hr+qn+524296,Ft=vr+2*(Pr+hr)>>3;zt=Ft+Bt>>1,Bt=(vr=vr+2*(Bt+qn)>>3)+Pr>>1,R(re[le+2*ht-1],255&zt,zt>>16,lt,Xe+(2*ht-1)*Y),R(re[le+2*ht-0],255&Bt,Bt>>16,lt,Xe+(2*ht-0)*Y),pe!=null&&(zt=vr+hr>>1,Bt=Ft+qn>>1,R(pe[ve+2*ht-1],255&zt,zt>>16,ot,He+(2*ht-1)*Y),R(pe[ve+2*ht+0],255&Bt,Bt>>16,ot,He+(2*ht+0)*Y)),Bt=Pr,hr=qn}1&ft||(zt=3*Bt+hr+131074>>2,R(re[le+ft-1],255&zt,zt>>16,lt,Xe+(ft-1)*Y),pe!=null&&(zt=3*hr+Bt+131074>>2,R(pe[ve+ft-1],255&zt,zt>>16,ot,He+(ft-1)*Y)))}}function Cc(){Ra[Bl]=Lh,Ra[Ko]=Ys,Ra[Tf]=Nh,Ra[zl]=wu,Ra[gu]=yi,Ra[fn]=Ni,Ra[Zu]=Bc,Ra[ql]=Ys,Ra[Ws]=wu,Ra[vu]=yi,Ra[mu]=Ni}function Oo(P){return P&-16384?0>P?0:255:P>>_s}function hs(P,R){return Oo((19077*P>>8)+(26149*R>>8)-14234)}function qs(P,R,Y){return Oo((19077*P>>8)-(6419*R>>8)-(13320*Y>>8)+8708)}function gl(P,R){return Oo((19077*P>>8)+(33050*R>>8)-17685)}function oo(P,R,Y,re,le){re[le+0]=hs(P,Y),re[le+1]=qs(P,R,Y),re[le+2]=gl(P,R)}function vl(P,R,Y,re,le){re[le+0]=gl(P,R),re[le+1]=qs(P,R,Y),re[le+2]=hs(P,Y)}function Pi(P,R,Y,re,le){var pe=qs(P,R,Y);R=pe<<3&224|gl(P,R)>>3,re[le+0]=248&hs(P,Y)|pe>>5,re[le+1]=R}function ds(P,R,Y,re,le){var pe=240&gl(P,R)|15;re[le+0]=240&hs(P,Y)|qs(P,R,Y)>>4,re[le+1]=pe}function Co(P,R,Y,re,le){re[le+0]=255,oo(P,R,Y,re,le+1)}function Ml(P,R,Y,re,le){vl(P,R,Y,re,le),re[le+3]=255}function Il(P,R,Y,re,le){oo(P,R,Y,re,le),re[le+3]=255}function zn(P,R){return 0>P?0:P>R?R:P}function so(P,R,Y){F[P]=function(re,le,pe,ve,be,we,Se,Fe,Je){for(var xe=Fe+(-2&Je)*Y;Fe!=xe;)R(re[le+0],pe[ve+0],be[we+0],Se,Fe),R(re[le+1],pe[ve+0],be[we+0],Se,Fe+Y),le+=2,++ve,++we,Fe+=2*Y;1&Je&&R(re[le+0],pe[ve+0],be[we+0],Se,Fe)}}function Lo(P,R,Y){return Y==0?P==0?R==0?6:5:R==0?4:0:Y}function Us(P,R,Y,re,le){switch(P>>>30){case 3:Hs(R,Y,re,le,0);break;case 2:Pn(R,Y,re,le);break;case 1:Cr(R,Y,re,le)}}function In(P,R){var Y,re,le=R.M,pe=R.Nb,ve=P.oc,be=P.pc+40,we=P.oc,Se=P.pc+584,Fe=P.oc,Je=P.pc+600;for(Y=0;16>Y;++Y)ve[be+32*Y-1]=129;for(Y=0;8>Y;++Y)we[Se+32*Y-1]=129,Fe[Je+32*Y-1]=129;for(0<le?ve[be-1-32]=we[Se-1-32]=Fe[Je-1-32]=129:(i(ve,be-32-1,127,21),i(we,Se-32-1,127,9),i(Fe,Je-32-1,127,9)),re=0;re<P.za;++re){var xe=R.ya[R.aa+re];if(0<re){for(Y=-1;16>Y;++Y)n(ve,be+32*Y-4,ve,be+32*Y+12,4);for(Y=-1;8>Y;++Y)n(we,Se+32*Y-4,we,Se+32*Y+4,4),n(Fe,Je+32*Y-4,Fe,Je+32*Y+4,4)}var $e=P.Gd,Qe=P.Hd+re,lt=xe.ad,Xe=xe.Hc;if(0<le&&(n(ve,be-32,$e[Qe].y,0,16),n(we,Se-32,$e[Qe].f,0,8),n(Fe,Je-32,$e[Qe].ea,0,8)),xe.Za){var ot=ve,He=be-32+16;for(0<le&&(re>=P.za-1?i(ot,He,$e[Qe].y[15],4):n(ot,He,$e[Qe+1].y,0,4)),Y=0;4>Y;Y++)ot[He+128+Y]=ot[He+256+Y]=ot[He+384+Y]=ot[He+0+Y];for(Y=0;16>Y;++Y,Xe<<=2)ot=ve,He=be+tc[Y],ta[xe.Ob[Y]](ot,He),Us(Xe,lt,16*+Y,ot,He)}else if(ot=Lo(re,le,xe.Ob[0]),ea[ot](ve,be),Xe!=0)for(Y=0;16>Y;++Y,Xe<<=2)Us(Xe,lt,16*+Y,ve,be+tc[Y]);for(Y=xe.Gc,ot=Lo(re,le,xe.Dd),ga[ot](we,Se),ga[ot](Fe,Je),Xe=lt,ot=we,He=Se,255&(xe=0|Y)&&(170&xe?pa(Xe,256,ot,He):ar(Xe,256,ot,He)),xe=Fe,Xe=Je,255&(Y>>=8)&&(170&Y?pa(lt,320,xe,Xe):ar(lt,320,xe,Xe)),le<P.Ub-1&&(n($e[Qe].y,0,ve,be+480,16),n($e[Qe].f,0,we,Se+224,8),n($e[Qe].ea,0,Fe,Je+224,8)),Y=8*pe*P.B,$e=P.sa,Qe=P.ta+16*re+16*pe*P.R,lt=P.qa,xe=P.ra+8*re+Y,Xe=P.Ha,ot=P.Ia+8*re+Y,Y=0;16>Y;++Y)n($e,Qe+Y*P.R,ve,be+32*Y,16);for(Y=0;8>Y;++Y)n(lt,xe+Y*P.B,we,Se+32*Y,8),n(Xe,ot+Y*P.B,Fe,Je+32*Y,8)}}function Ga(P,R,Y,re,le,pe,ve,be,we){var Se=[0],Fe=[0],Je=0,xe=we!=null?we.kd:0,$e=we??new at;if(P==null||12>Y)return 7;$e.data=P,$e.w=R,$e.ha=Y,R=[R],Y=[Y],$e.gb=[$e.gb];e:{var Qe=R,lt=Y,Xe=$e.gb;if(e(P!=null),e(lt!=null),e(Xe!=null),Xe[0]=0,12<=lt[0]&&!r(P,Qe[0],"RIFF")){if(r(P,Qe[0]+8,"WEBP")){Xe=3;break e}var ot=Ee(P,Qe[0]+4);if(12>ot||4294967286<ot){Xe=3;break e}if(xe&&ot>lt[0]-8){Xe=7;break e}Xe[0]=ot,Qe[0]+=12,lt[0]-=12}Xe=0}if(Xe!=0)return Xe;for(ot=0<$e.gb[0],Y=Y[0];;){e:{var He=P;lt=R,Xe=Y;var ft=Se,ht=Fe,Wt=Qe=[0];if((zt=Je=[Je])[0]=0,8>Xe[0])Xe=7;else{if(!r(He,lt[0],"VP8X")){if(Ee(He,lt[0]+4)!=10){Xe=3;break e}if(18>Xe[0]){Xe=7;break e}var Bt=Ee(He,lt[0]+8),hr=1+Ie(He,lt[0]+12);if(2147483648<=hr*(He=1+Ie(He,lt[0]+15))){Xe=3;break e}Wt!=null&&(Wt[0]=Bt),ft!=null&&(ft[0]=hr),ht!=null&&(ht[0]=He),lt[0]+=18,Xe[0]-=18,zt[0]=1}Xe=0}}if(Je=Je[0],Qe=Qe[0],Xe!=0)return Xe;if(lt=!!(2&Qe),!ot&&Je)return 3;if(pe!=null&&(pe[0]=!!(16&Qe)),ve!=null&&(ve[0]=lt),be!=null&&(be[0]=0),ve=Se[0],Qe=Fe[0],Je&<&&we==null){Xe=0;break}if(4>Y){Xe=7;break}if(ot&&Je||!ot&&!Je&&!r(P,R[0],"ALPH")){Y=[Y],$e.na=[$e.na],$e.P=[$e.P],$e.Sa=[$e.Sa];e:{Bt=P,Xe=R,ot=Y;var zt=$e.gb;ft=$e.na,ht=$e.P,Wt=$e.Sa,hr=22,e(Bt!=null),e(ot!=null),He=Xe[0];var Pr=ot[0];for(e(ft!=null),e(Wt!=null),ft[0]=null,ht[0]=null,Wt[0]=0;;){if(Xe[0]=He,ot[0]=Pr,8>Pr){Xe=7;break e}var qn=Ee(Bt,He+4);if(4294967286<qn){Xe=3;break e}var vr=8+qn+1&-2;if(hr+=vr,0<zt&&hr>zt){Xe=3;break e}if(!r(Bt,He,"VP8 ")||!r(Bt,He,"VP8L")){Xe=0;break e}if(Pr[0]<vr){Xe=7;break e}r(Bt,He,"ALPH")||(ft[0]=Bt,ht[0]=He+8,Wt[0]=qn),He+=vr,Pr-=vr}}if(Y=Y[0],$e.na=$e.na[0],$e.P=$e.P[0],$e.Sa=$e.Sa[0],Xe!=0)break}Y=[Y],$e.Ja=[$e.Ja],$e.xa=[$e.xa];e:if(zt=P,Xe=R,ot=Y,ft=$e.gb[0],ht=$e.Ja,Wt=$e.xa,Bt=Xe[0],He=!r(zt,Bt,"VP8 "),hr=!r(zt,Bt,"VP8L"),e(zt!=null),e(ot!=null),e(ht!=null),e(Wt!=null),8>ot[0])Xe=7;else{if(He||hr){if(zt=Ee(zt,Bt+4),12<=ft&&zt>ft-12){Xe=3;break e}if(xe&&zt>ot[0]-8){Xe=7;break e}ht[0]=zt,Xe[0]+=8,ot[0]-=8,Wt[0]=hr}else Wt[0]=5<=ot[0]&&zt[Bt+0]==47&&!(zt[Bt+4]>>5),ht[0]=ot[0];Xe=0}if(Y=Y[0],$e.Ja=$e.Ja[0],$e.xa=$e.xa[0],R=R[0],Xe!=0)break;if(4294967286<$e.Ja)return 3;if(be==null||lt||(be[0]=$e.xa?2:1),ve=[ve],Qe=[Qe],$e.xa){if(5>Y){Xe=7;break}be=ve,xe=Qe,lt=pe,P==null||5>Y?P=0:5<=Y&&P[R+0]==47&&!(P[R+4]>>5)?(ot=[0],zt=[0],ft=[0],te(ht=new U,P,R,Y),Fa(ht,ot,zt,ft)?(be!=null&&(be[0]=ot[0]),xe!=null&&(xe[0]=zt[0]),lt!=null&&(lt[0]=ft[0]),P=1):P=0):P=0}else{if(10>Y){Xe=7;break}be=Qe,P==null||10>Y||!Xi(P,R+3,Y-3)?P=0:(xe=P[R+0]|P[R+1]<<8|P[R+2]<<16,lt=16383&(P[R+7]<<8|P[R+6]),P=16383&(P[R+9]<<8|P[R+8]),1&xe||3<(xe>>1&7)||!(xe>>4&1)||xe>>5>=$e.Ja||!lt||!P?P=0:(ve&&(ve[0]=lt),be&&(be[0]=P),P=1))}if(!P||(ve=ve[0],Qe=Qe[0],Je&&(Se[0]!=ve||Fe[0]!=Qe)))return 3;we!=null&&(we[0]=$e,we.offset=R-we.w,e(4294967286>R-we.w),e(we.offset==we.ha-Y));break}return Xe==0||Xe==7&&Je&&we==null?(pe!=null&&(pe[0]|=$e.na!=null&&0<$e.na.length),re!=null&&(re[0]=ve),le!=null&&(le[0]=Qe),0):Xe}function ml(P,R,Y){var re=R.width,le=R.height,pe=0,ve=0,be=re,we=le;if(R.Da=P!=null&&0<P.Da,R.Da&&(be=P.cd,we=P.bd,pe=P.v,ve=P.j,11>Y||(pe&=-2,ve&=-2),0>pe||0>ve||0>=be||0>=we||pe+be>re||ve+we>le))return 0;if(R.v=pe,R.j=ve,R.va=pe+be,R.o=ve+we,R.U=be,R.T=we,R.da=P!=null&&0<P.da,R.da){if(!Oe(be,we,Y=[P.ib],pe=[P.hb]))return 0;R.ib=Y[0],R.hb=pe[0]}return R.ob=P!=null&&P.ob,R.Kb=P==null||!P.Sd,R.da&&(R.ob=R.ib<3*re/4&&R.hb<3*le/4,R.Kb=0),1}function jl(P){if(P==null)return 2;if(11>P.S){var R=P.f.RGBA;R.fb+=(P.height-1)*R.A,R.A=-R.A}else R=P.f.kb,P=P.height,R.O+=(P-1)*R.fa,R.fa=-R.fa,R.N+=(P-1>>1)*R.Ab,R.Ab=-R.Ab,R.W+=(P-1>>1)*R.Db,R.Db=-R.Db,R.F!=null&&(R.J+=(P-1)*R.lb,R.lb=-R.lb);return 0}function qi(P,R,Y,re){if(re==null||0>=P||0>=R)return 2;if(Y!=null){if(Y.Da){var le=Y.cd,pe=Y.bd,ve=-2&Y.v,be=-2&Y.j;if(0>ve||0>be||0>=le||0>=pe||ve+le>P||be+pe>R)return 2;P=le,R=pe}if(Y.da){if(!Oe(P,R,le=[Y.ib],pe=[Y.hb]))return 2;P=le[0],R=pe[0]}}re.width=P,re.height=R;e:{var we=re.width,Se=re.height;if(P=re.S,0>=we||0>=Se||!(P>=Bl&&13>P))P=2;else{if(0>=re.Rd&&re.sd==null){ve=pe=le=R=0;var Fe=(be=we*$l[P])*Se;if(11>P||(pe=(Se+1)/2*(R=(we+1)/2),P==12&&(ve=(le=we)*Se)),(Se=a(Fe+2*pe+ve))==null){P=1;break e}re.sd=Se,11>P?((we=re.f.RGBA).eb=Se,we.fb=0,we.A=be,we.size=Fe):((we=re.f.kb).y=Se,we.O=0,we.fa=be,we.Fd=Fe,we.f=Se,we.N=0+Fe,we.Ab=R,we.Cd=pe,we.ea=Se,we.W=0+Fe+pe,we.Db=R,we.Ed=pe,P==12&&(we.F=Se,we.J=0+Fe+2*pe),we.Tc=ve,we.lb=le)}if(R=1,le=re.S,pe=re.width,ve=re.height,le>=Bl&&13>le)if(11>le)P=re.f.RGBA,R&=(be=Math.abs(P.A))*(ve-1)+pe<=P.size,R&=be>=pe*$l[le],R&=P.eb!=null;else{P=re.f.kb,be=(pe+1)/2,Fe=(ve+1)/2,we=Math.abs(P.fa),Se=Math.abs(P.Ab);var Je=Math.abs(P.Db),xe=Math.abs(P.lb),$e=xe*(ve-1)+pe;R&=we*(ve-1)+pe<=P.Fd,R&=Se*(Fe-1)+be<=P.Cd,R=(R&=Je*(Fe-1)+be<=P.Ed)&we>=pe&Se>=be&Je>=be,R&=P.y!=null,R&=P.f!=null,R&=P.ea!=null,le==12&&(R&=xe>=pe,R&=$e<=P.Tc,R&=P.F!=null)}else R=0;P=R?0:2}}return P!=0||Y!=null&&Y.fd&&(P=jl(re)),P}var Oi=64,Na=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Wa=24,ha=32,Ji=8,No=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];Ne("Predictor0","PredictorAdd0"),F.Predictor0=function(){return 4278190080},F.Predictor1=function(P){return P},F.Predictor2=function(P,R,Y){return R[Y+0]},F.Predictor3=function(P,R,Y){return R[Y+1]},F.Predictor4=function(P,R,Y){return R[Y-1]},F.Predictor5=function(P,R,Y){return Ae(Ae(P,R[Y+1]),R[Y+0])},F.Predictor6=function(P,R,Y){return Ae(P,R[Y-1])},F.Predictor7=function(P,R,Y){return Ae(P,R[Y+0])},F.Predictor8=function(P,R,Y){return Ae(R[Y-1],R[Y+0])},F.Predictor9=function(P,R,Y){return Ae(R[Y+0],R[Y+1])},F.Predictor10=function(P,R,Y){return Ae(Ae(P,R[Y-1]),Ae(R[Y+0],R[Y+1]))},F.Predictor11=function(P,R,Y){var re=R[Y+0];return 0>=st(re>>24&255,P>>24&255,(R=R[Y-1])>>24&255)+st(re>>16&255,P>>16&255,R>>16&255)+st(re>>8&255,P>>8&255,R>>8&255)+st(255&re,255&P,255&R)?re:P},F.Predictor12=function(P,R,Y){var re=R[Y+0];return(Pe((P>>24&255)+(re>>24&255)-((R=R[Y-1])>>24&255))<<24|Pe((P>>16&255)+(re>>16&255)-(R>>16&255))<<16|Pe((P>>8&255)+(re>>8&255)-(R>>8&255))<<8|Pe((255&P)+(255&re)-(255&R)))>>>0},F.Predictor13=function(P,R,Y){var re=R[Y-1];return(Ue((P=Ae(P,R[Y+0]))>>24&255,re>>24&255)<<24|Ue(P>>16&255,re>>16&255)<<16|Ue(P>>8&255,re>>8&255)<<8|Ue(255&P,255&re))>>>0};var ps=F.PredictorAdd0;F.PredictorAdd1=dt,Ne("Predictor2","PredictorAdd2"),Ne("Predictor3","PredictorAdd3"),Ne("Predictor4","PredictorAdd4"),Ne("Predictor5","PredictorAdd5"),Ne("Predictor6","PredictorAdd6"),Ne("Predictor7","PredictorAdd7"),Ne("Predictor8","PredictorAdd8"),Ne("Predictor9","PredictorAdd9"),Ne("Predictor10","PredictorAdd10"),Ne("Predictor11","PredictorAdd11"),Ne("Predictor12","PredictorAdd12"),Ne("Predictor13","PredictorAdd13");var lo=F.PredictorAdd2;kt("ColorIndexInverseTransform","MapARGB","32b",function(P){return P>>8&255},function(P){return P}),kt("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(P){return P},function(P){return P>>8&255});var Jn,Wo=F.ColorIndexInverseTransform,ci=F.MapARGB,Ta=F.VP8LColorIndexInverseTransformAlpha,To=F.MapAlpha,da=F.VP8LPredictorsAdd=[];da.length=16,(F.VP8LPredictors=[]).length=16,(F.VP8LPredictorsAdd_C=[]).length=16,(F.VP8LPredictors_C=[]).length=16;var yl,Vo,gs,vs,en,ms,ys,Hs,Pn,pa,Cr,ar,Er,Lr,Va,$s,bs,Gs,Ci,bl,pu,Xu,Ya,Ui,Yo,Ku,Dl,Lc,Nc=a(511),Tc=a(2041),Rc=a(225),Mc=a(767),Ic=0,Xo=Tc,Fl=Rc,Li=Mc,uo=Nc,Bl=0,Ko=1,Tf=2,zl=3,gu=4,fn=5,Zu=6,ql=7,Ws=8,vu=9,mu=10,yu=[2,3,7],jc=[3,3,11],wl=[280,256,256,256,40],Ah=[0,1,1,1,0],Pd=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Ph=[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],Rf=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Qu=8,Vs=[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],Ju=[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],Ul=null,Mf=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],co=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Dc=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],ec=[[[[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]]]],Oh=[[[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]]],Ch=[[[[255,255,255,255,255,255,255,255,255,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]]]],Fc=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],ea=[],ta=[],ga=[],Ro=1,bu=2,ra=[],Ra=[];Qi("UpsampleRgbLinePair",oo,3),Qi("UpsampleBgrLinePair",vl,3),Qi("UpsampleRgbaLinePair",Il,4),Qi("UpsampleBgraLinePair",Ml,4),Qi("UpsampleArgbLinePair",Co,4),Qi("UpsampleRgba4444LinePair",ds,2),Qi("UpsampleRgb565LinePair",Pi,2);var Lh=F.UpsampleRgbLinePair,Nh=F.UpsampleBgrLinePair,Ys=F.UpsampleRgbaLinePair,wu=F.UpsampleBgraLinePair,yi=F.UpsampleArgbLinePair,Ni=F.UpsampleRgba4444LinePair,Bc=F.UpsampleRgb565LinePair,ws=16,Mo=1<<ws-1,tn=-227,sn=482,_s=6,Hi=0,va=a(256),_l=a(256),Hl=a(256),ma=a(256),_u=a(sn-tn),If=a(sn-tn);so("YuvToRgbRow",oo,3),so("YuvToBgrRow",vl,3),so("YuvToRgbaRow",Il,4),so("YuvToBgraRow",Ml,4),so("YuvToArgbRow",Co,4),so("YuvToRgba4444Row",ds,2),so("YuvToRgb565Row",Pi,2);var tc=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],xs=[0,2,8],Th=[8,7,6,4,4,2,2,2,1,1,1,1],Ss=1;this.WebPDecodeRGBA=function(P,R,Y,re,le){var pe=Ko,ve=new Ge,be=new xr;ve.ba=be,be.S=pe,be.width=[be.width],be.height=[be.height];var we=be.width,Se=be.height,Fe=new er;if(Fe==null||P==null)var Je=2;else e(Fe!=null),Je=Ga(P,R,Y,Fe.width,Fe.height,Fe.Pd,Fe.Qd,Fe.format,null);if(Je!=0?we=0:(we!=null&&(we[0]=Fe.width[0]),Se!=null&&(Se[0]=Fe.height[0]),we=1),we){be.width=be.width[0],be.height=be.height[0],re!=null&&(re[0]=be.width),le!=null&&(le[0]=be.height);e:{if(re=new Sr,(le=new at).data=P,le.w=R,le.ha=Y,le.kd=1,R=[0],e(le!=null),((P=Ga(le.data,le.w,le.ha,null,null,null,R,null,le))==0||P==7)&&R[0]&&(P=4),(R=P)==0){if(e(ve!=null),re.data=le.data,re.w=le.w+le.offset,re.ha=le.ha-le.offset,re.put=Qt,re.ac=Sn,re.bc=ca,re.ma=ve,le.xa){if((P=$o())==null){ve=1;break e}if(function(xe,$e){var Qe=[0],lt=[0],Xe=[0];t:for(;;){if(xe==null)return 0;if($e==null)return xe.a=2,0;if(xe.l=$e,xe.a=0,te(xe.m,$e.data,$e.w,$e.ha),!Fa(xe.m,Qe,lt,Xe)){xe.a=3;break t}if(xe.xb=bu,$e.width=Qe[0],$e.height=lt[0],!zi(Qe[0],lt[0],1,xe,null))break t;return 1}return e(xe.a!=0),0}(P,re)){if(re=(R=qi(re.width,re.height,ve.Oa,ve.ba))==0){t:{re=P;r:for(;;){if(re==null){re=0;break t}if(e(re.s.yc!=null),e(re.s.Ya!=null),e(0<re.s.Wb),e((Y=re.l)!=null),e((le=Y.ma)!=null),re.xb!=0){if(re.ca=le.ba,re.tb=le.tb,e(re.ca!=null),!ml(le.Oa,Y,zl)){re.a=2;break r}if(!to(re,Y.width)||Y.da)break r;if((Y.da||Ct(re.ca.S))&&Po(),11>re.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),re.ca.f.kb.F!=null&&Po()),re.Pb&&0<re.s.ua&&re.s.vb.X==null&&!ge(re.s.vb,re.s.Wa.Xa)){re.a=1;break r}re.xb=0}if(!ka(re,re.V,re.Ba,re.c,re.i,Y.o,Ho))break r;le.Dc=re.Ma,re=1;break t}e(re.a!=0),re=0}re=!re}re&&(R=P.a)}else R=P.a}else{if((P=new ss)==null){ve=1;break e}if(P.Fa=le.na,P.P=le.P,P.qc=le.Sa,ro(P,re)){if((R=qi(re.width,re.height,ve.Oa,ve.ba))==0){if(P.Aa=0,Y=ve.Oa,e((le=P)!=null),Y!=null){if(0<(we=0>(we=Y.Md)?0:100<we?255:255*we/100)){for(Se=Fe=0;4>Se;++Se)12>(Je=le.pb[Se]).lc&&(Je.ia=we*Th[0>Je.lc?0:Je.lc]>>3),Fe|=Je.ia;Fe&&(alert("todo:VP8InitRandom"),le.ia=1)}le.Ga=Y.Id,100<le.Ga?le.Ga=100:0>le.Ga&&(le.Ga=0)}(function(xe,$e){if(xe==null)return 0;if($e==null)return Tr(xe,2,"NULL VP8Io parameter in VP8Decode().");if(!xe.cb&&!ro(xe,$e))return 0;if(e(xe.cb),$e.ac==null||$e.ac($e)){$e.ob&&(xe.L=0);var Qe=xs[xe.L];if(xe.L==2?(xe.yb=0,xe.zb=0):(xe.yb=$e.v-Qe>>4,xe.zb=$e.j-Qe>>4,0>xe.yb&&(xe.yb=0),0>xe.zb&&(xe.zb=0)),xe.Va=$e.o+15+Qe>>4,xe.Hb=$e.va+15+Qe>>4,xe.Hb>xe.za&&(xe.Hb=xe.za),xe.Va>xe.Ub&&(xe.Va=xe.Ub),0<xe.L){var lt=xe.ed;for(Qe=0;4>Qe;++Qe){var Xe;if(xe.Qa.Cb){var ot=xe.Qa.Lb[Qe];xe.Qa.Fb||(ot+=lt.Tb)}else ot=lt.Tb;for(Xe=0;1>=Xe;++Xe){var He=xe.gd[Qe][Xe],ft=ot;if(lt.Pc&&(ft+=lt.vd[0],Xe&&(ft+=lt.od[0])),0<(ft=0>ft?0:63<ft?63:ft)){var ht=ft;0<lt.wb&&(ht=4<lt.wb?ht>>2:ht>>1)>9-lt.wb&&(ht=9-lt.wb),1>ht&&(ht=1),He.dd=ht,He.tc=2*ft+ht,He.ld=40<=ft?2:15<=ft?1:0}else He.tc=0;He.La=Xe}}}Qe=0}else Tr(xe,6,"Frame setup failed"),Qe=xe.a;if(Qe=Qe==0){if(Qe){xe.$c=0,0<xe.Aa||(xe.Ic=Ss);t:{Qe=xe.Ic,lt=4*(ht=xe.za);var Wt=32*ht,Bt=ht+1,hr=0<xe.L?ht*(0<xe.Aa?2:1):0,zt=(xe.Aa==2?2:1)*ht;if((He=lt+832+(Xe=3*(16*Qe+xs[xe.L])/2*Wt)+(ot=xe.Fa!=null&&0<xe.Fa.length?xe.Kc.c*xe.Kc.i:0))!=He)Qe=0;else{if(He>xe.Vb){if(xe.Vb=0,xe.Ec=a(He),xe.Fc=0,xe.Ec==null){Qe=Tr(xe,1,"no memory during frame initialization.");break t}xe.Vb=He}He=xe.Ec,ft=xe.Fc,xe.Ac=He,xe.Bc=ft,ft+=lt,xe.Gd=o(Wt,gi),xe.Hd=0,xe.rb=o(Bt+1,os),xe.sb=1,xe.wa=hr?o(hr,Pa):null,xe.Y=0,xe.D.Nb=0,xe.D.wa=xe.wa,xe.D.Y=xe.Y,0<xe.Aa&&(xe.D.Y+=ht),e(!0),xe.oc=He,xe.pc=ft,ft+=832,xe.ya=o(zt,ll),xe.aa=0,xe.D.ya=xe.ya,xe.D.aa=xe.aa,xe.Aa==2&&(xe.D.aa+=ht),xe.R=16*ht,xe.B=8*ht,ht=(Wt=xs[xe.L])*xe.R,Wt=Wt/2*xe.B,xe.sa=He,xe.ta=ft+ht,xe.qa=xe.sa,xe.ra=xe.ta+16*Qe*xe.R+Wt,xe.Ha=xe.qa,xe.Ia=xe.ra+8*Qe*xe.B+Wt,xe.$c=0,ft+=Xe,xe.mb=ot?He:null,xe.nb=ot?ft:null,e(ft+ot<=xe.Fc+xe.Vb),Mn(xe),i(xe.Ac,xe.Bc,0,lt),Qe=1}}if(Qe){if($e.ka=0,$e.y=xe.sa,$e.O=xe.ta,$e.f=xe.qa,$e.N=xe.ra,$e.ea=xe.Ha,$e.Vd=xe.Ia,$e.fa=xe.R,$e.Rc=xe.B,$e.F=null,$e.J=0,!Ic){for(Qe=-255;255>=Qe;++Qe)Nc[255+Qe]=0>Qe?-Qe:Qe;for(Qe=-1020;1020>=Qe;++Qe)Tc[1020+Qe]=-128>Qe?-128:127<Qe?127:Qe;for(Qe=-112;112>=Qe;++Qe)Rc[112+Qe]=-16>Qe?-16:15<Qe?15:Qe;for(Qe=-255;510>=Qe;++Qe)Mc[255+Qe]=0>Qe?0:255<Qe?255:Qe;Ic=1}ys=Rr,Hs=Oa,pa=Tl,Cr=us,ar=cu,Pn=Vu,Er=fa,Lr=Qn,Va=H,$s=ce,bs=vi,Gs=$a,Ci=ke,bl=De,pu=li,Xu=Ha,Ya=Ao,Ui=pl,ta[0]=Pc,ta[1]=cs,ta[2]=hl,ta[3]=So,ta[4]=Oc,ta[5]=wn,ta[6]=io,ta[7]=fu,ta[8]=zs,ta[9]=hu,ea[0]=no,ea[1]=kc,ea[2]=Ac,ea[3]=fl,ea[4]=Ba,ea[5]=za,ea[6]=qa,ga[0]=Go,ga[1]=cl,ga[2]=Yu,ga[3]=Ua,ga[4]=Ca,ga[5]=du,ga[6]=ao,Qe=1}else Qe=0}Qe&&(Qe=function(Pr,qn){for(Pr.M=0;Pr.M<Pr.Va;++Pr.M){var vr,Ft=Pr.Jc[Pr.M&Pr.Xb],St=Pr.m,Un=Pr;for(vr=0;vr<Un.za;++vr){var Ht=St,dr=Un,Mr=dr.Ac,bi=dr.Bc+4*vr,fi=dr.zc,Hr=dr.ya[dr.aa+vr];if(dr.Qa.Bb?Hr.$b=ye(Ht,dr.Pa.jb[0])?2+ye(Ht,dr.Pa.jb[2]):ye(Ht,dr.Pa.jb[1]):Hr.$b=0,dr.kc&&(Hr.Ad=ye(Ht,dr.Bd)),Hr.Za=!ye(Ht,145)+0,Hr.Za){var wi=Hr.Ob,vn=0;for(dr=0;4>dr;++dr){var jn,Nr=fi[0+dr];for(jn=0;4>jn;++jn){Nr=Oh[Mr[bi+jn]][Nr];for(var Gr=Dc[ye(Ht,Nr[0])];0<Gr;)Gr=Dc[2*Gr+ye(Ht,Nr[Gr])];Nr=-Gr,Mr[bi+jn]=Nr}n(wi,vn,Mr,bi,4),vn+=4,fi[0+dr]=Nr}}else Nr=ye(Ht,156)?ye(Ht,128)?1:3:ye(Ht,163)?2:0,Hr.Ob[0]=Nr,i(Mr,bi,Nr,4),i(fi,0,Nr,4);Hr.Dd=ye(Ht,142)?ye(Ht,114)?ye(Ht,183)?1:3:2:0}if(Un.m.Ka)return Tr(Pr,7,"Premature end-of-partition0 encountered.");for(;Pr.ja<Pr.za;++Pr.ja){if(Un=Ft,Ht=(St=Pr).rb[St.sb-1],Mr=St.rb[St.sb+St.ja],vr=St.ya[St.aa+St.ja],bi=St.kc?vr.Ad:0)Ht.la=Mr.la=0,vr.Za||(Ht.Na=Mr.Na=0),vr.Hc=0,vr.Gc=0,vr.ia=0;else{var On,Wr;if(Ht=Mr,Mr=Un,bi=St.Pa.Xc,fi=St.ya[St.aa+St.ja],Hr=St.pb[fi.$b],dr=fi.ad,wi=0,vn=St.rb[St.sb-1],Nr=jn=0,i(dr,wi,0,384),fi.Za)var Cn=0,Ln=bi[3];else{Gr=a(16);var rn=Ht.Na+vn.Na;if(rn=Ul(Mr,bi[1],rn,Hr.Eb,0,Gr,0),Ht.Na=vn.Na=(0<rn)+0,1<rn)ys(Gr,0,dr,wi);else{var Ti=Gr[0]+3>>3;for(Gr=0;256>Gr;Gr+=16)dr[wi+Gr]=Ti}Cn=1,Ln=bi[0]}var Kr=15&Ht.la,Zr=15&vn.la;for(Gr=0;4>Gr;++Gr){var ei=1&Zr;for(Ti=Wr=0;4>Ti;++Ti)Kr=Kr>>1|(ei=(rn=Ul(Mr,Ln,rn=ei+(1&Kr),Hr.Sc,Cn,dr,wi))>Cn)<<7,Wr=Wr<<2|(3<rn?3:1<rn?2:dr[wi+0]!=0),wi+=16;Kr>>=4,Zr=Zr>>1|ei<<7,jn=(jn<<8|Wr)>>>0}for(Ln=Kr,Cn=Zr>>4,On=0;4>On;On+=2){for(Wr=0,Kr=Ht.la>>4+On,Zr=vn.la>>4+On,Gr=0;2>Gr;++Gr){for(ei=1&Zr,Ti=0;2>Ti;++Ti)rn=ei+(1&Kr),Kr=Kr>>1|(ei=0<(rn=Ul(Mr,bi[2],rn,Hr.Qc,0,dr,wi)))<<3,Wr=Wr<<2|(3<rn?3:1<rn?2:dr[wi+0]!=0),wi+=16;Kr>>=2,Zr=Zr>>1|ei<<5}Nr|=Wr<<4*On,Ln|=Kr<<4<<On,Cn|=(240&Zr)<<On}Ht.la=Ln,vn.la=Cn,fi.Hc=jn,fi.Gc=Nr,fi.ia=43690&Nr?0:Hr.ia,bi=!(jn|Nr)}if(0<St.L&&(St.wa[St.Y+St.ja]=St.gd[vr.$b][vr.Za],St.wa[St.Y+St.ja].La|=!bi),Un.Ka)return Tr(Pr,7,"Premature end-of-file encountered.")}if(Mn(Pr),St=qn,Un=1,vr=(Ft=Pr).D,Ht=0<Ft.L&&Ft.M>=Ft.zb&&Ft.M<=Ft.Va,Ft.Aa==0)t:{if(vr.M=Ft.M,vr.uc=Ht,In(Ft,vr),Un=1,vr=(Wr=Ft.D).Nb,Ht=(Nr=xs[Ft.L])*Ft.R,Mr=Nr/2*Ft.B,Gr=16*vr*Ft.R,Ti=8*vr*Ft.B,bi=Ft.sa,fi=Ft.ta-Ht+Gr,Hr=Ft.qa,dr=Ft.ra-Mr+Ti,wi=Ft.Ha,vn=Ft.Ia-Mr+Ti,Zr=(Kr=Wr.M)==0,jn=Kr>=Ft.Va-1,Ft.Aa==2&&In(Ft,Wr),Wr.uc)for(ei=(rn=Ft).D.M,e(rn.D.uc),Wr=rn.yb;Wr<rn.Hb;++Wr){Cn=Wr,Ln=ei;var Ri=(ya=(kr=rn).D).Nb;On=kr.R;var ya=ya.wa[ya.Y+Cn],ti=kr.sa,Hn=kr.ta+16*Ri*On+16*Cn,ba=ya.dd,nn=ya.tc;if(nn!=0)if(e(3<=nn),kr.L==1)0<Cn&&Xu(ti,Hn,On,nn+4),ya.La&&Ui(ti,Hn,On,nn),0<Ln&&pu(ti,Hn,On,nn+4),ya.La&&Ya(ti,Hn,On,nn);else{var $i=kr.B,Vr=kr.qa,sr=kr.ra+8*Ri*$i+8*Cn,Ir=kr.Ha,kr=kr.Ia+8*Ri*$i+8*Cn;Ri=ya.ld,0<Cn&&(Lr(ti,Hn,On,nn+4,ba,Ri),$s(Vr,sr,Ir,kr,$i,nn+4,ba,Ri)),ya.La&&(Gs(ti,Hn,On,nn,ba,Ri),bl(Vr,sr,Ir,kr,$i,nn,ba,Ri)),0<Ln&&(Er(ti,Hn,On,nn+4,ba,Ri),Va(Vr,sr,Ir,kr,$i,nn+4,ba,Ri)),ya.La&&(bs(ti,Hn,On,nn,ba,Ri),Ci(Vr,sr,Ir,kr,$i,nn,ba,Ri))}}if(Ft.ia&&alert("todo:DitherRow"),St.put!=null){if(Wr=16*Kr,Kr=16*(Kr+1),Zr?(St.y=Ft.sa,St.O=Ft.ta+Gr,St.f=Ft.qa,St.N=Ft.ra+Ti,St.ea=Ft.Ha,St.W=Ft.Ia+Ti):(Wr-=Nr,St.y=bi,St.O=fi,St.f=Hr,St.N=dr,St.ea=wi,St.W=vn),jn||(Kr-=Nr),Kr>St.o&&(Kr=St.o),St.F=null,St.J=null,Ft.Fa!=null&&0<Ft.Fa.length&&Wr<Kr&&(St.J=ui(Ft,St,Wr,Kr-Wr),St.F=Ft.mb,St.F==null&&St.F.length==0)){Un=Tr(Ft,3,"Could not decode alpha data.");break t}Wr<St.j&&(Nr=St.j-Wr,Wr=St.j,e(!(1&Nr)),St.O+=Ft.R*Nr,St.N+=Ft.B*(Nr>>1),St.W+=Ft.B*(Nr>>1),St.F!=null&&(St.J+=St.width*Nr)),Wr<Kr&&(St.O+=St.v,St.N+=St.v>>1,St.W+=St.v>>1,St.F!=null&&(St.J+=St.v),St.ka=Wr-St.j,St.U=St.va-St.v,St.T=Kr-Wr,Un=St.put(St))}vr+1!=Ft.Ic||jn||(n(Ft.sa,Ft.ta-Ht,bi,fi+16*Ft.R,Ht),n(Ft.qa,Ft.ra-Mr,Hr,dr+8*Ft.B,Mr),n(Ft.Ha,Ft.Ia-Mr,wi,vn+8*Ft.B,Mr))}if(!Un)return Tr(Pr,6,"Output aborted.")}return 1}(xe,$e)),$e.bc!=null&&$e.bc($e),Qe&=1}return Qe?(xe.cb=0,Qe):0})(P,re)||(R=P.a)}}else R=P.a}R==0&&ve.Oa!=null&&ve.Oa.fd&&(R=jl(ve.ba))}ve=R}pe=ve!=0?null:11>pe?be.f.RGBA.eb:be.f.kb.y}else pe=null;return pe};var $l=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function h(F,j){for(var T="",L=0;L<4;L++)T+=String.fromCharCode(F[j++]);return T}function f(F,j){return F[j+0]|F[j+1]<<8}function g(F,j){return(F[j+0]|F[j+1]<<8|F[j+2]<<16)>>>0}function v(F,j){return(F[j+0]|F[j+1]<<8|F[j+2]<<16|F[j+3]<<24)>>>0}new u;var p=[0],y=[0],_=[],x=new u,b=t,E=function(F,j){var T={},L=0,$=!1,q=0,J=0;if(T.frames=[],!function(D,U){for(var X=0;X<4;X++)if(D[U+X]!="RIFF".charCodeAt(X))return!0;return!1}(F,j)){for(v(F,j+=4),j+=8;j<F.length;){var ae=h(F,j),ie=v(F,j+=4);j+=4;var Z=ie+(1&ie);switch(ae){case"VP8 ":case"VP8L":T.frames[L]===void 0&&(T.frames[L]={}),(B=T.frames[L]).src_off=$?J:j-8,B.src_size=q+ie+8,L++,$&&($=!1,q=0,J=0);break;case"VP8X":(B=T.header={}).feature_flags=F[j];var te=j+4;B.canvas_width=1+g(F,te),te+=3,B.canvas_height=1+g(F,te),te+=3;break;case"ALPH":$=!0,q=Z+8,J=j-8;break;case"ANIM":(B=T.header).bgcolor=v(F,j),te=j+4,B.loop_count=f(F,te),te+=2;break;case"ANMF":var V,B;(B=T.frames[L]={}).offset_x=2*g(F,j),j+=3,B.offset_y=2*g(F,j),j+=3,B.width=1+g(F,j),j+=3,B.height=1+g(F,j),j+=3,B.duration=g(F,j),j+=3,V=F[j++],B.dispose=1&V,B.blend=V>>1&1}ae!="ANMF"&&(j+=Z)}return T}}(b,0);E.response=b,E.rgbaoutput=!0,E.dataurl=!1;var A=E.header?E.header:null,S=E.frames?E.frames:null;if(A){A.loop_counter=A.loop_count,p=[A.canvas_height],y=[A.canvas_width];for(var k=0;k<S.length&&S[k].blend!=0;k++);}var I=S[0],O=x.WebPDecodeRGBA(b,I.src_off,I.src_size,y,p);I.rgba=O,I.imgwidth=y[0],I.imgheight=p[0];for(var M=0;M<y[0]*p[0]*4;M++)_[M]=O[M];return this.width=y,this.height=p,this.data=_,this}(function(t){var e,r,n,i,a,o,s,u,h,f=function(D){return D=D||{},this.isStrokeTransparent=D.isStrokeTransparent||!1,this.strokeOpacity=D.strokeOpacity||1,this.strokeStyle=D.strokeStyle||"#000000",this.fillStyle=D.fillStyle||"#000000",this.isFillTransparent=D.isFillTransparent||!1,this.fillOpacity=D.fillOpacity||1,this.font=D.font||"10px sans-serif",this.textBaseline=D.textBaseline||"alphabetic",this.textAlign=D.textAlign||"left",this.lineWidth=D.lineWidth||1,this.lineJoin=D.lineJoin||"miter",this.lineCap=D.lineCap||"butt",this.path=D.path||[],this.transform=D.transform!==void 0?D.transform.clone():new u,this.globalCompositeOperation=D.globalCompositeOperation||"normal",this.globalAlpha=D.globalAlpha||1,this.clip_path=D.clip_path||[],this.currentPoint=D.currentPoint||new o,this.miterLimit=D.miterLimit||10,this.lastPoint=D.lastPoint||new o,this.lineDashOffset=D.lineDashOffset||0,this.lineDash=D.lineDash||[],this.margin=D.margin||[0,0,0,0],this.prevPageLastElemOffset=D.prevPageLastElemOffset||0,this.ignoreClearRect=typeof D.ignoreClearRect!="boolean"||D.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new g(this),e=this.internal.f2,r=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,a=this.internal.getVerticalCoordinate,o=this.internal.Point,s=this.internal.Rectangle,u=this.internal.Matrix,h=new f}]);var g=function(D){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var U=D;Object.defineProperty(this,"pdf",{get:function(){return U}});var X=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return X},set:function(Ee){X=!!Ee}});var ee=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return ee},set:function(Ee){ee=!!Ee}});var K=0;Object.defineProperty(this,"posX",{get:function(){return K},set:function(Ee){isNaN(Ee)||(K=Ee)}});var oe=0;Object.defineProperty(this,"posY",{get:function(){return oe},set:function(Ee){isNaN(Ee)||(oe=Ee)}}),Object.defineProperty(this,"margin",{get:function(){return h.margin},set:function(Ee){var ge;typeof Ee=="number"?ge=[Ee,Ee,Ee,Ee]:((ge=new Array(4))[0]=Ee[0],ge[1]=Ee.length>=2?Ee[1]:ge[0],ge[2]=Ee.length>=3?Ee[2]:ge[0],ge[3]=Ee.length>=4?Ee[3]:ge[1]),h.margin=ge}});var me=!1;Object.defineProperty(this,"autoPaging",{get:function(){return me},set:function(Ee){me=Ee}});var de=0;Object.defineProperty(this,"lastBreak",{get:function(){return de},set:function(Ee){de=Ee}});var ye=[];Object.defineProperty(this,"pageBreaks",{get:function(){return ye},set:function(Ee){ye=Ee}}),Object.defineProperty(this,"ctx",{get:function(){return h},set:function(Ee){Ee instanceof f&&(h=Ee)}}),Object.defineProperty(this,"path",{get:function(){return h.path},set:function(Ee){h.path=Ee}});var Te=[];Object.defineProperty(this,"ctxStack",{get:function(){return Te},set:function(Ee){Te=Ee}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(Ee){var ge;ge=v(Ee),this.ctx.fillStyle=ge.style,this.ctx.isFillTransparent=ge.a===0,this.ctx.fillOpacity=ge.a,this.pdf.setFillColor(ge.r,ge.g,ge.b,{a:ge.a}),this.pdf.setTextColor(ge.r,ge.g,ge.b,{a:ge.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(Ee){var ge=v(Ee);this.ctx.strokeStyle=ge.style,this.ctx.isStrokeTransparent=ge.a===0,this.ctx.strokeOpacity=ge.a,ge.a===0?this.pdf.setDrawColor(255,255,255):(ge.a,this.pdf.setDrawColor(ge.r,ge.g,ge.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(Ee){["butt","round","square"].indexOf(Ee)!==-1&&(this.ctx.lineCap=Ee,this.pdf.setLineCap(Ee))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(Ee){isNaN(Ee)||(this.ctx.lineWidth=Ee,this.pdf.setLineWidth(Ee))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(Ee){["bevel","round","miter"].indexOf(Ee)!==-1&&(this.ctx.lineJoin=Ee,this.pdf.setLineJoin(Ee))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(Ee){isNaN(Ee)||(this.ctx.miterLimit=Ee,this.pdf.setMiterLimit(Ee))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(Ee){this.ctx.textBaseline=Ee}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(Ee){["right","end","center","left","start"].indexOf(Ee)!==-1&&(this.ctx.textAlign=Ee)}});var Ce=null,Ie=null;Object.defineProperty(this,"fontFaces",{get:function(){return Ie},set:function(Ee){Ce=null,Ie=Ee}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(Ee){var ge;if(this.ctx.font=Ee,(ge=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(Ee))!==null){var Re=ge[1];ge[2];var Be=ge[3],Oe=ge[4];ge[5];var fe=ge[6],Le=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Oe)[2];Oe=Math.floor(Le==="px"?parseFloat(Oe)*this.pdf.internal.scaleFactor:Le==="em"?parseFloat(Oe)*this.pdf.getFontSize():parseFloat(Oe)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Oe);var Ne=function(bt){var kt,zr,_r=[],It=bt.trim();if(It==="")return qv;if(It in Tw)return[Tw[It]];for(;It!=="";){switch(zr=null,kt=(It=Mw(It)).charAt(0)){case'"':case"'":zr=YI(It.substring(1),kt);break;default:zr=XI(It)}if(zr===null||(_r.push(zr[0]),(It=Mw(zr[1]))!==""&&It.charAt(0)!==","))return qv;It=It.replace(/^,/,"")}return _r}(fe);if(this.fontFaces){var ue=function(bt,kt){if(Ce===null){var zr=function(_r){var It=[];return Object.keys(_r).forEach(function(Jt){_r[Jt].forEach(function(Ve){var qe=null;switch(Ve){case"bold":qe={family:Jt,weight:"bold"};break;case"italic":qe={family:Jt,style:"italic"};break;case"bolditalic":qe={family:Jt,weight:"bold",style:"italic"};break;case"":case"normal":qe={family:Jt}}qe!==null&&(qe.ref={name:Jt,style:Ve},It.push(qe))})}),It}(bt.getFontList());Ce=function(_r){for(var It={},Jt=0;Jt<_r.length;++Jt){var Ve=zv(_r[Jt]),qe=Ve.family,Nt=Ve.stretch,Ct=Ve.style,ir=Ve.weight;It[qe]=It[qe]||{},It[qe][Nt]=It[qe][Nt]||{},It[qe][Nt][Ct]=It[qe][Nt][Ct]||{},It[qe][Nt][Ct][ir]=Ve}return It}(zr.concat(kt))}return Ce}(this.pdf,this.fontFaces),Ae=Ne.map(function(bt){return{family:bt,stretch:"normal",weight:Be,style:Re}}),Pe=function(bt,kt,zr){for(var _r=(zr=zr||{}).defaultFontFamily||"times",It=Object.assign({},VI,zr.genericFontFamilies||{}),Jt=null,Ve=null,qe=0;qe<kt.length;++qe)if(It[(Jt=zv(kt[qe])).family]&&(Jt.family=It[Jt.family]),bt.hasOwnProperty(Jt.family)){Ve=bt[Jt.family];break}if(!(Ve=Ve||bt[_r]))throw new Error("Could not find a font-family for the rule '"+Rw(Jt)+"' and default family '"+_r+"'.");if(Ve=function(Nt,Ct){if(Ct[Nt])return Ct[Nt];var ir=Mm[Nt],Ut=ir<=Mm.normal?-1:1,xr=Nw(Ct,lx,ir,Ut);if(!xr)throw new Error("Could not find a matching font-stretch value for "+Nt);return xr}(Jt.stretch,Ve),Ve=function(Nt,Ct){if(Ct[Nt])return Ct[Nt];for(var ir=sx[Nt],Ut=0;Ut<ir.length;++Ut)if(Ct[ir[Ut]])return Ct[ir[Ut]];throw new Error("Could not find a matching font-style for "+Nt)}(Jt.style,Ve),!(Ve=function(Nt,Ct){if(Ct[Nt])return Ct[Nt];if(Nt===400&&Ct[500])return Ct[500];if(Nt===500&&Ct[400])return Ct[400];var ir=WI[Nt],Ut=Nw(Ct,ux,ir,Nt<400?-1:1);if(!Ut)throw new Error("Could not find a matching font-weight for value "+Nt);return Ut}(Jt.weight,Ve)))throw new Error("Failed to resolve a font for the rule '"+Rw(Jt)+"'.");return Ve}(ue,Ae);this.pdf.setFont(Pe.ref.name,Pe.ref.style)}else{var Ue="";(Be==="bold"||parseInt(Be,10)>=700||Re==="bold")&&(Ue="bold"),Re==="italic"&&(Ue+="italic"),Ue.length===0&&(Ue="normal");for(var st="",dt={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},pt=0;pt<Ne.length;pt++){if(this.pdf.internal.getFont(Ne[pt],Ue,{noFallback:!0,disableWarning:!0})!==void 0){st=Ne[pt];break}if(Ue==="bolditalic"&&this.pdf.internal.getFont(Ne[pt],"bold",{noFallback:!0,disableWarning:!0})!==void 0)st=Ne[pt],Ue="bold";else if(this.pdf.internal.getFont(Ne[pt],"normal",{noFallback:!0,disableWarning:!0})!==void 0){st=Ne[pt],Ue="normal";break}}if(st===""){for(var xt=0;xt<Ne.length;xt++)if(dt[Ne[xt]]){st=dt[Ne[xt]];break}}st=st===""?"Times":st,this.pdf.setFont(st,Ue)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(Ee){this.ctx.globalCompositeOperation=Ee}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(Ee){this.ctx.globalAlpha=Ee}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(Ee){this.ctx.lineDashOffset=Ee,B.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(Ee){this.ctx.lineDash=Ee,B.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(Ee){this.ctx.ignoreClearRect=!!Ee}})};g.prototype.setLineDash=function(D){this.lineDash=D},g.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},g.prototype.fill=function(){S.call(this,"fill",!1)},g.prototype.stroke=function(){S.call(this,"stroke",!1)},g.prototype.beginPath=function(){this.path=[{type:"begin"}]},g.prototype.moveTo=function(D,U){if(isNaN(D)||isNaN(U))throw Yn.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var X=this.ctx.transform.applyToPoint(new o(D,U));this.path.push({type:"mt",x:X.x,y:X.y}),this.ctx.lastPoint=new o(D,U)},g.prototype.closePath=function(){var D=new o(0,0),U=0;for(U=this.path.length-1;U!==-1;U--)if(this.path[U].type==="begin"&&Nn(this.path[U+1])==="object"&&typeof this.path[U+1].x=="number"){D=new o(this.path[U+1].x,this.path[U+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(D.x,D.y)},g.prototype.lineTo=function(D,U){if(isNaN(D)||isNaN(U))throw Yn.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var X=this.ctx.transform.applyToPoint(new o(D,U));this.path.push({type:"lt",x:X.x,y:X.y}),this.ctx.lastPoint=new o(X.x,X.y)},g.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),S.call(this,null,!0)},g.prototype.quadraticCurveTo=function(D,U,X,ee){if(isNaN(X)||isNaN(ee)||isNaN(D)||isNaN(U))throw Yn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var K=this.ctx.transform.applyToPoint(new o(X,ee)),oe=this.ctx.transform.applyToPoint(new o(D,U));this.path.push({type:"qct",x1:oe.x,y1:oe.y,x:K.x,y:K.y}),this.ctx.lastPoint=new o(K.x,K.y)},g.prototype.bezierCurveTo=function(D,U,X,ee,K,oe){if(isNaN(K)||isNaN(oe)||isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var me=this.ctx.transform.applyToPoint(new o(K,oe)),de=this.ctx.transform.applyToPoint(new o(D,U)),ye=this.ctx.transform.applyToPoint(new o(X,ee));this.path.push({type:"bct",x1:de.x,y1:de.y,x2:ye.x,y2:ye.y,x:me.x,y:me.y}),this.ctx.lastPoint=new o(me.x,me.y)},g.prototype.arc=function(D,U,X,ee,K,oe){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee)||isNaN(K))throw Yn.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(oe=!!oe,!this.ctx.transform.isIdentity){var me=this.ctx.transform.applyToPoint(new o(D,U));D=me.x,U=me.y;var de=this.ctx.transform.applyToPoint(new o(0,X)),ye=this.ctx.transform.applyToPoint(new o(0,0));X=Math.sqrt(Math.pow(de.x-ye.x,2)+Math.pow(de.y-ye.y,2))}Math.abs(K-ee)>=2*Math.PI&&(ee=0,K=2*Math.PI),this.path.push({type:"arc",x:D,y:U,radius:X,startAngle:ee,endAngle:K,counterclockwise:oe})},g.prototype.arcTo=function(D,U,X,ee,K){throw new Error("arcTo not implemented.")},g.prototype.rect=function(D,U,X,ee){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yn.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(D,U),this.lineTo(D+X,U),this.lineTo(D+X,U+ee),this.lineTo(D,U+ee),this.lineTo(D,U),this.lineTo(D+X,U),this.lineTo(D,U)},g.prototype.fillRect=function(D,U,X,ee){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yn.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!p.call(this)){var K={};this.lineCap!=="butt"&&(K.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(K.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(D,U,X,ee),this.fill(),K.hasOwnProperty("lineCap")&&(this.lineCap=K.lineCap),K.hasOwnProperty("lineJoin")&&(this.lineJoin=K.lineJoin)}},g.prototype.strokeRect=function(D,U,X,ee){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yn.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");y.call(this)||(this.beginPath(),this.rect(D,U,X,ee),this.stroke())},g.prototype.clearRect=function(D,U,X,ee){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee))throw Yn.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(D,U,X,ee))},g.prototype.save=function(D){D=typeof D!="boolean"||D;for(var U=this.pdf.internal.getCurrentPageInfo().pageNumber,X=0;X<this.pdf.internal.getNumberOfPages();X++)this.pdf.setPage(X+1),this.pdf.internal.out("q");if(this.pdf.setPage(U),D){this.ctx.fontSize=this.pdf.internal.getFontSize();var ee=new f(this.ctx);this.ctxStack.push(this.ctx),this.ctx=ee}},g.prototype.restore=function(D){D=typeof D!="boolean"||D;for(var U=this.pdf.internal.getCurrentPageInfo().pageNumber,X=0;X<this.pdf.internal.getNumberOfPages();X++)this.pdf.setPage(X+1),this.pdf.internal.out("Q");this.pdf.setPage(U),D&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},g.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var v=function(D){var U,X,ee,K;if(D.isCanvasGradient===!0&&(D=D.getColor()),!D)return{r:0,g:0,b:0,a:0,style:D};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(D))U=0,X=0,ee=0,K=0;else{var oe=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(D);if(oe!==null)U=parseInt(oe[1]),X=parseInt(oe[2]),ee=parseInt(oe[3]),K=1;else if((oe=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(D))!==null)U=parseInt(oe[1]),X=parseInt(oe[2]),ee=parseInt(oe[3]),K=parseFloat(oe[4]);else{if(K=1,typeof D=="string"&&D.charAt(0)!=="#"){var me=new ex(D);D=me.ok?me.toHex():"#000000"}D.length===4?(U=D.substring(1,2),U+=U,X=D.substring(2,3),X+=X,ee=D.substring(3,4),ee+=ee):(U=D.substring(1,3),X=D.substring(3,5),ee=D.substring(5,7)),U=parseInt(U,16),X=parseInt(X,16),ee=parseInt(ee,16)}}return{r:U,g:X,b:ee,a:K,style:D}},p=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},y=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};g.prototype.fillText=function(D,U,X,ee){if(isNaN(U)||isNaN(X)||typeof D!="string")throw Yn.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(ee=isNaN(ee)?void 0:ee,!p.call(this)){var K=Z(this.ctx.transform.rotation),oe=this.ctx.transform.scaleX;L.call(this,{text:D,x:U,y:X,scale:oe,angle:K,align:this.textAlign,maxWidth:ee})}},g.prototype.strokeText=function(D,U,X,ee){if(isNaN(U)||isNaN(X)||typeof D!="string")throw Yn.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!y.call(this)){ee=isNaN(ee)?void 0:ee;var K=Z(this.ctx.transform.rotation),oe=this.ctx.transform.scaleX;L.call(this,{text:D,x:U,y:X,scale:oe,renderingMode:"stroke",angle:K,align:this.textAlign,maxWidth:ee})}},g.prototype.measureText=function(D){if(typeof D!="string")throw Yn.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var U=this.pdf,X=this.pdf.internal.scaleFactor,ee=U.internal.getFontSize(),K=U.getStringUnitWidth(D)*ee/U.internal.scaleFactor;return new function(oe){var me=(oe=oe||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return me}}),this}({width:K*=Math.round(96*X/72*1e4)/1e4})},g.prototype.scale=function(D,U){if(isNaN(D)||isNaN(U))throw Yn.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var X=new u(D,0,0,U,0,0);this.ctx.transform=this.ctx.transform.multiply(X)},g.prototype.rotate=function(D){if(isNaN(D))throw Yn.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var U=new u(Math.cos(D),Math.sin(D),-Math.sin(D),Math.cos(D),0,0);this.ctx.transform=this.ctx.transform.multiply(U)},g.prototype.translate=function(D,U){if(isNaN(D)||isNaN(U))throw Yn.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var X=new u(1,0,0,1,D,U);this.ctx.transform=this.ctx.transform.multiply(X)},g.prototype.transform=function(D,U,X,ee,K,oe){if(isNaN(D)||isNaN(U)||isNaN(X)||isNaN(ee)||isNaN(K)||isNaN(oe))throw Yn.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var me=new u(D,U,X,ee,K,oe);this.ctx.transform=this.ctx.transform.multiply(me)},g.prototype.setTransform=function(D,U,X,ee,K,oe){D=isNaN(D)?1:D,U=isNaN(U)?0:U,X=isNaN(X)?0:X,ee=isNaN(ee)?1:ee,K=isNaN(K)?0:K,oe=isNaN(oe)?0:oe,this.ctx.transform=new u(D,U,X,ee,K,oe)};var _=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};g.prototype.drawImage=function(D,U,X,ee,K,oe,me,de,ye){var Te=this.pdf.getImageProperties(D),Ce=1,Ie=1,Ee=1,ge=1;ee!==void 0&&de!==void 0&&(Ee=de/ee,ge=ye/K,Ce=Te.width/ee*de/ee,Ie=Te.height/K*ye/K),oe===void 0&&(oe=U,me=X,U=0,X=0),ee!==void 0&&de===void 0&&(de=ee,ye=K),ee===void 0&&de===void 0&&(de=Te.width,ye=Te.height);for(var Re,Be=this.ctx.transform.decompose(),Oe=Z(Be.rotate.shx),fe=new u,Le=(fe=(fe=(fe=fe.multiply(Be.translate)).multiply(Be.skew)).multiply(Be.scale)).applyToRectangle(new s(oe-U*Ee,me-X*ge,ee*Ce,K*Ie)),Ne=x.call(this,Le),ue=[],Ae=0;Ae<Ne.length;Ae+=1)ue.indexOf(Ne[Ae])===-1&&ue.push(Ne[Ae]);if(A(ue),this.autoPaging)for(var Pe=ue[0],Ue=ue[ue.length-1],st=Pe;st<Ue+1;st++){this.pdf.setPage(st);var dt=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],pt=st===1?this.posY+this.margin[0]:this.margin[0],xt=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],bt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],kt=st===1?0:xt+(st-2)*bt;if(this.ctx.clip_path.length!==0){var zr=this.path;Re=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=E(Re,this.posX+this.margin[3],-kt+pt+this.ctx.prevPageLastElemOffset),k.call(this,"fill",!0),this.path=zr}var _r=JSON.parse(JSON.stringify(Le));_r=E([_r],this.posX+this.margin[3],-kt+pt+this.ctx.prevPageLastElemOffset)[0];var It=(st>Pe||st<Ue)&&_.call(this);It&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],dt,bt,null).clip().discardPath()),this.pdf.addImage(D,"JPEG",_r.x,_r.y,_r.w,_r.h,null,null,Oe),It&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(D,"JPEG",Le.x,Le.y,Le.w,Le.h,null,null,Oe)};var x=function(D,U,X){var ee=[];U=U||this.pdf.internal.pageSize.width,X=X||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var K=this.posY+this.ctx.prevPageLastElemOffset;switch(D.type){default:case"mt":case"lt":ee.push(Math.floor((D.y+K)/X)+1);break;case"arc":ee.push(Math.floor((D.y+K-D.radius)/X)+1),ee.push(Math.floor((D.y+K+D.radius)/X)+1);break;case"qct":var oe=te(this.ctx.lastPoint.x,this.ctx.lastPoint.y,D.x1,D.y1,D.x,D.y);ee.push(Math.floor((oe.y+K)/X)+1),ee.push(Math.floor((oe.y+oe.h+K)/X)+1);break;case"bct":var me=V(this.ctx.lastPoint.x,this.ctx.lastPoint.y,D.x1,D.y1,D.x2,D.y2,D.x,D.y);ee.push(Math.floor((me.y+K)/X)+1),ee.push(Math.floor((me.y+me.h+K)/X)+1);break;case"rect":ee.push(Math.floor((D.y+K)/X)+1),ee.push(Math.floor((D.y+D.h+K)/X)+1)}for(var de=0;de<ee.length;de+=1)for(;this.pdf.internal.getNumberOfPages()<ee[de];)b.call(this);return ee},b=function(){var D=this.fillStyle,U=this.strokeStyle,X=this.font,ee=this.lineCap,K=this.lineWidth,oe=this.lineJoin;this.pdf.addPage(),this.fillStyle=D,this.strokeStyle=U,this.font=X,this.lineCap=ee,this.lineWidth=K,this.lineJoin=oe},E=function(D,U,X){for(var ee=0;ee<D.length;ee++)switch(D[ee].type){case"bct":D[ee].x2+=U,D[ee].y2+=X;case"qct":D[ee].x1+=U,D[ee].y1+=X;default:D[ee].x+=U,D[ee].y+=X}return D},A=function(D){return D.sort(function(U,X){return U-X})},S=function(D,U){for(var X,ee,K=this.fillStyle,oe=this.strokeStyle,me=this.lineCap,de=this.lineWidth,ye=Math.abs(de*this.ctx.transform.scaleX),Te=this.lineJoin,Ce=JSON.parse(JSON.stringify(this.path)),Ie=JSON.parse(JSON.stringify(this.path)),Ee=[],ge=0;ge<Ie.length;ge++)if(Ie[ge].x!==void 0)for(var Re=x.call(this,Ie[ge]),Be=0;Be<Re.length;Be+=1)Ee.indexOf(Re[Be])===-1&&Ee.push(Re[Be]);for(var Oe=0;Oe<Ee.length;Oe++)for(;this.pdf.internal.getNumberOfPages()<Ee[Oe];)b.call(this);if(A(Ee),this.autoPaging)for(var fe=Ee[0],Le=Ee[Ee.length-1],Ne=fe;Ne<Le+1;Ne++){this.pdf.setPage(Ne),this.fillStyle=K,this.strokeStyle=oe,this.lineCap=me,this.lineWidth=ye,this.lineJoin=Te;var ue=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ae=Ne===1?this.posY+this.margin[0]:this.margin[0],Pe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ue=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],st=Ne===1?0:Pe+(Ne-2)*Ue;if(this.ctx.clip_path.length!==0){var dt=this.path;X=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=E(X,this.posX+this.margin[3],-st+Ae+this.ctx.prevPageLastElemOffset),k.call(this,D,!0),this.path=dt}if(ee=JSON.parse(JSON.stringify(Ce)),this.path=E(ee,this.posX+this.margin[3],-st+Ae+this.ctx.prevPageLastElemOffset),U===!1||Ne===0){var pt=(Ne>fe||Ne<Le)&&_.call(this);pt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ue,Ue,null).clip().discardPath()),k.call(this,D,U),pt&&this.pdf.restoreGraphicsState()}this.lineWidth=de}else this.lineWidth=ye,k.call(this,D,U),this.lineWidth=de;this.path=Ce},k=function(D,U){if((D!=="stroke"||U||!y.call(this))&&(D==="stroke"||U||!p.call(this))){for(var X,ee,K=[],oe=this.path,me=0;me<oe.length;me++){var de=oe[me];switch(de.type){case"begin":K.push({begin:!0});break;case"close":K.push({close:!0});break;case"mt":K.push({start:de,deltas:[],abs:[]});break;case"lt":var ye=K.length;if(oe[me-1]&&!isNaN(oe[me-1].x)&&(X=[de.x-oe[me-1].x,de.y-oe[me-1].y],ye>0)){for(;ye>=0;ye--)if(K[ye-1].close!==!0&&K[ye-1].begin!==!0){K[ye-1].deltas.push(X),K[ye-1].abs.push(de);break}}break;case"bct":X=[de.x1-oe[me-1].x,de.y1-oe[me-1].y,de.x2-oe[me-1].x,de.y2-oe[me-1].y,de.x-oe[me-1].x,de.y-oe[me-1].y],K[K.length-1].deltas.push(X);break;case"qct":var Te=oe[me-1].x+2/3*(de.x1-oe[me-1].x),Ce=oe[me-1].y+2/3*(de.y1-oe[me-1].y),Ie=de.x+2/3*(de.x1-de.x),Ee=de.y+2/3*(de.y1-de.y),ge=de.x,Re=de.y;X=[Te-oe[me-1].x,Ce-oe[me-1].y,Ie-oe[me-1].x,Ee-oe[me-1].y,ge-oe[me-1].x,Re-oe[me-1].y],K[K.length-1].deltas.push(X);break;case"arc":K.push({deltas:[],abs:[],arc:!0}),Array.isArray(K[K.length-1].abs)&&K[K.length-1].abs.push(de)}}ee=U?null:D==="stroke"?"stroke":"fill";for(var Be=!1,Oe=0;Oe<K.length;Oe++)if(K[Oe].arc)for(var fe=K[Oe].abs,Le=0;Le<fe.length;Le++){var Ne=fe[Le];Ne.type==="arc"?M.call(this,Ne.x,Ne.y,Ne.radius,Ne.startAngle,Ne.endAngle,Ne.counterclockwise,void 0,U,!Be):$.call(this,Ne.x,Ne.y),Be=!0}else if(K[Oe].close===!0)this.pdf.internal.out("h"),Be=!1;else if(K[Oe].begin!==!0){var ue=K[Oe].start.x,Ae=K[Oe].start.y;q.call(this,K[Oe].deltas,ue,Ae),Be=!0}ee&&F.call(this,ee),U&&j.call(this)}},I=function(D){var U=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,X=U*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return D-X;case"top":return D+U-X;case"hanging":return D+U-2*X;case"middle":return D+U/2-X;default:return D}},O=function(D){return D+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};g.prototype.createLinearGradient=function(){var D=function(){};return D.colorStops=[],D.addColorStop=function(U,X){this.colorStops.push([U,X])},D.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},D.isCanvasGradient=!0,D},g.prototype.createPattern=function(){return this.createLinearGradient()},g.prototype.createRadialGradient=function(){return this.createLinearGradient()};var M=function(D,U,X,ee,K,oe,me,de,ye){for(var Te=ae.call(this,X,ee,K,oe),Ce=0;Ce<Te.length;Ce++){var Ie=Te[Ce];Ce===0&&(ye?T.call(this,Ie.x1+D,Ie.y1+U):$.call(this,Ie.x1+D,Ie.y1+U)),J.call(this,D,U,Ie.x2,Ie.y2,Ie.x3,Ie.y3,Ie.x4,Ie.y4)}de?j.call(this):F.call(this,me)},F=function(D){switch(D){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},j=function(){this.pdf.clip(),this.pdf.discardPath()},T=function(D,U){this.pdf.internal.out(r(D)+" "+n(U)+" m")},L=function(D){var U;switch(D.align){case"right":case"end":U="right";break;case"center":U="center";break;default:U="left"}var X=this.pdf.getTextDimensions(D.text),ee=I.call(this,D.y),K=O.call(this,ee)-X.h,oe=this.ctx.transform.applyToPoint(new o(D.x,ee)),me=this.ctx.transform.decompose(),de=new u;de=(de=(de=de.multiply(me.translate)).multiply(me.skew)).multiply(me.scale);for(var ye,Te,Ce,Ie=this.ctx.transform.applyToRectangle(new s(D.x,ee,X.w,X.h)),Ee=de.applyToRectangle(new s(D.x,K,X.w,X.h)),ge=x.call(this,Ee),Re=[],Be=0;Be<ge.length;Be+=1)Re.indexOf(ge[Be])===-1&&Re.push(ge[Be]);if(A(Re),this.autoPaging)for(var Oe=Re[0],fe=Re[Re.length-1],Le=Oe;Le<fe+1;Le++){this.pdf.setPage(Le);var Ne=Le===1?this.posY+this.margin[0]:this.margin[0],ue=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ae=this.pdf.internal.pageSize.height-this.margin[2],Pe=Ae-this.margin[0],Ue=this.pdf.internal.pageSize.width-this.margin[1],st=Ue-this.margin[3],dt=Le===1?0:ue+(Le-2)*Pe;if(this.ctx.clip_path.length!==0){var pt=this.path;ye=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=E(ye,this.posX+this.margin[3],-1*dt+Ne),k.call(this,"fill",!0),this.path=pt}var xt=E([JSON.parse(JSON.stringify(Ee))],this.posX+this.margin[3],-dt+Ne+this.ctx.prevPageLastElemOffset)[0];D.scale>=.01&&(Te=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Te*D.scale),Ce=this.lineWidth,this.lineWidth=Ce*D.scale);var bt=this.autoPaging!=="text";if(bt||xt.y+xt.h<=Ae){if(bt||xt.y>=Ne&&xt.x<=Ue){var kt=bt?D.text:this.pdf.splitTextToSize(D.text,D.maxWidth||Ue-xt.x)[0],zr=E([JSON.parse(JSON.stringify(Ie))],this.posX+this.margin[3],-dt+Ne+this.ctx.prevPageLastElemOffset)[0],_r=bt&&(Le>Oe||Le<fe)&&_.call(this);_r&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],st,Pe,null).clip().discardPath()),this.pdf.text(kt,zr.x,zr.y,{angle:D.angle,align:U,renderingMode:D.renderingMode}),_r&&this.pdf.restoreGraphicsState()}}else xt.y<Ae&&(this.ctx.prevPageLastElemOffset+=Ae-xt.y);D.scale>=.01&&(this.pdf.setFontSize(Te),this.lineWidth=Ce)}else D.scale>=.01&&(Te=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Te*D.scale),Ce=this.lineWidth,this.lineWidth=Ce*D.scale),this.pdf.text(D.text,oe.x+this.posX,oe.y+this.posY,{angle:D.angle,align:U,renderingMode:D.renderingMode,maxWidth:D.maxWidth}),D.scale>=.01&&(this.pdf.setFontSize(Te),this.lineWidth=Ce)},$=function(D,U,X,ee){X=X||0,ee=ee||0,this.pdf.internal.out(r(D+X)+" "+n(U+ee)+" l")},q=function(D,U,X){return this.pdf.lines(D,U,X,null,null)},J=function(D,U,X,ee,K,oe,me,de){this.pdf.internal.out([e(i(X+D)),e(a(ee+U)),e(i(K+D)),e(a(oe+U)),e(i(me+D)),e(a(de+U)),"c"].join(" "))},ae=function(D,U,X,ee){for(var K=2*Math.PI,oe=Math.PI/2;U>X;)U-=K;var me=Math.abs(X-U);me<K&&ee&&(me=K-me);for(var de=[],ye=ee?-1:1,Te=U;me>1e-5;){var Ce=Te+ye*Math.min(me,oe);de.push(ie.call(this,D,Te,Ce)),me-=Math.abs(Ce-Te),Te=Ce}return de},ie=function(D,U,X){var ee=(X-U)/2,K=D*Math.cos(ee),oe=D*Math.sin(ee),me=K,de=-oe,ye=me*me+de*de,Te=ye+me*K+de*oe,Ce=4/3*(Math.sqrt(2*ye*Te)-Te)/(me*oe-de*K),Ie=me-Ce*de,Ee=de+Ce*me,ge=Ie,Re=-Ee,Be=ee+U,Oe=Math.cos(Be),fe=Math.sin(Be);return{x1:D*Math.cos(U),y1:D*Math.sin(U),x2:Ie*Oe-Ee*fe,y2:Ie*fe+Ee*Oe,x3:ge*Oe-Re*fe,y3:ge*fe+Re*Oe,x4:D*Math.cos(X),y4:D*Math.sin(X)}},Z=function(D){return 180*D/Math.PI},te=function(D,U,X,ee,K,oe){var me=D+.5*(X-D),de=U+.5*(ee-U),ye=K+.5*(X-K),Te=oe+.5*(ee-oe),Ce=Math.min(D,K,me,ye),Ie=Math.max(D,K,me,ye),Ee=Math.min(U,oe,de,Te),ge=Math.max(U,oe,de,Te);return new s(Ce,Ee,Ie-Ce,ge-Ee)},V=function(D,U,X,ee,K,oe,me,de){var ye,Te,Ce,Ie,Ee,ge,Re,Be,Oe,fe,Le,Ne,ue,Ae,Pe=X-D,Ue=ee-U,st=K-X,dt=oe-ee,pt=me-K,xt=de-oe;for(Te=0;Te<41;Te++)Oe=(Re=(Ce=D+(ye=Te/40)*Pe)+ye*((Ee=X+ye*st)-Ce))+ye*(Ee+ye*(K+ye*pt-Ee)-Re),fe=(Be=(Ie=U+ye*Ue)+ye*((ge=ee+ye*dt)-Ie))+ye*(ge+ye*(oe+ye*xt-ge)-Be),Te==0?(Le=Oe,Ne=fe,ue=Oe,Ae=fe):(Le=Math.min(Le,Oe),Ne=Math.min(Ne,fe),ue=Math.max(ue,Oe),Ae=Math.max(Ae,fe));return new s(Math.round(Le),Math.round(Ne),Math.round(ue-Le),Math.round(Ae-Ne))},B=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var D,U,X=(D=this.ctx.lineDash,U=this.ctx.lineDashOffset,JSON.stringify({lineDash:D,lineDashOffset:U}));this.prevLineDash!==X&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=X)}}})(tr.API),function(t){var e=function(o){var s,u,h,f,g,v,p,y,_,x;for(u=[],h=0,f=(o+=s="\0\0\0\0".slice(o.length%4||4)).length;f>h;h+=4)(g=(o.charCodeAt(h)<<24)+(o.charCodeAt(h+1)<<16)+(o.charCodeAt(h+2)<<8)+o.charCodeAt(h+3))!==0?(v=(g=((g=((g=((g=(g-(x=g%85))/85)-(_=g%85))/85)-(y=g%85))/85)-(p=g%85))/85)%85,u.push(v+33,p+33,y+33,_+33,x+33)):u.push(122);return function(b,E){for(var A=E;A>0;A--)b.pop()}(u,s.length),String.fromCharCode.apply(String,u)+"~>"},r=function(o){var s,u,h,f,g,v=String,p="length",y=255,_="charCodeAt",x="slice",b="replace";for(o[x](-2),o=o[x](0,-2)[b](/\s/g,"")[b]("z","!!!!!"),h=[],f=0,g=(o+=s="uuuuu"[x](o[p]%5||5))[p];g>f;f+=5)u=52200625*(o[_](f)-33)+614125*(o[_](f+1)-33)+7225*(o[_](f+2)-33)+85*(o[_](f+3)-33)+(o[_](f+4)-33),h.push(y&u>>24,y&u>>16,y&u>>8,y&u);return function(E,A){for(var S=A;S>0;S--)E.pop()}(h,s[p]),v.fromCharCode.apply(v,h)},n=function(o){return o.split("").map(function(s){return("0"+s.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(o){var s=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((o=o.replace(/\s/g,"")).indexOf(">")!==-1&&(o=o.substr(0,o.indexOf(">"))),o.length%2&&(o+="0"),s.test(o)===!1)return"";for(var u="",h=0;h<o.length;h+=2)u+=String.fromCharCode("0x"+(o[h]+o[h+1]));return u},a=function(o){for(var s=new Uint8Array(o.length),u=o.length;u--;)s[u]=o.charCodeAt(u);return(s=Pm(s)).reduce(function(h,f){return h+String.fromCharCode(f)},"")};t.processDataByFilters=function(o,s){var u=0,h=o||"",f=[];for(typeof(s=s||[])=="string"&&(s=[s]),u=0;u<s.length;u+=1)switch(s[u]){case"ASCII85Decode":case"/ASCII85Decode":h=r(h),f.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":h=e(h),f.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":h=i(h),f.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":h=n(h),f.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":h=a(h),f.push("/FlateDecode");break;default:throw new Error('The filter: "'+s[u]+'" is not implemented')}return{data:h,reverseChain:f.reverse().join(" ")}}}(tr.API),function(t){t.loadFile=function(e,r,n){return function(i,a,o){a=a!==!1,o=typeof o=="function"?o:function(){};var s=void 0;try{s=function(u,h,f){var g=new XMLHttpRequest,v=0,p=function(y){var _=y.length,x=[],b=String.fromCharCode;for(v=0;v<_;v+=1)x.push(b(255&y.charCodeAt(v)));return x.join("")};if(g.open("GET",u,!h),g.overrideMimeType("text/plain; charset=x-user-defined"),h===!1&&(g.onload=function(){g.status===200?f(p(this.responseText)):f(void 0)}),g.send(null),h&&g.status===200)return p(g.responseText)}(i,a,o)}catch{}return s}(e,r,n)},t.loadImageFile=t.loadFile}(tr.API),function(t){function e(){return(yr.html2canvas?Promise.resolve(yr.html2canvas):xv(()=>import("./html2canvas.esm-BfxBtG_O.js"),[],import.meta.url)).catch(function(s){return Promise.reject(new Error("Could not load html2canvas: "+s))}).then(function(s){return s.default?s.default:s})}function r(){return(yr.DOMPurify?Promise.resolve(yr.DOMPurify):xv(()=>import("./purify.es-CQJ0hv7W.js"),[],import.meta.url)).catch(function(s){return Promise.reject(new Error("Could not load dompurify: "+s))}).then(function(s){return s.default?s.default:s})}var n=function(s){var u=Nn(s);return u==="undefined"?"undefined":u==="string"||s instanceof String?"string":u==="number"||s instanceof Number?"number":u==="function"||s instanceof Function?"function":s&&s.constructor===Array?"array":s&&s.nodeType===1?"element":u==="object"?"object":"unknown"},i=function(s,u){var h=document.createElement(s);for(var f in u.className&&(h.className=u.className),u.innerHTML&&u.dompurify&&(h.innerHTML=u.dompurify.sanitize(u.innerHTML)),u.style)h.style[f]=u.style[f];return h},a=function s(u,h){for(var f=u.nodeType===3?document.createTextNode(u.nodeValue):u.cloneNode(!1),g=u.firstChild;g;g=g.nextSibling)h!==!0&&g.nodeType===1&&g.nodeName==="SCRIPT"||f.appendChild(s(g,h));return u.nodeType===1&&(u.nodeName==="CANVAS"?(f.width=u.width,f.height=u.height,f.getContext("2d").drawImage(u,0,0)):u.nodeName!=="TEXTAREA"&&u.nodeName!=="SELECT"||(f.value=u.value),f.addEventListener("load",function(){f.scrollTop=u.scrollTop,f.scrollLeft=u.scrollLeft},!0)),f},o=function s(u){var h=Object.assign(s.convert(Promise.resolve()),JSON.parse(JSON.stringify(s.template))),f=s.convert(Promise.resolve(),h);return(f=f.setProgress(1,s,1,[s])).set(u)};(o.prototype=Object.create(Promise.prototype)).constructor=o,o.convert=function(s,u){return s.__proto__=u||o.prototype,s},o.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},o.prototype.from=function(s,u){return this.then(function(){switch(u=u||function(h){switch(n(h)){case"string":return"string";case"element":return h.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(s),u){case"string":return this.then(r).then(function(h){return this.set({src:i("div",{innerHTML:s,dompurify:h})})});case"element":return this.set({src:s});case"canvas":return this.set({canvas:s});case"img":return this.set({img:s});default:return this.error("Unknown source type.")}})},o.prototype.to=function(s){switch(s){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},o.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var s={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},u=a(this.prop.src,this.opt.html2canvas.javascriptEnabled);u.tagName==="BODY"&&(s.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:s}),this.prop.container.appendChild(u),this.prop.container.firstChild.appendChild(i("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},o.prototype.toCanvas=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(e).then(function(u){var h=Object.assign({},this.opt.html2canvas);return delete h.onrendered,u(this.prop.container,h)}).then(function(u){(this.opt.html2canvas.onrendered||function(){})(u),this.prop.canvas=u,document.body.removeChild(this.prop.overlay)})},o.prototype.toContext2d=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(e).then(function(u){var h=this.opt.jsPDF,f=this.opt.fontFaces,g=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:g,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,h.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,h.context2d.posX=this.opt.x,h.context2d.posY=this.opt.y,h.context2d.margin=this.opt.margin,h.context2d.fontFaces=f,f)for(var p=0;p<f.length;++p){var y=f[p],_=y.src.find(function(x){return x.format==="truetype"});_&&h.addFont(_.url,y.ref.name,y.ref.style)}return 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,h.context2d.save(!0),u(this.prop.container,v)}).then(function(u){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(u),this.prop.canvas=u,document.body.removeChild(this.prop.overlay)})},o.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var s=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=s})},o.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},o.prototype.output=function(s,u,h){return(h=h||"pdf").toLowerCase()==="img"||h.toLowerCase()==="image"?this.outputImg(s,u):this.outputPdf(s,u)},o.prototype.outputPdf=function(s,u){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(s,u)})},o.prototype.outputImg=function(s){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(s){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+s+'" is not supported.'}})},o.prototype.save=function(s){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(s?{filename:s}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},o.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},o.prototype.set=function(s){if(n(s)!=="object")return this;var u=Object.keys(s||{}).map(function(h){if(h in o.template.prop)return function(){this.prop[h]=s[h]};switch(h){case"margin":return this.setMargin.bind(this,s.margin);case"jsPDF":return function(){return this.opt.jsPDF=s.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,s.pageSize);default:return function(){this.opt[h]=s[h]}}},this);return this.then(function(){return this.thenList(u)})},o.prototype.get=function(s,u){return this.then(function(){var h=s in o.template.prop?this.prop[s]:this.opt[s];return u?u(h):h})},o.prototype.setMargin=function(s){return this.then(function(){switch(n(s)){case"number":s=[s,s,s,s];case"array":if(s.length===2&&(s=[s[0],s[1],s[0],s[1]]),s.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=s}).then(this.setPageSize)},o.prototype.setPageSize=function(s){function u(h,f){return Math.floor(h*f/72*96)}return this.then(function(){(s=s||tr.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(s.inner={width:s.width-this.opt.margin[1]-this.opt.margin[3],height:s.height-this.opt.margin[0]-this.opt.margin[2]},s.inner.px={width:u(s.inner.width,s.k),height:u(s.inner.height,s.k)},s.inner.ratio=s.inner.height/s.inner.width),this.prop.pageSize=s})},o.prototype.setProgress=function(s,u,h,f){return s!=null&&(this.progress.val=s),u!=null&&(this.progress.state=u),h!=null&&(this.progress.n=h),f!=null&&(this.progress.stack=f),this.progress.ratio=this.progress.val/this.progress.state,this},o.prototype.updateProgress=function(s,u,h,f){return this.setProgress(s?this.progress.val+s:null,u||null,h?this.progress.n+h:null,f?this.progress.stack.concat(f):null)},o.prototype.then=function(s,u){var h=this;return this.thenCore(s,u,function(f,g){return h.updateProgress(null,null,1,[f]),Promise.prototype.then.call(this,function(v){return h.updateProgress(null,f),v}).then(f,g).then(function(v){return h.updateProgress(1),v})})},o.prototype.thenCore=function(s,u,h){h=h||Promise.prototype.then;var f=this;s&&(s=s.bind(f)),u&&(u=u.bind(f));var g=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?f:o.convert(Object.assign({},f),Promise.prototype),v=h.call(g,s,u);return o.convert(v,f.__proto__)},o.prototype.thenExternal=function(s,u){return Promise.prototype.then.call(this,s,u)},o.prototype.thenList=function(s){var u=this;return s.forEach(function(h){u=u.thenCore(h)}),u},o.prototype.catch=function(s){s&&(s=s.bind(this));var u=Promise.prototype.catch.call(this,s);return o.convert(u,this)},o.prototype.catchExternal=function(s){return Promise.prototype.catch.call(this,s)},o.prototype.error=function(s){return this.then(function(){throw new Error(s)})},o.prototype.using=o.prototype.set,o.prototype.saveAs=o.prototype.save,o.prototype.export=o.prototype.output,o.prototype.run=o.prototype.then,tr.getPageSize=function(s,u,h){if(Nn(s)==="object"){var f=s;s=f.orientation,u=f.unit||u,h=f.format||h}u=u||"mm",h=h||"a4",s=(""+(s||"P")).toLowerCase();var g,v=(""+h).toLowerCase(),p={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(u){case"pt":g=1;break;case"mm":g=72/25.4;break;case"cm":g=72/2.54;break;case"in":g=72;break;case"px":g=.75;break;case"pc":case"em":g=12;break;case"ex":g=6;break;default:throw"Invalid unit: "+u}var y,_=0,x=0;if(p.hasOwnProperty(v))_=p[v][1]/g,x=p[v][0]/g;else try{_=h[1],x=h[0]}catch{throw new Error("Invalid format: "+h)}if(s==="p"||s==="portrait")s="p",x>_&&(y=x,x=_,_=y);else{if(s!=="l"&&s!=="landscape")throw"Invalid orientation: "+s;s="l",_>x&&(y=x,x=_,_=y)}return{width:x,height:_,unit:u,k:g,orientation:s}},t.html=function(s,u){(u=u||{}).callback=u.callback||function(){},u.html2canvas=u.html2canvas||{},u.html2canvas.canvas=u.html2canvas.canvas||this.canvas,u.jsPDF=u.jsPDF||this,u.fontFaces=u.fontFaces?u.fontFaces.map(zv):null;var h=new o(u);return u.worker?h:h.from(s).doCallback()}}(tr.API),tr.API.addJS=function(t){return jw=t,this.internal.events.subscribe("postPutResources",function(){z1=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(z1+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),Iw=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+jw+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){z1!==void 0&&Iw!==void 0&&this.internal.out("/Names <</JavaScript "+z1+" 0 R>>")}),this},function(t){var e;t.events.push(["postPutResources",function(){var r=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=r.outline.render().split(/\r\n/),a=0;a<i.length;a++){var o=i[a],s=n.exec(o);if(s!=null){var u=s[1];r.internal.newObjectDeferredBegin(u,!1)}r.internal.write(o)}if(this.outline.createNamedDestinations){var h=this.internal.pages.length,f=[];for(a=0;a<h;a++){var g=r.internal.newObject();f.push(g);var v=r.internal.getPageInfo(a+1);r.internal.write("<< /D["+v.objId+" 0 R /XYZ null null null]>> endobj")}var p=r.internal.newObject();for(r.internal.write("<< /Names [ "),a=0;a<f.length;a++)r.internal.write("(page_"+(a+1)+")"+f[a]+" 0 R");r.internal.write(" ] >>","endobj"),e=r.internal.newObject(),r.internal.write("<< /Dests "+p+" 0 R"),r.internal.write(">>","endobj")}}]),t.events.push(["putCatalog",function(){var r=this;r.outline.root.children.length>0&&(r.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&r.internal.write("/Names "+e+" 0 R"))}]),t.events.push(["initialized",function(){var r=this;r.outline={createNamedDestinations:!1,root:{children:[]}},r.outline.add=function(n,i,a){var o={title:i,options:a,children:[]};return n==null&&(n=this.root),n.children.push(o),o},r.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=r,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},r.outline.genIds_r=function(n){n.id=r.internal.newObjectDeferred();for(var i=0;i<n.children.length;i++)this.genIds_r(n.children[i])},r.outline.renderRoot=function(n){this.objStart(n),this.line("/Type /Outlines"),n.children.length>0&&(this.line("/First "+this.makeRef(n.children[0])),this.line("/Last "+this.makeRef(n.children[n.children.length-1]))),this.line("/Count "+this.count_r({count:0},n)),this.objEnd()},r.outline.renderItems=function(n){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,a=0;a<n.children.length;a++){var o=n.children[a];this.objStart(o),this.line("/Title "+this.makeString(o.title)),this.line("/Parent "+this.makeRef(n)),a>0&&this.line("/Prev "+this.makeRef(n.children[a-1])),a<n.children.length-1&&this.line("/Next "+this.makeRef(n.children[a+1])),o.children.length>0&&(this.line("/First "+this.makeRef(o.children[0])),this.line("/Last "+this.makeRef(o.children[o.children.length-1])));var s=this.count=this.count_r({count:0},o);if(s>0&&this.line("/Count "+s),o.options&&o.options.pageNumber){var u=r.internal.getPageInfo(o.options.pageNumber);this.line("/Dest ["+u.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var h=0;h<n.children.length;h++)this.renderItems(n.children[h])},r.outline.line=function(n){this.ctx.val+=n+`\r
|
|
567
|
-
`},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
|
|
568
|
-
`+n.id+` 0 obj\r
|
|
569
|
-
<<\r
|
|
570
|
-
`},r.outline.objEnd=function(){this.ctx.val+=`>> \r
|
|
571
|
-
endobj\r
|
|
572
|
-
`},r.outline.count_r=function(n,i){for(var a=0;a<i.children.length;a++)n.count++,this.count_r(n,i.children[a]);return n.count}}])}(tr.API),function(t){var e=[192,193,194,195,196,197,198,199];t.processJPEG=function(r,n,i,a,o,s){var u,h=this.decode.DCT_DECODE,f=null;if(typeof r=="string"||this.__addimage__.isArrayBuffer(r)||this.__addimage__.isArrayBufferView(r)){switch(r=o||r,r=this.__addimage__.isArrayBuffer(r)?new Uint8Array(r):r,u=function(g){for(var v,p=256*g.charCodeAt(4)+g.charCodeAt(5),y=g.length,_={width:0,height:0,numcomponents:1},x=4;x<y;x+=2){if(x+=p,e.indexOf(g.charCodeAt(x+1))!==-1){v=256*g.charCodeAt(x+5)+g.charCodeAt(x+6),_={width:256*g.charCodeAt(x+7)+g.charCodeAt(x+8),height:v,numcomponents:g.charCodeAt(x+9)};break}p=256*g.charCodeAt(x+2)+g.charCodeAt(x+3)}return _}(r=this.__addimage__.isArrayBufferView(r)?this.__addimage__.arrayBufferToBinaryString(r):r),u.numcomponents){case 1:s=this.color_spaces.DEVICE_GRAY;break;case 4:s=this.color_spaces.DEVICE_CMYK;break;case 3:s=this.color_spaces.DEVICE_RGB}f={data:r,width:u.width,height:u.height,colorSpace:s,bitsPerComponent:8,filter:h,index:n,alias:i}}return f}}(tr.API),tr.API.processPNG=function(t,e,r,n){if(this.__addimage__.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.__addimage__.isArrayBufferView(t)){var i,a=TI(t,{checkCrc:!0}),o=a.width,s=a.height,u=a.channels,h=a.palette,f=a.depth;i=h&&u===1?function(M){for(var F=M.width,j=M.height,T=M.data,L=M.palette,$=M.depth,q=!1,J=[],ae=[],ie=void 0,Z=!1,te=0,V=0;V<L.length;V++){var B=z4(L[V],4),D=B[0],U=B[1],X=B[2],ee=B[3];J.push(D,U,X),ee!=null&&(ee===0?(te++,ae.length<1&&ae.push(V)):ee<255&&(Z=!0))}if(Z||te>1){q=!0,ae=void 0;var K=F*j;ie=new Uint8Array(K);for(var oe=new DataView(T.buffer),me=0;me<K;me++){var de=Uv(oe,me,$),ye=z4(L[de],4)[3];ie[me]=ye}}else te===0&&(ae=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:q?8:void 0,colorBytes:T,alphaBytes:ie,needSMask:q,palette:J,mask:ae}}(a):u===2||u===4?function(M){for(var F=M.data,j=M.width,T=M.height,L=M.channels,$=M.depth,q=L===2?"DeviceGray":"DeviceRGB",J=L-1,ae=j*T,ie=J,Z=ae*ie,te=1*ae,V=Math.ceil(Z*$/8),B=Math.ceil(te*$/8),D=new Uint8Array(V),U=new Uint8Array(B),X=new DataView(F.buffer),ee=new DataView(D.buffer),K=new DataView(U.buffer),oe=!1,me=0;me<ae;me++){for(var de=me*L,ye=0;ye<ie;ye++)Gw(ee,Uv(X,de+ye,$),me*ie+ye,$);var Te=Uv(X,de+ie,$);Te<(1<<$)-1&&(oe=!0),Gw(K,Te,1*me,$)}return{colorSpace:q,colorsPerPixel:J,sMaskBitsPerComponent:oe?$:void 0,colorBytes:D,alphaBytes:U,needSMask:oe}}(a):function(M){var F=M.data,j=M.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:j,colorsPerPixel:j==="DeviceGray"?1:3,colorBytes:F instanceof Uint16Array?function(T){for(var L=T.length,$=new Uint8Array(2*L),q=new DataView($.buffer,$.byteOffset,$.byteLength),J=0;J<L;J++)q.setUint16(2*J,T[J],!1);return $}(F):F,needSMask:!1}}(a);var g,v,p,y=i,_=y.colorSpace,x=y.colorsPerPixel,b=y.sMaskBitsPerComponent,E=y.colorBytes,A=y.alphaBytes,S=y.needSMask,k=y.palette,I=y.mask,O=null;return n!==tr.API.image_compression.NONE&&typeof Pm=="function"?(O=function(M){var F;switch(M){case tr.API.image_compression.FAST:F=11;break;case tr.API.image_compression.MEDIUM:F=13;break;case tr.API.image_compression.SLOW:F=14;break;default:F=12}return F}(n),g=this.decode.FLATE_DECODE,v="/Predictor ".concat(O," /Colors ").concat(x," /BitsPerComponent ").concat(f," /Columns ").concat(o),t=zw(E,Math.ceil(o*x*f/8),x,f,n),S&&(p=zw(A,Math.ceil(o*b/8),1,b,n))):(g=void 0,v=void 0,t=E,S&&(p=A)),(this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t))&&(t=this.__addimage__.arrayBufferToBinaryString(t)),(p&&this.__addimage__.isArrayBuffer(p)||this.__addimage__.isArrayBufferView(p))&&(p=this.__addimage__.arrayBufferToBinaryString(p)),{alias:r,data:t,index:e,filter:g,decodeParameters:v,transparency:I,palette:k,sMask:p,predictor:O,width:o,height:s,bitsPerComponent:f,sMaskBitsPerComponent:b,colorSpace:_}}},function(t){t.processGIF89A=function(e,r,n,i){var a=new JI(e),o=a.width,s=a.height,u=[];a.decodeAndBlitFrameRGBA(0,u);var h={data:u,width:o,height:s},f=new Hv(100).encode(h,100);return t.processJPEG.call(this,f,r,n,i)},t.processGIF87A=t.processGIF89A}(tr.API),Zl.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:i,green:n,blue:r,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Zl.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e),this[t]()}catch(r){Yn.log("bit decode error:"+r)}},Zl.prototype.bit1=function(){var t,e=Math.ceil(this.width/8),r=e%4;for(t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,i=0;i<e;i++)for(var a=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+8*i*4,s=0;s<8&&8*i+s<this.width;s++){var u=this.palette[a>>7-s&1];this.data[o+4*s]=u.blue,this.data[o+4*s+1]=u.green,this.data[o+4*s+2]=u.red,this.data[o+4*s+3]=255}r!==0&&(this.pos+=4-r)}},Zl.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i<t;i++){var a=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+2*i*4,s=a>>4,u=15&a,h=this.palette[s];if(this.data[o]=h.blue,this.data[o+1]=h.green,this.data[o+2]=h.red,this.data[o+3]=255,2*i+1>=this.width)break;h=this.palette[u],this.data[o+4]=h.blue,this.data[o+4+1]=h.green,this.data[o+4+2]=h.red,this.data[o+4+3]=255}e!==0&&(this.pos+=4-e)}},Zl.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var i=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+4*n;if(i<this.palette.length){var o=this.palette[i];this.data[a]=o.red,this.data[a+1]=o.green,this.data[a+2]=o.blue,this.data[a+3]=255}else this.data[a]=255,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}t!==0&&(this.pos+=4-t)}},Zl.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i<this.width;i++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(a&e)/e*255|0,s=(a>>5&e)/e*255|0,u=(a>>10&e)/e*255|0,h=a>>15?255:0,f=n*this.width*4+4*i;this.data[f]=u,this.data[f+1]=s,this.data[f+2]=o,this.data[f+3]=h}this.pos+=t}},Zl.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),r=parseInt("111111",2),n=this.height-1;n>=0;n--){for(var i=this.bottom_up?n:this.height-1-n,a=0;a<this.width;a++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(o&e)/e*255|0,u=(o>>5&r)/r*255|0,h=(o>>11)/e*255|0,f=i*this.width*4+4*a;this.data[f]=h,this.data[f+1]=u,this.data[f+2]=s,this.data[f+3]=255}this.pos+=t}},Zl.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=e*this.width*4+4*r;this.data[o]=a,this.data[o+1]=i,this.data[o+2]=n,this.data[o+3]=255}this.pos+=this.width%4}},Zl.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),s=e*this.width*4+4*r;this.data[s]=a,this.data[s+1]=i,this.data[s+2]=n,this.data[s+3]=o}},Zl.prototype.getData=function(){return this.data},function(t){t.processBMP=function(e,r,n,i){var a=new Zl(e,!1),o=a.width,s=a.height,u={data:a.getData(),width:o,height:s},h=new Hv(100).encode(u,100);return t.processJPEG.call(this,h,r,n,i)}}(tr.API),Vw.prototype.getData=function(){return this.data},function(t){t.processWEBP=function(e,r,n,i){var a=new Vw(e),o=a.width,s=a.height,u={data:a.getData(),width:o,height:s},h=new Hv(100).encode(u,100);return t.processJPEG.call(this,h,r,n,i)}}(tr.API),tr.API.processRGBA=function(t,e,r){for(var n=t.data,i=n.length,a=new Uint8Array(i/4*3),o=new Uint8Array(i/4),s=0,u=0,h=0;h<i;h+=4){var f=n[h],g=n[h+1],v=n[h+2],p=n[h+3];a[s++]=f,a[s++]=g,a[s++]=v,o[u++]=p}var y=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:y,index:e,alias:r,colorSpace:"DeviceRGB",bitsPerComponent:8,width:t.width,height:t.height}},tr.API.setLanguage=function(t){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[t]!==void 0&&(this.internal.languageSettings.languageCode=t,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},Xh=tr.API,q1=Xh.getCharWidthsArray=function(t,e){var r,n,i=(e=e||{}).font||this.internal.getFont(),a=e.fontSize||this.internal.getFontSize(),o=e.charSpace||this.internal.getCharSpace(),s=e.widths?e.widths:i.metadata.Unicode.widths,u=s.fof?s.fof:1,h=e.kerning?e.kerning:i.metadata.Unicode.kerning,f=h.fof?h.fof:1,g=e.doKerning!==!1,v=0,p=t.length,y=0,_=s[0]||u,x=[];for(r=0;r<p;r++)n=t.charCodeAt(r),typeof i.metadata.widthOfString=="function"?x.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(n))+o*(1e3/a)||0)/1e3):(v=g&&Nn(h[n])==="object"&&!isNaN(parseInt(h[n][y],10))?h[n][y]/f:0,x.push((s[n]||_)/u+v)),y=n;return x},Dw=Xh.getStringUnitWidth=function(t,e){var r=(e=e||{}).fontSize||this.internal.getFontSize(),n=e.font||this.internal.getFont(),i=e.charSpace||this.internal.getCharSpace();return Xh.processArabic&&(t=Xh.processArabic(t)),typeof n.metadata.widthOfString=="function"?n.metadata.widthOfString(t,r,i)/r:q1.apply(this,arguments).reduce(function(a,o){return a+o},0)},Fw=function(t,e,r,n){for(var i=[],a=0,o=t.length,s=0;a!==o&&s+e[a]<r;)s+=e[a],a++;i.push(t.slice(0,a));var u=a;for(s=0;a!==o;)s+e[a]>n&&(i.push(t.slice(u,a)),s=0,u=a),s+=e[a],a++;return u!==a&&i.push(t.slice(u,a)),i},Bw=function(t,e,r){r||(r={});var n,i,a,o,s,u,h,f=[],g=[f],v=r.textIndent||0,p=0,y=0,_=t.split(" "),x=q1.apply(this,[" ",r])[0];if(u=r.lineIndent===-1?_[0].length+2:r.lineIndent||0){var b=Array(u).join(" "),E=[];_.map(function(S){(S=S.split(/\s*\n/)).length>1?E=E.concat(S.map(function(k,I){return(I&&k.length?`
|
|
573
|
-
`:"")+k})):E.push(S[0])}),_=E,u=Dw.apply(this,[b,r])}for(a=0,o=_.length;a<o;a++){var A=0;if(n=_[a],u&&n[0]==`
|
|
574
|
-
`&&(n=n.substr(1),A=1),v+p+(y=(i=q1.apply(this,[n,r])).reduce(function(S,k){return S+k},0))>e||A){if(y>e){for(s=Fw.apply(this,[n,i,e-(v+p),e]),f.push(s.shift()),f=[s.pop()];s.length;)g.push([s.shift()]);y=i.slice(n.length-(f[0]?f[0].length:0)).reduce(function(S,k){return S+k},0)}else f=[n];g.push(f),v=y+u,p=x}else f.push(n),v+=p+y,p=x}return h=u?function(S,k){return(k?b:"")+S.join(" ")}:function(S){return S.join(" ")},g.map(h)},Xh.splitTextToSize=function(t,e,r){var n,i=(r=r||{}).fontSize||this.internal.getFontSize(),a=(function(f){if(f.widths&&f.kerning)return{widths:f.widths,kerning:f.kerning};var g=this.internal.getFont(f.fontName,f.fontStyle),v="Unicode";return g.metadata[v]?{widths:g.metadata[v].widths||{0:1},kerning:g.metadata[v].kerning||{}}:{font:g.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,r);n=Array.isArray(t)?t:String(t).split(/\r?\n/);var o=1*this.internal.scaleFactor*e/i;a.textIndent=r.textIndent?1*r.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=r.lineIndent;var s,u,h=[];for(s=0,u=n.length;s<u;s++)h=h.concat(Bw.apply(this,[n[s],o,a]));return h},function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var e="0123456789abcdef",r="klmnopqrstuvwxyz",n={},i={},a=0;a<16;a++)n[r[a]]=e[a],i[e[a]]=r[a];var o=function(v){return"0x"+parseInt(v,10).toString(16)},s=t.__fontmetrics__.compress=function(v){var p,y,_,x,b=["{"];for(var E in v){if(p=v[E],isNaN(parseInt(E,10))?y="'"+E+"'":(E=parseInt(E,10),y=(y=o(E).slice(2)).slice(0,-1)+i[y.slice(-1)]),typeof p=="number")p<0?(_=o(p).slice(3),x="-"):(_=o(p).slice(2),x=""),_=x+_.slice(0,-1)+i[_.slice(-1)];else{if(Nn(p)!=="object")throw new Error("Don't know what to do with value type "+Nn(p)+".");_=s(p)}b.push(y+_)}return b.push("}"),b.join("")},u=t.__fontmetrics__.uncompress=function(v){if(typeof v!="string")throw new Error("Invalid argument passed to uncompress.");for(var p,y,_,x,b={},E=1,A=b,S=[],k="",I="",O=v.length-1,M=1;M<O;M+=1)(x=v[M])=="'"?p?(_=p.join(""),p=void 0):p=[]:p?p.push(x):x=="{"?(S.push([A,_]),A={},_=void 0):x=="}"?((y=S.pop())[0][y[1]]=A,_=void 0,A=y[0]):x=="-"?E=-1:_===void 0?n.hasOwnProperty(x)?(k+=n[x],_=parseInt(k,16)*E,E=1,k=""):k+=x:n.hasOwnProperty(x)?(I+=n[x],A[_]=parseInt(I,16)*E,E=1,_=void 0,I=""):I+=x;return b},h={codePages:["WinAnsiEncoding"],WinAnsiEncoding:u("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},f={Unicode:{Courier:h,"Courier-Bold":h,"Courier-BoldOblique":h,"Courier-Oblique":h,Helvetica:h,"Helvetica-Bold":h,"Helvetica-BoldOblique":h,"Helvetica-Oblique":h,"Times-Roman":h,"Times-Bold":h,"Times-BoldItalic":h,"Times-Italic":h}},g={Unicode:{"Courier-Oblique":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":u("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":u("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":u("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:u("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:u("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":u("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:u("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":u("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":u("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":u("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};t.events.push(["addFont",function(v){var p=v.font,y=g.Unicode[p.postScriptName];y&&(p.metadata.Unicode={},p.metadata.Unicode.widths=y.widths,p.metadata.Unicode.kerning=y.kerning);var _=f.Unicode[p.postScriptName];_&&(p.metadata.Unicode.encoding=_,p.encoding=_.codePages[0])}])}(tr.API),function(t){var e=function(r){for(var n=r.length,i=new Uint8Array(n),a=0;a<n;a++)i[a]=r.charCodeAt(a);return i};t.API.events.push(["addFont",function(r){var n=void 0,i=r.font,a=r.instance;if(!i.isStandardFont){if(a===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(n=a.existsFileInVFS(i.postScriptName)===!1?a.loadFile(i.postScriptName):a.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(o,s){s=/^\x00\x01\x00\x00/.test(s)?e(s):e(J1(s)),o.metadata=t.API.TTFFont.open(s),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(i,n)}}])}(tr),tr.API.addSvgAsImage=function(t,e,r,n,i,a,o,s){if(isNaN(e)||isNaN(r))throw Yn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(n)||isNaN(i))throw Yn.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var u=document.createElement("canvas");u.width=n,u.height=i;var h=u.getContext("2d");h.fillStyle="#fff",h.fillRect(0,0,u.width,u.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},g=this;return(yr.canvg?Promise.resolve(yr.canvg):xv(()=>import("./index.es-B1I-k0g7.js"),[],import.meta.url)).catch(function(v){return Promise.reject(new Error("Could not load canvg: "+v))}).then(function(v){return v.default?v.default:v}).then(function(v){return v.fromString(h,t,f)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(v){return v.render(f)}).then(function(){g.addImage(u.toDataURL("image/jpeg",1),e,r,n,i,o,s)})},tr.API.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(e,r);return this},tr.API.viewerPreferences=function(t,e){var r;t=t||{},e=e||!1;var n,i,a,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},s=Object.keys(o),u=[],h=0,f=0,g=0;function v(y,_){var x,b=!1;for(x=0;x<y.length;x+=1)y[x]===_&&(b=!0);return b}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),r=this.internal.viewerpreferences.configuration,t==="reset"||e===!0){var p=s.length;for(g=0;g<p;g+=1)r[s[g]].value=r[s[g]].defaultValue,r[s[g]].explicitSet=!1}if(Nn(t)==="object"){for(i in t)if(a=t[i],v(s,i)&&a!==void 0){if(r[i].type==="boolean"&&typeof a=="boolean")r[i].value=a;else if(r[i].type==="name"&&v(r[i].valueSet,a))r[i].value=a;else if(r[i].type==="integer"&&Number.isInteger(a))r[i].value=a;else if(r[i].type==="array"){for(h=0;h<a.length;h+=1)if(n=!0,a[h].length===1&&typeof a[h][0]=="number")u.push(String(a[h]-1));else if(a[h].length>1){for(f=0;f<a[h].length;f+=1)typeof a[h][f]!="number"&&(n=!1);n===!0&&u.push([a[h][0]-1,a[h][1]-1].join(" "))}r[i].value="["+u.join(" ")+"]"}else r[i].value=r[i].defaultValue;r[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var y,_=[];for(y in r)r[y].explicitSet===!0&&(r[y].type==="name"?_.push("/"+y+" /"+r[y].value):_.push("/"+y+" "+r[y].value));_.length!==0&&this.internal.write(`/ViewerPreferences
|
|
575
|
-
<<
|
|
576
|
-
`+_.join(`
|
|
577
|
-
`)+`
|
|
578
|
-
>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=r,this},function(t){var e=function(){var n='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',i=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),a=unescape(encodeURIComponent(n)),o=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),s=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),u=unescape(encodeURIComponent("</x:xmpmeta>")),h=a.length+o.length+s.length+i.length+u.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+h+" >>"),this.internal.write("stream"),this.internal.write(i+a+o+s+u),this.internal.write("endstream"),this.internal.write("endobj")},r=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};t.addMetadata=function(n,i){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:n,namespaceuri:i||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",r),this.internal.events.subscribe("postPutResources",e)),this}}(tr.API),function(t){var e=t.API,r=e.pdfEscape16=function(a,o){for(var s,u=o.metadata.Unicode.widths,h=["","0","00","000","0000"],f=[""],g=0,v=a.length;g<v;++g){if(s=o.metadata.characterToGlyph(a.charCodeAt(g)),o.metadata.glyIdsUsed.push(s),o.metadata.toUnicode[s]=a.charCodeAt(g),u.indexOf(s)==-1&&(u.push(s),u.push([parseInt(o.metadata.widthOfGlyph(s),10)])),s=="0")return f.join("");s=s.toString(16),f.push(h[4-s.length],s)}return f.join("")},n=function(a){var o,s,u,h,f,g,v;for(f=`/CIDInit /ProcSet findresource begin
|
|
579
|
-
12 dict begin
|
|
580
|
-
begincmap
|
|
581
|
-
/CIDSystemInfo <<
|
|
582
|
-
/Registry (Adobe)
|
|
583
|
-
/Ordering (UCS)
|
|
584
|
-
/Supplement 0
|
|
585
|
-
>> def
|
|
586
|
-
/CMapName /Adobe-Identity-UCS def
|
|
587
|
-
/CMapType 2 def
|
|
588
|
-
1 begincodespacerange
|
|
589
|
-
<0000><ffff>
|
|
590
|
-
endcodespacerange`,u=[],g=0,v=(s=Object.keys(a).sort(function(p,y){return p-y})).length;g<v;g++)o=s[g],u.length>=100&&(f+=`
|
|
591
|
-
`+u.length+` beginbfchar
|
|
592
|
-
`+u.join(`
|
|
593
|
-
`)+`
|
|
594
|
-
endbfchar`,u=[]),a[o]!==void 0&&a[o]!==null&&typeof a[o].toString=="function"&&(h=("0000"+a[o].toString(16)).slice(-4),o=("0000"+(+o).toString(16)).slice(-4),u.push("<"+o+"><"+h+">"));return u.length&&(f+=`
|
|
595
|
-
`+u.length+` beginbfchar
|
|
596
|
-
`+u.join(`
|
|
597
|
-
`)+`
|
|
598
|
-
endbfchar
|
|
599
|
-
`),f+`endcmap
|
|
600
|
-
CMapName currentdict /CMap defineresource pop
|
|
601
|
-
end
|
|
602
|
-
end`};e.events.push(["putFont",function(a){(function(o){var s=o.font,u=o.out,h=o.newObject,f=o.putStream;if(s.metadata instanceof t.API.TTFFont&&s.encoding==="Identity-H"){for(var g=s.metadata.Unicode.widths,v=s.metadata.subset.encode(s.metadata.glyIdsUsed,1),p="",y=0;y<v.length;y++)p+=String.fromCharCode(v[y]);var _=h();f({data:p,addLength1:!0,objectId:_}),u("endobj");var x=h();f({data:n(s.metadata.toUnicode),addLength1:!0,objectId:x}),u("endobj");var b=h();u("<<"),u("/Type /FontDescriptor"),u("/FontName /"+Jh(s.fontName)),u("/FontFile2 "+_+" 0 R"),u("/FontBBox "+t.API.PDFObject.convert(s.metadata.bbox)),u("/Flags "+s.metadata.flags),u("/StemV "+s.metadata.stemV),u("/ItalicAngle "+s.metadata.italicAngle),u("/Ascent "+s.metadata.ascender),u("/Descent "+s.metadata.decender),u("/CapHeight "+s.metadata.capHeight),u(">>"),u("endobj");var E=h();u("<<"),u("/Type /Font"),u("/BaseFont /"+Jh(s.fontName)),u("/FontDescriptor "+b+" 0 R"),u("/W "+t.API.PDFObject.convert(g)),u("/CIDToGIDMap /Identity"),u("/DW 1000"),u("/Subtype /CIDFontType2"),u("/CIDSystemInfo"),u("<<"),u("/Supplement 0"),u("/Registry (Adobe)"),u("/Ordering ("+s.encoding+")"),u(">>"),u(">>"),u("endobj"),s.objectNumber=h(),u("<<"),u("/Type /Font"),u("/Subtype /Type0"),u("/ToUnicode "+x+" 0 R"),u("/BaseFont /"+Jh(s.fontName)),u("/Encoding /"+s.encoding),u("/DescendantFonts ["+E+" 0 R]"),u(">>"),u("endobj"),s.isAlreadyPutted=!0}})(a)}]),e.events.push(["putFont",function(a){(function(o){var s=o.font,u=o.out,h=o.newObject,f=o.putStream;if(s.metadata instanceof t.API.TTFFont&&s.encoding==="WinAnsiEncoding"){for(var g=s.metadata.rawData,v="",p=0;p<g.length;p++)v+=String.fromCharCode(g[p]);var y=h();f({data:v,addLength1:!0,objectId:y}),u("endobj");var _=h();f({data:n(s.metadata.toUnicode),addLength1:!0,objectId:_}),u("endobj");var x=h();u("<<"),u("/Descent "+s.metadata.decender),u("/CapHeight "+s.metadata.capHeight),u("/StemV "+s.metadata.stemV),u("/Type /FontDescriptor"),u("/FontFile2 "+y+" 0 R"),u("/Flags 96"),u("/FontBBox "+t.API.PDFObject.convert(s.metadata.bbox)),u("/FontName /"+Jh(s.fontName)),u("/ItalicAngle "+s.metadata.italicAngle),u("/Ascent "+s.metadata.ascender),u(">>"),u("endobj"),s.objectNumber=h();for(var b=0;b<s.metadata.hmtx.widths.length;b++)s.metadata.hmtx.widths[b]=parseInt(s.metadata.hmtx.widths[b]*(1e3/s.metadata.head.unitsPerEm));u("<</Subtype/TrueType/Type/Font/ToUnicode "+_+" 0 R/BaseFont/"+Jh(s.fontName)+"/FontDescriptor "+x+" 0 R/Encoding/"+s.encoding+" /FirstChar 29 /LastChar 255 /Widths "+t.API.PDFObject.convert(s.metadata.hmtx.widths)+">>"),u("endobj"),s.isAlreadyPutted=!0}})(a)}]);var i=function(a){var o,s=a.text||"",u=a.x,h=a.y,f=a.options||{},g=a.mutex||{},v=g.pdfEscape,p=g.activeFontKey,y=g.fonts,_=p,x="",b=0,E="",A=y[_].encoding;if(y[_].encoding!=="Identity-H")return{text:s,x:u,y:h,options:f,mutex:g};for(E=s,_=p,Array.isArray(s)&&(E=s[0]),b=0;b<E.length;b+=1)y[_].metadata.hasOwnProperty("cmap")&&(o=y[_].metadata.cmap.unicode.codeMap[E[b].charCodeAt(0)]),o||E[b].charCodeAt(0)<256&&y[_].metadata.hasOwnProperty("Unicode")?x+=E[b]:x+="";var S="";return parseInt(_.slice(1))<14||A==="WinAnsiEncoding"?S=v(x,_).split("").map(function(k){return k.charCodeAt(0).toString(16)}).join(""):A==="Identity-H"&&(S=r(x,y[_])),g.isHex=!0,{text:S,x:u,y:h,options:f,mutex:g}};e.events.push(["postProcessText",function(a){var o=a.text||"",s=[],u={text:o,x:a.x,y:a.y,options:a.options,mutex:a.mutex};if(Array.isArray(o)){var h=0;for(h=0;h<o.length;h+=1)Array.isArray(o[h])&&o[h].length===3?s.push([i(Object.assign({},u,{text:o[h][0]})).text,o[h][1],o[h][2]]):s.push(i(Object.assign({},u,{text:o[h]})).text);a.text=s}else a.text=i(Object.assign({},u,{text:o})).text}])}(tr),function(t){var e=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};t.existsFileInVFS=function(r){return e.call(this),this.internal.vFS[r]!==void 0},t.addFileToVFS=function(r,n){return e.call(this),this.internal.vFS[r]=n,this},t.getFileFromVFS=function(r){return e.call(this),this.internal.vFS[r]!==void 0?this.internal.vFS[r]:null}}(tr.API),function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(n){var i,a,o,s,u,h,f,g=e,v=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],p=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],y={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},_={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},x=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],b=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),E=!1,A=0;this.__bidiEngine__={};var S=function(T){var L=T.charCodeAt(),$=L>>8,q=_[$];return q!==void 0?g[256*q+(255&L)]:$===252||$===253?"AL":b.test($)?"L":$===8?"R":"N"},k=function(T){for(var L,$=0;$<T.length;$++){if((L=S(T.charAt($)))==="L")return!1;if(L==="R")return!0}return!1},I=function(T,L,$,q){var J,ae,ie,Z,te=L[q];switch(te){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":E=!1;break;case"N":case"AN":break;case"EN":E&&(te="AN");break;case"AL":E=!0,te="R";break;case"WS":case"BN":te="N";break;case"CS":q<1||q+1>=L.length||(J=$[q-1])!=="EN"&&J!=="AN"||(ae=L[q+1])!=="EN"&&ae!=="AN"?te="N":E&&(ae="AN"),te=ae===J?ae:"N";break;case"ES":te=(J=q>0?$[q-1]:"B")==="EN"&&q+1<L.length&&L[q+1]==="EN"?"EN":"N";break;case"ET":if(q>0&&$[q-1]==="EN"){te="EN";break}if(E){te="N";break}for(ie=q+1,Z=L.length;ie<Z&&L[ie]==="ET";)ie++;te=ie<Z&&L[ie]==="EN"?"EN":"N";break;case"NSM":if(o&&!s){for(Z=L.length,ie=q+1;ie<Z&&L[ie]==="NSM";)ie++;if(ie<Z){var V=T[q],B=V>=1425&&V<=2303||V===64286;if(J=L[ie],B&&(J==="R"||J==="AL")){te="R";break}}}te=q<1||(J=L[q-1])==="B"?"N":$[q-1];break;case"B":E=!1,i=!0,te=A;break;case"S":a=!0,te="N"}return te},O=function(T,L,$){var q=T.split("");return $&&M(q,$,{hiLevel:A}),q.reverse(),L&&L.reverse(),q.join("")},M=function(T,L,$){var q,J,ae,ie,Z,te=-1,V=T.length,B=0,D=[],U=A?p:v,X=[];for(E=!1,i=!1,a=!1,J=0;J<V;J++)X[J]=S(T[J]);for(ae=0;ae<V;ae++){if(Z=B,D[ae]=I(T,X,D,ae),q=240&(B=U[Z][y[D[ae]]]),B&=15,L[ae]=ie=U[B][5],q>0)if(q===16){for(J=te;J<ae;J++)L[J]=1;te=-1}else te=-1;if(U[B][6])te===-1&&(te=ae);else if(te>-1){for(J=te;J<ae;J++)L[J]=ie;te=-1}X[ae]==="B"&&(L[ae]=0),$.hiLevel|=ie}a&&function(ee,K,oe){for(var me=0;me<oe;me++)if(ee[me]==="S"){K[me]=A;for(var de=me-1;de>=0&&ee[de]==="WS";de--)K[de]=A}}(X,L,V)},F=function(T,L,$,q,J){if(!(J.hiLevel<T)){if(T===1&&A===1&&!i)return L.reverse(),void($&&$.reverse());for(var ae,ie,Z,te,V=L.length,B=0;B<V;){if(q[B]>=T){for(Z=B+1;Z<V&&q[Z]>=T;)Z++;for(te=B,ie=Z-1;te<ie;te++,ie--)ae=L[te],L[te]=L[ie],L[ie]=ae,$&&(ae=$[te],$[te]=$[ie],$[ie]=ae);B=Z}B++}}},j=function(T,L,$){var q=T.split(""),J={hiLevel:A};return $||($=[]),M(q,$,J),function(ae,ie,Z){if(Z.hiLevel!==0&&f)for(var te,V=0;V<ae.length;V++)ie[V]===1&&(te=x.indexOf(ae[V]))>=0&&(ae[V]=x[te+1])}(q,$,J),F(2,q,L,$,J),F(1,q,L,$,J),q.join("")};return this.__bidiEngine__.doBidiReorder=function(T,L,$){if(function(J,ae){if(ae)for(var ie=0;ie<J.length;ie++)ae[ie]=ie;s===void 0&&(s=k(J)),h===void 0&&(h=k(J))}(T,L),o||!u||h)if(o&&u&&s^h)A=s?1:0,T=O(T,L,$);else if(!o&&u&&h)A=s?1:0,T=j(T,L,$),T=O(T,L);else if(!o||s||u||h){if(o&&!u&&s^h)T=O(T,L),s?(A=0,T=j(T,L,$)):(A=1,T=j(T,L,$),T=O(T,L));else if(o&&s&&!u&&h)A=1,T=j(T,L,$),T=O(T,L);else if(!o&&!u&&s^h){var q=f;s?(A=1,T=j(T,L,$),A=0,f=!1,T=j(T,L,$),f=q):(A=0,T=j(T,L,$),T=O(T,L),A=1,f=!1,T=j(T,L,$),f=q,T=O(T,L))}}else A=0,T=j(T,L,$);else A=s?1:0,T=j(T,L,$);return T},this.__bidiEngine__.setOptions=function(T){T&&(o=T.isInputVisual,u=T.isOutputVisual,s=T.isInputRtl,h=T.isOutputRtl,f=T.isSymmetricSwapping)},this.__bidiEngine__.setOptions(n),this.__bidiEngine__};var e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],r=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(n){var i=n.text;n.x,n.y;var a=n.options||{};n.mutex,a.lang;var o=[];if(a.isInputVisual=typeof a.isInputVisual!="boolean"||a.isInputVisual,r.setOptions(a),Object.prototype.toString.call(i)==="[object Array]"){var s=0;for(o=[],s=0;s<i.length;s+=1)Object.prototype.toString.call(i[s])==="[object Array]"?o.push([r.doBidiReorder(i[s][0]),i[s][1],i[s][2]]):o.push([r.doBidiReorder(i[s])]);n.text=o}else n.text=r.doBidiReorder(i);r.setOptions({isInputVisual:!0})}])}(tr),tr.API.TTFFont=function(){function t(e){var r;if(this.rawData=e,r=this.contents=new _f(e),this.contents.pos=4,r.readString(4)==="ttcf")throw new Error("TTCF not supported.");r.pos=0,this.parse(),this.subset=new pj(this),this.registerTTF()}return t.open=function(e){return new t(e)},t.prototype.parse=function(){return this.directory=new ej(this.contents),this.head=new rj(this),this.name=new sj(this),this.cmap=new fx(this),this.toUnicode={},this.hhea=new nj(this),this.maxp=new lj(this),this.hmtx=new uj(this),this.post=new aj(this),this.os2=new ij(this),this.loca=new dj(this),this.glyf=new cj(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},t.prototype.registerTTF=function(){var e,r,n,i,a;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var o,s,u,h;for(h=[],o=0,s=(u=this.bbox).length;o<s;o++)e=u[o],h.push(Math.round(e*this.scaleFactor));return h}).call(this),this.stemV=0,this.post.exists?(n=255&(i=this.post.italic_angle),32768&(r=i>>16)&&(r=-(1+(65535^r))),this.italicAngle=+(r+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(a=this.familyClass)===1||a===2||a===3||a===4||a===5||a===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},t.prototype.characterToGlyph=function(e){var r;return((r=this.cmap.unicode)!=null?r.codeMap[e]:void 0)||0},t.prototype.widthOfGlyph=function(e){var r;return r=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*r},t.prototype.widthOfString=function(e,r,n){var i,a,o,s;for(o=0,a=0,s=(e=""+e).length;0<=s?a<s:a>s;a=0<=s?++a:--a)i=e.charCodeAt(a),o+=this.widthOfGlyph(this.characterToGlyph(i))+n*(1e3/r)||0;return o*(r/1e3)},t.prototype.lineHeight=function(e,r){var n;return r==null&&(r=!1),n=r?this.lineGap:0,(this.ascender+n-this.decender)/1e3*e},t}();var su,_f=function(){function t(e){this.data=e??[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(e){return this.data[this.pos++]=e},t.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},t.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},t.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},t.prototype.readString=function(e){var r,n;for(n=[],r=0;0<=e?r<e:r>e;r=0<=e?++r:--r)n[r]=String.fromCharCode(this.readByte());return n.join("")},t.prototype.writeString=function(e){var r,n,i;for(i=[],r=0,n=e.length;0<=n?r<n:r>n;r=0<=n?++r:--r)i.push(this.writeByte(e.charCodeAt(r)));return i},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(e){return this.writeInt16(e)},t.prototype.readLongLong=function(){var e,r,n,i,a,o,s,u;return e=this.readByte(),r=this.readByte(),n=this.readByte(),i=this.readByte(),a=this.readByte(),o=this.readByte(),s=this.readByte(),u=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^r)+1099511627776*(255^n)+4294967296*(255^i)+16777216*(255^a)+65536*(255^o)+256*(255^s)+(255^u)+1):72057594037927940*e+281474976710656*r+1099511627776*n+4294967296*i+16777216*a+65536*o+256*s+u},t.prototype.writeLongLong=function(e){var r,n;return r=Math.floor(e/4294967296),n=4294967295&e,this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(e){return this.writeInt32(e)},t.prototype.read=function(e){var r,n;for(r=[],n=0;0<=e?n<e:n>e;n=0<=e?++n:--n)r.push(this.readByte());return r},t.prototype.write=function(e){var r,n,i,a;for(a=[],n=0,i=e.length;n<i;n++)r=e[n],a.push(this.writeByte(r));return a},t}(),ej=function(){var t;function e(r){var n,i,a;for(this.scalarType=r.readInt(),this.tableCount=r.readShort(),this.searchRange=r.readShort(),this.entrySelector=r.readShort(),this.rangeShift=r.readShort(),this.tables={},i=0,a=this.tableCount;0<=a?i<a:i>a;i=0<=a?++i:--i)n={tag:r.readString(4),checksum:r.readInt(),offset:r.readInt(),length:r.readInt()},this.tables[n.tag]=n}return e.prototype.encode=function(r){var n,i,a,o,s,u,h,f,g,v,p,y,_;for(_ in p=Object.keys(r).length,u=Math.log(2),g=16*Math.floor(Math.log(p)/u),o=Math.floor(g/u),f=16*p-g,(i=new _f).writeInt(this.scalarType),i.writeShort(p),i.writeShort(g),i.writeShort(o),i.writeShort(f),a=16*p,h=i.pos+a,s=null,y=[],r)for(v=r[_],i.writeString(_),i.writeInt(t(v)),i.writeInt(h),i.writeInt(v.length),y=y.concat(v),_==="head"&&(s=h),h+=v.length;h%4;)y.push(0),h++;return i.write(y),n=2981146554-t(i.data),i.pos=s+8,i.writeUInt32(n),i.data},t=function(r){var n,i,a,o;for(r=hx.call(r);r.length%4;)r.push(0);for(a=new _f(r),i=0,n=0,o=r.length;n<o;n=n+=4)i+=a.readUInt32();return 4294967295&i},e}(),tj={}.hasOwnProperty,Wu=function(t,e){for(var r in e)tj.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};su=function(){function t(e){var r;this.file=e,r=this.file.directory.tables[this.tag],this.exists=!!r,r&&(this.offset=r.offset,this.length=r.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t}();var rj=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="head",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},t.prototype.encode=function(e){var r;return(r=new _f).writeInt(this.version),r.writeInt(this.revision),r.writeInt(this.checkSumAdjustment),r.writeInt(this.magicNumber),r.writeShort(this.flags),r.writeShort(this.unitsPerEm),r.writeLongLong(this.created),r.writeLongLong(this.modified),r.writeShort(this.xMin),r.writeShort(this.yMin),r.writeShort(this.xMax),r.writeShort(this.yMax),r.writeShort(this.macStyle),r.writeShort(this.lowestRecPPEM),r.writeShort(this.fontDirectionHint),r.writeShort(e),r.writeShort(this.glyphDataFormat),r.data},t}(),Yw=function(){function t(e,r){var n,i,a,o,s,u,h,f,g,v,p,y,_,x,b,E,A;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=r+e.readInt(),g=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(u=0;u<256;++u)this.codeMap[u]=e.readByte();break;case 4:for(p=e.readUInt16(),v=p/2,e.pos+=6,a=function(){var S,k;for(k=[],u=S=0;0<=v?S<v:S>v;u=0<=v?++S:--S)k.push(e.readUInt16());return k}(),e.pos+=2,_=function(){var S,k;for(k=[],u=S=0;0<=v?S<v:S>v;u=0<=v?++S:--S)k.push(e.readUInt16());return k}(),h=function(){var S,k;for(k=[],u=S=0;0<=v?S<v:S>v;u=0<=v?++S:--S)k.push(e.readUInt16());return k}(),f=function(){var S,k;for(k=[],u=S=0;0<=v?S<v:S>v;u=0<=v?++S:--S)k.push(e.readUInt16());return k}(),i=(this.length-e.pos+this.offset)/2,s=function(){var S,k;for(k=[],u=S=0;0<=i?S<i:S>i;u=0<=i?++S:--S)k.push(e.readUInt16());return k}(),u=b=0,A=a.length;b<A;u=++b)for(x=a[u],n=E=y=_[u];y<=x?E<=x:E>=x;n=y<=x?++E:--E)f[u]===0?o=n+h[u]:(o=s[f[u]/2+(n-y)-(v-u)]||0)!==0&&(o+=h[u]),this.codeMap[n]=65535&o}e.pos=g}return t.encode=function(e,r){var n,i,a,o,s,u,h,f,g,v,p,y,_,x,b,E,A,S,k,I,O,M,F,j,T,L,$,q,J,ae,ie,Z,te,V,B,D,U,X,ee,K,oe,me,de,ye,Te,Ce;switch(q=new _f,o=Object.keys(e).sort(function(Ie,Ee){return Ie-Ee}),r){case"macroman":for(_=0,x=function(){var Ie=[];for(y=0;y<256;++y)Ie.push(0);return Ie}(),E={0:0},a={},J=0,te=o.length;J<te;J++)E[de=e[i=o[J]]]==null&&(E[de]=++_),a[i]={old:e[i],new:E[e[i]]},x[i]=E[e[i]];return q.writeUInt16(1),q.writeUInt16(0),q.writeUInt32(12),q.writeUInt16(0),q.writeUInt16(262),q.writeUInt16(0),q.write(x),{charMap:a,subtable:q.data,maxGlyphID:_+1};case"unicode":for(L=[],g=[],A=0,E={},n={},b=h=null,ae=0,V=o.length;ae<V;ae++)E[k=e[i=o[ae]]]==null&&(E[k]=++A),n[i]={old:k,new:E[k]},s=E[k]-i,b!=null&&s===h||(b&&g.push(b),L.push(i),h=s),b=i;for(b&&g.push(b),g.push(65535),L.push(65535),j=2*(F=L.length),M=2*Math.pow(Math.log(F)/Math.LN2,2),v=Math.log(M/2)/Math.LN2,O=2*F-M,u=[],I=[],p=[],y=ie=0,B=L.length;ie<B;y=++ie){if(T=L[y],f=g[y],T===65535){u.push(0),I.push(0);break}if(T-($=n[T].new)>=32768)for(u.push(0),I.push(2*(p.length+F-y)),i=Z=T;T<=f?Z<=f:Z>=f;i=T<=f?++Z:--Z)p.push(n[i].new);else u.push($-T),I.push(0)}for(q.writeUInt16(3),q.writeUInt16(1),q.writeUInt32(12),q.writeUInt16(4),q.writeUInt16(16+8*F+2*p.length),q.writeUInt16(0),q.writeUInt16(j),q.writeUInt16(M),q.writeUInt16(v),q.writeUInt16(O),oe=0,D=g.length;oe<D;oe++)i=g[oe],q.writeUInt16(i);for(q.writeUInt16(0),me=0,U=L.length;me<U;me++)i=L[me],q.writeUInt16(i);for(ye=0,X=u.length;ye<X;ye++)s=u[ye],q.writeUInt16(s);for(Te=0,ee=I.length;Te<ee;Te++)S=I[Te],q.writeUInt16(S);for(Ce=0,K=p.length;Ce<K;Ce++)_=p[Ce],q.writeUInt16(_);return{charMap:n,subtable:q.data,maxGlyphID:A+1}}},t}(),fx=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="cmap",t.prototype.parse=function(e){var r,n,i;for(e.pos=this.offset,this.version=e.readUInt16(),i=e.readUInt16(),this.tables=[],this.unicode=null,n=0;0<=i?n<i:n>i;n=0<=i?++n:--n)r=new Yw(e,this.offset),this.tables.push(r),r.isUnicode&&this.unicode==null&&(this.unicode=r);return!0},t.encode=function(e,r){var n,i;return r==null&&(r="macroman"),n=Yw.encode(e,r),(i=new _f).writeUInt16(0),i.writeUInt16(1),n.table=i.data.concat(n.subtable),n},t}(),nj=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="hhea",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},t}(),ij=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="OS/2",t.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=function(){var r,n;for(n=[],r=0;r<10;++r)n.push(e.readByte());return n}(),this.charRange=function(){var r,n;for(n=[],r=0;r<4;++r)n.push(e.readInt());return n}(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=function(){var r,n;for(n=[],r=0;r<2;r=++r)n.push(e.readInt());return n}(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},t}(),aj=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="post",t.prototype.parse=function(e){var r,n,i;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var a;for(n=e.readUInt16(),this.glyphNameIndex=[],a=0;0<=n?a<n:a>n;a=0<=n?++a:--a)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],i=[];e.pos<this.offset+this.length;)r=e.readByte(),i.push(this.names.push(e.readString(r)));return i;case 151552:return n=e.readUInt16(),this.offsets=e.read(n);case 262144:return this.map=(function(){var o,s,u;for(u=[],a=o=0,s=this.file.maxp.numGlyphs;0<=s?o<s:o>s;a=0<=s?++o:--o)u.push(e.readUInt32());return u}).call(this)}},t}(),oj=function(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},sj=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="name",t.prototype.parse=function(e){var r,n,i,a,o,s,u,h,f,g,v;for(e.pos=this.offset,e.readShort(),r=e.readShort(),s=e.readShort(),n=[],a=0;0<=r?a<r:a>r;a=0<=r?++a:--a)n.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+s+e.readShort()});for(u={},a=f=0,g=n.length;f<g;a=++f)i=n[a],e.pos=i.offset,h=e.readString(i.length),o=new oj(h,i),u[v=i.nameID]==null&&(u[v]=[]),u[i.nameID].push(o);this.strings=u,this.copyright=u[0],this.fontFamily=u[1],this.fontSubfamily=u[2],this.uniqueSubfamily=u[3],this.fontName=u[4],this.version=u[5];try{this.postscriptName=u[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=u[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=u[7],this.manufacturer=u[8],this.designer=u[9],this.description=u[10],this.vendorUrl=u[11],this.designerUrl=u[12],this.license=u[13],this.licenseUrl=u[14],this.preferredFamily=u[15],this.preferredSubfamily=u[17],this.compatibleFull=u[18],this.sampleText=u[19]},t}(),lj=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="maxp",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},t}(),uj=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="hmtx",t.prototype.parse=function(e){var r,n,i,a,o,s,u;for(e.pos=this.offset,this.metrics=[],r=0,s=this.file.hhea.numberOfMetrics;0<=s?r<s:r>s;r=0<=s?++r:--r)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var h,f;for(f=[],r=h=0;0<=i?h<i:h>i;r=0<=i?++h:--h)f.push(e.readInt16());return f}(),this.widths=(function(){var h,f,g,v;for(v=[],h=0,f=(g=this.metrics).length;h<f;h++)a=g[h],v.push(a.advance);return v}).call(this),n=this.widths[this.widths.length-1],u=[],r=o=0;0<=i?o<i:o>i;r=0<=i?++o:--o)u.push(this.widths.push(n));return u},t.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},t}(),hx=[].slice,cj=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(e){var r,n,i,a,o,s,u,h,f,g;return e in this.cache?this.cache[e]:(a=this.file.loca,r=this.file.contents,n=a.indexOf(e),(i=a.lengthOf(e))===0?this.cache[e]=null:(r.pos=this.offset+n,o=(s=new _f(r.read(i))).readShort(),h=s.readShort(),g=s.readShort(),u=s.readShort(),f=s.readShort(),this.cache[e]=o===-1?new hj(s,h,g,u,f):new fj(s,o,h,g,u,f),this.cache[e]))},t.prototype.encode=function(e,r,n){var i,a,o,s,u;for(o=[],a=[],s=0,u=r.length;s<u;s++)i=e[r[s]],a.push(o.length),i&&(o=o.concat(i.encode(n)));return a.push(o.length),{table:o,offsets:a}},t}(),fj=function(){function t(e,r,n,i,a,o){this.raw=e,this.numberOfContours=r,this.xMin=n,this.yMin=i,this.xMax=a,this.yMax=o,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),hj=function(){function t(e,r,n,i,a){var o,s;for(this.raw=e,this.xMin=r,this.yMin=n,this.xMax=i,this.yMax=a,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],o=this.raw;s=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readUInt16()),32&s;)o.pos+=1&s?4:2,128&s?o.pos+=8:64&s?o.pos+=4:8&s&&(o.pos+=2)}return t.prototype.encode=function(){var e,r,n;for(r=new _f(hx.call(this.raw.data)),e=0,n=this.glyphIDs.length;e<n;++e)r.pos=this.glyphOffsets[e];return r.data},t}(),dj=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Wu(t,su),t.prototype.tag="loca",t.prototype.parse=function(e){var r,n;return e.pos=this.offset,r=this.file.head.indexToLocFormat,this.offsets=r===0?(function(){var i,a;for(a=[],n=0,i=this.length;n<i;n+=2)a.push(2*e.readUInt16());return a}).call(this):(function(){var i,a;for(a=[],n=0,i=this.length;n<i;n+=4)a.push(e.readUInt32());return a}).call(this)},t.prototype.indexOf=function(e){return this.offsets[e]},t.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},t.prototype.encode=function(e,r){for(var n=new Uint32Array(this.offsets.length),i=0,a=0,o=0;o<n.length;++o)if(n[o]=i,a<r.length&&r[a]==o){++a,n[o]=i;var s=this.offsets[o],u=this.offsets[o+1]-s;u>0&&(i+=u)}for(var h=new Array(4*n.length),f=0;f<n.length;++f)h[4*f+3]=255&n[f],h[4*f+2]=(65280&n[f])>>8,h[4*f+1]=(16711680&n[f])>>16,h[4*f]=(4278190080&n[f])>>24;return h},t}(),pj=function(){function t(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var e,r,n,i,a;for(r in i=this.font.cmap.tables[0].codeMap,e={},a=this.subset)n=a[r],e[r]=i[n];return e},t.prototype.glyphsFor=function(e){var r,n,i,a,o,s,u;for(i={},o=0,s=e.length;o<s;o++)i[a=e[o]]=this.font.glyf.glyphFor(a);for(a in r=[],i)(n=i[a])!=null&&n.compound&&r.push.apply(r,n.glyphIDs);if(r.length>0)for(a in u=this.glyphsFor(r))n=u[a],i[a]=n;return i},t.prototype.encode=function(e,r){var n,i,a,o,s,u,h,f,g,v,p,y,_,x,b;for(i in n=fx.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(e),p={0:0},b=n.charMap)p[(u=b[i]).old]=u.new;for(y in v=n.maxGlyphID,o)y in p||(p[y]=v++);return f=function(E){var A,S;for(A in S={},E)S[E[A]]=A;return S}(p),g=Object.keys(f).sort(function(E,A){return E-A}),_=function(){var E,A,S;for(S=[],E=0,A=g.length;E<A;E++)s=g[E],S.push(f[s]);return S}(),a=this.font.glyf.encode(o,_,p),h=this.font.loca.encode(a.offsets,_),x={cmap:this.font.cmap.raw(),glyf:a.table,loca:h,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(r)},this.font.os2.exists&&(x["OS/2"]=this.font.os2.raw()),this.font.directory.encode(x)},t}();tr.API.PDFObject=function(){var t;function e(){}return t=function(r,n){return(Array(n+1).join("0")+r).slice(-n)},e.convert=function(r){var n,i,a,o;if(Array.isArray(r))return"["+function(){var s,u,h;for(h=[],s=0,u=r.length;s<u;s++)n=r[s],h.push(e.convert(n));return h}().join(" ")+"]";if(typeof r=="string")return"/"+r;if(r?.isString)return"("+r+")";if(r instanceof Date)return"(D:"+t(r.getUTCFullYear(),4)+t(r.getUTCMonth(),2)+t(r.getUTCDate(),2)+t(r.getUTCHours(),2)+t(r.getUTCMinutes(),2)+t(r.getUTCSeconds(),2)+"Z)";if({}.toString.call(r)==="[object Object]"){for(i in a=["<<"],r)o=r[i],a.push("/"+i+" "+e.convert(o));return a.push(">>"),a.join(`
|
|
603
|
-
`)}return""+r},e}();window.jspdf={jsPDF:tr};XP(!1);W8("change-font-size");const gj=new URLSearchParams(location.search).get("key"),dx=TT({key:gj});window.store=dx;window.config={addGlobalFont:rO,unstable_useHtmlTextRender:sO,unstable_setTextVerticalResizeEnabled:aO,unstable_setTextOverflow:W8,onLoadError:tO,setAssetLoadTimeout:ZP,setFontLoadTimeout:QP,unstable_setTextSplitAllowed:uO};const vj=Kw.createRoot(document.getElementById("root"));vj.render(se.createElement(ER,{visiblePagesOffset:0,renderOnlyActivePage:!0,store:dx,components:{PageControls:()=>null,Tooltip:()=>null}}));export{Nn as _,i0 as c,hh as g};
|