polotno-node 2.12.22 → 2.12.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,559 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).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 Ch=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function e9(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var ng={exports:{}},Lr={};/**
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 my;function t9(){if(my)return Lr;my=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),v=Symbol.iterator;function g(D){return D===null||typeof D!="object"?null:(D=v&&D[v]||D["@@iterator"],typeof D=="function"?D:null)}var c={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,x={};function E(D,j,z){this.props=D,this.context=j,this.refs=x,this.updater=z||c}E.prototype.isReactComponent={},E.prototype.setState=function(D,j){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,j,"setState")},E.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function S(){}S.prototype=E.prototype;function b(D,j,z){this.props=D,this.context=j,this.refs=x,this.updater=z||c}var w=b.prototype=new S;w.constructor=b,y(w,E.prototype),w.isPureReactComponent=!0;var _=Array.isArray,A=Object.prototype.hasOwnProperty,M={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function L(D,j,z){var Z,re={},W=null,Q=null;if(j!=null)for(Z in j.ref!==void 0&&(Q=j.ref),j.key!==void 0&&(W=""+j.key),j)A.call(j,Z)&&!O.hasOwnProperty(Z)&&(re[Z]=j[Z]);var se=arguments.length-2;if(se===1)re.children=z;else if(1<se){for(var ue=Array(se),le=0;le<se;le++)ue[le]=arguments[le+2];re.children=ue}if(D&&D.defaultProps)for(Z in se=D.defaultProps,se)re[Z]===void 0&&(re[Z]=se[Z]);return{$$typeof:e,type:D,key:W,ref:Q,props:re,_owner:M.current}}function R(D,j){return{$$typeof:e,type:D.type,key:j,ref:D.ref,props:D.props,_owner:D._owner}}function T(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function k(D){var j={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(z){return j[z]})}var C=/\/+/g;function q(D,j){return typeof D=="object"&&D!==null&&D.key!=null?k(""+D.key):j.toString(36)}function G(D,j,z,Z,re){var W=typeof D;(W==="undefined"||W==="boolean")&&(D=null);var Q=!1;if(D===null)Q=!0;else switch(W){case"string":case"number":Q=!0;break;case"object":switch(D.$$typeof){case e:case t:Q=!0}}if(Q)return Q=D,re=re(Q),D=Z===""?"."+q(Q,0):Z,_(re)?(z="",D!=null&&(z=D.replace(C,"$&/")+"/"),G(re,j,z,"",function(le){return le})):re!=null&&(T(re)&&(re=R(re,z+(!re.key||Q&&Q.key===re.key?"":(""+re.key).replace(C,"$&/")+"/")+D)),j.push(re)),1;if(Q=0,Z=Z===""?".":Z+":",_(D))for(var se=0;se<D.length;se++){W=D[se];var ue=Z+q(W,se);Q+=G(W,j,z,ue,re)}else if(ue=g(D),typeof ue=="function")for(D=ue.call(D),se=0;!(W=D.next()).done;)W=W.value,ue=Z+q(W,se++),Q+=G(W,j,z,ue,re);else if(W==="object")throw j=String(D),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.");return Q}function J(D,j,z){if(D==null)return D;var Z=[],re=0;return G(D,Z,"","",function(W){return j.call(z,W,re++)}),Z}function ae(D){if(D._status===-1){var j=D._result;j=j(),j.then(function(z){(D._status===0||D._status===-1)&&(D._status=1,D._result=z)},function(z){(D._status===0||D._status===-1)&&(D._status=2,D._result=z)}),D._status===-1&&(D._status=0,D._result=j)}if(D._status===1)return D._result.default;throw D._result}var H={current:null},V={transition:null},Y={ReactCurrentDispatcher:H,ReactCurrentBatchConfig:V,ReactCurrentOwner:M};function U(){throw Error("act(...) is not supported in production builds of React.")}return Lr.Children={map:J,forEach:function(D,j,z){J(D,function(){j.apply(this,arguments)},z)},count:function(D){var j=0;return J(D,function(){j++}),j},toArray:function(D){return J(D,function(j){return j})||[]},only:function(D){if(!T(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},Lr.Component=E,Lr.Fragment=r,Lr.Profiler=i,Lr.PureComponent=b,Lr.StrictMode=n,Lr.Suspense=u,Lr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,Lr.act=U,Lr.cloneElement=function(D,j,z){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var Z=y({},D.props),re=D.key,W=D.ref,Q=D._owner;if(j!=null){if(j.ref!==void 0&&(W=j.ref,Q=M.current),j.key!==void 0&&(re=""+j.key),D.type&&D.type.defaultProps)var se=D.type.defaultProps;for(ue in j)A.call(j,ue)&&!O.hasOwnProperty(ue)&&(Z[ue]=j[ue]===void 0&&se!==void 0?se[ue]:j[ue])}var ue=arguments.length-2;if(ue===1)Z.children=z;else if(1<ue){se=Array(ue);for(var le=0;le<ue;le++)se[le]=arguments[le+2];Z.children=se}return{$$typeof:e,type:D.type,key:re,ref:W,props:Z,_owner:Q}},Lr.createContext=function(D){return D={$$typeof:l,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:a,_context:D},D.Consumer=D},Lr.createElement=L,Lr.createFactory=function(D){var j=L.bind(null,D);return j.type=D,j},Lr.createRef=function(){return{current:null}},Lr.forwardRef=function(D){return{$$typeof:o,render:D}},Lr.isValidElement=T,Lr.lazy=function(D){return{$$typeof:f,_payload:{_status:-1,_result:D},_init:ae}},Lr.memo=function(D,j){return{$$typeof:d,type:D,compare:j===void 0?null:j}},Lr.startTransition=function(D){var j=V.transition;V.transition={};try{D()}finally{V.transition=j}},Lr.unstable_act=U,Lr.useCallback=function(D,j){return H.current.useCallback(D,j)},Lr.useContext=function(D){return H.current.useContext(D)},Lr.useDebugValue=function(){},Lr.useDeferredValue=function(D){return H.current.useDeferredValue(D)},Lr.useEffect=function(D,j){return H.current.useEffect(D,j)},Lr.useId=function(){return H.current.useId()},Lr.useImperativeHandle=function(D,j,z){return H.current.useImperativeHandle(D,j,z)},Lr.useInsertionEffect=function(D,j){return H.current.useInsertionEffect(D,j)},Lr.useLayoutEffect=function(D,j){return H.current.useLayoutEffect(D,j)},Lr.useMemo=function(D,j){return H.current.useMemo(D,j)},Lr.useReducer=function(D,j,z){return H.current.useReducer(D,j,z)},Lr.useRef=function(D){return H.current.useRef(D)},Lr.useState=function(D){return H.current.useState(D)},Lr.useSyncExternalStore=function(D,j,z){return H.current.useSyncExternalStore(D,j,z)},Lr.useTransition=function(){return H.current.useTransition()},Lr.version="18.3.1",Lr}var yy;function vp(){return yy||(yy=1,ng.exports=t9()),ng.exports}var Pi=vp();const ce=lc(Pi);var t1={},ig={exports:{}},ms={},ag={exports:{}},og={};/**
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 by;function r9(){return by||(by=1,function(e){function t(V,Y){var U=V.length;V.push(Y);e:for(;0<U;){var D=U-1>>>1,j=V[D];if(0<i(j,Y))V[D]=Y,V[U]=j,U=D;else break e}}function r(V){return V.length===0?null:V[0]}function n(V){if(V.length===0)return null;var Y=V[0],U=V.pop();if(U!==Y){V[0]=U;e:for(var D=0,j=V.length,z=j>>>1;D<z;){var Z=2*(D+1)-1,re=V[Z],W=Z+1,Q=V[W];if(0>i(re,U))W<j&&0>i(Q,re)?(V[D]=Q,V[W]=U,D=W):(V[D]=re,V[Z]=U,D=Z);else if(W<j&&0>i(Q,U))V[D]=Q,V[W]=U,D=W;else break e}}return Y}function i(V,Y){var U=V.sortIndex-Y.sortIndex;return U!==0?U:V.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,o=l.now();e.unstable_now=function(){return l.now()-o}}var u=[],d=[],f=1,v=null,g=3,c=!1,y=!1,x=!1,E=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(V){for(var Y=r(d);Y!==null;){if(Y.callback===null)n(d);else if(Y.startTime<=V)n(d),Y.sortIndex=Y.expirationTime,t(u,Y);else break;Y=r(d)}}function _(V){if(x=!1,w(V),!y)if(r(u)!==null)y=!0,ae(A);else{var Y=r(d);Y!==null&&H(_,Y.startTime-V)}}function A(V,Y){y=!1,x&&(x=!1,S(L),L=-1),c=!0;var U=g;try{for(w(Y),v=r(u);v!==null&&(!(v.expirationTime>Y)||V&&!k());){var D=v.callback;if(typeof D=="function"){v.callback=null,g=v.priorityLevel;var j=D(v.expirationTime<=Y);Y=e.unstable_now(),typeof j=="function"?v.callback=j:v===r(u)&&n(u),w(Y)}else n(u);v=r(u)}if(v!==null)var z=!0;else{var Z=r(d);Z!==null&&H(_,Z.startTime-Y),z=!1}return z}finally{v=null,g=U,c=!1}}var M=!1,O=null,L=-1,R=5,T=-1;function k(){return!(e.unstable_now()-T<R)}function C(){if(O!==null){var V=e.unstable_now();T=V;var Y=!0;try{Y=O(!0,V)}finally{Y?q():(M=!1,O=null)}}else M=!1}var q;if(typeof b=="function")q=function(){b(C)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,J=G.port2;G.port1.onmessage=C,q=function(){J.postMessage(null)}}else q=function(){E(C,0)};function ae(V){O=V,M||(M=!0,q())}function H(V,Y){L=E(function(){V(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_continueExecution=function(){y||c||(y=!0,ae(A))},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(V){switch(g){case 1:case 2:case 3:var Y=3;break;default:Y=g}var U=g;g=Y;try{return V()}finally{g=U}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(V,Y){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var U=g;g=V;try{return Y()}finally{g=U}},e.unstable_scheduleCallback=function(V,Y,U){var D=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?D+U:D):U=D,V){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=U+j,V={id:f++,callback:Y,priorityLevel:V,startTime:U,expirationTime:j,sortIndex:-1},U>D?(V.sortIndex=U,t(d,V),r(u)===null&&V===r(d)&&(x?(S(L),L=-1):x=!0,H(_,U-D))):(V.sortIndex=j,t(u,V),y||c||(y=!0,ae(A))),V},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(V){var Y=g;return function(){var U=g;g=Y;try{return V.apply(this,arguments)}finally{g=U}}}}(og)),og}var wy;function em(){return wy||(wy=1,ag.exports=r9()),ag.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 _y;function n9(){if(_y)return ms;_y=1;var e=vp(),t=em();function r(s){for(var h="https://reactjs.org/docs/error-decoder.html?invariant="+s,P=1;P<arguments.length;P++)h+="&args[]="+encodeURIComponent(arguments[P]);return"Minified React error #"+s+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function a(s,h){l(s,h),l(s+"Capture",h)}function l(s,h){for(i[s]=h,s=0;s<h.length;s++)n.add(h[s])}var o=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},v={};function g(s){return u.call(v,s)?!0:u.call(f,s)?!1:d.test(s)?v[s]=!0:(f[s]=!0,!1)}function c(s,h,P,F){if(P!==null&&P.type===0)return!1;switch(typeof h){case"function":case"symbol":return!0;case"boolean":return F?!1:P!==null?!P.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function y(s,h,P,F){if(h===null||typeof h>"u"||c(s,h,P,F))return!0;if(F)return!1;if(P!==null)switch(P.type){case 3:return!h;case 4:return h===!1;case 5:return isNaN(h);case 6:return isNaN(h)||1>h}return!1}function x(s,h,P,F,K,ne,ge){this.acceptsBooleans=h===2||h===3||h===4,this.attributeName=F,this.attributeNamespace=K,this.mustUseProperty=P,this.propertyName=s,this.type=h,this.sanitizeURL=ne,this.removeEmptyString=ge}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){E[s]=new x(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var h=s[0];E[h]=new x(h,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){E[s]=new x(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){E[s]=new x(s,2,!1,s,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(s){E[s]=new x(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){E[s]=new x(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){E[s]=new x(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){E[s]=new x(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){E[s]=new x(s,5,!1,s.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function b(s){return s[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(s){var h=s.replace(S,b);E[h]=new x(h,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var h=s.replace(S,b);E[h]=new x(h,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var h=s.replace(S,b);E[h]=new x(h,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){E[s]=new x(s,1,!1,s.toLowerCase(),null,!1,!1)}),E.xlinkHref=new x("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){E[s]=new x(s,1,!1,s.toLowerCase(),null,!0,!0)});function w(s,h,P,F){var K=E.hasOwnProperty(h)?E[h]:null;(K!==null?K.type!==0:F||!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(y(h,P,K,F)&&(P=null),F||K===null?g(h)&&(P===null?s.removeAttribute(h):s.setAttribute(h,""+P)):K.mustUseProperty?s[K.propertyName]=P===null?K.type===3?!1:"":P:(h=K.attributeName,F=K.attributeNamespace,P===null?s.removeAttribute(h):(K=K.type,P=K===3||K===4&&P===!0?"":""+P,F?s.setAttributeNS(F,h,P):s.setAttribute(h,P))))}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),M=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),k=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),H=Symbol.for("react.offscreen"),V=Symbol.iterator;function Y(s){return s===null||typeof s!="object"?null:(s=V&&s[V]||s["@@iterator"],typeof s=="function"?s:null)}var U=Object.assign,D;function j(s){if(D===void 0)try{throw Error()}catch(P){var h=P.stack.trim().match(/\n( *(at )?)/);D=h&&h[1]||""}return`
26
- `+D+s}var z=!1;function Z(s,h){if(!s||z)return"";z=!0;var P=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(h)if(h=function(){throw Error()},Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(tt){var F=tt}Reflect.construct(s,[],h)}else{try{h.call()}catch(tt){F=tt}s.call(h.prototype)}else{try{throw Error()}catch(tt){F=tt}s()}}catch(tt){if(tt&&F&&typeof tt.stack=="string"){for(var K=tt.stack.split(`
27
- `),ne=F.stack.split(`
28
- `),ge=K.length-1,Ie=ne.length-1;1<=ge&&0<=Ie&&K[ge]!==ne[Ie];)Ie--;for(;1<=ge&&0<=Ie;ge--,Ie--)if(K[ge]!==ne[Ie]){if(ge!==1||Ie!==1)do if(ge--,Ie--,0>Ie||K[ge]!==ne[Ie]){var Be=`
29
- `+K[ge].replace(" at new "," at ");return s.displayName&&Be.includes("<anonymous>")&&(Be=Be.replace("<anonymous>",s.displayName)),Be}while(1<=ge&&0<=Ie);break}}}finally{z=!1,Error.prepareStackTrace=P}return(s=s?s.displayName||s.name:"")?j(s):""}function re(s){switch(s.tag){case 5:return j(s.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 2:case 15:return s=Z(s.type,!1),s;case 11:return s=Z(s.type.render,!1),s;case 1:return s=Z(s.type,!0),s;default:return""}}function W(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case O:return"Fragment";case M:return"Portal";case R:return"Profiler";case L:return"StrictMode";case q:return"Suspense";case G:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case k:return(s.displayName||"Context")+".Consumer";case T:return(s._context.displayName||"Context")+".Provider";case C:var h=s.render;return s=s.displayName,s||(s=h.displayName||h.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case J:return h=s.displayName||null,h!==null?h:W(s.type)||"Memo";case ae:h=s._payload,s=s._init;try{return W(s(h))}catch{}}return null}function Q(s){var h=s.type;switch(s.tag){case 24:return"Cache";case 9:return(h.displayName||"Context")+".Consumer";case 10:return(h._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=h.render,s=s.displayName||s.name||"",h.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return h;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return W(h);case 8:return h===L?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h}return null}function se(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function ue(s){var h=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(h==="checkbox"||h==="radio")}function le(s){var h=ue(s)?"checked":"value",P=Object.getOwnPropertyDescriptor(s.constructor.prototype,h),F=""+s[h];if(!s.hasOwnProperty(h)&&typeof P<"u"&&typeof P.get=="function"&&typeof P.set=="function"){var K=P.get,ne=P.set;return Object.defineProperty(s,h,{configurable:!0,get:function(){return K.call(this)},set:function(ge){F=""+ge,ne.call(this,ge)}}),Object.defineProperty(s,h,{enumerable:P.enumerable}),{getValue:function(){return F},setValue:function(ge){F=""+ge},stopTracking:function(){s._valueTracker=null,delete s[h]}}}}function ye(s){s._valueTracker||(s._valueTracker=le(s))}function Re(s){if(!s)return!1;var h=s._valueTracker;if(!h)return!0;var P=h.getValue(),F="";return s&&(F=ue(s)?s.checked?"true":"false":s.value),s=F,s!==P?(h.setValue(s),!0):!1}function Me(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Pe(s,h){var P=h.checked;return U({},h,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:P??s._wrapperState.initialChecked})}function de(s,h){var P=h.defaultValue==null?"":h.defaultValue,F=h.checked!=null?h.checked:h.defaultChecked;P=se(h.value!=null?h.value:P),s._wrapperState={initialChecked:F,initialValue:P,controlled:h.type==="checkbox"||h.type==="radio"?h.checked!=null:h.value!=null}}function Te(s,h){h=h.checked,h!=null&&w(s,"checked",h,!1)}function Ae(s,h){Te(s,h);var P=se(h.value),F=h.type;if(P!=null)F==="number"?(P===0&&s.value===""||s.value!=P)&&(s.value=""+P):s.value!==""+P&&(s.value=""+P);else if(F==="submit"||F==="reset"){s.removeAttribute("value");return}h.hasOwnProperty("value")?_e(s,h.type,P):h.hasOwnProperty("defaultValue")&&_e(s,h.type,se(h.defaultValue)),h.checked==null&&h.defaultChecked!=null&&(s.defaultChecked=!!h.defaultChecked)}function be(s,h,P){if(h.hasOwnProperty("value")||h.hasOwnProperty("defaultValue")){var F=h.type;if(!(F!=="submit"&&F!=="reset"||h.value!==void 0&&h.value!==null))return;h=""+s._wrapperState.initialValue,P||h===s.value||(s.value=h),s.defaultValue=h}P=s.name,P!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,P!==""&&(s.name=P)}function _e(s,h,P){(h!=="number"||Me(s.ownerDocument)!==s)&&(P==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+P&&(s.defaultValue=""+P))}var xe=Array.isArray;function Le(s,h,P,F){if(s=s.options,h){h={};for(var K=0;K<P.length;K++)h["$"+P[K]]=!0;for(P=0;P<s.length;P++)K=h.hasOwnProperty("$"+s[P].value),s[P].selected!==K&&(s[P].selected=K),K&&F&&(s[P].defaultSelected=!0)}else{for(P=""+se(P),h=null,K=0;K<s.length;K++){if(s[K].value===P){s[K].selected=!0,F&&(s[K].defaultSelected=!0);return}h!==null||s[K].disabled||(h=s[K])}h!==null&&(h.selected=!0)}}function pe(s,h){if(h.dangerouslySetInnerHTML!=null)throw Error(r(91));return U({},h,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function Ce(s,h){var P=h.value;if(P==null){if(P=h.children,h=h.defaultValue,P!=null){if(h!=null)throw Error(r(92));if(xe(P)){if(1<P.length)throw Error(r(93));P=P[0]}h=P}h==null&&(h=""),P=h}s._wrapperState={initialValue:se(P)}}function je(s,h){var P=se(h.value),F=se(h.defaultValue);P!=null&&(P=""+P,P!==s.value&&(s.value=P),h.defaultValue==null&&s.defaultValue!==P&&(s.defaultValue=P)),F!=null&&(s.defaultValue=""+F)}function He(s){var h=s.textContent;h===s._wrapperState.initialValue&&h!==""&&h!==null&&(s.value=h)}function st(s){switch(s){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pt(s,h){return s==null||s==="http://www.w3.org/1999/xhtml"?st(h):s==="http://www.w3.org/2000/svg"&&h==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var ct,bt=function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(h,P,F,K){MSApp.execUnsafeLocalFunction(function(){return s(h,P,F,K)})}:s}(function(s,h){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=h;else{for(ct=ct||document.createElement("div"),ct.innerHTML="<svg>"+h.valueOf().toString()+"</svg>",h=ct.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;h.firstChild;)s.appendChild(h.firstChild)}});function ht(s,h){if(h){var P=s.firstChild;if(P&&P===s.lastChild&&P.nodeType===3){P.nodeValue=h;return}}s.textContent=h}var vt={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},wr=["Webkit","ms","Moz","O"];Object.keys(vt).forEach(function(s){wr.forEach(function(h){h=h+s.charAt(0).toUpperCase()+s.substring(1),vt[h]=vt[s]})});function cr(s,h,P){return h==null||typeof h=="boolean"||h===""?"":P||typeof h!="number"||h===0||vt.hasOwnProperty(s)&&vt[s]?(""+h).trim():h+"px"}function Pt(s,h){s=s.style;for(var P in h)if(h.hasOwnProperty(P)){var F=P.indexOf("--")===0,K=cr(P,h[P],F);P==="float"&&(P="cssFloat"),F?s.setProperty(P,K):s[P]=K}}var $t=U({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 $e(s,h){if(h){if($t[s]&&(h.children!=null||h.dangerouslySetInnerHTML!=null))throw Error(r(137,s));if(h.dangerouslySetInnerHTML!=null){if(h.children!=null)throw Error(r(60));if(typeof h.dangerouslySetInnerHTML!="object"||!("__html"in h.dangerouslySetInnerHTML))throw Error(r(61))}if(h.style!=null&&typeof h.style!="object")throw Error(r(62))}}function ze(s,h){if(s.indexOf("-")===-1)return typeof h.is=="string";switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var kt=null;function St(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var er=null,jt=null,vr=null;function Xt(s){if(s=su(s)){if(typeof er!="function")throw Error(r(280));var h=s.stateNode;h&&(h=xi(h),er(s.stateNode,s.type,h))}}function lr(s){jt?vr?vr.push(s):vr=[s]:jt=s}function Oi(){if(jt){var s=jt,h=vr;if(vr=jt=null,Xt(s),h)for(s=0;s<h.length;s++)Xt(h[s])}}function Zn(s,h){return s(h)}function vi(){}var mn=!1;function Yt(s,h,P){if(mn)return s(h,P);mn=!0;try{return Zn(s,h,P)}finally{mn=!1,(jt!==null||vr!==null)&&(vi(),Oi())}}function sa(s,h){var P=s.stateNode;if(P===null)return null;var F=xi(P);if(F===null)return null;P=F[h];e:switch(h){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(F=!F.disabled)||(s=s.type,F=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!F;break e;default:s=!1}if(s)return null;if(P&&typeof P!="function")throw Error(r(231,h,typeof P));return P}var Ra=!1;if(o)try{var Un={};Object.defineProperty(Un,"passive",{get:function(){Ra=!0}}),window.addEventListener("test",Un,Un),window.removeEventListener("test",Un,Un)}catch{Ra=!1}function Ui(s,h,P,F,K,ne,ge,Ie,Be){var tt=Array.prototype.slice.call(arguments,3);try{h.apply(P,tt)}catch(gt){this.onError(gt)}}var Rr=!1,yn=null,An=!1,ba=null,Mo={onError:function(s){Rr=!0,yn=s}};function wa(s,h,P,F,K,ne,ge,Ie,Be){Rr=!1,yn=null,Ui.apply(Mo,arguments)}function Ya(s,h,P,F,K,ne,ge,Ie,Be){if(wa.apply(this,arguments),Rr){if(Rr){var tt=yn;Rr=!1,yn=null}else throw Error(r(198));An||(An=!0,ba=tt)}}function Qn(s){var h=s,P=s;if(s.alternate)for(;h.return;)h=h.return;else{s=h;do h=s,(h.flags&4098)!==0&&(P=h.return),s=h.return;while(s)}return h.tag===3?P:null}function _a(s){if(s.tag===13){var h=s.memoizedState;if(h===null&&(s=s.alternate,s!==null&&(h=s.memoizedState)),h!==null)return h.dehydrated}return null}function xa(s){if(Qn(s)!==s)throw Error(r(188))}function Io(s){var h=s.alternate;if(!h){if(h=Qn(s),h===null)throw Error(r(188));return h!==s?null:s}for(var P=s,F=h;;){var K=P.return;if(K===null)break;var ne=K.alternate;if(ne===null){if(F=K.return,F!==null){P=F;continue}break}if(K.child===ne.child){for(ne=K.child;ne;){if(ne===P)return xa(K),s;if(ne===F)return xa(K),h;ne=ne.sibling}throw Error(r(188))}if(P.return!==F.return)P=K,F=ne;else{for(var ge=!1,Ie=K.child;Ie;){if(Ie===P){ge=!0,P=K,F=ne;break}if(Ie===F){ge=!0,F=K,P=ne;break}Ie=Ie.sibling}if(!ge){for(Ie=ne.child;Ie;){if(Ie===P){ge=!0,P=ne,F=K;break}if(Ie===F){ge=!0,F=ne,P=K;break}Ie=Ie.sibling}if(!ge)throw Error(r(189))}}if(P.alternate!==F)throw Error(r(190))}if(P.tag!==3)throw Error(r(188));return P.stateNode.current===P?s:h}function Ci(s){return s=Io(s),s!==null?Xa(s):null}function Xa(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var h=Xa(s);if(h!==null)return h;s=s.sibling}return null}var Ps=t.unstable_scheduleCallback,Ko=t.unstable_cancelCallback,Vl=t.unstable_shouldYield,cf=t.unstable_requestPaint,bn=t.unstable_now,Gl=t.unstable_getCurrentPriorityLevel,Zo=t.unstable_ImmediatePriority,Sa=t.unstable_UserBlockingPriority,Qo=t.unstable_NormalPriority,cc=t.unstable_LowPriority,$s=t.unstable_IdlePriority,po=null,oi=null;function an(s){if(oi&&typeof oi.onCommitFiberRoot=="function")try{oi.onCommitFiberRoot(po,s,void 0,(s.current.flags&128)===128)}catch{}}var mr=Math.clz32?Math.clz32:qi,Jo=Math.log,Er=Math.LN2;function qi(s){return s>>>=0,s===0?32:31-(Jo(s)/Er|0)|0}var Ka=64,Hi=4194304;function Pn(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function Vi(s,h){var P=s.pendingLanes;if(P===0)return 0;var F=0,K=s.suspendedLanes,ne=s.pingedLanes,ge=P&268435455;if(ge!==0){var Ie=ge&~K;Ie!==0?F=Pn(Ie):(ne&=ge,ne!==0&&(F=Pn(ne)))}else ge=P&~K,ge!==0?F=Pn(ge):ne!==0&&(F=Pn(ne));if(F===0)return 0;if(h!==0&&h!==F&&(h&K)===0&&(K=F&-F,ne=h&-h,K>=ne||K===16&&(ne&4194240)!==0))return h;if((F&4)!==0&&(F|=P&16),h=s.entangledLanes,h!==0)for(s=s.entanglements,h&=F;0<h;)P=31-mr(h),K=1<<P,F|=s[P],h&=~K;return F}function Ws(s,h){switch(s){case 1:case 2:case 4:return h+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return h+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qn(s,h){for(var P=s.suspendedLanes,F=s.pingedLanes,K=s.expirationTimes,ne=s.pendingLanes;0<ne;){var ge=31-mr(ne),Ie=1<<ge,Be=K[ge];Be===-1?((Ie&P)===0||(Ie&F)!==0)&&(K[ge]=Ws(Ie,h)):Be<=h&&(s.expiredLanes|=Ie),ne&=~Ie}}function es(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function Ru(){var s=Ka;return Ka<<=1,(Ka&4194240)===0&&(Ka=64),s}function Ea(s){for(var h=[],P=0;31>P;P++)h.push(s);return h}function hl(s,h,P){s.pendingLanes|=h,h!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,h=31-mr(h),s[h]=P}function ts(s,h){var P=s.pendingLanes&~h;s.pendingLanes=h,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=h,s.mutableReadLanes&=h,s.entangledLanes&=h,h=s.entanglements;var F=s.eventTimes;for(s=s.expirationTimes;0<P;){var K=31-mr(P),ne=1<<K;h[K]=0,F[K]=-1,s[K]=-1,P&=~ne}}function $l(s,h){var P=s.entangledLanes|=h;for(s=s.entanglements;P;){var F=31-mr(P),K=1<<F;K&h|s[F]&h&&(s[F]|=h),P&=~K}}var Ar=0;function go(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var rs,Ys,fc,hc,Xs,ns=!1,Za=[],Ma=null,Ia=null,Fa=null,xt=new Map,Ks=new Map,vo=[],dc="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function pc(s,h){switch(s){case"focusin":case"focusout":Ma=null;break;case"dragenter":case"dragleave":Ia=null;break;case"mouseover":case"mouseout":Fa=null;break;case"pointerover":case"pointerout":xt.delete(h.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ks.delete(h.pointerId)}}function Qa(s,h,P,F,K,ne){return s===null||s.nativeEvent!==ne?(s={blockedOn:h,domEventName:P,eventSystemFlags:F,nativeEvent:ne,targetContainers:[K]},h!==null&&(h=su(h),h!==null&&Ys(h)),s):(s.eventSystemFlags|=F,h=s.targetContainers,K!==null&&h.indexOf(K)===-1&&h.push(K),s)}function pn(s,h,P,F,K){switch(h){case"focusin":return Ma=Qa(Ma,s,h,P,F,K),!0;case"dragenter":return Ia=Qa(Ia,s,h,P,F,K),!0;case"mouseover":return Fa=Qa(Fa,s,h,P,F,K),!0;case"pointerover":var ne=K.pointerId;return xt.set(ne,Qa(xt.get(ne)||null,s,h,P,F,K)),!0;case"gotpointercapture":return ne=K.pointerId,Ks.set(ne,Qa(Ks.get(ne)||null,s,h,P,F,K)),!0}return!1}function Wl(s){var h=Ms(s.target);if(h!==null){var P=Qn(h);if(P!==null){if(h=P.tag,h===13){if(h=_a(P),h!==null){s.blockedOn=h,Xs(s.priority,function(){fc(P)});return}}else if(h===3&&P.stateNode.current.memoizedState.isDehydrated){s.blockedOn=P.tag===3?P.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Yl(s){if(s.blockedOn!==null)return!1;for(var h=s.targetContainers;0<h.length;){var P=Zs(s.domEventName,s.eventSystemFlags,h[0],s.nativeEvent);if(P===null){P=s.nativeEvent;var F=new P.constructor(P.type,P);kt=F,P.target.dispatchEvent(F),kt=null}else return h=su(P),h!==null&&Ys(h),s.blockedOn=P,!1;h.shift()}return!0}function ks(s,h,P){Yl(s)&&P.delete(h)}function Mu(){ns=!1,Ma!==null&&Yl(Ma)&&(Ma=null),Ia!==null&&Yl(Ia)&&(Ia=null),Fa!==null&&Yl(Fa)&&(Fa=null),xt.forEach(ks),Ks.forEach(ks)}function ja(s,h){s.blockedOn===h&&(s.blockedOn=null,ns||(ns=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Mu)))}function mi(s){function h(K){return ja(K,s)}if(0<Za.length){ja(Za[0],s);for(var P=1;P<Za.length;P++){var F=Za[P];F.blockedOn===s&&(F.blockedOn=null)}}for(Ma!==null&&ja(Ma,s),Ia!==null&&ja(Ia,s),Fa!==null&&ja(Fa,s),xt.forEach(h),Ks.forEach(h),P=0;P<vo.length;P++)F=vo[P],F.blockedOn===s&&(F.blockedOn=null);for(;0<vo.length&&(P=vo[0],P.blockedOn===null);)Wl(P),P.blockedOn===null&&vo.shift()}var Fo=_.ReactCurrentBatchConfig,Xl=!0;function Aa(s,h,P,F){var K=Ar,ne=Fo.transition;Fo.transition=null;try{Ar=1,mo(s,h,P,F)}finally{Ar=K,Fo.transition=ne}}function Ja(s,h,P,F){var K=Ar,ne=Fo.transition;Fo.transition=null;try{Ar=4,mo(s,h,P,F)}finally{Ar=K,Fo.transition=ne}}function mo(s,h,P,F){if(Xl){var K=Zs(s,h,P,F);if(K===null)iu(s,h,F,yo,P),pc(s,F);else if(pn(K,s,h,P,F))F.stopPropagation();else if(pc(s,F),h&4&&-1<dc.indexOf(s)){for(;K!==null;){var ne=su(K);if(ne!==null&&rs(ne),ne=Zs(s,h,P,F),ne===null&&iu(s,h,F,yo,P),ne===K)break;K=ne}K!==null&&F.stopPropagation()}else iu(s,h,F,null,P)}}var yo=null;function Zs(s,h,P,F){if(yo=null,s=St(F),s=Ms(s),s!==null)if(h=Qn(s),h===null)s=null;else if(P=h.tag,P===13){if(s=_a(h),s!==null)return s;s=null}else if(P===3){if(h.stateNode.current.memoizedState.isDehydrated)return h.tag===3?h.stateNode.containerInfo:null;s=null}else h!==s&&(s=null);return yo=s,null}function dl(s){switch(s){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Gl()){case Zo:return 1;case Sa:return 4;case Qo:case cc:return 16;case $s:return 536870912;default:return 16}default:return 16}}var Jn=null,Da=null,eo=null;function Os(){if(eo)return eo;var s,h=Da,P=h.length,F,K="value"in Jn?Jn.value:Jn.textContent,ne=K.length;for(s=0;s<P&&h[s]===K[s];s++);var ge=P-s;for(F=1;F<=ge&&h[P-F]===K[ne-F];F++);return eo=K.slice(s,1<F?1-F:void 0)}function yi(s){var h=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&h===13&&(s=13)):s=h,s===10&&(s=13),32<=s||s===13?s:0}function kn(){return!0}function X(){return!1}function fe(s){function h(P,F,K,ne,ge){this._reactName=P,this._targetInst=K,this.type=F,this.nativeEvent=ne,this.target=ge,this.currentTarget=null;for(var Ie in s)s.hasOwnProperty(Ie)&&(P=s[Ie],this[Ie]=P?P(ne):ne[Ie]);return this.isDefaultPrevented=(ne.defaultPrevented!=null?ne.defaultPrevented:ne.returnValue===!1)?kn:X,this.isPropagationStopped=X,this}return U(h.prototype,{preventDefault:function(){this.defaultPrevented=!0;var P=this.nativeEvent;P&&(P.preventDefault?P.preventDefault():typeof P.returnValue!="unknown"&&(P.returnValue=!1),this.isDefaultPrevented=kn)},stopPropagation:function(){var P=this.nativeEvent;P&&(P.stopPropagation?P.stopPropagation():typeof P.cancelBubble!="unknown"&&(P.cancelBubble=!0),this.isPropagationStopped=kn)},persist:function(){},isPersistent:kn}),h}var Ne={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fe=fe(Ne),Ge=U({},Ne,{view:0,detail:0}),lt=fe(Ge),ft,Lt,Et,Ut=U({},Ge,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wo,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Et&&(Et&&s.type==="mousemove"?(ft=s.screenX-Et.screenX,Lt=s.screenY-Et.screenY):Lt=ft=0,Et=s),ft)},movementY:function(s){return"movementY"in s?s.movementY:Lt}}),Rt=fe(Ut),Pr=U({},Ut,{dataTransfer:0}),Mr=fe(Pr),ei=U({},Ge,{relatedTarget:0}),Hr=fe(ei),ti=U({},Ne,{animationName:0,elapsedTime:0,pseudoElement:0}),Hn=fe(ti),Ni=U({},Ne,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),bo=fe(Ni),Cs=U({},Ne,{data:0}),Ns=fe(Cs),Kl={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pl={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"},Ba={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Iu(s){var h=this.nativeEvent;return h.getModifierState?h.getModifierState(s):(s=Ba[s])?!!h[s]:!1}function wo(){return Iu}var jo=U({},Ge,{key:function(s){if(s.key){var h=Kl[s.key]||s.key;if(h!=="Unidentified")return h}return s.type==="keypress"?(s=yi(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?pl[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wo,charCode:function(s){return s.type==="keypress"?yi(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?yi(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),bi=fe(jo),is=U({},Ut,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pa=fe(is),gl=U({},Ge,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wo}),Qs=fe(gl),Li=U({},Ne,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ls=fe(Li),Js=U({},Ut,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),Zl=fe(Js),si=[9,13,27,32],la=o&&"CompositionEvent"in window,Do=null;o&&"documentMode"in document&&(Do=document.documentMode);var as=o&&"TextEvent"in window&&!Do,li=o&&(!la||Do&&8<Do&&11>=Do),to=" ",Gi=!1;function ua(s,h){switch(s){case"keyup":return si.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $i(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Vn=!1;function os(s,h){switch(s){case"compositionend":return $i(h);case"keypress":return h.which!==32?null:(Gi=!0,to);case"textInput":return s=h.data,s===to&&Gi?null:s;default:return null}}function Ql(s,h){if(Vn)return s==="compositionend"||!la&&ua(s,h)?(s=Os(),eo=Da=Jn=null,Vn=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1<h.char.length)return h.char;if(h.which)return String.fromCharCode(h.which)}return null;case"compositionend":return li&&h.locale!=="ko"?null:h.data;default:return null}}var ca={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 Jr(s){var h=s&&s.nodeName&&s.nodeName.toLowerCase();return h==="input"?!!ca[s.type]:h==="textarea"}function vl(s,h,P,F){lr(F),h=_c(h,"onChange"),0<h.length&&(P=new Fe("onChange","change",null,P,F),s.push({event:P,listeners:h}))}var ka=null,Wi=null;function ml(s){ru(s,0)}function _o(s){var h=ci(s);if(Re(h))return s}function Yi(s,h){if(s==="change")return h}var Bo=!1;if(o){var za;if(o){var Ti="oninput"in document;if(!Ti){var xo=document.createElement("div");xo.setAttribute("oninput","return;"),Ti=typeof xo.oninput=="function"}za=Ti}else za=!1;Bo=za&&(!document.documentMode||9<document.documentMode)}function zo(){ka&&(ka.detachEvent("onpropertychange",Oa),Wi=ka=null)}function Oa(s){if(s.propertyName==="value"&&_o(Wi)){var h=[];vl(h,Wi,s,St(s)),Yt(ml,h)}}function So(s,h,P){s==="focusin"?(zo(),ka=h,Wi=P,ka.attachEvent("onpropertychange",Oa)):s==="focusout"&&zo()}function tr(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return _o(Wi)}function en(s,h){if(s==="click")return _o(h)}function Ln(s,h){if(s==="input"||s==="change")return _o(h)}function Tn(s,h){return s===h&&(s!==0||1/s===1/h)||s!==s&&h!==h}var Gn=typeof Object.is=="function"?Object.is:Tn;function Eo(s,h){if(Gn(s,h))return!0;if(typeof s!="object"||s===null||typeof h!="object"||h===null)return!1;var P=Object.keys(s),F=Object.keys(h);if(P.length!==F.length)return!1;for(F=0;F<P.length;F++){var K=P[F];if(!u.call(h,K)||!Gn(s[K],h[K]))return!1}return!0}function Xi(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function on(s,h){var P=Xi(s);s=0;for(var F;P;){if(P.nodeType===3){if(F=s+P.textContent.length,s<=h&&F>=h)return{node:P,offset:h-s};s=F}e:{for(;P;){if(P.nextSibling){P=P.nextSibling;break e}P=P.parentNode}P=void 0}P=Xi(P)}}function ri(s,h){return s&&h?s===h?!0:s&&s.nodeType===3?!1:h&&h.nodeType===3?ri(s,h.parentNode):"contains"in s?s.contains(h):s.compareDocumentPosition?!!(s.compareDocumentPosition(h)&16):!1:!1}function ui(){for(var s=window,h=Me();h instanceof s.HTMLIFrameElement;){try{var P=typeof h.contentWindow.location.href=="string"}catch{P=!1}if(P)s=h.contentWindow;else break;h=Me(s.document)}return h}function yl(s){var h=s&&s.nodeName&&s.nodeName.toLowerCase();return h&&(h==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||h==="textarea"||s.contentEditable==="true")}function Jl(s){var h=ui(),P=s.focusedElem,F=s.selectionRange;if(h!==P&&P&&P.ownerDocument&&ri(P.ownerDocument.documentElement,P)){if(F!==null&&yl(P)){if(h=F.start,s=F.end,s===void 0&&(s=h),"selectionStart"in P)P.selectionStart=h,P.selectionEnd=Math.min(s,P.value.length);else if(s=(h=P.ownerDocument||document)&&h.defaultView||window,s.getSelection){s=s.getSelection();var K=P.textContent.length,ne=Math.min(F.start,K);F=F.end===void 0?ne:Math.min(F.end,K),!s.extend&&ne>F&&(K=F,F=ne,ne=K),K=on(P,ne);var ge=on(P,F);K&&ge&&(s.rangeCount!==1||s.anchorNode!==K.node||s.anchorOffset!==K.offset||s.focusNode!==ge.node||s.focusOffset!==ge.offset)&&(h=h.createRange(),h.setStart(K.node,K.offset),s.removeAllRanges(),ne>F?(s.addRange(h),s.extend(ge.node,ge.offset)):(h.setEnd(ge.node,ge.offset),s.addRange(h)))}}for(h=[],s=P;s=s.parentNode;)s.nodeType===1&&h.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<h.length;P++)s=h[P],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var eu=o&&"documentMode"in document&&11>=document.documentMode,bl=null,wi=null,el=null,tu=!1;function Fu(s,h,P){var F=P.window===P?P.document:P.nodeType===9?P:P.ownerDocument;tu||bl==null||bl!==Me(F)||(F=bl,"selectionStart"in F&&yl(F)?F={start:F.selectionStart,end:F.selectionEnd}:(F=(F.ownerDocument&&F.ownerDocument.defaultView||window).getSelection(),F={anchorNode:F.anchorNode,anchorOffset:F.anchorOffset,focusNode:F.focusNode,focusOffset:F.focusOffset}),el&&Eo(el,F)||(el=F,F=_c(wi,"onSelect"),0<F.length&&(h=new Fe("onSelect","select",null,h,P),s.push({event:h,listeners:F}),h.target=bl)))}function Ua(s,h){var P={};return P[s.toLowerCase()]=h.toLowerCase(),P["Webkit"+s]="webkit"+h,P["Moz"+s]="moz"+h,P}var Ri={animationend:Ua("Animation","AnimationEnd"),animationiteration:Ua("Animation","AnimationIteration"),animationstart:Ua("Animation","AnimationStart"),transitionend:Ua("Transition","TransitionEnd")},Uo={},ju={};o&&(ju=document.createElement("div").style,"AnimationEvent"in window||(delete Ri.animationend.animation,delete Ri.animationiteration.animation,delete Ri.animationstart.animation),"TransitionEvent"in window||delete Ri.transitionend.transition);function wl(s){if(Uo[s])return Uo[s];if(!Ri[s])return s;var h=Ri[s],P;for(P in h)if(h.hasOwnProperty(P)&&P in ju)return Uo[s]=h[P];return s}var gc=wl("animationend"),vc=wl("animationiteration"),mc=wl("animationstart"),yc=wl("transitionend"),bc=new Map,wc="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 qo(s,h){bc.set(s,h),a(h,[s])}for(var _l=0;_l<wc.length;_l++){var _i=wc[_l],ro=_i.toLowerCase(),xl=_i[0].toUpperCase()+_i.slice(1);qo(ro,"on"+xl)}qo(gc,"onAnimationEnd"),qo(vc,"onAnimationIteration"),qo(mc,"onAnimationStart"),qo("dblclick","onDoubleClick"),qo("focusin","onFocus"),qo("focusout","onBlur"),qo(yc,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("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 Ho="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(" "),ff=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ho));function Sl(s,h,P){var F=s.type||"unknown-event";s.currentTarget=P,Ya(F,h,void 0,s),s.currentTarget=null}function ru(s,h){h=(h&4)!==0;for(var P=0;P<s.length;P++){var F=s[P],K=F.event;F=F.listeners;e:{var ne=void 0;if(h)for(var ge=F.length-1;0<=ge;ge--){var Ie=F[ge],Be=Ie.instance,tt=Ie.currentTarget;if(Ie=Ie.listener,Be!==ne&&K.isPropagationStopped())break e;Sl(K,Ie,tt),ne=Be}else for(ge=0;ge<F.length;ge++){if(Ie=F[ge],Be=Ie.instance,tt=Ie.currentTarget,Ie=Ie.listener,Be!==ne&&K.isPropagationStopped())break e;Sl(K,Ie,tt),ne=Be}}}if(An)throw s=ba,An=!1,ba=null,s}function sn(s,h){var P=h[Ca];P===void 0&&(P=h[Ca]=new Set);var F=s+"__bubble";P.has(F)||(nu(h,s,2,!1),P.add(F))}function Du(s,h,P){var F=0;h&&(F|=4),nu(P,s,F,h)}var El="_reactListening"+Math.random().toString(36).slice(2);function Ts(s){if(!s[El]){s[El]=!0,n.forEach(function(P){P!=="selectionchange"&&(ff.has(P)||Du(P,!1,s),Du(P,!0,s))});var h=s.nodeType===9?s:s.ownerDocument;h===null||h[El]||(h[El]=!0,Du("selectionchange",!1,h))}}function nu(s,h,P,F){switch(dl(h)){case 1:var K=Aa;break;case 4:K=Ja;break;default:K=mo}P=K.bind(null,h,P,s),K=void 0,!Ra||h!=="touchstart"&&h!=="touchmove"&&h!=="wheel"||(K=!0),F?K!==void 0?s.addEventListener(h,P,{capture:!0,passive:K}):s.addEventListener(h,P,!0):K!==void 0?s.addEventListener(h,P,{passive:K}):s.addEventListener(h,P,!1)}function iu(s,h,P,F,K){var ne=F;if((h&1)===0&&(h&2)===0&&F!==null)e:for(;;){if(F===null)return;var ge=F.tag;if(ge===3||ge===4){var Ie=F.stateNode.containerInfo;if(Ie===K||Ie.nodeType===8&&Ie.parentNode===K)break;if(ge===4)for(ge=F.return;ge!==null;){var Be=ge.tag;if((Be===3||Be===4)&&(Be=ge.stateNode.containerInfo,Be===K||Be.nodeType===8&&Be.parentNode===K))return;ge=ge.return}for(;Ie!==null;){if(ge=Ms(Ie),ge===null)return;if(Be=ge.tag,Be===5||Be===6){F=ne=ge;continue e}Ie=Ie.parentNode}}F=F.return}Yt(function(){var tt=ne,gt=St(P),mt=[];e:{var dt=bc.get(s);if(dt!==void 0){var Ft=Fe,Ht=s;switch(s){case"keypress":if(yi(P)===0)break e;case"keydown":case"keyup":Ft=bi;break;case"focusin":Ht="focus",Ft=Hr;break;case"focusout":Ht="blur",Ft=Hr;break;case"beforeblur":case"afterblur":Ft=Hr;break;case"click":if(P.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ft=Rt;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ft=Mr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ft=Qs;break;case gc:case vc:case mc:Ft=Hn;break;case yc:Ft=Ls;break;case"scroll":Ft=lt;break;case"wheel":Ft=Zl;break;case"copy":case"cut":case"paste":Ft=bo;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ft=Pa}var Gt=(h&4)!==0,ta=!Gt&&s==="scroll",Qe=Gt?dt!==null?dt+"Capture":null:dt;Gt=[];for(var Ve=tt,Je;Ve!==null;){Je=Ve;var wt=Je.stateNode;if(Je.tag===5&&wt!==null&&(Je=wt,Qe!==null&&(wt=sa(Ve,Qe),wt!=null&&Gt.push(au(Ve,wt,Je)))),ta)break;Ve=Ve.return}0<Gt.length&&(dt=new Ft(dt,Ht,null,P,gt),mt.push({event:dt,listeners:Gt}))}}if((h&7)===0){e:{if(dt=s==="mouseover"||s==="pointerover",Ft=s==="mouseout"||s==="pointerout",dt&&P!==kt&&(Ht=P.relatedTarget||P.fromElement)&&(Ms(Ht)||Ht[Qi]))break e;if((Ft||dt)&&(dt=gt.window===gt?gt:(dt=gt.ownerDocument)?dt.defaultView||dt.parentWindow:window,Ft?(Ht=P.relatedTarget||P.toElement,Ft=tt,Ht=Ht?Ms(Ht):null,Ht!==null&&(ta=Qn(Ht),Ht!==ta||Ht.tag!==5&&Ht.tag!==6)&&(Ht=null)):(Ft=null,Ht=tt),Ft!==Ht)){if(Gt=Rt,wt="onMouseLeave",Qe="onMouseEnter",Ve="mouse",(s==="pointerout"||s==="pointerover")&&(Gt=Pa,wt="onPointerLeave",Qe="onPointerEnter",Ve="pointer"),ta=Ft==null?dt:ci(Ft),Je=Ht==null?dt:ci(Ht),dt=new Gt(wt,Ve+"leave",Ft,P,gt),dt.target=ta,dt.relatedTarget=Je,wt=null,Ms(gt)===tt&&(Gt=new Gt(Qe,Ve+"enter",Ht,P,gt),Gt.target=Je,Gt.relatedTarget=ta,wt=Gt),ta=wt,Ft&&Ht)t:{for(Gt=Ft,Qe=Ht,Ve=0,Je=Gt;Je;Je=tl(Je))Ve++;for(Je=0,wt=Qe;wt;wt=tl(wt))Je++;for(;0<Ve-Je;)Gt=tl(Gt),Ve--;for(;0<Je-Ve;)Qe=tl(Qe),Je--;for(;Ve--;){if(Gt===Qe||Qe!==null&&Gt===Qe.alternate)break t;Gt=tl(Gt),Qe=tl(Qe)}Gt=null}else Gt=null;Ft!==null&&Xf(mt,dt,Ft,Gt,!1),Ht!==null&&ta!==null&&Xf(mt,ta,Ht,Gt,!0)}}e:{if(dt=tt?ci(tt):window,Ft=dt.nodeName&&dt.nodeName.toLowerCase(),Ft==="select"||Ft==="input"&&dt.type==="file")var Wt=Yi;else if(Jr(dt))if(Bo)Wt=Ln;else{Wt=tr;var nr=So}else(Ft=dt.nodeName)&&Ft.toLowerCase()==="input"&&(dt.type==="checkbox"||dt.type==="radio")&&(Wt=en);if(Wt&&(Wt=Wt(s,tt))){vl(mt,Wt,P,gt);break e}nr&&nr(s,dt,tt),s==="focusout"&&(nr=dt._wrapperState)&&nr.controlled&&dt.type==="number"&&_e(dt,"number",dt.value)}switch(nr=tt?ci(tt):window,s){case"focusin":(Jr(nr)||nr.contentEditable==="true")&&(bl=nr,wi=tt,el=null);break;case"focusout":el=wi=bl=null;break;case"mousedown":tu=!0;break;case"contextmenu":case"mouseup":case"dragend":tu=!1,Fu(mt,P,gt);break;case"selectionchange":if(eu)break;case"keydown":case"keyup":Fu(mt,P,gt)}var ir;if(la)e:{switch(s){case"compositionstart":var hr="onCompositionStart";break e;case"compositionend":hr="onCompositionEnd";break e;case"compositionupdate":hr="onCompositionUpdate";break e}hr=void 0}else Vn?ua(s,P)&&(hr="onCompositionEnd"):s==="keydown"&&P.keyCode===229&&(hr="onCompositionStart");hr&&(li&&P.locale!=="ko"&&(Vn||hr!=="onCompositionStart"?hr==="onCompositionEnd"&&Vn&&(ir=Os()):(Jn=gt,Da="value"in Jn?Jn.value:Jn.textContent,Vn=!0)),nr=_c(tt,hr),0<nr.length&&(hr=new Ns(hr,s,null,P,gt),mt.push({event:hr,listeners:nr}),ir?hr.data=ir:(ir=$i(P),ir!==null&&(hr.data=ir)))),(ir=as?os(s,P):Ql(s,P))&&(tt=_c(tt,"onBeforeInput"),0<tt.length&&(gt=new Ns("onBeforeInput","beforeinput",null,P,gt),mt.push({event:gt,listeners:tt}),gt.data=ir))}ru(mt,h)})}function au(s,h,P){return{instance:s,listener:h,currentTarget:P}}function _c(s,h){for(var P=h+"Capture",F=[];s!==null;){var K=s,ne=K.stateNode;K.tag===5&&ne!==null&&(K=ne,ne=sa(s,P),ne!=null&&F.unshift(au(s,ne,K)),ne=sa(s,h),ne!=null&&F.push(au(s,ne,K))),s=s.return}return F}function tl(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function Xf(s,h,P,F,K){for(var ne=h._reactName,ge=[];P!==null&&P!==F;){var Ie=P,Be=Ie.alternate,tt=Ie.stateNode;if(Be!==null&&Be===F)break;Ie.tag===5&&tt!==null&&(Ie=tt,K?(Be=sa(P,ne),Be!=null&&ge.unshift(au(P,Be,Ie))):K||(Be=sa(P,ne),Be!=null&&ge.push(au(P,Be,Ie)))),P=P.return}ge.length!==0&&s.push({event:h,listeners:ge})}var Hh=/\r\n?/g,Kf=/\u0000|\uFFFD/g;function hf(s){return(typeof s=="string"?s:""+s).replace(Hh,`
30
- `).replace(Kf,"")}function Bu(s,h,P){if(h=hf(h),hf(s)!==h&&P)throw Error(r(425))}function Rs(){}var zu=null,Al=null;function df(s,h){return s==="textarea"||s==="noscript"||typeof h.children=="string"||typeof h.children=="number"||typeof h.dangerouslySetInnerHTML=="object"&&h.dangerouslySetInnerHTML!==null&&h.dangerouslySetInnerHTML.__html!=null}var no=typeof setTimeout=="function"?setTimeout:void 0,xc=typeof clearTimeout=="function"?clearTimeout:void 0,Uu=typeof Promise=="function"?Promise:void 0,Zf=typeof queueMicrotask=="function"?queueMicrotask:typeof Uu<"u"?function(s){return Uu.resolve(null).then(s).catch(Qf)}:no;function Qf(s){setTimeout(function(){throw s})}function Sc(s,h){var P=h,F=0;do{var K=P.nextSibling;if(s.removeChild(P),K&&K.nodeType===8)if(P=K.data,P==="/$"){if(F===0){s.removeChild(K),mi(h);return}F--}else P!=="$"&&P!=="$?"&&P!=="$!"||F++;P=K}while(P);mi(h)}function Ki(s){for(;s!=null;s=s.nextSibling){var h=s.nodeType;if(h===1||h===3)break;if(h===8){if(h=s.data,h==="$"||h==="$!"||h==="$?")break;if(h==="/$")return null}}return s}function Zi(s){s=s.previousSibling;for(var h=0;s;){if(s.nodeType===8){var P=s.data;if(P==="$"||P==="$!"||P==="$?"){if(h===0)return s;h--}else P==="/$"&&h++}s=s.previousSibling}return null}var fa=Math.random().toString(36).slice(2),Ao="__reactFiber$"+fa,ou="__reactProps$"+fa,Qi="__reactContainer$"+fa,Ca="__reactEvents$"+fa,Jf="__reactListeners$"+fa,eh="__reactHandles$"+fa;function Ms(s){var h=s[Ao];if(h)return h;for(var P=s.parentNode;P;){if(h=P[Qi]||P[Ao]){if(P=h.alternate,h.child!==null||P!==null&&P.child!==null)for(s=Zi(s);s!==null;){if(P=s[Ao])return P;s=Zi(s)}return h}s=P,P=s.parentNode}return null}function su(s){return s=s[Ao]||s[Qi],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function ci(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(r(33))}function xi(s){return s[ou]||null}var Ec=[],ss=-1;function Po(s){return{current:s}}function Yr(s){0>ss||(s.current=Ec[ss],Ec[ss]=null,ss--)}function tn(s,h){ss++,Ec[ss]=s.current,s.current=h}var ls={},Mi=Po(ls),ha=Po(!1),rl=ls;function Pl(s,h){var P=s.type.contextTypes;if(!P)return ls;var F=s.stateNode;if(F&&F.__reactInternalMemoizedUnmaskedChildContext===h)return F.__reactInternalMemoizedMaskedChildContext;var K={},ne;for(ne in P)K[ne]=h[ne];return F&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=h,s.__reactInternalMemoizedMaskedChildContext=K),K}function da(s){return s=s.childContextTypes,s!=null}function lu(){Yr(ha),Yr(Mi)}function pf(s,h,P){if(Mi.current!==ls)throw Error(r(168));tn(Mi,h),tn(ha,P)}function qu(s,h,P){var F=s.stateNode;if(h=h.childContextTypes,typeof F.getChildContext!="function")return P;F=F.getChildContext();for(var K in F)if(!(K in h))throw Error(r(108,Q(s)||"Unknown",K));return U({},P,F)}function us(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ls,rl=Mi.current,tn(Mi,s),tn(ha,ha.current),!0}function th(s,h,P){var F=s.stateNode;if(!F)throw Error(r(169));P?(s=qu(s,h,rl),F.__reactInternalMemoizedMergedChildContext=s,Yr(ha),Yr(Mi),tn(Mi,s)):Yr(ha),tn(ha,P)}var cs=null,kl=!1,N=!1;function B(s){cs===null?cs=[s]:cs.push(s)}function te(s){kl=!0,B(s)}function ie(){if(!N&&cs!==null){N=!0;var s=0,h=Ar;try{var P=cs;for(Ar=1;s<P.length;s++){var F=P[s];do F=F(!0);while(F!==null)}cs=null,kl=!1}catch(K){throw cs!==null&&(cs=cs.slice(s+1)),Ps(Zo,ie),K}finally{Ar=h,N=!1}}return null}var he=[],ve=0,me=null,we=0,Se=[],Oe=0,De=null,Ze=1,ke="";function qe(s,h){he[ve++]=we,he[ve++]=me,me=s,we=h}function Ke(s,h,P){Se[Oe++]=Ze,Se[Oe++]=ke,Se[Oe++]=De,De=s;var F=Ze;s=ke;var K=32-mr(F)-1;F&=~(1<<K),P+=1;var ne=32-mr(h)+K;if(30<ne){var ge=K-K%5;ne=(F&(1<<ge)-1).toString(32),F>>=ge,K-=ge,Ze=1<<32-mr(h)+K|P<<K|F,ke=ne+s}else Ze=1<<ne|P<<K|F,ke=s}function it(s){s.return!==null&&(qe(s,1),Ke(s,1,0))}function Ye(s){for(;s===me;)me=he[--ve],he[ve]=null,we=he[--ve],he[ve]=null;for(;s===De;)De=Se[--Oe],Se[Oe]=null,ke=Se[--Oe],Se[Oe]=null,Ze=Se[--Oe],Se[Oe]=null}var nt=null,Ue=null,ot=!1,ut=null;function qt(s,h){var P=ol(5,null,null,0);P.elementType="DELETED",P.stateNode=h,P.return=s,h=s.deletions,h===null?(s.deletions=[P],s.flags|=16):h.push(P)}function Mt(s,h){switch(s.tag){case 5:var P=s.type;return h=h.nodeType!==1||P.toLowerCase()!==h.nodeName.toLowerCase()?null:h,h!==null?(s.stateNode=h,nt=s,Ue=Ki(h.firstChild),!0):!1;case 6:return h=s.pendingProps===""||h.nodeType!==3?null:h,h!==null?(s.stateNode=h,nt=s,Ue=null,!0):!1;case 13:return h=h.nodeType!==8?null:h,h!==null?(P=De!==null?{id:Ze,overflow:ke}:null,s.memoizedState={dehydrated:h,treeContext:P,retryLane:1073741824},P=ol(18,null,null,0),P.stateNode=h,P.return=s,s.child=P,nt=s,Ue=null,!0):!1;default:return!1}}function ar(s){return(s.mode&1)!==0&&(s.flags&128)===0}function It(s){if(ot){var h=Ue;if(h){var P=h;if(!Mt(s,h)){if(ar(s))throw Error(r(418));h=Ki(P.nextSibling);var F=nt;h&&Mt(s,h)?qt(F,P):(s.flags=s.flags&-4097|2,ot=!1,nt=s)}}else{if(ar(s))throw Error(r(418));s.flags=s.flags&-4097|2,ot=!1,nt=s}}}function _r(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;nt=s}function Rn(s){if(s!==nt)return!1;if(!ot)return _r(s),ot=!0,!1;var h;if((h=s.tag!==3)&&!(h=s.tag!==5)&&(h=s.type,h=h!=="head"&&h!=="body"&&!df(s.type,s.memoizedProps)),h&&(h=Ue)){if(ar(s))throw fr(),Error(r(418));for(;h;)qt(s,h),h=Ki(h.nextSibling)}if(_r(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));e:{for(s=s.nextSibling,h=0;s;){if(s.nodeType===8){var P=s.data;if(P==="/$"){if(h===0){Ue=Ki(s.nextSibling);break e}h--}else P!=="$"&&P!=="$!"&&P!=="$?"||h++}s=s.nextSibling}Ue=null}}else Ue=nt?Ki(s.stateNode.nextSibling):null;return!0}function fr(){for(var s=Ue;s;)s=Ki(s.nextSibling)}function Tt(){Ue=nt=null,ot=!1}function _t(s){ut===null?ut=[s]:ut.push(s)}var Mn=_.ReactCurrentBatchConfig;function Dt(s,h,P){if(s=P.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(P._owner){if(P=P._owner,P){if(P.tag!==1)throw Error(r(309));var F=P.stateNode}if(!F)throw Error(r(147,s));var K=F,ne=""+s;return h!==null&&h.ref!==null&&typeof h.ref=="function"&&h.ref._stringRef===ne?h.ref:(h=function(ge){var Ie=K.refs;ge===null?delete Ie[ne]:Ie[ne]=ge},h._stringRef=ne,h)}if(typeof s!="string")throw Error(r(284));if(!P._owner)throw Error(r(290,s))}return s}function or(s,h){throw s=Object.prototype.toString.call(h),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":s))}function kr(s){var h=s._init;return h(s._payload)}function fi(s){function h(Qe,Ve){if(s){var Je=Qe.deletions;Je===null?(Qe.deletions=[Ve],Qe.flags|=16):Je.push(Ve)}}function P(Qe,Ve){if(!s)return null;for(;Ve!==null;)h(Qe,Ve),Ve=Ve.sibling;return null}function F(Qe,Ve){for(Qe=new Map;Ve!==null;)Ve.key!==null?Qe.set(Ve.key,Ve):Qe.set(Ve.index,Ve),Ve=Ve.sibling;return Qe}function K(Qe,Ve){return Qe=Dc(Qe,Ve),Qe.index=0,Qe.sibling=null,Qe}function ne(Qe,Ve,Je){return Qe.index=Je,s?(Je=Qe.alternate,Je!==null?(Je=Je.index,Je<Ve?(Qe.flags|=2,Ve):Je):(Qe.flags|=2,Ve)):(Qe.flags|=1048576,Ve)}function ge(Qe){return s&&Qe.alternate===null&&(Qe.flags|=2),Qe}function Ie(Qe,Ve,Je,wt){return Ve===null||Ve.tag!==6?(Ve=Z0(Je,Qe.mode,wt),Ve.return=Qe,Ve):(Ve=K(Ve,Je),Ve.return=Qe,Ve)}function Be(Qe,Ve,Je,wt){var Wt=Je.type;return Wt===O?gt(Qe,Ve,Je.props.children,wt,Je.key):Ve!==null&&(Ve.elementType===Wt||typeof Wt=="object"&&Wt!==null&&Wt.$$typeof===ae&&kr(Wt)===Ve.type)?(wt=K(Ve,Je.props),wt.ref=Dt(Qe,Ve,Je),wt.return=Qe,wt):(wt=Wp(Je.type,Je.key,Je.props,null,Qe.mode,wt),wt.ref=Dt(Qe,Ve,Je),wt.return=Qe,wt)}function tt(Qe,Ve,Je,wt){return Ve===null||Ve.tag!==4||Ve.stateNode.containerInfo!==Je.containerInfo||Ve.stateNode.implementation!==Je.implementation?(Ve=Q0(Je,Qe.mode,wt),Ve.return=Qe,Ve):(Ve=K(Ve,Je.children||[]),Ve.return=Qe,Ve)}function gt(Qe,Ve,Je,wt,Wt){return Ve===null||Ve.tag!==7?(Ve=_f(Je,Qe.mode,wt,Wt),Ve.return=Qe,Ve):(Ve=K(Ve,Je),Ve.return=Qe,Ve)}function mt(Qe,Ve,Je){if(typeof Ve=="string"&&Ve!==""||typeof Ve=="number")return Ve=Z0(""+Ve,Qe.mode,Je),Ve.return=Qe,Ve;if(typeof Ve=="object"&&Ve!==null){switch(Ve.$$typeof){case A:return Je=Wp(Ve.type,Ve.key,Ve.props,null,Qe.mode,Je),Je.ref=Dt(Qe,null,Ve),Je.return=Qe,Je;case M:return Ve=Q0(Ve,Qe.mode,Je),Ve.return=Qe,Ve;case ae:var wt=Ve._init;return mt(Qe,wt(Ve._payload),Je)}if(xe(Ve)||Y(Ve))return Ve=_f(Ve,Qe.mode,Je,null),Ve.return=Qe,Ve;or(Qe,Ve)}return null}function dt(Qe,Ve,Je,wt){var Wt=Ve!==null?Ve.key:null;if(typeof Je=="string"&&Je!==""||typeof Je=="number")return Wt!==null?null:Ie(Qe,Ve,""+Je,wt);if(typeof Je=="object"&&Je!==null){switch(Je.$$typeof){case A:return Je.key===Wt?Be(Qe,Ve,Je,wt):null;case M:return Je.key===Wt?tt(Qe,Ve,Je,wt):null;case ae:return Wt=Je._init,dt(Qe,Ve,Wt(Je._payload),wt)}if(xe(Je)||Y(Je))return Wt!==null?null:gt(Qe,Ve,Je,wt,null);or(Qe,Je)}return null}function Ft(Qe,Ve,Je,wt,Wt){if(typeof wt=="string"&&wt!==""||typeof wt=="number")return Qe=Qe.get(Je)||null,Ie(Ve,Qe,""+wt,Wt);if(typeof wt=="object"&&wt!==null){switch(wt.$$typeof){case A:return Qe=Qe.get(wt.key===null?Je:wt.key)||null,Be(Ve,Qe,wt,Wt);case M:return Qe=Qe.get(wt.key===null?Je:wt.key)||null,tt(Ve,Qe,wt,Wt);case ae:var nr=wt._init;return Ft(Qe,Ve,Je,nr(wt._payload),Wt)}if(xe(wt)||Y(wt))return Qe=Qe.get(Je)||null,gt(Ve,Qe,wt,Wt,null);or(Ve,wt)}return null}function Ht(Qe,Ve,Je,wt){for(var Wt=null,nr=null,ir=Ve,hr=Ve=0,Ga=null;ir!==null&&hr<Je.length;hr++){ir.index>hr?(Ga=ir,ir=null):Ga=ir.sibling;var cn=dt(Qe,ir,Je[hr],wt);if(cn===null){ir===null&&(ir=Ga);break}s&&ir&&cn.alternate===null&&h(Qe,ir),Ve=ne(cn,Ve,hr),nr===null?Wt=cn:nr.sibling=cn,nr=cn,ir=Ga}if(hr===Je.length)return P(Qe,ir),ot&&qe(Qe,hr),Wt;if(ir===null){for(;hr<Je.length;hr++)ir=mt(Qe,Je[hr],wt),ir!==null&&(Ve=ne(ir,Ve,hr),nr===null?Wt=ir:nr.sibling=ir,nr=ir);return ot&&qe(Qe,hr),Wt}for(ir=F(Qe,ir);hr<Je.length;hr++)Ga=Ft(ir,Qe,hr,Je[hr],wt),Ga!==null&&(s&&Ga.alternate!==null&&ir.delete(Ga.key===null?hr:Ga.key),Ve=ne(Ga,Ve,hr),nr===null?Wt=Ga:nr.sibling=Ga,nr=Ga);return s&&ir.forEach(function(Bc){return h(Qe,Bc)}),ot&&qe(Qe,hr),Wt}function Gt(Qe,Ve,Je,wt){var Wt=Y(Je);if(typeof Wt!="function")throw Error(r(150));if(Je=Wt.call(Je),Je==null)throw Error(r(151));for(var nr=Wt=null,ir=Ve,hr=Ve=0,Ga=null,cn=Je.next();ir!==null&&!cn.done;hr++,cn=Je.next()){ir.index>hr?(Ga=ir,ir=null):Ga=ir.sibling;var Bc=dt(Qe,ir,cn.value,wt);if(Bc===null){ir===null&&(ir=Ga);break}s&&ir&&Bc.alternate===null&&h(Qe,ir),Ve=ne(Bc,Ve,hr),nr===null?Wt=Bc:nr.sibling=Bc,nr=Bc,ir=Ga}if(cn.done)return P(Qe,ir),ot&&qe(Qe,hr),Wt;if(ir===null){for(;!cn.done;hr++,cn=Je.next())cn=mt(Qe,cn.value,wt),cn!==null&&(Ve=ne(cn,Ve,hr),nr===null?Wt=cn:nr.sibling=cn,nr=cn);return ot&&qe(Qe,hr),Wt}for(ir=F(Qe,ir);!cn.done;hr++,cn=Je.next())cn=Ft(ir,Qe,hr,cn.value,wt),cn!==null&&(s&&cn.alternate!==null&&ir.delete(cn.key===null?hr:cn.key),Ve=ne(cn,Ve,hr),nr===null?Wt=cn:nr.sibling=cn,nr=cn);return s&&ir.forEach(function(J7){return h(Qe,J7)}),ot&&qe(Qe,hr),Wt}function ta(Qe,Ve,Je,wt){if(typeof Je=="object"&&Je!==null&&Je.type===O&&Je.key===null&&(Je=Je.props.children),typeof Je=="object"&&Je!==null){switch(Je.$$typeof){case A:e:{for(var Wt=Je.key,nr=Ve;nr!==null;){if(nr.key===Wt){if(Wt=Je.type,Wt===O){if(nr.tag===7){P(Qe,nr.sibling),Ve=K(nr,Je.props.children),Ve.return=Qe,Qe=Ve;break e}}else if(nr.elementType===Wt||typeof Wt=="object"&&Wt!==null&&Wt.$$typeof===ae&&kr(Wt)===nr.type){P(Qe,nr.sibling),Ve=K(nr,Je.props),Ve.ref=Dt(Qe,nr,Je),Ve.return=Qe,Qe=Ve;break e}P(Qe,nr);break}else h(Qe,nr);nr=nr.sibling}Je.type===O?(Ve=_f(Je.props.children,Qe.mode,wt,Je.key),Ve.return=Qe,Qe=Ve):(wt=Wp(Je.type,Je.key,Je.props,null,Qe.mode,wt),wt.ref=Dt(Qe,Ve,Je),wt.return=Qe,Qe=wt)}return ge(Qe);case M:e:{for(nr=Je.key;Ve!==null;){if(Ve.key===nr)if(Ve.tag===4&&Ve.stateNode.containerInfo===Je.containerInfo&&Ve.stateNode.implementation===Je.implementation){P(Qe,Ve.sibling),Ve=K(Ve,Je.children||[]),Ve.return=Qe,Qe=Ve;break e}else{P(Qe,Ve);break}else h(Qe,Ve);Ve=Ve.sibling}Ve=Q0(Je,Qe.mode,wt),Ve.return=Qe,Qe=Ve}return ge(Qe);case ae:return nr=Je._init,ta(Qe,Ve,nr(Je._payload),wt)}if(xe(Je))return Ht(Qe,Ve,Je,wt);if(Y(Je))return Gt(Qe,Ve,Je,wt);or(Qe,Je)}return typeof Je=="string"&&Je!==""||typeof Je=="number"?(Je=""+Je,Ve!==null&&Ve.tag===6?(P(Qe,Ve.sibling),Ve=K(Ve,Je),Ve.return=Qe,Qe=Ve):(P(Qe,Ve),Ve=Z0(Je,Qe.mode,wt),Ve.return=Qe,Qe=Ve),ge(Qe)):P(Qe,Ve)}return ta}var ni=fi(!0),Ir=fi(!1),hi=Po(null),hn=null,On=null,Sr=null;function Dr(){Sr=On=hn=null}function wn(s){var h=hi.current;Yr(hi),s._currentValue=h}function Br(s,h,P){for(;s!==null;){var F=s.alternate;if((s.childLanes&h)!==h?(s.childLanes|=h,F!==null&&(F.childLanes|=h)):F!==null&&(F.childLanes&h)!==h&&(F.childLanes|=h),s===P)break;s=s.return}}function _n(s,h){hn=s,Sr=On=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&h)!==0&&(oe=!0),s.firstContext=null)}function xn(s){var h=s._currentValue;if(Sr!==s)if(s={context:s,memoizedValue:h,next:null},On===null){if(hn===null)throw Error(r(308));On=s,hn.dependencies={lanes:0,firstContext:s}}else On=On.next=s;return h}var Xr=null;function Si(s){Xr===null?Xr=[s]:Xr.push(s)}function Vr(s,h,P,F){var K=h.interleaved;return K===null?(P.next=P,Si(h)):(P.next=K.next,K.next=P),h.interleaved=P,Gr(s,F)}function Gr(s,h){s.lanes|=h;var P=s.alternate;for(P!==null&&(P.lanes|=h),P=s,s=s.return;s!==null;)s.childLanes|=h,P=s.alternate,P!==null&&(P.childLanes|=h),P=s,s=s.return;return P.tag===3?P.stateNode:null}var $n=!1;function Ei(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pa(s,h){s=s.updateQueue,h.updateQueue===s&&(h.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function Wn(s,h){return{eventTime:s,lane:h,tag:0,payload:null,callback:null,next:null}}function In(s,h,P){var F=s.updateQueue;if(F===null)return null;if(F=F.shared,(nn&2)!==0){var K=F.pending;return K===null?h.next=h:(h.next=K.next,K.next=h),F.pending=h,Gr(s,P)}return K=F.interleaved,K===null?(h.next=h,Si(F)):(h.next=K.next,K.next=h),F.interleaved=h,Gr(s,P)}function ga(s,h,P){if(h=h.updateQueue,h!==null&&(h=h.shared,(P&4194240)!==0)){var F=h.lanes;F&=s.pendingLanes,P|=F,h.lanes=P,$l(s,P)}}function Kr(s,h){var P=s.updateQueue,F=s.alternate;if(F!==null&&(F=F.updateQueue,P===F)){var K=null,ne=null;if(P=P.firstBaseUpdate,P!==null){do{var ge={eventTime:P.eventTime,lane:P.lane,tag:P.tag,payload:P.payload,callback:P.callback,next:null};ne===null?K=ne=ge:ne=ne.next=ge,P=P.next}while(P!==null);ne===null?K=ne=h:ne=ne.next=h}else K=ne=h;P={baseState:F.baseState,firstBaseUpdate:K,lastBaseUpdate:ne,shared:F.shared,effects:F.effects},s.updateQueue=P;return}s=P.lastBaseUpdate,s===null?P.firstBaseUpdate=h:s.next=h,P.lastBaseUpdate=h}function Ii(s,h,P,F){var K=s.updateQueue;$n=!1;var ne=K.firstBaseUpdate,ge=K.lastBaseUpdate,Ie=K.shared.pending;if(Ie!==null){K.shared.pending=null;var Be=Ie,tt=Be.next;Be.next=null,ge===null?ne=tt:ge.next=tt,ge=Be;var gt=s.alternate;gt!==null&&(gt=gt.updateQueue,Ie=gt.lastBaseUpdate,Ie!==ge&&(Ie===null?gt.firstBaseUpdate=tt:Ie.next=tt,gt.lastBaseUpdate=Be))}if(ne!==null){var mt=K.baseState;ge=0,gt=tt=Be=null,Ie=ne;do{var dt=Ie.lane,Ft=Ie.eventTime;if((F&dt)===dt){gt!==null&&(gt=gt.next={eventTime:Ft,lane:0,tag:Ie.tag,payload:Ie.payload,callback:Ie.callback,next:null});e:{var Ht=s,Gt=Ie;switch(dt=h,Ft=P,Gt.tag){case 1:if(Ht=Gt.payload,typeof Ht=="function"){mt=Ht.call(Ft,mt,dt);break e}mt=Ht;break e;case 3:Ht.flags=Ht.flags&-65537|128;case 0:if(Ht=Gt.payload,dt=typeof Ht=="function"?Ht.call(Ft,mt,dt):Ht,dt==null)break e;mt=U({},mt,dt);break e;case 2:$n=!0}}Ie.callback!==null&&Ie.lane!==0&&(s.flags|=64,dt=K.effects,dt===null?K.effects=[Ie]:dt.push(Ie))}else Ft={eventTime:Ft,lane:dt,tag:Ie.tag,payload:Ie.payload,callback:Ie.callback,next:null},gt===null?(tt=gt=Ft,Be=mt):gt=gt.next=Ft,ge|=dt;if(Ie=Ie.next,Ie===null){if(Ie=K.shared.pending,Ie===null)break;dt=Ie,Ie=dt.next,dt.next=null,K.lastBaseUpdate=dt,K.shared.pending=null}}while(!0);if(gt===null&&(Be=mt),K.baseState=Be,K.firstBaseUpdate=tt,K.lastBaseUpdate=gt,h=K.shared.interleaved,h!==null){K=h;do ge|=K.lane,K=K.next;while(K!==h)}else ne===null&&(K.shared.lanes=0);mf|=ge,s.lanes=ge,s.memoizedState=mt}}function zr(s,h,P){if(s=h.effects,h.effects=null,s!==null)for(h=0;h<s.length;h++){var F=s[h],K=F.callback;if(K!==null){if(F.callback=null,F=P,typeof K!="function")throw Error(r(191,K));K.call(F)}}}var rr={},Or=Po(rr),yr=Po(rr),Cn=Po(rr);function ii(s){if(s===rr)throw Error(r(174));return s}function Vo(s,h){switch(tn(Cn,h),tn(yr,s),tn(Or,rr),s=h.nodeType,s){case 9:case 11:h=(h=h.documentElement)?h.namespaceURI:pt(null,"");break;default:s=s===8?h.parentNode:h,h=s.namespaceURI||null,s=s.tagName,h=pt(h,s)}Yr(Or),tn(Or,h)}function ln(){Yr(Or),Yr(yr),Yr(Cn)}function uu(s){ii(Cn.current);var h=ii(Or.current),P=pt(h,s.type);h!==P&&(tn(yr,s),tn(Or,P))}function Is(s){yr.current===s&&(Yr(Or),Yr(yr))}var un=Po(0);function io(s){for(var h=s;h!==null;){if(h.tag===13){var P=h.memoizedState;if(P!==null&&(P=P.dehydrated,P===null||P.data==="$?"||P.data==="$!"))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if((h.flags&128)!==0)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===s)break;for(;h.sibling===null;){if(h.return===null||h.return===s)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var Ol=[];function va(){for(var s=0;s<Ol.length;s++)Ol[s]._workInProgressVersionPrimary=null;Ol.length=0}var cu=_.ReactCurrentDispatcher,fu=_.ReactCurrentBatchConfig,Fi=0,rn=null,Fn=null,jn=null,ao=!1,ko=!1,oo=0,Ac=0;function Dn(){throw Error(r(321))}function hu(s,h){if(h===null)return!1;for(var P=0;P<h.length&&P<s.length;P++)if(!Gn(s[P],h[P]))return!1;return!0}function nl(s,h,P,F,K,ne){if(Fi=ne,rn=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,cu.current=s===null||s.memoizedState===null?T0:pu,s=P(F,K),ko){ne=0;do{if(ko=!1,oo=0,25<=ne)throw Error(r(301));ne+=1,jn=Fn=null,h.updateQueue=null,cu.current=nh,s=P(F,K)}while(ko)}if(cu.current=Cc,h=Fn!==null&&Fn.next!==null,Fi=0,jn=Fn=rn=null,ao=!1,h)throw Error(r(300));return s}function so(){var s=oo!==0;return oo=0,s}function gn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?rn.memoizedState=jn=s:jn=jn.next=s,jn}function di(){if(Fn===null){var s=rn.alternate;s=s!==null?s.memoizedState:null}else s=Fn.next;var h=jn===null?rn.memoizedState:jn.next;if(h!==null)jn=h,Fn=s;else{if(s===null)throw Error(r(310));Fn=s,s={memoizedState:Fn.memoizedState,baseState:Fn.baseState,baseQueue:Fn.baseQueue,queue:Fn.queue,next:null},jn===null?rn.memoizedState=jn=s:jn=jn.next=s}return jn}function ma(s,h){return typeof h=="function"?h(s):h}function Ji(s){var h=di(),P=h.queue;if(P===null)throw Error(r(311));P.lastRenderedReducer=s;var F=Fn,K=F.baseQueue,ne=P.pending;if(ne!==null){if(K!==null){var ge=K.next;K.next=ne.next,ne.next=ge}F.baseQueue=K=ne,P.pending=null}if(K!==null){ne=K.next,F=F.baseState;var Ie=ge=null,Be=null,tt=ne;do{var gt=tt.lane;if((Fi&gt)===gt)Be!==null&&(Be=Be.next={lane:0,action:tt.action,hasEagerState:tt.hasEagerState,eagerState:tt.eagerState,next:null}),F=tt.hasEagerState?tt.eagerState:s(F,tt.action);else{var mt={lane:gt,action:tt.action,hasEagerState:tt.hasEagerState,eagerState:tt.eagerState,next:null};Be===null?(Ie=Be=mt,ge=F):Be=Be.next=mt,rn.lanes|=gt,mf|=gt}tt=tt.next}while(tt!==null&&tt!==ne);Be===null?ge=F:Be.next=Ie,Gn(F,h.memoizedState)||(oe=!0),h.memoizedState=F,h.baseState=ge,h.baseQueue=Be,P.lastRenderedState=F}if(s=P.interleaved,s!==null){K=s;do ne=K.lane,rn.lanes|=ne,mf|=ne,K=K.next;while(K!==s)}else K===null&&(P.lanes=0);return[h.memoizedState,P.dispatch]}function Fs(s){var h=di(),P=h.queue;if(P===null)throw Error(r(311));P.lastRenderedReducer=s;var F=P.dispatch,K=P.pending,ne=h.memoizedState;if(K!==null){P.pending=null;var ge=K=K.next;do ne=s(ne,ge.action),ge=ge.next;while(ge!==K);Gn(ne,h.memoizedState)||(oe=!0),h.memoizedState=ne,h.baseQueue===null&&(h.baseState=ne),P.lastRenderedState=ne}return[ne,F]}function Pc(){}function Hu(s,h){var P=rn,F=di(),K=h(),ne=!Gn(F.memoizedState,K);if(ne&&(F.memoizedState=K,oe=!0),F=F.queue,Oc(gf.bind(null,P,F,s),[s]),F.getSnapshot!==h||ne||jn!==null&&jn.memoizedState.tag&1){if(P.flags|=2048,qa(9,fs.bind(null,P,F,K,h),void 0,null),Va===null)throw Error(r(349));(Fi&30)!==0||rh(P,h,K)}return K}function rh(s,h,P){s.flags|=16384,s={getSnapshot:h,value:P},h=rn.updateQueue,h===null?(h={lastEffect:null,stores:null},rn.updateQueue=h,h.stores=[s]):(P=h.stores,P===null?h.stores=[s]:P.push(s))}function fs(s,h,P,F){h.value=P,h.getSnapshot=F,Cl(h)&&du(s)}function gf(s,h,P){return P(function(){Cl(h)&&du(s)})}function Cl(s){var h=s.getSnapshot;s=s.value;try{var P=h();return!Gn(s,P)}catch{return!0}}function du(s){var h=Gr(s,1);h!==null&&Rl(h,s,1,-1)}function Go(s){var h=gn();return typeof s=="function"&&(s=s()),h.memoizedState=h.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:s},h.queue=s,s=s.dispatch=Rp.bind(null,rn,s),[h.memoizedState,s]}function qa(s,h,P,F){return s={tag:s,create:h,destroy:P,deps:F,next:null},h=rn.updateQueue,h===null?(h={lastEffect:null,stores:null},rn.updateQueue=h,h.lastEffect=s.next=s):(P=h.lastEffect,P===null?h.lastEffect=s.next=s:(F=P.next,P.next=s,s.next=F,h.lastEffect=s)),s}function hs(){return di().memoizedState}function lo(s,h,P,F){var K=gn();rn.flags|=s,K.memoizedState=qa(1|h,P,void 0,F===void 0?null:F)}function ds(s,h,P,F){var K=di();F=F===void 0?null:F;var ne=void 0;if(Fn!==null){var ge=Fn.memoizedState;if(ne=ge.destroy,F!==null&&hu(F,ge.deps)){K.memoizedState=qa(h,P,ne,F);return}}rn.flags|=s,K.memoizedState=qa(1|h,P,ne,F)}function kc(s,h){return lo(8390656,8,s,h)}function Oc(s,h){return ds(2048,8,s,h)}function vf(s,h){return ds(4,2,s,h)}function Vu(s,h){return ds(4,4,s,h)}function ps(s,h){if(typeof h=="function")return s=s(),h(s),function(){h(null)};if(h!=null)return s=s(),h.current=s,function(){h.current=null}}function Cp(s,h,P){return P=P!=null?P.concat([s]):null,ds(4,4,ps.bind(null,h,s),P)}function Nl(){}function Vh(s,h){var P=di();h=h===void 0?null:h;var F=P.memoizedState;return F!==null&&h!==null&&hu(h,F[1])?F[0]:(P.memoizedState=[s,h],s)}function Bn(s,h){var P=di();h=h===void 0?null:h;var F=P.memoizedState;return F!==null&&h!==null&&hu(h,F[1])?F[0]:(s=s(),P.memoizedState=[s,h],s)}function Np(s,h,P){return(Fi&21)===0?(s.baseState&&(s.baseState=!1,oe=!0),s.memoizedState=P):(Gn(P,h)||(P=Ru(),rn.lanes|=P,mf|=P,s.baseState=!0),h)}function Lp(s,h){var P=Ar;Ar=P!==0&&4>P?P:4,s(!0);var F=fu.transition;fu.transition={};try{s(!1),h()}finally{Ar=P,fu.transition=F}}function Tp(){return di().memoizedState}function L0(s,h,P){var F=Fc(s);if(P={lane:F,action:P,hasEagerState:!1,eagerState:null,next:null},Gh(s))Mp(h,P);else if(P=Vr(s,h,P,F),P!==null){var K=Wo();Rl(P,s,F,K),$o(P,h,F)}}function Rp(s,h,P){var F=Fc(s),K={lane:F,action:P,hasEagerState:!1,eagerState:null,next:null};if(Gh(s))Mp(h,K);else{var ne=s.alternate;if(s.lanes===0&&(ne===null||ne.lanes===0)&&(ne=h.lastRenderedReducer,ne!==null))try{var ge=h.lastRenderedState,Ie=ne(ge,P);if(K.hasEagerState=!0,K.eagerState=Ie,Gn(Ie,ge)){var Be=h.interleaved;Be===null?(K.next=K,Si(h)):(K.next=Be.next,Be.next=K),h.interleaved=K;return}}catch{}finally{}P=Vr(s,h,K,F),P!==null&&(K=Wo(),Rl(P,s,F,K),$o(P,h,F))}}function Gh(s){var h=s.alternate;return s===rn||h!==null&&h===rn}function Mp(s,h){ko=ao=!0;var P=s.pending;P===null?h.next=h:(h.next=P.next,P.next=h),s.pending=h}function $o(s,h,P){if((P&4194240)!==0){var F=h.lanes;F&=s.pendingLanes,P|=F,h.lanes=P,$l(s,P)}}var Cc={readContext:xn,useCallback:Dn,useContext:Dn,useEffect:Dn,useImperativeHandle:Dn,useInsertionEffect:Dn,useLayoutEffect:Dn,useMemo:Dn,useReducer:Dn,useRef:Dn,useState:Dn,useDebugValue:Dn,useDeferredValue:Dn,useTransition:Dn,useMutableSource:Dn,useSyncExternalStore:Dn,useId:Dn,unstable_isNewReconciler:!1},T0={readContext:xn,useCallback:function(s,h){return gn().memoizedState=[s,h===void 0?null:h],s},useContext:xn,useEffect:kc,useImperativeHandle:function(s,h,P){return P=P!=null?P.concat([s]):null,lo(4194308,4,ps.bind(null,h,s),P)},useLayoutEffect:function(s,h){return lo(4194308,4,s,h)},useInsertionEffect:function(s,h){return lo(4,2,s,h)},useMemo:function(s,h){var P=gn();return h=h===void 0?null:h,s=s(),P.memoizedState=[s,h],s},useReducer:function(s,h,P){var F=gn();return h=P!==void 0?P(h):h,F.memoizedState=F.baseState=h,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:h},F.queue=s,s=s.dispatch=L0.bind(null,rn,s),[F.memoizedState,s]},useRef:function(s){var h=gn();return s={current:s},h.memoizedState=s},useState:Go,useDebugValue:Nl,useDeferredValue:function(s){return gn().memoizedState=s},useTransition:function(){var s=Go(!1),h=s[0];return s=Lp.bind(null,s[1]),gn().memoizedState=s,[h,s]},useMutableSource:function(){},useSyncExternalStore:function(s,h,P){var F=rn,K=gn();if(ot){if(P===void 0)throw Error(r(407));P=P()}else{if(P=h(),Va===null)throw Error(r(349));(Fi&30)!==0||rh(F,h,P)}K.memoizedState=P;var ne={value:P,getSnapshot:h};return K.queue=ne,kc(gf.bind(null,F,ne,s),[s]),F.flags|=2048,qa(9,fs.bind(null,F,ne,P,h),void 0,null),P},useId:function(){var s=gn(),h=Va.identifierPrefix;if(ot){var P=ke,F=Ze;P=(F&~(1<<32-mr(F)-1)).toString(32)+P,h=":"+h+"R"+P,P=oo++,0<P&&(h+="H"+P.toString(32)),h+=":"}else P=Ac++,h=":"+h+"r"+P.toString(32)+":";return s.memoizedState=h},unstable_isNewReconciler:!1},pu={readContext:xn,useCallback:Vh,useContext:xn,useEffect:Oc,useImperativeHandle:Cp,useInsertionEffect:vf,useLayoutEffect:Vu,useMemo:Bn,useReducer:Ji,useRef:hs,useState:function(){return Ji(ma)},useDebugValue:Nl,useDeferredValue:function(s){var h=di();return Np(h,Fn.memoizedState,s)},useTransition:function(){var s=Ji(ma)[0],h=di().memoizedState;return[s,h]},useMutableSource:Pc,useSyncExternalStore:Hu,useId:Tp,unstable_isNewReconciler:!1},nh={readContext:xn,useCallback:Vh,useContext:xn,useEffect:Oc,useImperativeHandle:Cp,useInsertionEffect:vf,useLayoutEffect:Vu,useMemo:Bn,useReducer:Fs,useRef:hs,useState:function(){return Fs(ma)},useDebugValue:Nl,useDeferredValue:function(s){var h=di();return Fn===null?h.memoizedState=s:Np(h,Fn.memoizedState,s)},useTransition:function(){var s=Fs(ma)[0],h=di().memoizedState;return[s,h]},useMutableSource:Pc,useSyncExternalStore:Hu,useId:Tp,unstable_isNewReconciler:!1};function Na(s,h){if(s&&s.defaultProps){h=U({},h),s=s.defaultProps;for(var P in s)h[P]===void 0&&(h[P]=s[P]);return h}return h}function Nc(s,h,P,F){h=s.memoizedState,P=P(F,h),P=P==null?h:U({},h,P),s.memoizedState=P,s.lanes===0&&(s.updateQueue.baseState=P)}var Lc={isMounted:function(s){return(s=s._reactInternals)?Qn(s)===s:!1},enqueueSetState:function(s,h,P){s=s._reactInternals;var F=Wo(),K=Fc(s),ne=Wn(F,K);ne.payload=h,P!=null&&(ne.callback=P),h=In(s,ne,K),h!==null&&(Rl(h,s,K,F),ga(h,s,K))},enqueueReplaceState:function(s,h,P){s=s._reactInternals;var F=Wo(),K=Fc(s),ne=Wn(F,K);ne.tag=1,ne.payload=h,P!=null&&(ne.callback=P),h=In(s,ne,K),h!==null&&(Rl(h,s,K,F),ga(h,s,K))},enqueueForceUpdate:function(s,h){s=s._reactInternals;var P=Wo(),F=Fc(s),K=Wn(P,F);K.tag=2,h!=null&&(K.callback=h),h=In(s,K,F),h!==null&&(Rl(h,s,F,P),ga(h,s,F))}};function ih(s,h,P,F,K,ne,ge){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(F,ne,ge):h.prototype&&h.prototype.isPureReactComponent?!Eo(P,F)||!Eo(K,ne):!0}function Ip(s,h,P){var F=!1,K=ls,ne=h.contextType;return typeof ne=="object"&&ne!==null?ne=xn(ne):(K=da(h)?rl:Mi.current,F=h.contextTypes,ne=(F=F!=null)?Pl(s,K):ls),h=new h(P,ne),s.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Lc,s.stateNode=h,h._reactInternals=s,F&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=K,s.__reactInternalMemoizedMaskedChildContext=ne),h}function $h(s,h,P,F){s=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(P,F),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(P,F),h.state!==s&&Lc.enqueueReplaceState(h,h.state,null)}function ah(s,h,P,F){var K=s.stateNode;K.props=P,K.state=s.memoizedState,K.refs={},Ei(s);var ne=h.contextType;typeof ne=="object"&&ne!==null?K.context=xn(ne):(ne=da(h)?rl:Mi.current,K.context=Pl(s,ne)),K.state=s.memoizedState,ne=h.getDerivedStateFromProps,typeof ne=="function"&&(Nc(s,h,ne,P),K.state=s.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof K.getSnapshotBeforeUpdate=="function"||typeof K.UNSAFE_componentWillMount!="function"&&typeof K.componentWillMount!="function"||(h=K.state,typeof K.componentWillMount=="function"&&K.componentWillMount(),typeof K.UNSAFE_componentWillMount=="function"&&K.UNSAFE_componentWillMount(),h!==K.state&&Lc.enqueueReplaceState(K,K.state,null),Ii(s,P,K,F),K.state=s.memoizedState),typeof K.componentDidMount=="function"&&(s.flags|=4194308)}function Gu(s,h){try{var P="",F=h;do P+=re(F),F=F.return;while(F);var K=P}catch(ne){K=`
31
- Error generating stack: `+ne.message+`
32
- `+ne.stack}return{value:s,source:h,stack:K,digest:null}}function oh(s,h,P){return{value:s,source:null,stack:P??null,digest:h??null}}function Tc(s,h){try{console.error(h.value)}catch(P){setTimeout(function(){throw P})}}var R0=typeof WeakMap=="function"?WeakMap:Map;function Fp(s,h,P){P=Wn(-1,P),P.tag=3,P.payload={element:null};var F=h.value;return P.callback=function(){Up||(Up=!0,H0=F),Tc(s,h)},P}function p(s,h,P){P=Wn(-1,P),P.tag=3;var F=s.type.getDerivedStateFromError;if(typeof F=="function"){var K=h.value;P.payload=function(){return F(K)},P.callback=function(){Tc(s,h)}}var ne=s.stateNode;return ne!==null&&typeof ne.componentDidCatch=="function"&&(P.callback=function(){Tc(s,h),typeof F!="function"&&(Mc===null?Mc=new Set([this]):Mc.add(this));var ge=h.stack;this.componentDidCatch(h.value,{componentStack:ge!==null?ge:""})}),P}function m(s,h,P){var F=s.pingCache;if(F===null){F=s.pingCache=new R0;var K=new Set;F.set(h,K)}else K=F.get(h),K===void 0&&(K=new Set,F.set(h,K));K.has(P)||(K.add(P),s=q7.bind(null,s,h,P),h.then(s,s))}function I(s){do{var h;if((h=s.tag===13)&&(h=s.memoizedState,h=h!==null?h.dehydrated!==null:!0),h)return s;s=s.return}while(s!==null);return null}function $(s,h,P,F,K){return(s.mode&1)===0?(s===h?s.flags|=65536:(s.flags|=128,P.flags|=131072,P.flags&=-52805,P.tag===1&&(P.alternate===null?P.tag=17:(h=Wn(-1,1),h.tag=2,In(P,h,1))),P.lanes|=1),s):(s.flags|=65536,s.lanes=K,s)}var ee=_.ReactCurrentOwner,oe=!1;function Ee(s,h,P,F){h.child=s===null?Ir(h,null,P,F):ni(h,s.child,P,F)}function We(s,h,P,F,K){P=P.render;var ne=h.ref;return _n(h,K),F=nl(s,h,P,F,ne,K),P=so(),s!==null&&!oe?(h.updateQueue=s.updateQueue,h.flags&=-2053,s.lanes&=~K,Ha(s,h,K)):(ot&&P&&it(h),h.flags|=1,Ee(s,h,F,K),h.child)}function rt(s,h,P,F,K){if(s===null){var ne=P.type;return typeof ne=="function"&&!K0(ne)&&ne.defaultProps===void 0&&P.compare===null&&P.defaultProps===void 0?(h.tag=15,h.type=ne,yt(s,h,ne,F,K)):(s=Wp(P.type,null,F,h,h.mode,K),s.ref=h.ref,s.return=h,h.child=s)}if(ne=s.child,(s.lanes&K)===0){var ge=ne.memoizedProps;if(P=P.compare,P=P!==null?P:Eo,P(ge,F)&&s.ref===h.ref)return Ha(s,h,K)}return h.flags|=1,s=Dc(ne,F),s.ref=h.ref,s.return=h,h.child=s}function yt(s,h,P,F,K){if(s!==null){var ne=s.memoizedProps;if(Eo(ne,F)&&s.ref===h.ref)if(oe=!1,h.pendingProps=F=ne,(s.lanes&K)!==0)(s.flags&131072)!==0&&(oe=!0);else return h.lanes=s.lanes,Ha(s,h,K)}return Ot(s,h,P,F,K)}function Bt(s,h,P){var F=h.pendingProps,K=F.children,ne=s!==null?s.memoizedState:null;if(F.mode==="hidden")if((h.mode&1)===0)h.memoizedState={baseLanes:0,cachePool:null,transitions:null},tn(lh,js),js|=P;else{if((P&1073741824)===0)return s=ne!==null?ne.baseLanes|P:P,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:s,cachePool:null,transitions:null},h.updateQueue=null,tn(lh,js),js|=s,null;h.memoizedState={baseLanes:0,cachePool:null,transitions:null},F=ne!==null?ne.baseLanes:P,tn(lh,js),js|=F}else ne!==null?(F=ne.baseLanes|P,h.memoizedState=null):F=P,tn(lh,js),js|=F;return Ee(s,h,K,P),h.child}function pr(s,h){var P=h.ref;(s===null&&P!==null||s!==null&&s.ref!==P)&&(h.flags|=512,h.flags|=2097152)}function Ot(s,h,P,F,K){var ne=da(P)?rl:Mi.current;return ne=Pl(h,ne),_n(h,K),P=nl(s,h,P,F,ne,K),F=so(),s!==null&&!oe?(h.updateQueue=s.updateQueue,h.flags&=-2053,s.lanes&=~K,Ha(s,h,K)):(ot&&F&&it(h),h.flags|=1,Ee(s,h,P,K),h.child)}function Nn(s,h,P,F,K){if(da(P)){var ne=!0;us(h)}else ne=!1;if(_n(h,K),h.stateNode===null)Fr(s,h),Ip(h,P,F),ah(h,P,F,K),F=!0;else if(s===null){var ge=h.stateNode,Ie=h.memoizedProps;ge.props=Ie;var Be=ge.context,tt=P.contextType;typeof tt=="object"&&tt!==null?tt=xn(tt):(tt=da(P)?rl:Mi.current,tt=Pl(h,tt));var gt=P.getDerivedStateFromProps,mt=typeof gt=="function"||typeof ge.getSnapshotBeforeUpdate=="function";mt||typeof ge.UNSAFE_componentWillReceiveProps!="function"&&typeof ge.componentWillReceiveProps!="function"||(Ie!==F||Be!==tt)&&$h(h,ge,F,tt),$n=!1;var dt=h.memoizedState;ge.state=dt,Ii(h,F,ge,K),Be=h.memoizedState,Ie!==F||dt!==Be||ha.current||$n?(typeof gt=="function"&&(Nc(h,P,gt,F),Be=h.memoizedState),(Ie=$n||ih(h,P,Ie,F,dt,Be,tt))?(mt||typeof ge.UNSAFE_componentWillMount!="function"&&typeof ge.componentWillMount!="function"||(typeof ge.componentWillMount=="function"&&ge.componentWillMount(),typeof ge.UNSAFE_componentWillMount=="function"&&ge.UNSAFE_componentWillMount()),typeof ge.componentDidMount=="function"&&(h.flags|=4194308)):(typeof ge.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=F,h.memoizedState=Be),ge.props=F,ge.state=Be,ge.context=tt,F=Ie):(typeof ge.componentDidMount=="function"&&(h.flags|=4194308),F=!1)}else{ge=h.stateNode,pa(s,h),Ie=h.memoizedProps,tt=h.type===h.elementType?Ie:Na(h.type,Ie),ge.props=tt,mt=h.pendingProps,dt=ge.context,Be=P.contextType,typeof Be=="object"&&Be!==null?Be=xn(Be):(Be=da(P)?rl:Mi.current,Be=Pl(h,Be));var Ft=P.getDerivedStateFromProps;(gt=typeof Ft=="function"||typeof ge.getSnapshotBeforeUpdate=="function")||typeof ge.UNSAFE_componentWillReceiveProps!="function"&&typeof ge.componentWillReceiveProps!="function"||(Ie!==mt||dt!==Be)&&$h(h,ge,F,Be),$n=!1,dt=h.memoizedState,ge.state=dt,Ii(h,F,ge,K);var Ht=h.memoizedState;Ie!==mt||dt!==Ht||ha.current||$n?(typeof Ft=="function"&&(Nc(h,P,Ft,F),Ht=h.memoizedState),(tt=$n||ih(h,P,tt,F,dt,Ht,Be)||!1)?(gt||typeof ge.UNSAFE_componentWillUpdate!="function"&&typeof ge.componentWillUpdate!="function"||(typeof ge.componentWillUpdate=="function"&&ge.componentWillUpdate(F,Ht,Be),typeof ge.UNSAFE_componentWillUpdate=="function"&&ge.UNSAFE_componentWillUpdate(F,Ht,Be)),typeof ge.componentDidUpdate=="function"&&(h.flags|=4),typeof ge.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof ge.componentDidUpdate!="function"||Ie===s.memoizedProps&&dt===s.memoizedState||(h.flags|=4),typeof ge.getSnapshotBeforeUpdate!="function"||Ie===s.memoizedProps&&dt===s.memoizedState||(h.flags|=1024),h.memoizedProps=F,h.memoizedState=Ht),ge.props=F,ge.state=Ht,ge.context=Be,F=tt):(typeof ge.componentDidUpdate!="function"||Ie===s.memoizedProps&&dt===s.memoizedState||(h.flags|=4),typeof ge.getSnapshotBeforeUpdate!="function"||Ie===s.memoizedProps&&dt===s.memoizedState||(h.flags|=1024),F=!1)}return dn(s,h,P,F,ne,K)}function dn(s,h,P,F,K,ne){pr(s,h);var ge=(h.flags&128)!==0;if(!F&&!ge)return K&&th(h,P,!1),Ha(s,h,ne);F=h.stateNode,ee.current=h;var Ie=ge&&typeof P.getDerivedStateFromError!="function"?null:F.render();return h.flags|=1,s!==null&&ge?(h.child=ni(h,s.child,null,ne),h.child=ni(h,null,Ie,ne)):Ee(s,h,Ie,ne),h.memoizedState=F.state,K&&th(h,P,!0),h.child}function uo(s){var h=s.stateNode;h.pendingContext?pf(s,h.pendingContext,h.pendingContext!==h.context):h.context&&pf(s,h.context,!1),Vo(s,h.containerInfo)}function il(s,h,P,F,K){return Tt(),_t(K),h.flags|=256,Ee(s,h,P,F),h.child}var et={dehydrated:null,treeContext:null,retryLane:0};function Xe(s){return{baseLanes:s,cachePool:null,transitions:null}}function at(s,h,P){var F=h.pendingProps,K=un.current,ne=!1,ge=(h.flags&128)!==0,Ie;if((Ie=ge)||(Ie=s!==null&&s.memoizedState===null?!1:(K&2)!==0),Ie?(ne=!0,h.flags&=-129):(s===null||s.memoizedState!==null)&&(K|=1),tn(un,K&1),s===null)return It(h),s=h.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((h.mode&1)===0?h.lanes=1:s.data==="$!"?h.lanes=8:h.lanes=1073741824,null):(ge=F.children,s=F.fallback,ne?(F=h.mode,ne=h.child,ge={mode:"hidden",children:ge},(F&1)===0&&ne!==null?(ne.childLanes=0,ne.pendingProps=ge):ne=Yp(ge,F,0,null),s=_f(s,F,P,null),ne.return=h,s.return=h,ne.sibling=s,h.child=ne,h.child.memoizedState=Xe(P),h.memoizedState=et,s):Ct(h,ge));if(K=s.memoizedState,K!==null&&(Ie=K.dehydrated,Ie!==null))return xr(s,h,ge,F,Ie,K,P);if(ne){ne=F.fallback,ge=h.mode,K=s.child,Ie=K.sibling;var Be={mode:"hidden",children:F.children};return(ge&1)===0&&h.child!==K?(F=h.child,F.childLanes=0,F.pendingProps=Be,h.deletions=null):(F=Dc(K,Be),F.subtreeFlags=K.subtreeFlags&14680064),Ie!==null?ne=Dc(Ie,ne):(ne=_f(ne,ge,P,null),ne.flags|=2),ne.return=h,F.return=h,F.sibling=ne,h.child=F,F=ne,ne=h.child,ge=s.child.memoizedState,ge=ge===null?Xe(P):{baseLanes:ge.baseLanes|P,cachePool:null,transitions:ge.transitions},ne.memoizedState=ge,ne.childLanes=s.childLanes&~P,h.memoizedState=et,F}return ne=s.child,s=ne.sibling,F=Dc(ne,{mode:"visible",children:F.children}),(h.mode&1)===0&&(F.lanes=P),F.return=h,F.sibling=null,s!==null&&(P=h.deletions,P===null?(h.deletions=[s],h.flags|=16):P.push(s)),h.child=F,h.memoizedState=null,F}function Ct(s,h){return h=Yp({mode:"visible",children:h},s.mode,0,null),h.return=s,s.child=h}function Qt(s,h,P,F){return F!==null&&_t(F),ni(h,s.child,null,P),s=Ct(h,h.pendingProps.children),s.flags|=2,h.memoizedState=null,s}function xr(s,h,P,F,K,ne,ge){if(P)return h.flags&256?(h.flags&=-257,F=oh(Error(r(422))),Qt(s,h,ge,F)):h.memoizedState!==null?(h.child=s.child,h.flags|=128,null):(ne=F.fallback,K=h.mode,F=Yp({mode:"visible",children:F.children},K,0,null),ne=_f(ne,K,ge,null),ne.flags|=2,F.return=h,ne.return=h,F.sibling=ne,h.child=F,(h.mode&1)!==0&&ni(h,s.child,null,ge),h.child.memoizedState=Xe(ge),h.memoizedState=et,ne);if((h.mode&1)===0)return Qt(s,h,ge,null);if(K.data==="$!"){if(F=K.nextSibling&&K.nextSibling.dataset,F)var Ie=F.dgst;return F=Ie,ne=Error(r(419)),F=oh(ne,F,void 0),Qt(s,h,ge,F)}if(Ie=(ge&s.childLanes)!==0,oe||Ie){if(F=Va,F!==null){switch(ge&-ge){case 4:K=2;break;case 16:K=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:K=32;break;case 536870912:K=268435456;break;default:K=0}K=(K&(F.suspendedLanes|ge))!==0?0:K,K!==0&&K!==ne.retryLane&&(ne.retryLane=K,Gr(s,K),Rl(F,s,K,-1))}return X0(),F=oh(Error(r(421))),Qt(s,h,ge,F)}return K.data==="$?"?(h.flags|=128,h.child=s.child,h=H7.bind(null,s),K._reactRetry=h,null):(s=ne.treeContext,Ue=Ki(K.nextSibling),nt=h,ot=!0,ut=null,s!==null&&(Se[Oe++]=Ze,Se[Oe++]=ke,Se[Oe++]=De,Ze=s.id,ke=s.overflow,De=h),h=Ct(h,F.children),h.flags|=4096,h)}function gr(s,h,P){s.lanes|=h;var F=s.alternate;F!==null&&(F.lanes|=h),Br(s.return,h,P)}function Ur(s,h,P,F,K){var ne=s.memoizedState;ne===null?s.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:F,tail:P,tailMode:K}:(ne.isBackwards=h,ne.rendering=null,ne.renderingStartTime=0,ne.last=F,ne.tail=P,ne.tailMode=K)}function ea(s,h,P){var F=h.pendingProps,K=F.revealOrder,ne=F.tail;if(Ee(s,h,F.children,P),F=un.current,(F&2)!==0)F=F&1|2,h.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=h.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&gr(s,P,h);else if(s.tag===19)gr(s,P,h);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===h)break e;for(;s.sibling===null;){if(s.return===null||s.return===h)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}F&=1}if(tn(un,F),(h.mode&1)===0)h.memoizedState=null;else switch(K){case"forwards":for(P=h.child,K=null;P!==null;)s=P.alternate,s!==null&&io(s)===null&&(K=P),P=P.sibling;P=K,P===null?(K=h.child,h.child=null):(K=P.sibling,P.sibling=null),Ur(h,!1,K,P,ne);break;case"backwards":for(P=null,K=h.child,h.child=null;K!==null;){if(s=K.alternate,s!==null&&io(s)===null){h.child=K;break}s=K.sibling,K.sibling=P,P=K,K=s}Ur(h,!0,P,null,ne);break;case"together":Ur(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function Fr(s,h){(h.mode&1)===0&&s!==null&&(s.alternate=null,h.alternate=null,h.flags|=2)}function Ha(s,h,P){if(s!==null&&(h.dependencies=s.dependencies),mf|=h.lanes,(P&h.childLanes)===0)return null;if(s!==null&&h.child!==s.child)throw Error(r(153));if(h.child!==null){for(s=h.child,P=Dc(s,s.pendingProps),h.child=P,P.return=h;s.sibling!==null;)s=s.sibling,P=P.sibling=Dc(s,s.pendingProps),P.return=h;P.sibling=null}return h.child}function M0(s,h,P){switch(h.tag){case 3:uo(h),Tt();break;case 5:uu(h);break;case 1:da(h.type)&&us(h);break;case 4:Vo(h,h.stateNode.containerInfo);break;case 10:var F=h.type._context,K=h.memoizedProps.value;tn(hi,F._currentValue),F._currentValue=K;break;case 13:if(F=h.memoizedState,F!==null)return F.dehydrated!==null?(tn(un,un.current&1),h.flags|=128,null):(P&h.child.childLanes)!==0?at(s,h,P):(tn(un,un.current&1),s=Ha(s,h,P),s!==null?s.sibling:null);tn(un,un.current&1);break;case 19:if(F=(P&h.childLanes)!==0,(s.flags&128)!==0){if(F)return ea(s,h,P);h.flags|=128}if(K=h.memoizedState,K!==null&&(K.rendering=null,K.tail=null,K.lastEffect=null),tn(un,un.current),F)break;return null;case 22:case 23:return h.lanes=0,Bt(s,h,P)}return Ha(s,h,P)}var qm,I0,Hm,Vm;qm=function(s,h){for(var P=h.child;P!==null;){if(P.tag===5||P.tag===6)s.appendChild(P.stateNode);else if(P.tag!==4&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===h)break;for(;P.sibling===null;){if(P.return===null||P.return===h)return;P=P.return}P.sibling.return=P.return,P=P.sibling}},I0=function(){},Hm=function(s,h,P,F){var K=s.memoizedProps;if(K!==F){s=h.stateNode,ii(Or.current);var ne=null;switch(P){case"input":K=Pe(s,K),F=Pe(s,F),ne=[];break;case"select":K=U({},K,{value:void 0}),F=U({},F,{value:void 0}),ne=[];break;case"textarea":K=pe(s,K),F=pe(s,F),ne=[];break;default:typeof K.onClick!="function"&&typeof F.onClick=="function"&&(s.onclick=Rs)}$e(P,F);var ge;P=null;for(tt in K)if(!F.hasOwnProperty(tt)&&K.hasOwnProperty(tt)&&K[tt]!=null)if(tt==="style"){var Ie=K[tt];for(ge in Ie)Ie.hasOwnProperty(ge)&&(P||(P={}),P[ge]="")}else tt!=="dangerouslySetInnerHTML"&&tt!=="children"&&tt!=="suppressContentEditableWarning"&&tt!=="suppressHydrationWarning"&&tt!=="autoFocus"&&(i.hasOwnProperty(tt)?ne||(ne=[]):(ne=ne||[]).push(tt,null));for(tt in F){var Be=F[tt];if(Ie=K?.[tt],F.hasOwnProperty(tt)&&Be!==Ie&&(Be!=null||Ie!=null))if(tt==="style")if(Ie){for(ge in Ie)!Ie.hasOwnProperty(ge)||Be&&Be.hasOwnProperty(ge)||(P||(P={}),P[ge]="");for(ge in Be)Be.hasOwnProperty(ge)&&Ie[ge]!==Be[ge]&&(P||(P={}),P[ge]=Be[ge])}else P||(ne||(ne=[]),ne.push(tt,P)),P=Be;else tt==="dangerouslySetInnerHTML"?(Be=Be?Be.__html:void 0,Ie=Ie?Ie.__html:void 0,Be!=null&&Ie!==Be&&(ne=ne||[]).push(tt,Be)):tt==="children"?typeof Be!="string"&&typeof Be!="number"||(ne=ne||[]).push(tt,""+Be):tt!=="suppressContentEditableWarning"&&tt!=="suppressHydrationWarning"&&(i.hasOwnProperty(tt)?(Be!=null&&tt==="onScroll"&&sn("scroll",s),ne||Ie===Be||(ne=[])):(ne=ne||[]).push(tt,Be))}P&&(ne=ne||[]).push("style",P);var tt=ne;(h.updateQueue=tt)&&(h.flags|=4)}},Vm=function(s,h,P,F){P!==F&&(h.flags|=4)};function Wh(s,h){if(!ot)switch(s.tailMode){case"hidden":h=s.tail;for(var P=null;h!==null;)h.alternate!==null&&(P=h),h=h.sibling;P===null?s.tail=null:P.sibling=null;break;case"collapsed":P=s.tail;for(var F=null;P!==null;)P.alternate!==null&&(F=P),P=P.sibling;F===null?h||s.tail===null?s.tail=null:s.tail.sibling=null:F.sibling=null}}function Oo(s){var h=s.alternate!==null&&s.alternate.child===s.child,P=0,F=0;if(h)for(var K=s.child;K!==null;)P|=K.lanes|K.childLanes,F|=K.subtreeFlags&14680064,F|=K.flags&14680064,K.return=s,K=K.sibling;else for(K=s.child;K!==null;)P|=K.lanes|K.childLanes,F|=K.subtreeFlags,F|=K.flags,K.return=s,K=K.sibling;return s.subtreeFlags|=F,s.childLanes=P,h}function T7(s,h,P){var F=h.pendingProps;switch(Ye(h),h.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oo(h),null;case 1:return da(h.type)&&lu(),Oo(h),null;case 3:return F=h.stateNode,ln(),Yr(ha),Yr(Mi),va(),F.pendingContext&&(F.context=F.pendingContext,F.pendingContext=null),(s===null||s.child===null)&&(Rn(h)?h.flags|=4:s===null||s.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,ut!==null&&($0(ut),ut=null))),I0(s,h),Oo(h),null;case 5:Is(h);var K=ii(Cn.current);if(P=h.type,s!==null&&h.stateNode!=null)Hm(s,h,P,F,K),s.ref!==h.ref&&(h.flags|=512,h.flags|=2097152);else{if(!F){if(h.stateNode===null)throw Error(r(166));return Oo(h),null}if(s=ii(Or.current),Rn(h)){F=h.stateNode,P=h.type;var ne=h.memoizedProps;switch(F[Ao]=h,F[ou]=ne,s=(h.mode&1)!==0,P){case"dialog":sn("cancel",F),sn("close",F);break;case"iframe":case"object":case"embed":sn("load",F);break;case"video":case"audio":for(K=0;K<Ho.length;K++)sn(Ho[K],F);break;case"source":sn("error",F);break;case"img":case"image":case"link":sn("error",F),sn("load",F);break;case"details":sn("toggle",F);break;case"input":de(F,ne),sn("invalid",F);break;case"select":F._wrapperState={wasMultiple:!!ne.multiple},sn("invalid",F);break;case"textarea":Ce(F,ne),sn("invalid",F)}$e(P,ne),K=null;for(var ge in ne)if(ne.hasOwnProperty(ge)){var Ie=ne[ge];ge==="children"?typeof Ie=="string"?F.textContent!==Ie&&(ne.suppressHydrationWarning!==!0&&Bu(F.textContent,Ie,s),K=["children",Ie]):typeof Ie=="number"&&F.textContent!==""+Ie&&(ne.suppressHydrationWarning!==!0&&Bu(F.textContent,Ie,s),K=["children",""+Ie]):i.hasOwnProperty(ge)&&Ie!=null&&ge==="onScroll"&&sn("scroll",F)}switch(P){case"input":ye(F),be(F,ne,!0);break;case"textarea":ye(F),He(F);break;case"select":case"option":break;default:typeof ne.onClick=="function"&&(F.onclick=Rs)}F=K,h.updateQueue=F,F!==null&&(h.flags|=4)}else{ge=K.nodeType===9?K:K.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=st(P)),s==="http://www.w3.org/1999/xhtml"?P==="script"?(s=ge.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof F.is=="string"?s=ge.createElement(P,{is:F.is}):(s=ge.createElement(P),P==="select"&&(ge=s,F.multiple?ge.multiple=!0:F.size&&(ge.size=F.size))):s=ge.createElementNS(s,P),s[Ao]=h,s[ou]=F,qm(s,h,!1,!1),h.stateNode=s;e:{switch(ge=ze(P,F),P){case"dialog":sn("cancel",s),sn("close",s),K=F;break;case"iframe":case"object":case"embed":sn("load",s),K=F;break;case"video":case"audio":for(K=0;K<Ho.length;K++)sn(Ho[K],s);K=F;break;case"source":sn("error",s),K=F;break;case"img":case"image":case"link":sn("error",s),sn("load",s),K=F;break;case"details":sn("toggle",s),K=F;break;case"input":de(s,F),K=Pe(s,F),sn("invalid",s);break;case"option":K=F;break;case"select":s._wrapperState={wasMultiple:!!F.multiple},K=U({},F,{value:void 0}),sn("invalid",s);break;case"textarea":Ce(s,F),K=pe(s,F),sn("invalid",s);break;default:K=F}$e(P,K),Ie=K;for(ne in Ie)if(Ie.hasOwnProperty(ne)){var Be=Ie[ne];ne==="style"?Pt(s,Be):ne==="dangerouslySetInnerHTML"?(Be=Be?Be.__html:void 0,Be!=null&&bt(s,Be)):ne==="children"?typeof Be=="string"?(P!=="textarea"||Be!=="")&&ht(s,Be):typeof Be=="number"&&ht(s,""+Be):ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&ne!=="autoFocus"&&(i.hasOwnProperty(ne)?Be!=null&&ne==="onScroll"&&sn("scroll",s):Be!=null&&w(s,ne,Be,ge))}switch(P){case"input":ye(s),be(s,F,!1);break;case"textarea":ye(s),He(s);break;case"option":F.value!=null&&s.setAttribute("value",""+se(F.value));break;case"select":s.multiple=!!F.multiple,ne=F.value,ne!=null?Le(s,!!F.multiple,ne,!1):F.defaultValue!=null&&Le(s,!!F.multiple,F.defaultValue,!0);break;default:typeof K.onClick=="function"&&(s.onclick=Rs)}switch(P){case"button":case"input":case"select":case"textarea":F=!!F.autoFocus;break e;case"img":F=!0;break e;default:F=!1}}F&&(h.flags|=4)}h.ref!==null&&(h.flags|=512,h.flags|=2097152)}return Oo(h),null;case 6:if(s&&h.stateNode!=null)Vm(s,h,s.memoizedProps,F);else{if(typeof F!="string"&&h.stateNode===null)throw Error(r(166));if(P=ii(Cn.current),ii(Or.current),Rn(h)){if(F=h.stateNode,P=h.memoizedProps,F[Ao]=h,(ne=F.nodeValue!==P)&&(s=nt,s!==null))switch(s.tag){case 3:Bu(F.nodeValue,P,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&Bu(F.nodeValue,P,(s.mode&1)!==0)}ne&&(h.flags|=4)}else F=(P.nodeType===9?P:P.ownerDocument).createTextNode(F),F[Ao]=h,h.stateNode=F}return Oo(h),null;case 13:if(Yr(un),F=h.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(ot&&Ue!==null&&(h.mode&1)!==0&&(h.flags&128)===0)fr(),Tt(),h.flags|=98560,ne=!1;else if(ne=Rn(h),F!==null&&F.dehydrated!==null){if(s===null){if(!ne)throw Error(r(318));if(ne=h.memoizedState,ne=ne!==null?ne.dehydrated:null,!ne)throw Error(r(317));ne[Ao]=h}else Tt(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Oo(h),ne=!1}else ut!==null&&($0(ut),ut=null),ne=!0;if(!ne)return h.flags&65536?h:null}return(h.flags&128)!==0?(h.lanes=P,h):(F=F!==null,F!==(s!==null&&s.memoizedState!==null)&&F&&(h.child.flags|=8192,(h.mode&1)!==0&&(s===null||(un.current&1)!==0?La===0&&(La=3):X0())),h.updateQueue!==null&&(h.flags|=4),Oo(h),null);case 4:return ln(),I0(s,h),s===null&&Ts(h.stateNode.containerInfo),Oo(h),null;case 10:return wn(h.type._context),Oo(h),null;case 17:return da(h.type)&&lu(),Oo(h),null;case 19:if(Yr(un),ne=h.memoizedState,ne===null)return Oo(h),null;if(F=(h.flags&128)!==0,ge=ne.rendering,ge===null)if(F)Wh(ne,!1);else{if(La!==0||s!==null&&(s.flags&128)!==0)for(s=h.child;s!==null;){if(ge=io(s),ge!==null){for(h.flags|=128,Wh(ne,!1),F=ge.updateQueue,F!==null&&(h.updateQueue=F,h.flags|=4),h.subtreeFlags=0,F=P,P=h.child;P!==null;)ne=P,s=F,ne.flags&=14680066,ge=ne.alternate,ge===null?(ne.childLanes=0,ne.lanes=s,ne.child=null,ne.subtreeFlags=0,ne.memoizedProps=null,ne.memoizedState=null,ne.updateQueue=null,ne.dependencies=null,ne.stateNode=null):(ne.childLanes=ge.childLanes,ne.lanes=ge.lanes,ne.child=ge.child,ne.subtreeFlags=0,ne.deletions=null,ne.memoizedProps=ge.memoizedProps,ne.memoizedState=ge.memoizedState,ne.updateQueue=ge.updateQueue,ne.type=ge.type,s=ge.dependencies,ne.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),P=P.sibling;return tn(un,un.current&1|2),h.child}s=s.sibling}ne.tail!==null&&bn()>uh&&(h.flags|=128,F=!0,Wh(ne,!1),h.lanes=4194304)}else{if(!F)if(s=io(ge),s!==null){if(h.flags|=128,F=!0,P=s.updateQueue,P!==null&&(h.updateQueue=P,h.flags|=4),Wh(ne,!0),ne.tail===null&&ne.tailMode==="hidden"&&!ge.alternate&&!ot)return Oo(h),null}else 2*bn()-ne.renderingStartTime>uh&&P!==1073741824&&(h.flags|=128,F=!0,Wh(ne,!1),h.lanes=4194304);ne.isBackwards?(ge.sibling=h.child,h.child=ge):(P=ne.last,P!==null?P.sibling=ge:h.child=ge,ne.last=ge)}return ne.tail!==null?(h=ne.tail,ne.rendering=h,ne.tail=h.sibling,ne.renderingStartTime=bn(),h.sibling=null,P=un.current,tn(un,F?P&1|2:P&1),h):(Oo(h),null);case 22:case 23:return Y0(),F=h.memoizedState!==null,s!==null&&s.memoizedState!==null!==F&&(h.flags|=8192),F&&(h.mode&1)!==0?(js&1073741824)!==0&&(Oo(h),h.subtreeFlags&6&&(h.flags|=8192)):Oo(h),null;case 24:return null;case 25:return null}throw Error(r(156,h.tag))}function R7(s,h){switch(Ye(h),h.tag){case 1:return da(h.type)&&lu(),s=h.flags,s&65536?(h.flags=s&-65537|128,h):null;case 3:return ln(),Yr(ha),Yr(Mi),va(),s=h.flags,(s&65536)!==0&&(s&128)===0?(h.flags=s&-65537|128,h):null;case 5:return Is(h),null;case 13:if(Yr(un),s=h.memoizedState,s!==null&&s.dehydrated!==null){if(h.alternate===null)throw Error(r(340));Tt()}return s=h.flags,s&65536?(h.flags=s&-65537|128,h):null;case 19:return Yr(un),null;case 4:return ln(),null;case 10:return wn(h.type._context),null;case 22:case 23:return Y0(),null;case 24:return null;default:return null}}var jp=!1,Co=!1,M7=typeof WeakSet=="function"?WeakSet:Set,zt=null;function sh(s,h){var P=s.ref;if(P!==null)if(typeof P=="function")try{P(null)}catch(F){ji(s,h,F)}else P.current=null}function F0(s,h,P){try{P()}catch(F){ji(s,h,F)}}var Gm=!1;function I7(s,h){if(zu=Xl,s=ui(),yl(s)){if("selectionStart"in s)var P={start:s.selectionStart,end:s.selectionEnd};else e:{P=(P=s.ownerDocument)&&P.defaultView||window;var F=P.getSelection&&P.getSelection();if(F&&F.rangeCount!==0){P=F.anchorNode;var K=F.anchorOffset,ne=F.focusNode;F=F.focusOffset;try{P.nodeType,ne.nodeType}catch{P=null;break e}var ge=0,Ie=-1,Be=-1,tt=0,gt=0,mt=s,dt=null;t:for(;;){for(var Ft;mt!==P||K!==0&&mt.nodeType!==3||(Ie=ge+K),mt!==ne||F!==0&&mt.nodeType!==3||(Be=ge+F),mt.nodeType===3&&(ge+=mt.nodeValue.length),(Ft=mt.firstChild)!==null;)dt=mt,mt=Ft;for(;;){if(mt===s)break t;if(dt===P&&++tt===K&&(Ie=ge),dt===ne&&++gt===F&&(Be=ge),(Ft=mt.nextSibling)!==null)break;mt=dt,dt=mt.parentNode}mt=Ft}P=Ie===-1||Be===-1?null:{start:Ie,end:Be}}else P=null}P=P||{start:0,end:0}}else P=null;for(Al={focusedElem:s,selectionRange:P},Xl=!1,zt=h;zt!==null;)if(h=zt,s=h.child,(h.subtreeFlags&1028)!==0&&s!==null)s.return=h,zt=s;else for(;zt!==null;){h=zt;try{var Ht=h.alternate;if((h.flags&1024)!==0)switch(h.tag){case 0:case 11:case 15:break;case 1:if(Ht!==null){var Gt=Ht.memoizedProps,ta=Ht.memoizedState,Qe=h.stateNode,Ve=Qe.getSnapshotBeforeUpdate(h.elementType===h.type?Gt:Na(h.type,Gt),ta);Qe.__reactInternalSnapshotBeforeUpdate=Ve}break;case 3:var Je=h.stateNode.containerInfo;Je.nodeType===1?Je.textContent="":Je.nodeType===9&&Je.documentElement&&Je.removeChild(Je.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(wt){ji(h,h.return,wt)}if(s=h.sibling,s!==null){s.return=h.return,zt=s;break}zt=h.return}return Ht=Gm,Gm=!1,Ht}function Yh(s,h,P){var F=h.updateQueue;if(F=F!==null?F.lastEffect:null,F!==null){var K=F=F.next;do{if((K.tag&s)===s){var ne=K.destroy;K.destroy=void 0,ne!==void 0&&F0(h,P,ne)}K=K.next}while(K!==F)}}function Dp(s,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var P=h=h.next;do{if((P.tag&s)===s){var F=P.create;P.destroy=F()}P=P.next}while(P!==h)}}function j0(s){var h=s.ref;if(h!==null){var P=s.stateNode;switch(s.tag){case 5:s=P;break;default:s=P}typeof h=="function"?h(s):h.current=s}}function $m(s){var h=s.alternate;h!==null&&(s.alternate=null,$m(h)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(h=s.stateNode,h!==null&&(delete h[Ao],delete h[ou],delete h[Ca],delete h[Jf],delete h[eh])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function Wm(s){return s.tag===5||s.tag===3||s.tag===4}function Ym(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Wm(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function D0(s,h,P){var F=s.tag;if(F===5||F===6)s=s.stateNode,h?P.nodeType===8?P.parentNode.insertBefore(s,h):P.insertBefore(s,h):(P.nodeType===8?(h=P.parentNode,h.insertBefore(s,P)):(h=P,h.appendChild(s)),P=P._reactRootContainer,P!=null||h.onclick!==null||(h.onclick=Rs));else if(F!==4&&(s=s.child,s!==null))for(D0(s,h,P),s=s.sibling;s!==null;)D0(s,h,P),s=s.sibling}function B0(s,h,P){var F=s.tag;if(F===5||F===6)s=s.stateNode,h?P.insertBefore(s,h):P.appendChild(s);else if(F!==4&&(s=s.child,s!==null))for(B0(s,h,P),s=s.sibling;s!==null;)B0(s,h,P),s=s.sibling}var co=null,Ll=!1;function Rc(s,h,P){for(P=P.child;P!==null;)Xm(s,h,P),P=P.sibling}function Xm(s,h,P){if(oi&&typeof oi.onCommitFiberUnmount=="function")try{oi.onCommitFiberUnmount(po,P)}catch{}switch(P.tag){case 5:Co||sh(P,h);case 6:var F=co,K=Ll;co=null,Rc(s,h,P),co=F,Ll=K,co!==null&&(Ll?(s=co,P=P.stateNode,s.nodeType===8?s.parentNode.removeChild(P):s.removeChild(P)):co.removeChild(P.stateNode));break;case 18:co!==null&&(Ll?(s=co,P=P.stateNode,s.nodeType===8?Sc(s.parentNode,P):s.nodeType===1&&Sc(s,P),mi(s)):Sc(co,P.stateNode));break;case 4:F=co,K=Ll,co=P.stateNode.containerInfo,Ll=!0,Rc(s,h,P),co=F,Ll=K;break;case 0:case 11:case 14:case 15:if(!Co&&(F=P.updateQueue,F!==null&&(F=F.lastEffect,F!==null))){K=F=F.next;do{var ne=K,ge=ne.destroy;ne=ne.tag,ge!==void 0&&((ne&2)!==0||(ne&4)!==0)&&F0(P,h,ge),K=K.next}while(K!==F)}Rc(s,h,P);break;case 1:if(!Co&&(sh(P,h),F=P.stateNode,typeof F.componentWillUnmount=="function"))try{F.props=P.memoizedProps,F.state=P.memoizedState,F.componentWillUnmount()}catch(Ie){ji(P,h,Ie)}Rc(s,h,P);break;case 21:Rc(s,h,P);break;case 22:P.mode&1?(Co=(F=Co)||P.memoizedState!==null,Rc(s,h,P),Co=F):Rc(s,h,P);break;default:Rc(s,h,P)}}function Km(s){var h=s.updateQueue;if(h!==null){s.updateQueue=null;var P=s.stateNode;P===null&&(P=s.stateNode=new M7),h.forEach(function(F){var K=V7.bind(null,s,F);P.has(F)||(P.add(F),F.then(K,K))})}}function Tl(s,h){var P=h.deletions;if(P!==null)for(var F=0;F<P.length;F++){var K=P[F];try{var ne=s,ge=h,Ie=ge;e:for(;Ie!==null;){switch(Ie.tag){case 5:co=Ie.stateNode,Ll=!1;break e;case 3:co=Ie.stateNode.containerInfo,Ll=!0;break e;case 4:co=Ie.stateNode.containerInfo,Ll=!0;break e}Ie=Ie.return}if(co===null)throw Error(r(160));Xm(ne,ge,K),co=null,Ll=!1;var Be=K.alternate;Be!==null&&(Be.return=null),K.return=null}catch(tt){ji(K,h,tt)}}if(h.subtreeFlags&12854)for(h=h.child;h!==null;)Zm(h,s),h=h.sibling}function Zm(s,h){var P=s.alternate,F=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Tl(h,s),gu(s),F&4){try{Yh(3,s,s.return),Dp(3,s)}catch(Gt){ji(s,s.return,Gt)}try{Yh(5,s,s.return)}catch(Gt){ji(s,s.return,Gt)}}break;case 1:Tl(h,s),gu(s),F&512&&P!==null&&sh(P,P.return);break;case 5:if(Tl(h,s),gu(s),F&512&&P!==null&&sh(P,P.return),s.flags&32){var K=s.stateNode;try{ht(K,"")}catch(Gt){ji(s,s.return,Gt)}}if(F&4&&(K=s.stateNode,K!=null)){var ne=s.memoizedProps,ge=P!==null?P.memoizedProps:ne,Ie=s.type,Be=s.updateQueue;if(s.updateQueue=null,Be!==null)try{Ie==="input"&&ne.type==="radio"&&ne.name!=null&&Te(K,ne),ze(Ie,ge);var tt=ze(Ie,ne);for(ge=0;ge<Be.length;ge+=2){var gt=Be[ge],mt=Be[ge+1];gt==="style"?Pt(K,mt):gt==="dangerouslySetInnerHTML"?bt(K,mt):gt==="children"?ht(K,mt):w(K,gt,mt,tt)}switch(Ie){case"input":Ae(K,ne);break;case"textarea":je(K,ne);break;case"select":var dt=K._wrapperState.wasMultiple;K._wrapperState.wasMultiple=!!ne.multiple;var Ft=ne.value;Ft!=null?Le(K,!!ne.multiple,Ft,!1):dt!==!!ne.multiple&&(ne.defaultValue!=null?Le(K,!!ne.multiple,ne.defaultValue,!0):Le(K,!!ne.multiple,ne.multiple?[]:"",!1))}K[ou]=ne}catch(Gt){ji(s,s.return,Gt)}}break;case 6:if(Tl(h,s),gu(s),F&4){if(s.stateNode===null)throw Error(r(162));K=s.stateNode,ne=s.memoizedProps;try{K.nodeValue=ne}catch(Gt){ji(s,s.return,Gt)}}break;case 3:if(Tl(h,s),gu(s),F&4&&P!==null&&P.memoizedState.isDehydrated)try{mi(h.containerInfo)}catch(Gt){ji(s,s.return,Gt)}break;case 4:Tl(h,s),gu(s);break;case 13:Tl(h,s),gu(s),K=s.child,K.flags&8192&&(ne=K.memoizedState!==null,K.stateNode.isHidden=ne,!ne||K.alternate!==null&&K.alternate.memoizedState!==null||(q0=bn())),F&4&&Km(s);break;case 22:if(gt=P!==null&&P.memoizedState!==null,s.mode&1?(Co=(tt=Co)||gt,Tl(h,s),Co=tt):Tl(h,s),gu(s),F&8192){if(tt=s.memoizedState!==null,(s.stateNode.isHidden=tt)&&!gt&&(s.mode&1)!==0)for(zt=s,gt=s.child;gt!==null;){for(mt=zt=gt;zt!==null;){switch(dt=zt,Ft=dt.child,dt.tag){case 0:case 11:case 14:case 15:Yh(4,dt,dt.return);break;case 1:sh(dt,dt.return);var Ht=dt.stateNode;if(typeof Ht.componentWillUnmount=="function"){F=dt,P=dt.return;try{h=F,Ht.props=h.memoizedProps,Ht.state=h.memoizedState,Ht.componentWillUnmount()}catch(Gt){ji(F,P,Gt)}}break;case 5:sh(dt,dt.return);break;case 22:if(dt.memoizedState!==null){ey(mt);continue}}Ft!==null?(Ft.return=dt,zt=Ft):ey(mt)}gt=gt.sibling}e:for(gt=null,mt=s;;){if(mt.tag===5){if(gt===null){gt=mt;try{K=mt.stateNode,tt?(ne=K.style,typeof ne.setProperty=="function"?ne.setProperty("display","none","important"):ne.display="none"):(Ie=mt.stateNode,Be=mt.memoizedProps.style,ge=Be!=null&&Be.hasOwnProperty("display")?Be.display:null,Ie.style.display=cr("display",ge))}catch(Gt){ji(s,s.return,Gt)}}}else if(mt.tag===6){if(gt===null)try{mt.stateNode.nodeValue=tt?"":mt.memoizedProps}catch(Gt){ji(s,s.return,Gt)}}else if((mt.tag!==22&&mt.tag!==23||mt.memoizedState===null||mt===s)&&mt.child!==null){mt.child.return=mt,mt=mt.child;continue}if(mt===s)break e;for(;mt.sibling===null;){if(mt.return===null||mt.return===s)break e;gt===mt&&(gt=null),mt=mt.return}gt===mt&&(gt=null),mt.sibling.return=mt.return,mt=mt.sibling}}break;case 19:Tl(h,s),gu(s),F&4&&Km(s);break;case 21:break;default:Tl(h,s),gu(s)}}function gu(s){var h=s.flags;if(h&2){try{e:{for(var P=s.return;P!==null;){if(Wm(P)){var F=P;break e}P=P.return}throw Error(r(160))}switch(F.tag){case 5:var K=F.stateNode;F.flags&32&&(ht(K,""),F.flags&=-33);var ne=Ym(s);B0(s,ne,K);break;case 3:case 4:var ge=F.stateNode.containerInfo,Ie=Ym(s);D0(s,Ie,ge);break;default:throw Error(r(161))}}catch(Be){ji(s,s.return,Be)}s.flags&=-3}h&4096&&(s.flags&=-4097)}function F7(s,h,P){zt=s,Qm(s)}function Qm(s,h,P){for(var F=(s.mode&1)!==0;zt!==null;){var K=zt,ne=K.child;if(K.tag===22&&F){var ge=K.memoizedState!==null||jp;if(!ge){var Ie=K.alternate,Be=Ie!==null&&Ie.memoizedState!==null||Co;Ie=jp;var tt=Co;if(jp=ge,(Co=Be)&&!tt)for(zt=K;zt!==null;)ge=zt,Be=ge.child,ge.tag===22&&ge.memoizedState!==null?ty(K):Be!==null?(Be.return=ge,zt=Be):ty(K);for(;ne!==null;)zt=ne,Qm(ne),ne=ne.sibling;zt=K,jp=Ie,Co=tt}Jm(s)}else(K.subtreeFlags&8772)!==0&&ne!==null?(ne.return=K,zt=ne):Jm(s)}}function Jm(s){for(;zt!==null;){var h=zt;if((h.flags&8772)!==0){var P=h.alternate;try{if((h.flags&8772)!==0)switch(h.tag){case 0:case 11:case 15:Co||Dp(5,h);break;case 1:var F=h.stateNode;if(h.flags&4&&!Co)if(P===null)F.componentDidMount();else{var K=h.elementType===h.type?P.memoizedProps:Na(h.type,P.memoizedProps);F.componentDidUpdate(K,P.memoizedState,F.__reactInternalSnapshotBeforeUpdate)}var ne=h.updateQueue;ne!==null&&zr(h,ne,F);break;case 3:var ge=h.updateQueue;if(ge!==null){if(P=null,h.child!==null)switch(h.child.tag){case 5:P=h.child.stateNode;break;case 1:P=h.child.stateNode}zr(h,ge,P)}break;case 5:var Ie=h.stateNode;if(P===null&&h.flags&4){P=Ie;var Be=h.memoizedProps;switch(h.type){case"button":case"input":case"select":case"textarea":Be.autoFocus&&P.focus();break;case"img":Be.src&&(P.src=Be.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(h.memoizedState===null){var tt=h.alternate;if(tt!==null){var gt=tt.memoizedState;if(gt!==null){var mt=gt.dehydrated;mt!==null&&mi(mt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Co||h.flags&512&&j0(h)}catch(dt){ji(h,h.return,dt)}}if(h===s){zt=null;break}if(P=h.sibling,P!==null){P.return=h.return,zt=P;break}zt=h.return}}function ey(s){for(;zt!==null;){var h=zt;if(h===s){zt=null;break}var P=h.sibling;if(P!==null){P.return=h.return,zt=P;break}zt=h.return}}function ty(s){for(;zt!==null;){var h=zt;try{switch(h.tag){case 0:case 11:case 15:var P=h.return;try{Dp(4,h)}catch(Be){ji(h,P,Be)}break;case 1:var F=h.stateNode;if(typeof F.componentDidMount=="function"){var K=h.return;try{F.componentDidMount()}catch(Be){ji(h,K,Be)}}var ne=h.return;try{j0(h)}catch(Be){ji(h,ne,Be)}break;case 5:var ge=h.return;try{j0(h)}catch(Be){ji(h,ge,Be)}}}catch(Be){ji(h,h.return,Be)}if(h===s){zt=null;break}var Ie=h.sibling;if(Ie!==null){Ie.return=h.return,zt=Ie;break}zt=h.return}}var j7=Math.ceil,Bp=_.ReactCurrentDispatcher,z0=_.ReactCurrentOwner,al=_.ReactCurrentBatchConfig,nn=0,Va=null,ya=null,fo=0,js=0,lh=Po(0),La=0,Xh=null,mf=0,zp=0,U0=0,Kh=null,gs=null,q0=0,uh=1/0,$u=null,Up=!1,H0=null,Mc=null,qp=!1,Ic=null,Hp=0,Zh=0,V0=null,Vp=-1,Gp=0;function Wo(){return(nn&6)!==0?bn():Vp!==-1?Vp:Vp=bn()}function Fc(s){return(s.mode&1)===0?1:(nn&2)!==0&&fo!==0?fo&-fo:Mn.transition!==null?(Gp===0&&(Gp=Ru()),Gp):(s=Ar,s!==0||(s=window.event,s=s===void 0?16:dl(s.type)),s)}function Rl(s,h,P,F){if(50<Zh)throw Zh=0,V0=null,Error(r(185));hl(s,P,F),((nn&2)===0||s!==Va)&&(s===Va&&((nn&2)===0&&(zp|=P),La===4&&jc(s,fo)),vs(s,F),P===1&&nn===0&&(h.mode&1)===0&&(uh=bn()+500,kl&&ie()))}function vs(s,h){var P=s.callbackNode;qn(s,h);var F=Vi(s,s===Va?fo:0);if(F===0)P!==null&&Ko(P),s.callbackNode=null,s.callbackPriority=0;else if(h=F&-F,s.callbackPriority!==h){if(P!=null&&Ko(P),h===1)s.tag===0?te(ny.bind(null,s)):B(ny.bind(null,s)),Zf(function(){(nn&6)===0&&ie()}),P=null;else{switch(go(F)){case 1:P=Zo;break;case 4:P=Sa;break;case 16:P=Qo;break;case 536870912:P=$s;break;default:P=Qo}P=fy(P,ry.bind(null,s))}s.callbackPriority=h,s.callbackNode=P}}function ry(s,h){if(Vp=-1,Gp=0,(nn&6)!==0)throw Error(r(327));var P=s.callbackNode;if(ch()&&s.callbackNode!==P)return null;var F=Vi(s,s===Va?fo:0);if(F===0)return null;if((F&30)!==0||(F&s.expiredLanes)!==0||h)h=$p(s,F);else{h=F;var K=nn;nn|=2;var ne=ay();(Va!==s||fo!==h)&&($u=null,uh=bn()+500,bf(s,h));do try{z7();break}catch(Ie){iy(s,Ie)}while(!0);Dr(),Bp.current=ne,nn=K,ya!==null?h=0:(Va=null,fo=0,h=La)}if(h!==0){if(h===2&&(K=es(s),K!==0&&(F=K,h=G0(s,K))),h===1)throw P=Xh,bf(s,0),jc(s,F),vs(s,bn()),P;if(h===6)jc(s,F);else{if(K=s.current.alternate,(F&30)===0&&!D7(K)&&(h=$p(s,F),h===2&&(ne=es(s),ne!==0&&(F=ne,h=G0(s,ne))),h===1))throw P=Xh,bf(s,0),jc(s,F),vs(s,bn()),P;switch(s.finishedWork=K,s.finishedLanes=F,h){case 0:case 1:throw Error(r(345));case 2:wf(s,gs,$u);break;case 3:if(jc(s,F),(F&130023424)===F&&(h=q0+500-bn(),10<h)){if(Vi(s,0)!==0)break;if(K=s.suspendedLanes,(K&F)!==F){Wo(),s.pingedLanes|=s.suspendedLanes&K;break}s.timeoutHandle=no(wf.bind(null,s,gs,$u),h);break}wf(s,gs,$u);break;case 4:if(jc(s,F),(F&4194240)===F)break;for(h=s.eventTimes,K=-1;0<F;){var ge=31-mr(F);ne=1<<ge,ge=h[ge],ge>K&&(K=ge),F&=~ne}if(F=K,F=bn()-F,F=(120>F?120:480>F?480:1080>F?1080:1920>F?1920:3e3>F?3e3:4320>F?4320:1960*j7(F/1960))-F,10<F){s.timeoutHandle=no(wf.bind(null,s,gs,$u),F);break}wf(s,gs,$u);break;case 5:wf(s,gs,$u);break;default:throw Error(r(329))}}}return vs(s,bn()),s.callbackNode===P?ry.bind(null,s):null}function G0(s,h){var P=Kh;return s.current.memoizedState.isDehydrated&&(bf(s,h).flags|=256),s=$p(s,h),s!==2&&(h=gs,gs=P,h!==null&&$0(h)),s}function $0(s){gs===null?gs=s:gs.push.apply(gs,s)}function D7(s){for(var h=s;;){if(h.flags&16384){var P=h.updateQueue;if(P!==null&&(P=P.stores,P!==null))for(var F=0;F<P.length;F++){var K=P[F],ne=K.getSnapshot;K=K.value;try{if(!Gn(ne(),K))return!1}catch{return!1}}}if(P=h.child,h.subtreeFlags&16384&&P!==null)P.return=h,h=P;else{if(h===s)break;for(;h.sibling===null;){if(h.return===null||h.return===s)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function jc(s,h){for(h&=~U0,h&=~zp,s.suspendedLanes|=h,s.pingedLanes&=~h,s=s.expirationTimes;0<h;){var P=31-mr(h),F=1<<P;s[P]=-1,h&=~F}}function ny(s){if((nn&6)!==0)throw Error(r(327));ch();var h=Vi(s,0);if((h&1)===0)return vs(s,bn()),null;var P=$p(s,h);if(s.tag!==0&&P===2){var F=es(s);F!==0&&(h=F,P=G0(s,F))}if(P===1)throw P=Xh,bf(s,0),jc(s,h),vs(s,bn()),P;if(P===6)throw Error(r(345));return s.finishedWork=s.current.alternate,s.finishedLanes=h,wf(s,gs,$u),vs(s,bn()),null}function W0(s,h){var P=nn;nn|=1;try{return s(h)}finally{nn=P,nn===0&&(uh=bn()+500,kl&&ie())}}function yf(s){Ic!==null&&Ic.tag===0&&(nn&6)===0&&ch();var h=nn;nn|=1;var P=al.transition,F=Ar;try{if(al.transition=null,Ar=1,s)return s()}finally{Ar=F,al.transition=P,nn=h,(nn&6)===0&&ie()}}function Y0(){js=lh.current,Yr(lh)}function bf(s,h){s.finishedWork=null,s.finishedLanes=0;var P=s.timeoutHandle;if(P!==-1&&(s.timeoutHandle=-1,xc(P)),ya!==null)for(P=ya.return;P!==null;){var F=P;switch(Ye(F),F.tag){case 1:F=F.type.childContextTypes,F!=null&&lu();break;case 3:ln(),Yr(ha),Yr(Mi),va();break;case 5:Is(F);break;case 4:ln();break;case 13:Yr(un);break;case 19:Yr(un);break;case 10:wn(F.type._context);break;case 22:case 23:Y0()}P=P.return}if(Va=s,ya=s=Dc(s.current,null),fo=js=h,La=0,Xh=null,U0=zp=mf=0,gs=Kh=null,Xr!==null){for(h=0;h<Xr.length;h++)if(P=Xr[h],F=P.interleaved,F!==null){P.interleaved=null;var K=F.next,ne=P.pending;if(ne!==null){var ge=ne.next;ne.next=K,F.next=ge}P.pending=F}Xr=null}return s}function iy(s,h){do{var P=ya;try{if(Dr(),cu.current=Cc,ao){for(var F=rn.memoizedState;F!==null;){var K=F.queue;K!==null&&(K.pending=null),F=F.next}ao=!1}if(Fi=0,jn=Fn=rn=null,ko=!1,oo=0,z0.current=null,P===null||P.return===null){La=1,Xh=h,ya=null;break}e:{var ne=s,ge=P.return,Ie=P,Be=h;if(h=fo,Ie.flags|=32768,Be!==null&&typeof Be=="object"&&typeof Be.then=="function"){var tt=Be,gt=Ie,mt=gt.tag;if((gt.mode&1)===0&&(mt===0||mt===11||mt===15)){var dt=gt.alternate;dt?(gt.updateQueue=dt.updateQueue,gt.memoizedState=dt.memoizedState,gt.lanes=dt.lanes):(gt.updateQueue=null,gt.memoizedState=null)}var Ft=I(ge);if(Ft!==null){Ft.flags&=-257,$(Ft,ge,Ie,ne,h),Ft.mode&1&&m(ne,tt,h),h=Ft,Be=tt;var Ht=h.updateQueue;if(Ht===null){var Gt=new Set;Gt.add(Be),h.updateQueue=Gt}else Ht.add(Be);break e}else{if((h&1)===0){m(ne,tt,h),X0();break e}Be=Error(r(426))}}else if(ot&&Ie.mode&1){var ta=I(ge);if(ta!==null){(ta.flags&65536)===0&&(ta.flags|=256),$(ta,ge,Ie,ne,h),_t(Gu(Be,Ie));break e}}ne=Be=Gu(Be,Ie),La!==4&&(La=2),Kh===null?Kh=[ne]:Kh.push(ne),ne=ge;do{switch(ne.tag){case 3:ne.flags|=65536,h&=-h,ne.lanes|=h;var Qe=Fp(ne,Be,h);Kr(ne,Qe);break e;case 1:Ie=Be;var Ve=ne.type,Je=ne.stateNode;if((ne.flags&128)===0&&(typeof Ve.getDerivedStateFromError=="function"||Je!==null&&typeof Je.componentDidCatch=="function"&&(Mc===null||!Mc.has(Je)))){ne.flags|=65536,h&=-h,ne.lanes|=h;var wt=p(ne,Ie,h);Kr(ne,wt);break e}}ne=ne.return}while(ne!==null)}sy(P)}catch(Wt){h=Wt,ya===P&&P!==null&&(ya=P=P.return);continue}break}while(!0)}function ay(){var s=Bp.current;return Bp.current=Cc,s===null?Cc:s}function X0(){(La===0||La===3||La===2)&&(La=4),Va===null||(mf&268435455)===0&&(zp&268435455)===0||jc(Va,fo)}function $p(s,h){var P=nn;nn|=2;var F=ay();(Va!==s||fo!==h)&&($u=null,bf(s,h));do try{B7();break}catch(K){iy(s,K)}while(!0);if(Dr(),nn=P,Bp.current=F,ya!==null)throw Error(r(261));return Va=null,fo=0,La}function B7(){for(;ya!==null;)oy(ya)}function z7(){for(;ya!==null&&!Vl();)oy(ya)}function oy(s){var h=cy(s.alternate,s,js);s.memoizedProps=s.pendingProps,h===null?sy(s):ya=h,z0.current=null}function sy(s){var h=s;do{var P=h.alternate;if(s=h.return,(h.flags&32768)===0){if(P=T7(P,h,js),P!==null){ya=P;return}}else{if(P=R7(P,h),P!==null){P.flags&=32767,ya=P;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{La=6,ya=null;return}}if(h=h.sibling,h!==null){ya=h;return}ya=h=s}while(h!==null);La===0&&(La=5)}function wf(s,h,P){var F=Ar,K=al.transition;try{al.transition=null,Ar=1,U7(s,h,P,F)}finally{al.transition=K,Ar=F}return null}function U7(s,h,P,F){do ch();while(Ic!==null);if((nn&6)!==0)throw Error(r(327));P=s.finishedWork;var K=s.finishedLanes;if(P===null)return null;if(s.finishedWork=null,s.finishedLanes=0,P===s.current)throw Error(r(177));s.callbackNode=null,s.callbackPriority=0;var ne=P.lanes|P.childLanes;if(ts(s,ne),s===Va&&(ya=Va=null,fo=0),(P.subtreeFlags&2064)===0&&(P.flags&2064)===0||qp||(qp=!0,fy(Qo,function(){return ch(),null})),ne=(P.flags&15990)!==0,(P.subtreeFlags&15990)!==0||ne){ne=al.transition,al.transition=null;var ge=Ar;Ar=1;var Ie=nn;nn|=4,z0.current=null,I7(s,P),Zm(P,s),Jl(Al),Xl=!!zu,Al=zu=null,s.current=P,F7(P),cf(),nn=Ie,Ar=ge,al.transition=ne}else s.current=P;if(qp&&(qp=!1,Ic=s,Hp=K),ne=s.pendingLanes,ne===0&&(Mc=null),an(P.stateNode),vs(s,bn()),h!==null)for(F=s.onRecoverableError,P=0;P<h.length;P++)K=h[P],F(K.value,{componentStack:K.stack,digest:K.digest});if(Up)throw Up=!1,s=H0,H0=null,s;return(Hp&1)!==0&&s.tag!==0&&ch(),ne=s.pendingLanes,(ne&1)!==0?s===V0?Zh++:(Zh=0,V0=s):Zh=0,ie(),null}function ch(){if(Ic!==null){var s=go(Hp),h=al.transition,P=Ar;try{if(al.transition=null,Ar=16>s?16:s,Ic===null)var F=!1;else{if(s=Ic,Ic=null,Hp=0,(nn&6)!==0)throw Error(r(331));var K=nn;for(nn|=4,zt=s.current;zt!==null;){var ne=zt,ge=ne.child;if((zt.flags&16)!==0){var Ie=ne.deletions;if(Ie!==null){for(var Be=0;Be<Ie.length;Be++){var tt=Ie[Be];for(zt=tt;zt!==null;){var gt=zt;switch(gt.tag){case 0:case 11:case 15:Yh(8,gt,ne)}var mt=gt.child;if(mt!==null)mt.return=gt,zt=mt;else for(;zt!==null;){gt=zt;var dt=gt.sibling,Ft=gt.return;if($m(gt),gt===tt){zt=null;break}if(dt!==null){dt.return=Ft,zt=dt;break}zt=Ft}}}var Ht=ne.alternate;if(Ht!==null){var Gt=Ht.child;if(Gt!==null){Ht.child=null;do{var ta=Gt.sibling;Gt.sibling=null,Gt=ta}while(Gt!==null)}}zt=ne}}if((ne.subtreeFlags&2064)!==0&&ge!==null)ge.return=ne,zt=ge;else e:for(;zt!==null;){if(ne=zt,(ne.flags&2048)!==0)switch(ne.tag){case 0:case 11:case 15:Yh(9,ne,ne.return)}var Qe=ne.sibling;if(Qe!==null){Qe.return=ne.return,zt=Qe;break e}zt=ne.return}}var Ve=s.current;for(zt=Ve;zt!==null;){ge=zt;var Je=ge.child;if((ge.subtreeFlags&2064)!==0&&Je!==null)Je.return=ge,zt=Je;else e:for(ge=Ve;zt!==null;){if(Ie=zt,(Ie.flags&2048)!==0)try{switch(Ie.tag){case 0:case 11:case 15:Dp(9,Ie)}}catch(Wt){ji(Ie,Ie.return,Wt)}if(Ie===ge){zt=null;break e}var wt=Ie.sibling;if(wt!==null){wt.return=Ie.return,zt=wt;break e}zt=Ie.return}}if(nn=K,ie(),oi&&typeof oi.onPostCommitFiberRoot=="function")try{oi.onPostCommitFiberRoot(po,s)}catch{}F=!0}return F}finally{Ar=P,al.transition=h}}return!1}function ly(s,h,P){h=Gu(P,h),h=Fp(s,h,1),s=In(s,h,1),h=Wo(),s!==null&&(hl(s,1,h),vs(s,h))}function ji(s,h,P){if(s.tag===3)ly(s,s,P);else for(;h!==null;){if(h.tag===3){ly(h,s,P);break}else if(h.tag===1){var F=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof F.componentDidCatch=="function"&&(Mc===null||!Mc.has(F))){s=Gu(P,s),s=p(h,s,1),h=In(h,s,1),s=Wo(),h!==null&&(hl(h,1,s),vs(h,s));break}}h=h.return}}function q7(s,h,P){var F=s.pingCache;F!==null&&F.delete(h),h=Wo(),s.pingedLanes|=s.suspendedLanes&P,Va===s&&(fo&P)===P&&(La===4||La===3&&(fo&130023424)===fo&&500>bn()-q0?bf(s,0):U0|=P),vs(s,h)}function uy(s,h){h===0&&((s.mode&1)===0?h=1:(h=Hi,Hi<<=1,(Hi&130023424)===0&&(Hi=4194304)));var P=Wo();s=Gr(s,h),s!==null&&(hl(s,h,P),vs(s,P))}function H7(s){var h=s.memoizedState,P=0;h!==null&&(P=h.retryLane),uy(s,P)}function V7(s,h){var P=0;switch(s.tag){case 13:var F=s.stateNode,K=s.memoizedState;K!==null&&(P=K.retryLane);break;case 19:F=s.stateNode;break;default:throw Error(r(314))}F!==null&&F.delete(h),uy(s,P)}var cy;cy=function(s,h,P){if(s!==null)if(s.memoizedProps!==h.pendingProps||ha.current)oe=!0;else{if((s.lanes&P)===0&&(h.flags&128)===0)return oe=!1,M0(s,h,P);oe=(s.flags&131072)!==0}else oe=!1,ot&&(h.flags&1048576)!==0&&Ke(h,we,h.index);switch(h.lanes=0,h.tag){case 2:var F=h.type;Fr(s,h),s=h.pendingProps;var K=Pl(h,Mi.current);_n(h,P),K=nl(null,h,F,s,K,P);var ne=so();return h.flags|=1,typeof K=="object"&&K!==null&&typeof K.render=="function"&&K.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,da(F)?(ne=!0,us(h)):ne=!1,h.memoizedState=K.state!==null&&K.state!==void 0?K.state:null,Ei(h),K.updater=Lc,h.stateNode=K,K._reactInternals=h,ah(h,F,s,P),h=dn(null,h,F,!0,ne,P)):(h.tag=0,ot&&ne&&it(h),Ee(null,h,K,P),h=h.child),h;case 16:F=h.elementType;e:{switch(Fr(s,h),s=h.pendingProps,K=F._init,F=K(F._payload),h.type=F,K=h.tag=$7(F),s=Na(F,s),K){case 0:h=Ot(null,h,F,s,P);break e;case 1:h=Nn(null,h,F,s,P);break e;case 11:h=We(null,h,F,s,P);break e;case 14:h=rt(null,h,F,Na(F.type,s),P);break e}throw Error(r(306,F,""))}return h;case 0:return F=h.type,K=h.pendingProps,K=h.elementType===F?K:Na(F,K),Ot(s,h,F,K,P);case 1:return F=h.type,K=h.pendingProps,K=h.elementType===F?K:Na(F,K),Nn(s,h,F,K,P);case 3:e:{if(uo(h),s===null)throw Error(r(387));F=h.pendingProps,ne=h.memoizedState,K=ne.element,pa(s,h),Ii(h,F,null,P);var ge=h.memoizedState;if(F=ge.element,ne.isDehydrated)if(ne={element:F,isDehydrated:!1,cache:ge.cache,pendingSuspenseBoundaries:ge.pendingSuspenseBoundaries,transitions:ge.transitions},h.updateQueue.baseState=ne,h.memoizedState=ne,h.flags&256){K=Gu(Error(r(423)),h),h=il(s,h,F,P,K);break e}else if(F!==K){K=Gu(Error(r(424)),h),h=il(s,h,F,P,K);break e}else for(Ue=Ki(h.stateNode.containerInfo.firstChild),nt=h,ot=!0,ut=null,P=Ir(h,null,F,P),h.child=P;P;)P.flags=P.flags&-3|4096,P=P.sibling;else{if(Tt(),F===K){h=Ha(s,h,P);break e}Ee(s,h,F,P)}h=h.child}return h;case 5:return uu(h),s===null&&It(h),F=h.type,K=h.pendingProps,ne=s!==null?s.memoizedProps:null,ge=K.children,df(F,K)?ge=null:ne!==null&&df(F,ne)&&(h.flags|=32),pr(s,h),Ee(s,h,ge,P),h.child;case 6:return s===null&&It(h),null;case 13:return at(s,h,P);case 4:return Vo(h,h.stateNode.containerInfo),F=h.pendingProps,s===null?h.child=ni(h,null,F,P):Ee(s,h,F,P),h.child;case 11:return F=h.type,K=h.pendingProps,K=h.elementType===F?K:Na(F,K),We(s,h,F,K,P);case 7:return Ee(s,h,h.pendingProps,P),h.child;case 8:return Ee(s,h,h.pendingProps.children,P),h.child;case 12:return Ee(s,h,h.pendingProps.children,P),h.child;case 10:e:{if(F=h.type._context,K=h.pendingProps,ne=h.memoizedProps,ge=K.value,tn(hi,F._currentValue),F._currentValue=ge,ne!==null)if(Gn(ne.value,ge)){if(ne.children===K.children&&!ha.current){h=Ha(s,h,P);break e}}else for(ne=h.child,ne!==null&&(ne.return=h);ne!==null;){var Ie=ne.dependencies;if(Ie!==null){ge=ne.child;for(var Be=Ie.firstContext;Be!==null;){if(Be.context===F){if(ne.tag===1){Be=Wn(-1,P&-P),Be.tag=2;var tt=ne.updateQueue;if(tt!==null){tt=tt.shared;var gt=tt.pending;gt===null?Be.next=Be:(Be.next=gt.next,gt.next=Be),tt.pending=Be}}ne.lanes|=P,Be=ne.alternate,Be!==null&&(Be.lanes|=P),Br(ne.return,P,h),Ie.lanes|=P;break}Be=Be.next}}else if(ne.tag===10)ge=ne.type===h.type?null:ne.child;else if(ne.tag===18){if(ge=ne.return,ge===null)throw Error(r(341));ge.lanes|=P,Ie=ge.alternate,Ie!==null&&(Ie.lanes|=P),Br(ge,P,h),ge=ne.sibling}else ge=ne.child;if(ge!==null)ge.return=ne;else for(ge=ne;ge!==null;){if(ge===h){ge=null;break}if(ne=ge.sibling,ne!==null){ne.return=ge.return,ge=ne;break}ge=ge.return}ne=ge}Ee(s,h,K.children,P),h=h.child}return h;case 9:return K=h.type,F=h.pendingProps.children,_n(h,P),K=xn(K),F=F(K),h.flags|=1,Ee(s,h,F,P),h.child;case 14:return F=h.type,K=Na(F,h.pendingProps),K=Na(F.type,K),rt(s,h,F,K,P);case 15:return yt(s,h,h.type,h.pendingProps,P);case 17:return F=h.type,K=h.pendingProps,K=h.elementType===F?K:Na(F,K),Fr(s,h),h.tag=1,da(F)?(s=!0,us(h)):s=!1,_n(h,P),Ip(h,F,K),ah(h,F,K,P),dn(null,h,F,!0,s,P);case 19:return ea(s,h,P);case 22:return Bt(s,h,P)}throw Error(r(156,h.tag))};function fy(s,h){return Ps(s,h)}function G7(s,h,P,F){this.tag=s,this.key=P,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=F,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ol(s,h,P,F){return new G7(s,h,P,F)}function K0(s){return s=s.prototype,!(!s||!s.isReactComponent)}function $7(s){if(typeof s=="function")return K0(s)?1:0;if(s!=null){if(s=s.$$typeof,s===C)return 11;if(s===J)return 14}return 2}function Dc(s,h){var P=s.alternate;return P===null?(P=ol(s.tag,h,s.key,s.mode),P.elementType=s.elementType,P.type=s.type,P.stateNode=s.stateNode,P.alternate=s,s.alternate=P):(P.pendingProps=h,P.type=s.type,P.flags=0,P.subtreeFlags=0,P.deletions=null),P.flags=s.flags&14680064,P.childLanes=s.childLanes,P.lanes=s.lanes,P.child=s.child,P.memoizedProps=s.memoizedProps,P.memoizedState=s.memoizedState,P.updateQueue=s.updateQueue,h=s.dependencies,P.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},P.sibling=s.sibling,P.index=s.index,P.ref=s.ref,P}function Wp(s,h,P,F,K,ne){var ge=2;if(F=s,typeof s=="function")K0(s)&&(ge=1);else if(typeof s=="string")ge=5;else e:switch(s){case O:return _f(P.children,K,ne,h);case L:ge=8,K|=8;break;case R:return s=ol(12,P,h,K|2),s.elementType=R,s.lanes=ne,s;case q:return s=ol(13,P,h,K),s.elementType=q,s.lanes=ne,s;case G:return s=ol(19,P,h,K),s.elementType=G,s.lanes=ne,s;case H:return Yp(P,K,ne,h);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case T:ge=10;break e;case k:ge=9;break e;case C:ge=11;break e;case J:ge=14;break e;case ae:ge=16,F=null;break e}throw Error(r(130,s==null?s:typeof s,""))}return h=ol(ge,P,h,K),h.elementType=s,h.type=F,h.lanes=ne,h}function _f(s,h,P,F){return s=ol(7,s,F,h),s.lanes=P,s}function Yp(s,h,P,F){return s=ol(22,s,F,h),s.elementType=H,s.lanes=P,s.stateNode={isHidden:!1},s}function Z0(s,h,P){return s=ol(6,s,null,h),s.lanes=P,s}function Q0(s,h,P){return h=ol(4,s.children!==null?s.children:[],s.key,h),h.lanes=P,h.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},h}function W7(s,h,P,F,K){this.tag=h,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ea(0),this.expirationTimes=Ea(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ea(0),this.identifierPrefix=F,this.onRecoverableError=K,this.mutableSourceEagerHydrationData=null}function J0(s,h,P,F,K,ne,ge,Ie,Be){return s=new W7(s,h,P,Ie,Be),h===1?(h=1,ne===!0&&(h|=8)):h=0,ne=ol(3,null,null,h),s.current=ne,ne.stateNode=s,ne.memoizedState={element:F,isDehydrated:P,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ei(ne),s}function Y7(s,h,P){var F=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:F==null?null:""+F,children:s,containerInfo:h,implementation:P}}function hy(s){if(!s)return ls;s=s._reactInternals;e:{if(Qn(s)!==s||s.tag!==1)throw Error(r(170));var h=s;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(da(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(r(171))}if(s.tag===1){var P=s.type;if(da(P))return qu(s,P,h)}return h}function dy(s,h,P,F,K,ne,ge,Ie,Be){return s=J0(P,F,!0,s,K,ne,ge,Ie,Be),s.context=hy(null),P=s.current,F=Wo(),K=Fc(P),ne=Wn(F,K),ne.callback=h??null,In(P,ne,K),s.current.lanes=K,hl(s,K,F),vs(s,F),s}function Xp(s,h,P,F){var K=h.current,ne=Wo(),ge=Fc(K);return P=hy(P),h.context===null?h.context=P:h.pendingContext=P,h=Wn(ne,ge),h.payload={element:s},F=F===void 0?null:F,F!==null&&(h.callback=F),s=In(K,h,ge),s!==null&&(Rl(s,K,ge,ne),ga(s,K,ge)),ge}function Kp(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function py(s,h){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var P=s.retryLane;s.retryLane=P!==0&&P<h?P:h}}function eg(s,h){py(s,h),(s=s.alternate)&&py(s,h)}function X7(){return null}var gy=typeof reportError=="function"?reportError:function(s){console.error(s)};function tg(s){this._internalRoot=s}Zp.prototype.render=tg.prototype.render=function(s){var h=this._internalRoot;if(h===null)throw Error(r(409));Xp(s,h,null,null)},Zp.prototype.unmount=tg.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var h=s.containerInfo;yf(function(){Xp(null,s,null,null)}),h[Qi]=null}};function Zp(s){this._internalRoot=s}Zp.prototype.unstable_scheduleHydration=function(s){if(s){var h=hc();s={blockedOn:null,target:s,priority:h};for(var P=0;P<vo.length&&h!==0&&h<vo[P].priority;P++);vo.splice(P,0,s),P===0&&Wl(s)}};function rg(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function Qp(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function vy(){}function K7(s,h,P,F,K){if(K){if(typeof F=="function"){var ne=F;F=function(){var tt=Kp(ge);ne.call(tt)}}var ge=dy(h,F,s,0,null,!1,!1,"",vy);return s._reactRootContainer=ge,s[Qi]=ge.current,Ts(s.nodeType===8?s.parentNode:s),yf(),ge}for(;K=s.lastChild;)s.removeChild(K);if(typeof F=="function"){var Ie=F;F=function(){var tt=Kp(Be);Ie.call(tt)}}var Be=J0(s,0,!1,null,null,!1,!1,"",vy);return s._reactRootContainer=Be,s[Qi]=Be.current,Ts(s.nodeType===8?s.parentNode:s),yf(function(){Xp(h,Be,P,F)}),Be}function Jp(s,h,P,F,K){var ne=P._reactRootContainer;if(ne){var ge=ne;if(typeof K=="function"){var Ie=K;K=function(){var Be=Kp(ge);Ie.call(Be)}}Xp(h,ge,s,K)}else ge=K7(P,h,s,K,F);return Kp(ge)}rs=function(s){switch(s.tag){case 3:var h=s.stateNode;if(h.current.memoizedState.isDehydrated){var P=Pn(h.pendingLanes);P!==0&&($l(h,P|1),vs(h,bn()),(nn&6)===0&&(uh=bn()+500,ie()))}break;case 13:yf(function(){var F=Gr(s,1);if(F!==null){var K=Wo();Rl(F,s,1,K)}}),eg(s,1)}},Ys=function(s){if(s.tag===13){var h=Gr(s,134217728);if(h!==null){var P=Wo();Rl(h,s,134217728,P)}eg(s,134217728)}},fc=function(s){if(s.tag===13){var h=Fc(s),P=Gr(s,h);if(P!==null){var F=Wo();Rl(P,s,h,F)}eg(s,h)}},hc=function(){return Ar},Xs=function(s,h){var P=Ar;try{return Ar=s,h()}finally{Ar=P}},er=function(s,h,P){switch(h){case"input":if(Ae(s,P),h=P.name,P.type==="radio"&&h!=null){for(P=s;P.parentNode;)P=P.parentNode;for(P=P.querySelectorAll("input[name="+JSON.stringify(""+h)+'][type="radio"]'),h=0;h<P.length;h++){var F=P[h];if(F!==s&&F.form===s.form){var K=xi(F);if(!K)throw Error(r(90));Re(F),Ae(F,K)}}}break;case"textarea":je(s,P);break;case"select":h=P.value,h!=null&&Le(s,!!P.multiple,h,!1)}},Zn=W0,vi=yf;var Z7={usingClientEntryPoint:!1,Events:[su,ci,xi,lr,Oi,W0]},Qh={findFiberByHostInstance:Ms,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Q7={bundleType:Qh.bundleType,version:Qh.version,rendererPackageName:Qh.rendererPackageName,rendererConfig:Qh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=Ci(s),s===null?null:s.stateNode},findFiberByHostInstance:Qh.findFiberByHostInstance||X7,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 e1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!e1.isDisabled&&e1.supportsFiber)try{po=e1.inject(Q7),oi=e1}catch{}}return ms.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z7,ms.createPortal=function(s,h){var P=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!rg(h))throw Error(r(200));return Y7(s,h,null,P)},ms.createRoot=function(s,h){if(!rg(s))throw Error(r(299));var P=!1,F="",K=gy;return h!=null&&(h.unstable_strictMode===!0&&(P=!0),h.identifierPrefix!==void 0&&(F=h.identifierPrefix),h.onRecoverableError!==void 0&&(K=h.onRecoverableError)),h=J0(s,1,!1,null,null,P,!1,F,K),s[Qi]=h.current,Ts(s.nodeType===8?s.parentNode:s),new tg(h)},ms.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var h=s._reactInternals;if(h===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=Ci(h),s=s===null?null:s.stateNode,s},ms.flushSync=function(s){return yf(s)},ms.hydrate=function(s,h,P){if(!Qp(h))throw Error(r(200));return Jp(null,s,h,!0,P)},ms.hydrateRoot=function(s,h,P){if(!rg(s))throw Error(r(405));var F=P!=null&&P.hydratedSources||null,K=!1,ne="",ge=gy;if(P!=null&&(P.unstable_strictMode===!0&&(K=!0),P.identifierPrefix!==void 0&&(ne=P.identifierPrefix),P.onRecoverableError!==void 0&&(ge=P.onRecoverableError)),h=dy(h,null,s,1,P??null,K,!1,ne,ge),s[Qi]=h.current,Ts(s),F)for(s=0;s<F.length;s++)P=F[s],K=P._getVersion,K=K(P._source),h.mutableSourceEagerHydrationData==null?h.mutableSourceEagerHydrationData=[P,K]:h.mutableSourceEagerHydrationData.push(P,K);return new Zp(h)},ms.render=function(s,h,P){if(!Qp(h))throw Error(r(200));return Jp(null,s,h,!1,P)},ms.unmountComponentAtNode=function(s){if(!Qp(s))throw Error(r(40));return s._reactRootContainer?(yf(function(){Jp(null,null,s,!1,function(){s._reactRootContainer=null,s[Qi]=null})}),!0):!1},ms.unstable_batchedUpdates=W0,ms.unstable_renderSubtreeIntoContainer=function(s,h,P,F){if(!Qp(P))throw Error(r(200));if(s==null||s._reactInternals===void 0)throw Error(r(38));return Jp(s,h,P,!1,F)},ms.version="18.3.1-next-f1338f8080-20240426",ms}var xy;function zw(){if(xy)return ig.exports;xy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ig.exports=n9(),ig.exports}var Sy;function i9(){if(Sy)return t1;Sy=1;var e=zw();return t1.createRoot=e.createRoot,t1.hydrateRoot=e.hydrateRoot,t1}var a9=i9();const Uw=lc(a9);function Cr(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(r.length?" "+r.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var o9={};function n0(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:o9}var qw=Object.assign,I1=Object.getOwnPropertyDescriptor,xu=Object.defineProperty,i0=Object.prototype,bv=[];Object.freeze(bv);var tm={};Object.freeze(tm);var s9=typeof Proxy<"u",l9=Object.toString();function Hw(){s9||Cr("Proxy not available")}function Vw(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var wh=function(){};function Vs(e){return typeof e=="function"}function jf(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function a0(e){return e!==null&&typeof e=="object"}function Qc(e){if(!a0(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===l9}function Gw(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function o0(e,t,r){xu(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function $w(e,t,r){xu(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function af(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return a0(n)&&n[r]===!0}}function jh(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function u9(e){var t=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t),n=Object.getPrototypeOf(r);return n===null}function ec(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Ww=typeof Object.getOwnPropertySymbols<"u";function c9(e){var t=Object.keys(e);if(!Ww)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return i0.propertyIsEnumerable.call(e,n)})):t}var s0=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Ww?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Yw(e){return e===null?null:typeof e=="object"?""+e:e}function nc(e,t){return i0.hasOwnProperty.call(e,t)}var f9=Object.getOwnPropertyDescriptors||function(t){var r={};return s0(t).forEach(function(n){r[n]=I1(t,n)}),r};function Us(e,t){return!!(e&t)}function qs(e,t,r){return r?e|=t:e&=~t,e}function Ey(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function h9(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p9(n.key),n)}}function Dh(e,t,r){return t&&h9(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _h(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=g9(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jc(){return Jc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jc.apply(null,arguments)}function Xw(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,wv(e,t)}function wv(e,t){return wv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},wv(e,t)}function d9(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function p9(e){var t=d9(e,"string");return typeof t=="symbol"?t:t+""}function g9(e,t){if(e){if(typeof e=="string")return Ey(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ey(e,t):void 0}}var yu=Symbol("mobx-stored-annotations");function Su(e){function t(r,n){if(yp(n))return e.decorate_20223_(r,n);mp(r,n,e)}return Object.assign(t,e)}function mp(e,t,r){nc(e,yu)||o0(e,yu,Jc({},e[yu])),x9(r)||(e[yu][t]=r)}function v9(e){return nc(e,yu)||o0(e,yu,Jc({},e[yu])),e[yu]}function yp(e){return typeof e=="object"&&typeof e.kind=="string"}var ur=Symbol("mobx administration"),of=function(){function e(r){r===void 0&&(r="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=fn.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.reportObserved=function(){return h6(this)},t.reportChanged=function(){bs(),d6(this),ws()},t.toString=function(){return this.name_},Dh(e,[{key:"isBeingObserved",get:function(){return Us(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=qs(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Us(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=qs(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Us(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=qs(this.flags_,e.diffValueMask_,n===1)}}])}();of.isBeingObservedMask_=1;of.isPendingUnobservationMask_=2;of.diffValueMask_=4;var rm=af("Atom",of);function F1(e,t,r){t===void 0&&(t=wh),r===void 0&&(r=wh);var n=new of(e);return t!==wh&&Ax(n,t),r!==wh&&_6(n,r),n}function m9(e,t){return D6(e,t)}function y9(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Nh={structural:m9,default:y9};function Df(e,t,r){return P6(e)?e:Array.isArray(e)?$r.array(e,{name:r}):Qc(e)?$r.object(e,void 0,{name:r}):jh(e)?$r.map(e,{name:r}):ec(e)?$r.set(e,{name:r}):typeof e=="function"&&!ap(e)&&!op(e)?Gw(e)?Lh(e):ip(r,e):e}function b9(e,t,r){if(e==null||Ul(e)||Lu(e)||fl(e)||Xo(e))return e;if(Array.isArray(e))return $r.array(e,{name:r,deep:!1});if(Qc(e))return $r.object(e,void 0,{name:r,deep:!1});if(jh(e))return $r.map(e,{name:r,deep:!1});if(ec(e))return $r.set(e,{name:r,deep:!1})}function l0(e){return e}function w9(e,t){return D6(e,t)?t:e}var _9="override";function x9(e){return e.annotationType_===_9}function bp(e,t){return{annotationType_:e,options_:t,make_:S9,extend_:E9,decorate_20223_:A9}}function S9(e,t,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,r,!1)===null?0:1;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if(ap(r.value))return 1;var a=Kw(e,this,t,r,!1);return xu(n,t,a),2}function E9(e,t,r,n){var i=Kw(e,this,t,r);return e.defineProperty_(t,i,n)}function A9(e,t){var r=t.kind,n=t.name,i=t.addInitializer,a=this,l=function(d){var f,v,g,c;return ef((f=(v=a.options_)==null?void 0:v.name)!=null?f:n.toString(),d,(g=(c=a.options_)==null?void 0:c.autoAction)!=null?g:!1)};if(r=="field")return function(u){var d,f=u;return ap(f)||(f=l(f)),(d=a.options_)!=null&&d.bound&&(f=f.bind(this),f.isMobxAction=!0),f};if(r=="method"){var o;return ap(e)||(e=l(e)),(o=this.options_)!=null&&o.bound&&i(function(){var u=this,d=u[n].bind(u);d.isMobxAction=!0,u[n]=d}),e}Cr("Cannot apply '"+a.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
34
- '`+a.annotationType_+"' can only be used on properties with a function value."))}function P9(e,t,r,n){t.annotationType_,n.value}function Kw(e,t,r,n,i){var a,l,o,u,d,f,v;i===void 0&&(i=At.safeDescriptors),P9(e,t,r,n);var g=n.value;if((a=t.options_)!=null&&a.bound){var c;g=g.bind((c=e.proxy_)!=null?c:e.target_)}return{value:ef((l=(o=t.options_)==null?void 0:o.name)!=null?l:r.toString(),g,(u=(d=t.options_)==null?void 0:d.autoAction)!=null?u:!1,(f=t.options_)!=null&&f.bound?(v=e.proxy_)!=null?v:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function Zw(e,t){return{annotationType_:e,options_:t,make_:k9,extend_:O9,decorate_20223_:C9}}function k9(e,t,r,n){var i;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!nc(e.target_,t)||!op(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(op(r.value))return 1;var a=Qw(e,this,t,r,!1,!1);return xu(n,t,a),2}function O9(e,t,r,n){var i,a=Qw(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,n)}function C9(e,t){var r,n=t.name,i=t.addInitializer;return op(e)||(e=Lh(e)),(r=this.options_)!=null&&r.bound&&i(function(){var a=this,l=a[n].bind(a);l.isMobXFlow=!0,a[n]=l}),e}function N9(e,t,r,n){t.annotationType_,n.value}function Qw(e,t,r,n,i,a){a===void 0&&(a=At.safeDescriptors),N9(e,t,r,n);var l=n.value;if(op(l)||(l=Lh(l)),i){var o;l=l.bind((o=e.proxy_)!=null?o:e.target_),l.isMobXFlow=!0}return{value:l,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function nm(e,t){return{annotationType_:e,options_:t,make_:L9,extend_:T9,decorate_20223_:R9}}function L9(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function T9(e,t,r,n){return M9(e,this,t,r),e.defineComputedProperty_(t,Jc({},this.options_,{get:r.get,set:r.set}),n)}function R9(e,t){var r=this,n=t.name,i=t.addInitializer;return i(function(){var a=Bh(this)[ur],l=Jc({},r.options_,{get:e,context:this});l.name||(l.name="ObservableObject."+n.toString()),a.values_.set(n,new Dl(l))}),function(){return this[ur].getObservablePropValue_(n)}}function M9(e,t,r,n){t.annotationType_,n.get}function u0(e,t){return{annotationType_:e,options_:t,make_:I9,extend_:F9,decorate_20223_:j9}}function I9(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function F9(e,t,r,n){var i,a;return D9(e,this),e.defineObservableProperty_(t,r.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:Df,n)}function j9(e,t){var r=this,n=t.kind,i=t.name,a=new WeakSet;function l(o,u){var d,f,v=Bh(o)[ur],g=new Zc(u,(d=(f=r.options_)==null?void 0:f.enhancer)!=null?d:Df,"ObservableObject."+i.toString(),!1);v.values_.set(i,g),a.add(o)}if(n=="accessor")return{get:function(){return a.has(this)||l(this,e.get.call(this)),this[ur].getObservablePropValue_(i)},set:function(u){return a.has(this)||l(this,u),this[ur].setObservablePropValue_(i,u)},init:function(u){return a.has(this)||l(this,u),u}}}function D9(e,t,r,n){t.annotationType_}var B9="true",z9=Jw();function Jw(e){return{annotationType_:B9,options_:e,make_:U9,extend_:q9,decorate_20223_:H9}}function U9(e,t,r,n){var i,a;if(r.get)return qf.make_(e,t,r,n);if(r.set){var l=ef(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:At.safeDescriptors?e.isPlainObject_:!0,set:l})===null?0:2:(xu(n,t,{configurable:!0,set:l}),2)}if(n!==e.target_&&typeof r.value=="function"){var o;if(Gw(r.value)){var u,d=(u=this.options_)!=null&&u.autoBind?Lh.bound:Lh;return d.make_(e,t,r,n)}var f=(o=this.options_)!=null&&o.autoBind?ip.bound:ip;return f.make_(e,t,r,n)}var v=((i=this.options_)==null?void 0:i.deep)===!1?$r.ref:$r;if(typeof r.value=="function"&&(a=this.options_)!=null&&a.autoBind){var g;r.value=r.value.bind((g=e.proxy_)!=null?g:e.target_)}return v.make_(e,t,r,n)}function q9(e,t,r,n){var i,a;if(r.get)return qf.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:At.safeDescriptors?e.isPlainObject_:!0,set:ef(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var l;r.value=r.value.bind((l=e.proxy_)!=null?l:e.target_)}var o=((a=this.options_)==null?void 0:a.deep)===!1?$r.ref:$r;return o.extend_(e,t,r,n)}function H9(e,t){Cr("'"+this.annotationType_+"' cannot be used as a decorator")}var V9="observable",G9="observable.ref",$9="observable.shallow",W9="observable.struct",e6={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(e6);function r1(e){return e||e6}var _v=u0(V9),Y9=u0(G9,{enhancer:l0}),X9=u0($9,{enhancer:b9}),K9=u0(W9,{enhancer:w9}),t6=Su(_v);function n1(e){return e.deep===!0?Df:e.deep===!1?l0:Q9(e.defaultDecorator)}function Z9(e){var t;return e?(t=e.defaultDecorator)!=null?t:Jw(e):void 0}function Q9(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:Df}function r6(e,t,r){if(yp(t))return _v.decorate_20223_(e,t);if(jf(t)){mp(e,t,_v);return}return P6(e)?e:Qc(e)?$r.object(e,t,r):Array.isArray(e)?$r.array(e,t):jh(e)?$r.map(e,t):ec(e)?$r.set(e,t):typeof e=="object"&&e!==null?e:$r.box(e,t)}qw(r6,t6);var J9={box:function(t,r){var n=r1(r);return new Zc(t,n1(n),n.name,!0,n.equals)},array:function(t,r){var n=r1(r);return(At.useProxies===!1||n.proxy===!1?tS:Gx)(t,n1(n),n.name)},map:function(t,r){var n=r1(r);return new lm(t,n1(n),n.name)},set:function(t,r){var n=r1(r);return new R6(t,n1(n),n.name)},object:function(t,r,n){return Vf(function(){return Cx(At.useProxies===!1||n?.proxy===!1?Bh({},n):qx({},n),t,r)})},ref:Su(Y9),shallow:Su(X9),deep:t6,struct:Su(K9)},$r=qw(r6,J9),n6="computed",ex="computed.struct",xv=nm(n6),tx=nm(ex,{equals:Nh.structural}),qf=function(t,r){if(yp(r))return xv.decorate_20223_(t,r);if(jf(r))return mp(t,r,xv);if(Qc(t))return Su(nm(n6,t));var n=Qc(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new Dl(n)};Object.assign(qf,xv);qf.struct=Su(tx);var Ay,Py,j1=0,rx=1,nx=(Ay=(Py=I1(function(){},"name"))==null?void 0:Py.configurable)!=null?Ay:!1,ky={value:"action",configurable:!0,writable:!1,enumerable:!1};function ef(e,t,r,n){r===void 0&&(r=!1);function i(){return i6(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},nx&&(ky.value=e,xu(i,"name",ky)),i}function i6(e,t,r,n,i){var a=ix(e,t);try{return r.apply(n,i)}catch(l){throw a.error_=l,l}finally{ax(a)}}function ix(e,t,r,n){var i=!1,a=0,l=At.trackingDerivation,o=!t||!l;bs();var u=At.allowStateChanges;o&&(Hf(),u=c0(!0));var d=im(!0),f={runAsAction_:o,prevDerivation_:l,prevAllowStateChanges_:u,prevAllowStateReads_:d,notifySpy_:i,startTime_:a,actionId_:rx++,parentActionId_:j1};return j1=f.actionId_,f}function ax(e){j1!==e.actionId_&&Cr(30),j1=e.parentActionId_,e.error_!==void 0&&(At.suppressReactionErrors=!0),f0(e.prevAllowStateChanges_),Xd(e.prevAllowStateReads_),ws(),e.runAsAction_&&ic(e.prevDerivation_),At.suppressReactionErrors=!1}function a6(e,t){var r=c0(e);try{return t()}finally{f0(r)}}function c0(e){var t=At.allowStateChanges;return At.allowStateChanges=e,t}function f0(e){At.allowStateChanges=e}var Zc=function(e){function t(n,i,a,l,o){var u;return a===void 0&&(a="ObservableValue"),o===void 0&&(o=Nh.default),u=e.call(this,a)||this,u.enhancer=void 0,u.name_=void 0,u.equals=void 0,u.hasUnreportedChange_=!1,u.interceptors_=void 0,u.changeListeners_=void 0,u.value_=void 0,u.dehancer=void 0,u.enhancer=i,u.name_=a,u.equals=o,u.value_=i(n,void 0,a),u}Xw(t,e);var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==At.UNCHANGED&&this.setNewValue_(i)},r.prepareNewValue_=function(i){if(sl(this)){var a=ll(this,{object:this,type:Eu,newValue:i});if(!a)return At.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?At.UNCHANGED:i},r.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),Fl(this)&&jl(this,{type:Eu,object:this,newValue:i,oldValue:a})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return wp(this,i)},r.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Eu,newValue:this.value_,oldValue:void 0}),_p(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 Yw(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},t}(of),ox=af("ObservableValue",Zc),Dl=function(){function e(r){this.dependenciesState_=fn.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=fn.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new B1(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=D1.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||Cr(31),this.derivation=r.get,this.name_=r.name||"ComputedValue",r.set&&(this.setter_=ef("ComputedValue-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?Nh.structural:Nh.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){hx(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.get=function(){if(this.isComputing&&Cr(32,this.name_,this.derivation),At.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Sv(this)&&(this.warnAboutUntrackedRead_(),bs(),this.value_=this.computeValue_(!1),ws());else if(h6(this),Sv(this)){var n=At.trackingContext;this.keepAlive_&&!n&&(At.trackingContext=this),this.trackAndCompute()&&fx(this),At.trackingContext=n}var i=this.value_;if(w1(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter&&Cr(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else Cr(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===fn.NOT_TRACKING_,a=this.computeValue_(!0),l=i||w1(n)||w1(a)||!this.equals_(n,a);return l&&(this.value_=a),l},t.computeValue_=function(n){this.isComputing=!0;var i=c0(!1),a;if(n)a=o6(this,this.derivation,this.scope_);else if(At.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(l){a=new B1(l)}return f0(i),this.isComputing=!1,a},t.suspend_=function(){this.keepAlive_||(Ev(this),this.value_=void 0)},t.observe_=function(n,i){var a=this,l=!0,o=void 0;return Ou(function(){var u=a.get();if(!l||i){var d=Hf();n({observableKind:"computed",debugObjectName:a.name_,type:Eu,object:a,newValue:u,oldValue:o}),ic(d)}l=!1,o=u})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Yw(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},Dh(e,[{key:"isComputing",get:function(){return Us(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=qs(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return Us(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=qs(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return Us(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=qs(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return Us(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=qs(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return Us(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=qs(this.flags_,e.diffValueMask_,n===1)}}])}();Dl.isComputingMask_=1;Dl.isRunningSetterMask_=2;Dl.isBeingObservedMask_=4;Dl.isPendingUnobservationMask_=8;Dl.diffValueMask_=16;var h0=af("ComputedValue",Dl),fn;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(fn||(fn={}));var D1;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(D1||(D1={}));var B1=function(t){this.cause=void 0,this.cause=t};function w1(e){return e instanceof B1}function Sv(e){switch(e.dependenciesState_){case fn.UP_TO_DATE_:return!1;case fn.NOT_TRACKING_:case fn.STALE_:return!0;case fn.POSSIBLY_STALE_:{for(var t=im(!0),r=Hf(),n=e.observing_,i=n.length,a=0;a<i;a++){var l=n[a];if(h0(l)){if(At.disableErrorBoundaries)l.get();else try{l.get()}catch{return ic(r),Xd(t),!0}if(e.dependenciesState_===fn.STALE_)return ic(r),Xd(t),!0}}return l6(e),ic(r),Xd(t),!1}}}function o6(e,t,r){var n=im(!0);l6(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++At.runId;var i=At.trackingDerivation;At.trackingDerivation=e,At.inBatch++;var a;if(At.disableErrorBoundaries===!0)a=t.call(r);else try{a=t.call(r)}catch(l){a=new B1(l)}return At.inBatch--,At.trackingDerivation=i,sx(e),Xd(n),a}function sx(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=fn.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,l=0;l<a;l++){var o=r[l];o.diffValue===0&&(o.diffValue=1,i!==l&&(r[i]=o),i++),o.dependenciesState_>n&&(n=o.dependenciesState_)}for(r.length=i,e.newObserving_=null,a=t.length;a--;){var u=t[a];u.diffValue===0&&c6(u,e),u.diffValue=0}for(;i--;){var d=r[i];d.diffValue===1&&(d.diffValue=0,cx(d,e))}n!==fn.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function Ev(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)c6(t[r],e);e.dependenciesState_=fn.NOT_TRACKING_}function s6(e){var t=Hf();try{return e()}finally{ic(t)}}function Hf(){var e=At.trackingDerivation;return At.trackingDerivation=null,e}function ic(e){At.trackingDerivation=e}function im(e){var t=At.allowStateReads;return At.allowStateReads=e,t}function Xd(e){At.allowStateReads=e}function l6(e){if(e.dependenciesState_!==fn.UP_TO_DATE_){e.dependenciesState_=fn.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=fn.UP_TO_DATE_}}var _1=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},x1=!0,u6=!1,At=function(){var e=n0();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(x1=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new _1().version&&(x1=!1),x1?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new _1):(setTimeout(function(){u6||Cr(35)},1),new _1)}();function lx(){if((At.pendingReactions.length||At.inBatch||At.isRunningReactions)&&Cr(36),u6=!0,x1){var e=n0();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),At=new _1}}function ux(){return At}function cx(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function c6(e,t){e.observers_.delete(t),e.observers_.size===0&&f6(e)}function f6(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,At.pendingUnobservations.push(e))}function bs(){At.inBatch++}function ws(){if(--At.inBatch===0){p6();for(var e=At.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,r.observers_.size===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBUO()),r instanceof Dl&&r.suspend_())}At.pendingUnobservations=[]}}function h6(e){var t=At.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&At.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&At.inBatch>0&&f6(e),!1)}function d6(e){e.lowestObserverState_!==fn.STALE_&&(e.lowestObserverState_=fn.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===fn.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=fn.STALE_}))}function fx(e){e.lowestObserverState_!==fn.STALE_&&(e.lowestObserverState_=fn.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===fn.POSSIBLY_STALE_?t.dependenciesState_=fn.STALE_:t.dependenciesState_===fn.UP_TO_DATE_&&(e.lowestObserverState_=fn.UP_TO_DATE_)}))}function hx(e){e.lowestObserverState_===fn.UP_TO_DATE_&&(e.lowestObserverState_=fn.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===fn.UP_TO_DATE_&&(t.dependenciesState_=fn.POSSIBLY_STALE_,t.onBecomeStale_())}))}var ku=function(){function e(r,n,i,a){r===void 0&&(r="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=fn.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=D1.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=a}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,At.pendingReactions.push(this),p6())},t.runReaction_=function(){if(!this.isDisposed){bs(),this.isScheduled=!1;var n=At.trackingContext;if(At.trackingContext=this,Sv(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}At.trackingContext=n,ws()}},t.track=function(n){if(!this.isDisposed){bs(),this.isRunning=!0;var i=At.trackingContext;At.trackingContext=this;var a=o6(this,n,void 0);At.trackingContext=i,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Ev(this),w1(a)&&this.reportExceptionInDerivation_(a.cause),ws()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(At.disableErrorBoundaries)throw n;var a="[mobx] uncaught error in '"+this+"'";At.suppressReactionErrors||console.error(a,n),At.globalReactionErrorHandlers.forEach(function(l){return l(n,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(bs(),Ev(this),ws()))},t.getDisposer_=function(n){var i=this,a=function l(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",l)};return n==null||n.addEventListener==null||n.addEventListener("abort",a),a[ur]=this,a},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){},Dh(e,[{key:"isDisposed",get:function(){return Us(this.flags_,e.isDisposedMask_)},set:function(n){this.flags_=qs(this.flags_,e.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return Us(this.flags_,e.isScheduledMask_)},set:function(n){this.flags_=qs(this.flags_,e.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return Us(this.flags_,e.isTrackPendingMask_)},set:function(n){this.flags_=qs(this.flags_,e.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return Us(this.flags_,e.isRunningMask_)},set:function(n){this.flags_=qs(this.flags_,e.isRunningMask_,n)}},{key:"diffValue",get:function(){return Us(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=qs(this.flags_,e.diffValueMask_,n===1)}}])}();ku.isDisposedMask_=1;ku.isScheduledMask_=2;ku.isTrackPendingMask_=4;ku.isRunningMask_=8;ku.diffValueMask_=16;var dx=100,Av=function(t){return t()};function p6(){At.inBatch>0||At.isRunningReactions||Av(px)}function px(){At.isRunningReactions=!0;for(var e=At.pendingReactions,t=0;e.length>0;){++t===dx&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}At.isRunningReactions=!1}var z1=af("Reaction",ku);function gx(e){var t=Av;Av=function(n){return e(function(){return t(n)})}}function Kd(){return!1}function vx(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var g6="action",mx="action.bound",v6="autoAction",yx="autoAction.bound",m6="<unnamed action>",Pv=bp(g6),bx=bp(mx,{bound:!0}),kv=bp(v6,{autoAction:!0}),wx=bp(yx,{autoAction:!0,bound:!0});function y6(e){var t=function(n,i){if(Vs(n))return ef(n.name||m6,n,e);if(Vs(i))return ef(n,i,e);if(yp(i))return(e?kv:Pv).decorate_20223_(n,i);if(jf(i))return mp(n,i,e?kv:Pv);if(jf(n))return Su(bp(e?v6:g6,{name:n,autoAction:e}))};return t}var Wr=y6(!1);Object.assign(Wr,Pv);var ip=y6(!0);Object.assign(ip,kv);Wr.bound=Su(bx);ip.bound=Su(wx);function tc(e){return i6(e.name||m6,!1,e,this,void 0)}function ap(e){return Vs(e)&&e.isMobxAction===!0}function Ou(e,t){var r,n,i,a;t===void 0&&(t=tm);var l=(r=(n=t)==null?void 0:n.name)!=null?r:"Autorun",o=!t.scheduler&&!t.delay,u;if(o)u=new ku(l,function(){this.track(v)},t.onError,t.requiresObservable);else{var d=b6(t),f=!1;u=new ku(l,function(){f||(f=!0,d(function(){f=!1,u.isDisposed||u.track(v)}))},t.onError,t.requiresObservable)}function v(){e(u)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||u.schedule_(),u.getDisposer_((a=t)==null?void 0:a.signal)}var _x=function(t){return t()};function b6(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:_x}function w6(e,t,r){var n,i,a;r===void 0&&(r=tm);var l=(n=r.name)!=null?n:"Reaction",o=Wr(l,r.onError?xx(r.onError,t):t),u=!r.scheduler&&!r.delay,d=b6(r),f=!0,v=!1,g,c=r.compareStructural?Nh.structural:r.equals||Nh.default,y=new ku(l,function(){f||u?x():v||(v=!0,d(x))},r.onError,r.requiresObservable);function x(){if(v=!1,!y.isDisposed){var E=!1,S=g;y.track(function(){var b=a6(!1,function(){return e(y)});E=f||!c(g,b),g=b}),(f&&r.fireImmediately||!f&&E)&&o(g,S,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 xx(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var Sx="onBO",Ex="onBUO";function Ax(e,t,r){return x6(Sx,e,t,r)}function _6(e,t,r){return x6(Ex,e,t,r)}function x6(e,t,r,n){var i=Th(t),a=Vs(n)?n:r,l=e+"L";return i[l]?i[l].add(a):i[l]=new Set([a]),function(){var o=i[l];o&&(o.delete(a),o.size===0&&delete i[l])}}var Px="never",i1="always",kx="observed";function Ox(e){e.isolateGlobalState===!0&&lx();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(At.useProxies=t===i1?!0:t===Px?!1:typeof Proxy<"u"),t==="ifavailable"&&(At.verifyProxies=!0),r!==void 0){var n=r===i1?i1:r===kx;At.enforceActions=n,At.allowStateChanges=!(n===!0||n===i1)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(At[i]=!!e[i])}),At.allowStateReads=!At.observableRequiresReaction,e.reactionScheduler&&gx(e.reactionScheduler)}function Cx(e,t,r,n){var i=f9(t);return Vf(function(){var a=Bh(e,n)[ur];s0(i).forEach(function(l){a.extend_(l,i[l],r&&l in r?r[l]:!0)})}),e}function Nx(e,t){return S6(Th(e,t))}function S6(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=Lx(e.observing_).map(S6)),t}function Lx(e){return Array.from(new Set(e))}var Tx=0;function E6(){this.message="FLOW_CANCELLED"}E6.prototype=Object.create(Error.prototype);var sg=Zw("flow"),Rx=Zw("flow.bound",{bound:!0}),Lh=Object.assign(function(t,r){if(yp(r))return sg.decorate_20223_(t,r);if(jf(r))return mp(t,r,sg);var n=t,i=n.name||"<unnamed flow>",a=function(){var o=this,u=arguments,d=++Tx,f=Wr(i+" - runid: "+d+" - init",n).apply(o,u),v,g=void 0,c=new Promise(function(y,x){var E=0;v=x;function S(_){g=void 0;var A;try{A=Wr(i+" - runid: "+d+" - yield "+E++,f.next).call(f,_)}catch(M){return x(M)}w(A)}function b(_){g=void 0;var A;try{A=Wr(i+" - runid: "+d+" - yield "+E++,f.throw).call(f,_)}catch(M){return x(M)}w(A)}function w(_){if(Vs(_?.then)){_.then(w,x);return}return _.done?y(_.value):(g=Promise.resolve(_.value),g.then(S,b))}S(void 0)});return c.cancel=Wr(i+" - runid: "+d+" - cancel",function(){try{g&&Oy(g);var y=f.return(void 0),x=Promise.resolve(y.value);x.then(wh,wh),Oy(x),v(new E6)}catch(E){v(E)}}),c};return a.isMobXFlow=!0,a},sg);Lh.bound=Su(Rx);function Oy(e){Vs(e.cancel)&&e.cancel()}function op(e){return e?.isMobXFlow===!0}function A6(e,t,r){var n;return fl(e)||Lu(e)||ox(e)?n=Cu(e):Ul(e)&&(n=Cu(e,t)),n.dehancer=typeof t=="function"?t:r,function(){n.dehancer=void 0}}function am(e,t,r){return Vs(r)?Ix(e,t,r):Mx(e,t)}function Mx(e,t){return Cu(e).intercept_(t)}function Ix(e,t,r){return Cu(e,t).intercept_(r)}function Fx(e,t){return e?Ul(e)||!!e[ur]||rm(e)||z1(e)||h0(e):!1}function P6(e){return Fx(e)}function U1(e){if(Ul(e))return e[ur].keys_();if(fl(e)||Xo(e))return Array.from(e.keys());if(Lu(e))return e.map(function(t,r){return r});Cr(5)}function k6(e){if(Ul(e))return U1(e).map(function(t){return e[t]});if(fl(e))return U1(e).map(function(t){return e.get(t)});if(Xo(e))return Array.from(e.values());if(Lu(e))return e.slice();Cr(6)}function jx(e){if(Ul(e))return U1(e).map(function(t){return[t,e[t]]});if(fl(e))return U1(e).map(function(t){return[t,e.get(t)]});if(Xo(e))return Array.from(e.entries());if(Lu(e))return e.map(function(t,r){return[r,t]});Cr(7)}function O6(e,t,r){if(arguments.length===2&&!Xo(e)){bs();var n=t;try{for(var i in n)O6(e,i,n[i])}finally{ws()}return}Ul(e)?e[ur].set_(t,r):fl(e)?e.set(t,r):Xo(e)?e.add(t):Lu(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&Cr("Invalid index: '"+t+"'"),bs(),t>=e.length&&(e.length=t+1),e[t]=r,ws()):Cr(8)}function C6(e,t,r){if(Ul(e))return e[ur].defineProperty_(t,r);Cr(39)}function om(e,t,r,n){return Vs(r)?Bx(e,t,r,n):Dx(e,t,r)}function Dx(e,t,r){return Cu(e).observe_(t,r)}function Bx(e,t,r,n){return Cu(e,t).observe_(r,n)}function rc(e,t){t===void 0&&(t=void 0),bs();try{return e.apply(t)}finally{ws()}}function Cy(e,t,r){return arguments.length===1||t&&typeof t=="object"?zx(e,t):N6(e,t,{})}function N6(e,t,r){var n;if(typeof r.timeout=="number"){var i=new Error("WHEN_TIMEOUT");n=setTimeout(function(){if(!l[ur].isDisposed)if(l(),r.onError)r.onError(i);else throw i},r.timeout)}r.name="When";var a=ef("When-effect",t),l=Ou(function(o){var u=a6(!1,e);u&&(o.dispose(),n&&clearTimeout(n),a())},r);return l}function zx(e,t){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var n,i,a=new Promise(function(l,o){var u,d=N6(e,l,Jc({},t,{onError:o}));n=function(){d(),o(new Error("WHEN_CANCELLED"))},i=function(){d(),o(new Error("WHEN_ABORTED"))},t==null||(u=t.signal)==null||u.addEventListener==null||u.addEventListener("abort",i)}).finally(function(){var l;return t==null||(l=t.signal)==null||l.removeEventListener==null?void 0:l.removeEventListener("abort",i)});return a.cancel=n,a}function fh(e){return e[ur]}var Ux={has:function(t,r){return fh(t).has_(r)},get:function(t,r){return fh(t).get_(r)},set:function(t,r,n){var i;return jf(r)?(i=fh(t).set_(r,n,!0))!=null?i:!0:!1},deleteProperty:function(t,r){var n;return jf(r)?(n=fh(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return(i=fh(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return fh(t).ownKeys_()},preventExtensions:function(t){Cr(13)}};function qx(e,t){var r,n;return Hw(),e=Bh(e,t),(n=(r=e[ur]).proxy_)!=null?n:r.proxy_=new Proxy(e,Ux)}function sl(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function wp(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),Vw(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function ll(e,t){var r=Hf();try{for(var n=[].concat(e.interceptors_||[]),i=0,a=n.length;i<a&&(t=n[i](t),t&&!t.type&&Cr(14),!!t);i++);return t}finally{ic(r)}}function Fl(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function _p(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),Vw(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function jl(e,t){var r=Hf(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,a=n.length;i<a;i++)n[i](t);ic(r)}}function L6(e,t,r){return Vf(function(){var n,i=Bh(e,r)[ur];(n=t)!=null||(t=v9(e)),s0(t).forEach(function(a){return i.make_(a,t[a])})}),e}var Ny="splice",Eu="update",Hx=1e4,Vx={get:function(t,r){var n=t[ur];return r===ur?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):nc(q1,r)?q1[r]:t[r]},set:function(t,r,n){var i=t[ur];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){Cr(15)}},sm=function(){function e(r,n,i,a){r===void 0&&(r="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=a,this.atom_=new of(r),this.enhancer_=function(l,o){return n(l,o,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},t.intercept_=function(n){return wp(this,n)},t.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),_p(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&Cr("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var a=new Array(n-i),l=0;l<n-i;l++)a[l]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&Cr(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&j6(n+i+1)},t.spliceWithArray_=function(n,i,a){var l=this;this.atom_;var o=this.values_.length;if(n===void 0?n=0:n>o?n=o:n<0&&(n=Math.max(0,o+n)),arguments.length===1?i=o-n:i==null?i=0:i=Math.max(0,Math.min(i,o-n)),a===void 0&&(a=bv),sl(this)){var u=ll(this,{object:this.proxy_,type:Ny,index:n,removedCount:i,added:a});if(!u)return bv;i=u.removedCount,a=u.added}if(a=a.length===0?a:a.map(function(v){return l.enhancer_(v,void 0)}),this.legacyMode_){var d=a.length-i;this.updateArrayLength_(o,d)}var f=this.spliceItemsIntoValues_(n,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(n,a,f),this.dehanceValues_(f)},t.spliceItemsIntoValues_=function(n,i,a){if(a.length<Hx){var l;return(l=this.values_).splice.apply(l,[n,i].concat(a))}else{var o=this.values_.slice(n,n+i),u=this.values_.slice(n+i);this.values_.length+=a.length-i;for(var d=0;d<a.length;d++)this.values_[n+d]=a[d];for(var f=0;f<u.length;f++)this.values_[n+a.length+f]=u[f];return o}},t.notifyArrayChildUpdate_=function(n,i,a){var l=!this.owned_&&Kd(),o=Fl(this),u=o||l?{observableKind:"array",object:this.proxy_,type:Eu,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),o&&jl(this,u)},t.notifyArraySplice_=function(n,i,a){var l=!this.owned_&&Kd(),o=Fl(this),u=o||l?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Ny,index:n,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),o&&jl(this,u)},t.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx] Out of bounds read: "+n);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},t.set_=function(n,i){var a=this.values_;if(this.legacyMode_&&n>a.length&&Cr(17,n,a.length),n<a.length){this.atom_;var l=a[n];if(sl(this)){var o=ll(this,{type:Eu,object:this.proxy_,index:n,newValue:i});if(!o)return;i=o.newValue}i=this.enhancer_(i,l);var u=i!==l;u&&(a[n]=i,this.notifyArrayChildUpdate_(n,i,l))}else{for(var d=new Array(n+1-a.length),f=0;f<d.length-1;f++)d[f]=void 0;d[d.length-1]=i,this.spliceWithArray_(a.length,0,d)}},e}();function Gx(e,t,r,n){return r===void 0&&(r="ObservableArray"),n===void 0&&(n=!1),Hw(),Vf(function(){var i=new sm(r,t,n,!1);$w(i.values_,ur,i);var a=new Proxy(i.values_,Vx);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var q1={clear:function(){return this.splice(0)},replace:function(t){var r=this[ur];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];var l=this[ur];switch(arguments.length){case 0:return[];case 1:return l.spliceWithArray_(t);case 2:return l.spliceWithArray_(t,r)}return l.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[ur].spliceWithArray_(t,r,n)},push:function(){for(var t=this[ur],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[ur].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[ur],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return At.trackingDerivation&&Cr(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){At.trackingDerivation&&Cr(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[ur],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};Xn("at",Gs);Xn("concat",Gs);Xn("flat",Gs);Xn("includes",Gs);Xn("indexOf",Gs);Xn("join",Gs);Xn("lastIndexOf",Gs);Xn("slice",Gs);Xn("toString",Gs);Xn("toLocaleString",Gs);Xn("toSorted",Gs);Xn("toSpliced",Gs);Xn("with",Gs);Xn("every",zl);Xn("filter",zl);Xn("find",zl);Xn("findIndex",zl);Xn("findLast",zl);Xn("findLastIndex",zl);Xn("flatMap",zl);Xn("forEach",zl);Xn("map",zl);Xn("some",zl);Xn("toReversed",zl);Xn("reduce",T6);Xn("reduceRight",T6);function Xn(e,t){typeof Array.prototype[e]=="function"&&(q1[e]=t(e))}function Gs(e){return function(){var t=this[ur];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function zl(e){return function(t,r){var n=this,i=this[ur];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[e](function(l,o){return t.call(r,l,o,n)})}}function T6(e){return function(){var t=this,r=this[ur];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(a,l,o){return i(a,l,o,t)},n[e].apply(n,arguments)}}var $x=af("ObservableArrayAdministration",sm);function Lu(e){return a0(e)&&$x(e[ur])}var Wx={},Wc="add",H1="delete",lm=function(){function e(r,n,i){var a=this;n===void 0&&(n=Df),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[ur]=Wx,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,Vs(Map)||Cr(18),Vf(function(){a.keysAtom_=F1("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,r&&a.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!At.trackingDerivation)return this.has_(n);var a=this.hasMap_.get(n);if(!a){var l=a=new Zc(this.has_(n),l0,"ObservableMap.key?",!1);this.hasMap_.set(n,l),_6(l,function(){return i.hasMap_.delete(n)})}return a.get()},t.set=function(n,i){var a=this.has_(n);if(sl(this)){var l=ll(this,{type:a?Eu:Wc,object:this,newValue:i,name:n});if(!l)return this;i=l.newValue}return a?this.updateValue_(n,i):this.addValue_(n,i),this},t.delete=function(n){var i=this;if(this.keysAtom_,sl(this)){var a=ll(this,{type:H1,object:this,name:n});if(!a)return!1}if(this.has_(n)){var l=Kd(),o=Fl(this),u=o||l?{observableKind:"map",debugObjectName:this.name_,type:H1,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return rc(function(){var d;i.keysAtom_.reportChanged(),(d=i.hasMap_.get(n))==null||d.setNewValue_(!1);var f=i.data_.get(n);f.setNewValue_(void 0),i.data_.delete(n)}),o&&jl(this,u),!0}return!1},t.updateValue_=function(n,i){var a=this.data_.get(n);if(i=a.prepareNewValue_(i),i!==At.UNCHANGED){var l=Kd(),o=Fl(this),u=o||l?{observableKind:"map",debugObjectName:this.name_,type:Eu,object:this,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),o&&jl(this,u)}},t.addValue_=function(n,i){var a=this;this.keysAtom_,rc(function(){var d,f=new Zc(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(n,f),i=f.value_,(d=a.hasMap_.get(n))==null||d.setNewValue_(!0),a.keysAtom_.reportChanged()});var l=Kd(),o=Fl(this),u=o||l?{observableKind:"map",debugObjectName:this.name_,type:Wc,object:this,name:n,newValue:i}:null;o&&jl(this,u)},t.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var n=this,i=this.keys();return Ly({next:function(){var l=i.next(),o=l.done,u=l.value;return{done:o,value:o?void 0:n.get(u)}}})},t.entries=function(){var n=this,i=this.keys();return Ly({next:function(){var l=i.next(),o=l.done,u=l.value;return{done:o,value:o?void 0:[u,n.get(u)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(n,i){for(var a=_h(this),l;!(l=a()).done;){var o=l.value,u=o[0],d=o[1];n.call(i,d,u,this)}},t.merge=function(n){var i=this;return fl(n)&&(n=new Map(n)),rc(function(){Qc(n)?c9(n).forEach(function(a){return i.set(a,n[a])}):Array.isArray(n)?n.forEach(function(a){var l=a[0],o=a[1];return i.set(l,o)}):jh(n)?(u9(n)||Cr(19,n),n.forEach(function(a,l){return i.set(l,a)})):n!=null&&Cr(20,n)}),this},t.clear=function(){var n=this;rc(function(){s6(function(){for(var i=_h(n.keys()),a;!(a=i()).done;){var l=a.value;n.delete(l)}})})},t.replace=function(n){var i=this;return rc(function(){for(var a=Yx(n),l=new Map,o=!1,u=_h(i.data_.keys()),d;!(d=u()).done;){var f=d.value;if(!a.has(f)){var v=i.delete(f);if(v)o=!0;else{var g=i.data_.get(f);l.set(f,g)}}}for(var c=_h(a.entries()),y;!(y=c()).done;){var x=y.value,E=x[0],S=x[1],b=i.data_.has(E);if(i.set(E,S),i.data_.has(E)){var w=i.data_.get(E);l.set(E,w),b||(o=!0)}}if(!o)if(i.data_.size!==l.size)i.keysAtom_.reportChanged();else for(var _=i.data_.keys(),A=l.keys(),M=_.next(),O=A.next();!M.done;){if(M.value!==O.value){i.keysAtom_.reportChanged();break}M=_.next(),O=A.next()}i.data_=l}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return _p(this,n)},t.intercept_=function(n){return wp(this,n)},Dh(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),fl=af("ObservableMap",lm);function Ly(e){return e[Symbol.toStringTag]="MapIterator",cm(e)}function Yx(e){if(jh(e)||fl(e))return e;if(Array.isArray(e))return new Map(e);if(Qc(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return Cr(21,e)}var Xx={},R6=function(){function e(r,n,i){var a=this;n===void 0&&(n=Df),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[ur]=Xx,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,Vs(Set)||Cr(22),this.enhancer_=function(l,o){return n(l,o,i)},Vf(function(){a.atom_=F1(a.name_),r&&a.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;rc(function(){s6(function(){for(var i=_h(n.data_.values()),a;!(a=i()).done;){var l=a.value;n.delete(l)}})})},t.forEach=function(n,i){for(var a=_h(this),l;!(l=a()).done;){var o=l.value;n.call(i,o,o,this)}},t.add=function(n){var i=this;if(this.atom_,sl(this)){var a=ll(this,{type:Wc,object:this,newValue:n});if(!a)return this;n=a.newValue}if(!this.has(n)){rc(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var l=!1,o=Fl(this),u=o||l?{observableKind:"set",debugObjectName:this.name_,type:Wc,object:this,newValue:n}:null;o&&jl(this,u)}return this},t.delete=function(n){var i=this;if(sl(this)){var a=ll(this,{type:H1,object:this,oldValue:n});if(!a)return!1}if(this.has(n)){var l=!1,o=Fl(this),u=o||l?{observableKind:"set",debugObjectName:this.name_,type:H1,object:this,oldValue:n}:null;return rc(function(){i.atom_.reportChanged(),i.data_.delete(n)}),o&&jl(this,u),!0}return!1},t.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},t.entries=function(){var n=this.values();return Ty({next:function(){var a=n.next(),l=a.value,o=a.done;return o?{value:void 0,done:o}:{value:[l,l],done:o}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var n=this,i=this.data_.values();return Ty({next:function(){var l=i.next(),o=l.value,u=l.done;return u?{value:void 0,done:u}:{value:n.dehanceValue_(o),done:u}}})},t.intersection=function(n){if(ec(n)&&!Xo(n))return n.intersection(this);var i=new Set(this);return i.intersection(n)},t.union=function(n){if(ec(n)&&!Xo(n))return n.union(this);var i=new Set(this);return i.union(n)},t.difference=function(n){return new Set(this).difference(n)},t.symmetricDifference=function(n){if(ec(n)&&!Xo(n))return n.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(n)},t.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},t.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},t.isDisjointFrom=function(n){if(ec(n)&&!Xo(n))return n.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(n)},t.replace=function(n){var i=this;return Xo(n)&&(n=new Set(n)),rc(function(){Array.isArray(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):ec(n)?(i.clear(),n.forEach(function(a){return i.add(a)})):n!=null&&Cr("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return _p(this,n)},t.intercept_=function(n){return wp(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},Dh(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Xo=af("ObservableSet",R6);function Ty(e){return e[Symbol.toStringTag]="SetIterator",cm(e)}var Ry=Object.create(null),My="remove",M6=function(){function e(r,n,i,a){n===void 0&&(n=new Map),a===void 0&&(a=z9),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 of("ObservableObject.keys"),this.isPlainObject_=Qc(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(n){return this.values_.get(n).get()},t.setObservablePropValue_=function(n,i){var a=this.values_.get(n);if(a instanceof Dl)return a.set(i),!0;if(sl(this)){var l=ll(this,{type:Eu,object:this.proxy_||this.target_,name:n,newValue:i});if(!l)return null;i=l.newValue}if(i=a.prepareNewValue_(i),i!==At.UNCHANGED){var o=Fl(this),u=!1,d=o||u?{type:Eu,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:n,newValue:i}:null;a.setNewValue_(i),o&&jl(this,d)}return!0},t.get_=function(n){return At.trackingDerivation&&!nc(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,a){return a===void 0&&(a=!1),nc(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):a?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},t.has_=function(n){if(!At.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new Zc(n in this.target_,l0,"ObservableObject.key?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(n in this.target_)){var a;if((a=this.target_[yu])!=null&&a[n])return;Cr(1,i.annotationType_,this.name_+"."+n.toString())}for(var l=this.target_;l&&l!==i0;){var o=I1(l,n);if(o){var u=i.make_(this,n,o,l);if(u===0)return;if(u===1)break}l=Object.getPrototypeOf(l)}Fy(this,i,n)}},t.extend_=function(n,i,a,l){if(l===void 0&&(l=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(n,i,l);var o=a.extend_(this,n,i,l);return o&&Fy(this,a,n),o},t.defineProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{bs();var l=this.delete_(n);if(!l)return l;if(sl(this)){var o=ll(this,{object:this.proxy_||this.target_,name:n,type:Wc,newValue:i.value});if(!o)return null;var u=o.newValue;i.value!==u&&(i=Jc({},i,{value:u}))}if(a){if(!Reflect.defineProperty(this.target_,n,i))return!1}else xu(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{ws()}return!0},t.defineObservableProperty_=function(n,i,a,l){l===void 0&&(l=!1),this.keysAtom_;try{bs();var o=this.delete_(n);if(!o)return o;if(sl(this)){var u=ll(this,{object:this.proxy_||this.target_,name:n,type:Wc,newValue:i});if(!u)return null;i=u.newValue}var d=Iy(n),f={configurable:At.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:d.get,set:d.set};if(l){if(!Reflect.defineProperty(this.target_,n,f))return!1}else xu(this.target_,n,f);var v=new Zc(i,a,"ObservableObject.key",!1);this.values_.set(n,v),this.notifyPropertyAddition_(n,v.value_)}finally{ws()}return!0},t.defineComputedProperty_=function(n,i,a){a===void 0&&(a=!1),this.keysAtom_;try{bs();var l=this.delete_(n);if(!l)return l;if(sl(this)){var o=ll(this,{object:this.proxy_||this.target_,name:n,type:Wc,newValue:void 0});if(!o)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var u=Iy(n),d={configurable:At.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:u.get,set:u.set};if(a){if(!Reflect.defineProperty(this.target_,n,d))return!1}else xu(this.target_,n,d);this.values_.set(n,new Dl(i)),this.notifyPropertyAddition_(n,void 0)}finally{ws()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),this.keysAtom_,!nc(this.target_,n))return!0;if(sl(this)){var a=ll(this,{object:this.proxy_||this.target_,name:n,type:My});if(!a)return null}try{var l;bs();var o=Fl(this),u=!1,d=this.values_.get(n),f=void 0;if(!d&&(o||u)){var v;f=(v=I1(this.target_,n))==null?void 0:v.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(d&&(this.values_.delete(n),d instanceof Zc&&(f=d.value_),d6(d)),this.keysAtom_.reportChanged(),(l=this.pendingKeys_)==null||(l=l.get(n))==null||l.set(n in this.target_),o||u){var g={type:My,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:f,name:n};o&&jl(this,g)}}finally{ws()}return!0},t.observe_=function(n,i){return _p(this,n)},t.intercept_=function(n){return wp(this,n)},t.notifyPropertyAddition_=function(n,i){var a,l=Fl(this),o=!1;if(l||o){var u=l||o?{type:Wc,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;l&&jl(this,u)}(a=this.pendingKeys_)==null||(a=a.get(n))==null||a.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),s0(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Bh(e,t){var r;if(nc(e,ur))return e;var n=(r=t?.name)!=null?r:"ObservableObject",i=new M6(e,new Map,String(n),Z9(t));return o0(e,ur,i),e}var Kx=af("ObservableObjectAdministration",M6);function Iy(e){return Ry[e]||(Ry[e]={get:function(){return this[ur].getObservablePropValue_(e)},set:function(r){return this[ur].setObservablePropValue_(e,r)}})}function Ul(e){return a0(e)?Kx(e[ur]):!1}function Fy(e,t,r){var n;(n=e.target_[yu])==null||delete n[r]}var Zx=F6(0),Qx=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),lg=0,I6=function(){};function Jx(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}Jx(I6,Array.prototype);var um=function(e){function t(n,i,a,l){var o;return a===void 0&&(a="ObservableArray"),l===void 0&&(l=!1),o=e.call(this)||this,Vf(function(){var u=new sm(a,i,l,!0);u.proxy_=o,$w(o,ur,u),n&&n.length&&o.spliceWithArray(0,0,n),Qx&&Object.defineProperty(o,"0",Zx)}),o}Xw(t,e);var r=t.prototype;return r.concat=function(){this[ur].atom_.reportObserved();for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return Array.prototype.concat.apply(this.slice(),a.map(function(o){return Lu(o)?o.slice():o}))},r[Symbol.iterator]=function(){var n=this,i=0;return cm({next:function(){return i<n.length?{value:n[i++],done:!1}:{done:!0,value:void 0}}})},Dh(t,[{key:"length",get:function(){return this[ur].getArrayLength_()},set:function(i){this[ur].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(I6);Object.entries(q1).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&o0(um.prototype,t,r)});function F6(e){return{enumerable:!1,configurable:!0,get:function(){return this[ur].get_(e)},set:function(r){this[ur].set_(e,r)}}}function eS(e){xu(um.prototype,""+e,F6(e))}function j6(e){if(e>lg){for(var t=lg;t<e+100;t++)eS(t);lg=e}}j6(1e3);function tS(e,t,r){return new um(e,t,r)}function Th(e,t){if(typeof e=="object"&&e!==null){if(Lu(e))return t!==void 0&&Cr(23),e[ur].atom_;if(Xo(e))return e.atom_;if(fl(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||Cr(25,t,Ov(e)),r}if(Ul(e)){if(!t)return Cr(26);var n=e[ur].values_.get(t);return n||Cr(27,t,Ov(e)),n}if(rm(e)||h0(e)||z1(e))return e}else if(Vs(e)&&z1(e[ur]))return e[ur];Cr(28)}function Cu(e,t){if(e||Cr(29),t!==void 0)return Cu(Th(e,t));if(rm(e)||h0(e)||z1(e)||fl(e)||Xo(e))return e;if(e[ur])return e[ur];Cr(24,e)}function Ov(e,t){var r;if(t!==void 0)r=Th(e,t);else{if(ap(e))return e.name;Ul(e)||fl(e)||Xo(e)?r=Cu(e):r=Th(e)}return r.name_}function Vf(e){var t=Hf(),r=c0(!0);bs();try{return e()}finally{ws(),f0(r),ic(t)}}var jy=i0.toString;function D6(e,t,r){return r===void 0&&(r=-1),Cv(e,t,r)}function Cv(e,t,r,n,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!=="function"&&a!=="object"&&typeof t!="object")return!1;var l=jy.call(e);if(l!==jy.call(t))return!1;switch(l){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++;break}e=Dy(e),t=Dy(t);var o=l==="[object Array]";if(!o){if(typeof e!="object"||typeof t!="object")return!1;var u=e.constructor,d=t.constructor;if(u!==d&&!(Vs(u)&&u instanceof u&&Vs(d)&&d instanceof d)&&"constructor"in e&&"constructor"in t)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var f=n.length;f--;)if(n[f]===e)return i[f]===t;if(n.push(e),i.push(t),o){if(f=e.length,f!==t.length)return!1;for(;f--;)if(!Cv(e[f],t[f],r-1,n,i))return!1}else{var v=Object.keys(e),g=v.length;if(Object.keys(t).length!==g)return!1;for(var c=0;c<g;c++){var y=v[c];if(!(nc(t,y)&&Cv(e[y],t[y],r-1,n,i)))return!1}}return n.pop(),i.pop(),!0}function Dy(e){return Lu(e)?e.slice():jh(e)||fl(e)||ec(e)||Xo(e)?Array.from(e.entries()):e}var By,rS=((By=n0().Iterator)==null?void 0:By.prototype)||{};function cm(e){return e[Symbol.iterator]=nS,Object.assign(Object.create(rS),e)}function nS(){return this}["Symbol","Map","Set"].forEach(function(e){var t=n0();typeof t[e]>"u"&&Cr("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:vx,extras:{getDebugName:Ov},$mobx:ur});if(!Pi.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!L6)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var B6=zw();function iS(e){e()}function aS(e){e||(e=iS),Ox({reactionScheduler:e})}function oS(e){return Nx(e)}var sS=1e4,lS=1e4,uS=function(){function e(t){var r=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=sS),clearTimeout(r.sweepTimeout),r.sweepTimeout=void 0;var i=Date.now();r.registrations.forEach(function(a,l){i-a.registeredAt>=n&&(r.finalize(a.value),r.registrations.delete(l))}),r.registrations.size>0&&r.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){r.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){this.registrations.set(n,{value:r,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.registrations.delete(t)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,lS))}}),e}(),cS=typeof FinalizationRegistry<"u"?FinalizationRegistry:uS,Nv=new cS(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),ug={exports:{}},cg={};/**
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 zy;function fS(){if(zy)return cg;zy=1;var e=vp();function t(v,g){return v===g&&(v!==0||1/v===1/g)||v!==v&&g!==g}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function o(v,g){var c=g(),y=n({inst:{value:c,getSnapshot:g}}),x=y[0].inst,E=y[1];return a(function(){x.value=c,x.getSnapshot=g,u(x)&&E({inst:x})},[v,c,g]),i(function(){return u(x)&&E({inst:x}),v(function(){u(x)&&E({inst:x})})},[v]),l(c),c}function u(v){var g=v.getSnapshot;v=v.value;try{var c=g();return!r(v,c)}catch{return!0}}function d(v,g){return g()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:o;return cg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,cg}var Uy;function hS(){return Uy||(Uy=1,ug.exports=fS()),ug.exports}var dS=hS();function qy(e){e.reaction=new ku("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function pS(e,t){t===void 0&&(t="observed");var r=ce.useRef(null);if(!r.current){var n={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(o){return Nv.unregister(n),n.onStoreChange=o,n.reaction||(qy(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||(qy(i),Nv.register(r,i,i)),ce.useDebugValue(i.reaction,oS),dS.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var a,l;if(i.reaction.track(function(){try{a=e()}catch(o){l=o}}),l)throw l;return a}var fg,hg,z6=typeof Symbol=="function"&&Symbol.for,gS=(hg=(fg=Object.getOwnPropertyDescriptor(function(){},"name"))===null||fg===void 0?void 0:fg.configurable)!==null&&hg!==void 0?hg:!1,Hy=z6?Symbol.for("react.forward_ref"):typeof Pi.forwardRef=="function"&&Pi.forwardRef(function(e){return null}).$$typeof,Vy=z6?Symbol.for("react.memo"):typeof Pi.memo=="function"&&Pi.memo(function(e){return null}).$$typeof;function Yn(e,t){var r;if(Vy&&e.$$typeof===Vy)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");var n=(r=void 0)!==null&&r!==void 0?r:!1,i=e,a=e.displayName||e.name;if(Hy&&e.$$typeof===Hy&&(n=!0,i=e.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var l=function(o,u){return pS(function(){return i(o,u)},a)};return l.displayName=e.displayName,gS&&Object.defineProperty(l,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(l.contextTypes=e.contextTypes),n&&(l=Pi.forwardRef(l)),l=Pi.memo(l),mS(e,l),l}var vS={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function mS(e,t){Object.keys(e).forEach(function(r){vS[r]||Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}function yS(e,t){return Pi.useState(function(){return $r(e(),t,{autoBind:!0})})[0]}var dg;aS(B6.unstable_batchedUpdates);dg=Nv.finalizeAllImmediately;var S1={exports:{}},Jh={},pg={},gg={},Gy;function Nr(){return Gy||(Gy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;const t=Math.PI/180;function r(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof Ch<"u"?Ch:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.3.22",isBrowser:r(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return e.Konva.angleDeg?i*t:i},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isTransforming(){var i;return(i=e.Konva.Transformer)===null||i===void 0?void 0:i.isTransforming()},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(i){e.glob.Konva=i}};const n=i=>{e.Konva[i.prototype.getClassName()]=i};e._registerNode=n,e.Konva._injectGlobal(e.Konva)}(gg)),gg}var vg={},$y;function zi(){return $y||($y=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=Nr();class r{constructor(_=[1,0,0,1,0,0]){this.dirty=!1,this.m=_&&_.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new r(this.m)}copyInto(_){_.m[0]=this.m[0],_.m[1]=this.m[1],_.m[2]=this.m[2],_.m[3]=this.m[3],_.m[4]=this.m[4],_.m[5]=this.m[5]}point(_){const A=this.m;return{x:A[0]*_.x+A[2]*_.y+A[4],y:A[1]*_.x+A[3]*_.y+A[5]}}translate(_,A){return this.m[4]+=this.m[0]*_+this.m[2]*A,this.m[5]+=this.m[1]*_+this.m[3]*A,this}scale(_,A){return this.m[0]*=_,this.m[1]*=_,this.m[2]*=A,this.m[3]*=A,this}rotate(_){const A=Math.cos(_),M=Math.sin(_),O=this.m[0]*A+this.m[2]*M,L=this.m[1]*A+this.m[3]*M,R=this.m[0]*-M+this.m[2]*A,T=this.m[1]*-M+this.m[3]*A;return this.m[0]=O,this.m[1]=L,this.m[2]=R,this.m[3]=T,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(_,A){const M=this.m[0]+this.m[2]*A,O=this.m[1]+this.m[3]*A,L=this.m[2]+this.m[0]*_,R=this.m[3]+this.m[1]*_;return this.m[0]=M,this.m[1]=O,this.m[2]=L,this.m[3]=R,this}multiply(_){const A=this.m[0]*_.m[0]+this.m[2]*_.m[1],M=this.m[1]*_.m[0]+this.m[3]*_.m[1],O=this.m[0]*_.m[2]+this.m[2]*_.m[3],L=this.m[1]*_.m[2]+this.m[3]*_.m[3],R=this.m[0]*_.m[4]+this.m[2]*_.m[5]+this.m[4],T=this.m[1]*_.m[4]+this.m[3]*_.m[5]+this.m[5];return this.m[0]=A,this.m[1]=M,this.m[2]=O,this.m[3]=L,this.m[4]=R,this.m[5]=T,this}invert(){const _=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),A=this.m[3]*_,M=-this.m[1]*_,O=-this.m[2]*_,L=this.m[0]*_,R=_*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),T=_*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=A,this.m[1]=M,this.m[2]=O,this.m[3]=L,this.m[4]=R,this.m[5]=T,this}getMatrix(){return this.m}decompose(){const _=this.m[0],A=this.m[1],M=this.m[2],O=this.m[3],L=this.m[4],R=this.m[5],T=_*O-A*M,k={x:L,y:R,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(_!=0||A!=0){const C=Math.sqrt(_*_+A*A);k.rotation=A>0?Math.acos(_/C):-Math.acos(_/C),k.scaleX=C,k.scaleY=T/C,k.skewX=(_*M+A*O)/T,k.skewY=0}else if(M!=0||O!=0){const C=Math.sqrt(M*M+O*O);k.rotation=Math.PI/2-(O>0?Math.acos(-M/C):-Math.acos(M/C)),k.scaleX=T/C,k.scaleY=C,k.skewX=0,k.skewY=(_*M+A*O)/T}return k.rotation=e.Util._getRotation(k.rotation),k}}e.Transform=r;const n="[object Array]",i="[object Number]",a="[object String]",l="[object Boolean]",o=Math.PI/180,u=180/Math.PI,d="#",f="",v="0",g="Konva warning: ",c="Konva error: ",y="rgb(",x={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]},E=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let S=[];const b=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(w){setTimeout(w,60)};e.Util={_isElement(w){return!!(w&&w.nodeType==1)},_isFunction(w){return!!(w&&w.constructor&&w.call&&w.apply)},_isPlainObject(w){return!!w&&w.constructor===Object},_isArray(w){return Object.prototype.toString.call(w)===n},_isNumber(w){return Object.prototype.toString.call(w)===i&&!isNaN(w)&&isFinite(w)},_isString(w){return Object.prototype.toString.call(w)===a},_isBoolean(w){return Object.prototype.toString.call(w)===l},isObject(w){return w instanceof Object},isValidSelector(w){if(typeof w!="string")return!1;const _=w[0];return _==="#"||_==="."||_===_.toUpperCase()},_sign(w){return w===0||w>0?1:-1},requestAnimFrame(w){S.push(w),S.length===1&&b(function(){const _=S;S=[],_.forEach(function(A){A()})})},createCanvasElement(){const w=document.createElement("canvas");try{w.style=w.style||{}}catch{}return w},createImageElement(){return document.createElement("img")},_isInDocument(w){for(;w=w.parentNode;)if(w==document)return!0;return!1},_urlToImage(w,_){const A=e.Util.createImageElement();A.onload=function(){_(A)},A.src=w},_rgbToHex(w,_,A){return((1<<24)+(w<<16)+(_<<8)+A).toString(16).slice(1)},_hexToRgb(w){w=w.replace(d,f);const _=parseInt(w,16);return{r:_>>16&255,g:_>>8&255,b:_&255}},getRandomColor(){let w=(Math.random()*16777215<<0).toString(16);for(;w.length<6;)w=v+w;return d+w},getRGB(w){let _;return w in x?(_=x[w],{r:_[0],g:_[1],b:_[2]}):w[0]===d?this._hexToRgb(w.substring(1)):w.substr(0,4)===y?(_=E.exec(w.replace(/ /g,"")),{r:parseInt(_[1],10),g:parseInt(_[2],10),b:parseInt(_[3],10)}):{r:0,g:0,b:0}},colorToRGBA(w){return w=w||"black",e.Util._namedColorToRBA(w)||e.Util._hex3ColorToRGBA(w)||e.Util._hex4ColorToRGBA(w)||e.Util._hex6ColorToRGBA(w)||e.Util._hex8ColorToRGBA(w)||e.Util._rgbColorToRGBA(w)||e.Util._rgbaColorToRGBA(w)||e.Util._hslColorToRGBA(w)},_namedColorToRBA(w){const _=x[w.toLowerCase()];return _?{r:_[0],g:_[1],b:_[2],a:1}:null},_rgbColorToRGBA(w){if(w.indexOf("rgb(")===0){w=w.match(/rgb\(([^)]+)\)/)[1];const _=w.split(/ *, */).map(Number);return{r:_[0],g:_[1],b:_[2],a:1}}},_rgbaColorToRGBA(w){if(w.indexOf("rgba(")===0){w=w.match(/rgba\(([^)]+)\)/)[1];const _=w.split(/ *, */).map((A,M)=>A.slice(-1)==="%"?M===3?parseInt(A)/100:parseInt(A)/100*255:Number(A));return{r:_[0],g:_[1],b:_[2],a:_[3]}}},_hex8ColorToRGBA(w){if(w[0]==="#"&&w.length===9)return{r:parseInt(w.slice(1,3),16),g:parseInt(w.slice(3,5),16),b:parseInt(w.slice(5,7),16),a:parseInt(w.slice(7,9),16)/255}},_hex6ColorToRGBA(w){if(w[0]==="#"&&w.length===7)return{r:parseInt(w.slice(1,3),16),g:parseInt(w.slice(3,5),16),b:parseInt(w.slice(5,7),16),a:1}},_hex4ColorToRGBA(w){if(w[0]==="#"&&w.length===5)return{r:parseInt(w[1]+w[1],16),g:parseInt(w[2]+w[2],16),b:parseInt(w[3]+w[3],16),a:parseInt(w[4]+w[4],16)/255}},_hex3ColorToRGBA(w){if(w[0]==="#"&&w.length===4)return{r:parseInt(w[1]+w[1],16),g:parseInt(w[2]+w[2],16),b:parseInt(w[3]+w[3],16),a:1}},_hslColorToRGBA(w){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(w)){const[_,...A]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(w),M=Number(A[0])/360,O=Number(A[1])/100,L=Number(A[2])/100;let R,T,k;if(O===0)return k=L*255,{r:Math.round(k),g:Math.round(k),b:Math.round(k),a:1};L<.5?R=L*(1+O):R=L+O-L*O;const C=2*L-R,q=[0,0,0];for(let G=0;G<3;G++)T=M+1/3*-(G-1),T<0&&T++,T>1&&T--,6*T<1?k=C+(R-C)*6*T:2*T<1?k=R:3*T<2?k=C+(R-C)*(2/3-T)*6:k=C,q[G]=k*255;return{r:Math.round(q[0]),g:Math.round(q[1]),b:Math.round(q[2]),a:1}}},haveIntersection(w,_){return!(_.x>w.x+w.width||_.x+_.width<w.x||_.y>w.y+w.height||_.y+_.height<w.y)},cloneObject(w){const _={};for(const A in w)this._isPlainObject(w[A])?_[A]=this.cloneObject(w[A]):this._isArray(w[A])?_[A]=this.cloneArray(w[A]):_[A]=w[A];return _},cloneArray(w){return w.slice(0)},degToRad(w){return w*o},radToDeg(w){return w*u},_degToRad(w){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(w)},_radToDeg(w){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(w)},_getRotation(w){return t.Konva.angleDeg?e.Util.radToDeg(w):w},_capitalize(w){return w.charAt(0).toUpperCase()+w.slice(1)},throw(w){throw new Error(c+w)},error(w){console.error(c+w)},warn(w){t.Konva.showWarnings&&console.warn(g+w)},each(w,_){for(const A in w)_(A,w[A])},_inRange(w,_,A){return _<=w&&w<A},_getProjectionToSegment(w,_,A,M,O,L){let R,T,k;const C=(w-A)*(w-A)+(_-M)*(_-M);if(C==0)R=w,T=_,k=(O-A)*(O-A)+(L-M)*(L-M);else{const q=((O-w)*(A-w)+(L-_)*(M-_))/C;q<0?(R=w,T=_,k=(w-O)*(w-O)+(_-L)*(_-L)):q>1?(R=A,T=M,k=(A-O)*(A-O)+(M-L)*(M-L)):(R=w+q*(A-w),T=_+q*(M-_),k=(R-O)*(R-O)+(T-L)*(T-L))}return[R,T,k]},_getProjectionToLine(w,_,A){const M=e.Util.cloneObject(w);let O=Number.MAX_VALUE;return _.forEach(function(L,R){if(!A&&R===_.length-1)return;const T=_[(R+1)%_.length],k=e.Util._getProjectionToSegment(L.x,L.y,T.x,T.y,w.x,w.y),C=k[0],q=k[1],G=k[2];G<O&&(M.x=C,M.y=q,O=G)}),M},_prepareArrayForTween(w,_,A){const M=[],O=[];if(w.length>_.length){const R=_;_=w,w=R}for(let R=0;R<w.length;R+=2)M.push({x:w[R],y:w[R+1]});for(let R=0;R<_.length;R+=2)O.push({x:_[R],y:_[R+1]});const L=[];return O.forEach(function(R){const T=e.Util._getProjectionToLine(R,M,A);L.push(T.x),L.push(T.y)}),L},_prepareToStringify(w){let _;w.visitedByCircularReferenceRemoval=!0;for(const A in w)if(w.hasOwnProperty(A)&&w[A]&&typeof w[A]=="object"){if(_=Object.getOwnPropertyDescriptor(w,A),w[A].visitedByCircularReferenceRemoval||e.Util._isElement(w[A]))if(_.configurable)delete w[A];else return null;else if(e.Util._prepareToStringify(w[A])===null)if(_.configurable)delete w[A];else return null}return delete w.visitedByCircularReferenceRemoval,w},_assign(w,_){for(const A in _)w[A]=_[A];return w},_getFirstPointerId(w){return w.touches?w.changedTouches[0].identifier:w.pointerId||999},releaseCanvas(...w){t.Konva.releaseCanvasOnDestroy&&w.forEach(_=>{_.width=0,_.height=0})},drawRoundedRectPath(w,_,A,M){let O=0,L=0,R=0,T=0;typeof M=="number"?O=L=R=T=Math.min(M,_/2,A/2):(O=Math.min(M[0]||0,_/2,A/2),L=Math.min(M[1]||0,_/2,A/2),T=Math.min(M[2]||0,_/2,A/2),R=Math.min(M[3]||0,_/2,A/2)),w.moveTo(O,0),w.lineTo(_-L,0),w.arc(_-L,L,L,Math.PI*3/2,0,!1),w.lineTo(_,A-T),w.arc(_-T,A-T,T,0,Math.PI/2,!1),w.lineTo(R,A),w.arc(R,A-R,R,Math.PI/2,Math.PI,!1),w.lineTo(0,O),w.arc(O,O,O,Math.PI,Math.PI*3/2,!1)}}}(vg)),vg}var ed={},Wu={},Yu={},Wy;function U6(){if(Wy)return Yu;Wy=1,Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.HitContext=Yu.SceneContext=Yu.Context=void 0;const e=zi(),t=Nr();function r(S){const b=[],w=S.length,_=e.Util;for(let A=0;A<w;A++){let M=S[A];_._isNumber(M)?M=Math.round(M*1e3)/1e3:_._isString(M)||(M=M+""),b.push(M)}return b}const n=",",i="(",a=")",l="([",o="])",u=";",d="()",f="=",v=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],g=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],c=100;let y=class{constructor(b){this.canvas=b,t.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(b){b.fillEnabled()&&this._fill(b)}_fill(b){}strokeShape(b){b.hasStroke()&&this._stroke(b)}_stroke(b){}fillStrokeShape(b){b.attrs.fillAfterStrokeEnabled?(this.strokeShape(b),this.fillShape(b)):(this.fillShape(b),this.strokeShape(b))}getTrace(b,w){let _=this.traceArr,A=_.length,M="",O,L,R,T;for(O=0;O<A;O++)L=_[O],R=L.method,R?(T=L.args,M+=R,b?M+=d:e.Util._isArray(T[0])?M+=l+T.join(n)+o:(w&&(T=T.map(k=>typeof k=="number"?Math.floor(k):k)),M+=i+T.join(n)+a)):(M+=L.property,b||(M+=f+L.val)),M+=u;return M}clearTrace(){this.traceArr=[]}_trace(b){let w=this.traceArr,_;w.push(b),_=w.length,_>=c&&w.shift()}reset(){const b=this.getCanvas().getPixelRatio();this.setTransform(1*b,0,0,1*b,0,0)}getCanvas(){return this.canvas}clear(b){const w=this.getCanvas();b?this.clearRect(b.x||0,b.y||0,b.width||0,b.height||0):this.clearRect(0,0,w.getWidth()/w.pixelRatio,w.getHeight()/w.pixelRatio)}_applyLineCap(b){const w=b.attrs.lineCap;w&&this.setAttr("lineCap",w)}_applyOpacity(b){const w=b.getAbsoluteOpacity();w!==1&&this.setAttr("globalAlpha",w)}_applyLineJoin(b){const w=b.attrs.lineJoin;w&&this.setAttr("lineJoin",w)}setAttr(b,w){this._context[b]=w}arc(b,w,_,A,M,O){this._context.arc(b,w,_,A,M,O)}arcTo(b,w,_,A,M){this._context.arcTo(b,w,_,A,M)}beginPath(){this._context.beginPath()}bezierCurveTo(b,w,_,A,M,O){this._context.bezierCurveTo(b,w,_,A,M,O)}clearRect(b,w,_,A){this._context.clearRect(b,w,_,A)}clip(...b){this._context.clip.apply(this._context,b)}closePath(){this._context.closePath()}createImageData(b,w){const _=arguments;if(_.length===2)return this._context.createImageData(b,w);if(_.length===1)return this._context.createImageData(b)}createLinearGradient(b,w,_,A){return this._context.createLinearGradient(b,w,_,A)}createPattern(b,w){return this._context.createPattern(b,w)}createRadialGradient(b,w,_,A,M,O){return this._context.createRadialGradient(b,w,_,A,M,O)}drawImage(b,w,_,A,M,O,L,R,T){const k=arguments,C=this._context;k.length===3?C.drawImage(b,w,_):k.length===5?C.drawImage(b,w,_,A,M):k.length===9&&C.drawImage(b,w,_,A,M,O,L,R,T)}ellipse(b,w,_,A,M,O,L,R){this._context.ellipse(b,w,_,A,M,O,L,R)}isPointInPath(b,w,_,A){return _?this._context.isPointInPath(_,b,w,A):this._context.isPointInPath(b,w,A)}fill(...b){this._context.fill.apply(this._context,b)}fillRect(b,w,_,A){this._context.fillRect(b,w,_,A)}strokeRect(b,w,_,A){this._context.strokeRect(b,w,_,A)}fillText(b,w,_,A){A?this._context.fillText(b,w,_,A):this._context.fillText(b,w,_)}measureText(b){return this._context.measureText(b)}getImageData(b,w,_,A){return this._context.getImageData(b,w,_,A)}lineTo(b,w){this._context.lineTo(b,w)}moveTo(b,w){this._context.moveTo(b,w)}rect(b,w,_,A){this._context.rect(b,w,_,A)}roundRect(b,w,_,A,M){this._context.roundRect(b,w,_,A,M)}putImageData(b,w,_){this._context.putImageData(b,w,_)}quadraticCurveTo(b,w,_,A){this._context.quadraticCurveTo(b,w,_,A)}restore(){this._context.restore()}rotate(b){this._context.rotate(b)}save(){this._context.save()}scale(b,w){this._context.scale(b,w)}setLineDash(b){this._context.setLineDash?this._context.setLineDash(b):"mozDash"in this._context?this._context.mozDash=b:"webkitLineDash"in this._context&&(this._context.webkitLineDash=b)}getLineDash(){return this._context.getLineDash()}setTransform(b,w,_,A,M,O){this._context.setTransform(b,w,_,A,M,O)}stroke(b){b?this._context.stroke(b):this._context.stroke()}strokeText(b,w,_,A){this._context.strokeText(b,w,_,A)}transform(b,w,_,A,M,O){this._context.transform(b,w,_,A,M,O)}translate(b,w){this._context.translate(b,w)}_enableTrace(){let b=this,w=v.length,_=this.setAttr,A,M;const O=function(L){let R=b[L],T;b[L]=function(){return M=r(Array.prototype.slice.call(arguments,0)),T=R.apply(b,arguments),b._trace({method:L,args:M}),T}};for(A=0;A<w;A++)O(v[A]);b.setAttr=function(){_.apply(b,arguments);const L=arguments[0];let R=arguments[1];(L==="shadowOffsetX"||L==="shadowOffsetY"||L==="shadowBlur")&&(R=R/this.canvas.getPixelRatio()),b._trace({property:L,val:R})}}_applyGlobalCompositeOperation(b){const w=b.attrs.globalCompositeOperation;!w||w==="source-over"||this.setAttr("globalCompositeOperation",w)}};Yu.Context=y,g.forEach(function(S){Object.defineProperty(y.prototype,S,{get(){return this._context[S]},set(b){this._context[S]=b}})});class x extends y{constructor(b,{willReadFrequently:w=!1}={}){super(b),this._context=b._canvas.getContext("2d",{willReadFrequently:w})}_fillColor(b){const w=b.fill();this.setAttr("fillStyle",w),b._fillFunc(this)}_fillPattern(b){this.setAttr("fillStyle",b._getFillPattern()),b._fillFunc(this)}_fillLinearGradient(b){const w=b._getLinearGradient();w&&(this.setAttr("fillStyle",w),b._fillFunc(this))}_fillRadialGradient(b){const w=b._getRadialGradient();w&&(this.setAttr("fillStyle",w),b._fillFunc(this))}_fill(b){const w=b.fill(),_=b.getFillPriority();if(w&&_==="color"){this._fillColor(b);return}const A=b.getFillPatternImage();if(A&&_==="pattern"){this._fillPattern(b);return}const M=b.getFillLinearGradientColorStops();if(M&&_==="linear-gradient"){this._fillLinearGradient(b);return}const O=b.getFillRadialGradientColorStops();if(O&&_==="radial-gradient"){this._fillRadialGradient(b);return}w?this._fillColor(b):A?this._fillPattern(b):M?this._fillLinearGradient(b):O&&this._fillRadialGradient(b)}_strokeLinearGradient(b){const w=b.getStrokeLinearGradientStartPoint(),_=b.getStrokeLinearGradientEndPoint(),A=b.getStrokeLinearGradientColorStops(),M=this.createLinearGradient(w.x,w.y,_.x,_.y);if(A){for(let O=0;O<A.length;O+=2)M.addColorStop(A[O],A[O+1]);this.setAttr("strokeStyle",M)}}_stroke(b){const w=b.dash(),_=b.getStrokeScaleEnabled();if(b.hasStroke()){if(!_){this.save();const M=this.getCanvas().getPixelRatio();this.setTransform(M,0,0,M,0,0)}this._applyLineCap(b),w&&b.dashEnabled()&&(this.setLineDash(w),this.setAttr("lineDashOffset",b.dashOffset())),this.setAttr("lineWidth",b.strokeWidth()),b.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),b.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(b):this.setAttr("strokeStyle",b.stroke()),b._strokeFunc(this),_||this.restore()}}_applyShadow(b){var w,_,A;const M=(w=b.getShadowRGBA())!==null&&w!==void 0?w:"black",O=(_=b.getShadowBlur())!==null&&_!==void 0?_:5,L=(A=b.getShadowOffset())!==null&&A!==void 0?A:{x:0,y:0},R=b.getAbsoluteScale(),T=this.canvas.getPixelRatio(),k=R.x*T,C=R.y*T;this.setAttr("shadowColor",M),this.setAttr("shadowBlur",O*Math.min(Math.abs(k),Math.abs(C))),this.setAttr("shadowOffsetX",L.x*k),this.setAttr("shadowOffsetY",L.y*C)}}Yu.SceneContext=x;class E extends y{constructor(b){super(b),this._context=b._canvas.getContext("2d",{willReadFrequently:!0})}_fill(b){this.save(),this.setAttr("fillStyle",b.colorKey),b._fillFuncHit(this),this.restore()}strokeShape(b){b.hasHitStroke()&&this._stroke(b)}_stroke(b){if(b.hasHitStroke()){const w=b.getStrokeScaleEnabled();if(!w){this.save();const M=this.getCanvas().getPixelRatio();this.setTransform(M,0,0,M,0,0)}this._applyLineCap(b);const _=b.hitStrokeWidth(),A=_==="auto"?b.strokeWidth():_;this.setAttr("lineWidth",A),this.setAttr("strokeStyle",b.colorKey),b._strokeFuncHit(this),w||this.restore()}}}return Yu.HitContext=E,Yu}var Yy;function d0(){if(Yy)return Wu;Yy=1,Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.HitCanvas=Wu.SceneCanvas=Wu.Canvas=void 0;const e=zi(),t=U6(),r=Nr();let n;function i(){if(n)return n;const u=e.Util.createCanvasElement(),d=u.getContext("2d");return n=function(){const f=r.Konva._global.devicePixelRatio||1,v=d.webkitBackingStorePixelRatio||d.mozBackingStorePixelRatio||d.msBackingStorePixelRatio||d.oBackingStorePixelRatio||d.backingStorePixelRatio||1;return f/v}(),e.Util.releaseCanvas(u),n}let a=class{constructor(d){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const v=(d||{}).pixelRatio||r.Konva.pixelRatio||i();this.pixelRatio=v,this._canvas=e.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(d){const f=this.pixelRatio;this.pixelRatio=d,this.setSize(this.getWidth()/f,this.getHeight()/f)}setWidth(d){this.width=this._canvas.width=d*this.pixelRatio,this._canvas.style.width=d+"px";const f=this.pixelRatio;this.getContext()._context.scale(f,f)}setHeight(d){this.height=this._canvas.height=d*this.pixelRatio,this._canvas.style.height=d+"px";const f=this.pixelRatio;this.getContext()._context.scale(f,f)}getWidth(){return this.width}getHeight(){return this.height}setSize(d,f){this.setWidth(d||0),this.setHeight(f||0)}toDataURL(d,f){try{return this._canvas.toDataURL(d,f)}catch{try{return this._canvas.toDataURL()}catch(g){return e.Util.error("Unable to get data URL. "+g.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}};Wu.Canvas=a;class l extends a{constructor(d={width:0,height:0,willReadFrequently:!1}){super(d),this.context=new t.SceneContext(this,{willReadFrequently:d.willReadFrequently}),this.setSize(d.width,d.height)}}Wu.SceneCanvas=l;class o extends a{constructor(d={width:0,height:0}){super(d),this.hitCanvas=!0,this.context=new t.HitContext(this),this.setSize(d.width,d.height)}}return Wu.HitCanvas=o,Wu}var mg={},Xy;function fm(){return Xy||(Xy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=Nr(),r=zi();e.DD={get isDragging(){let n=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(n=!0)}),n},justDragged:!1,get node(){let n;return e.DD._dragElements.forEach(i=>{n=i.node}),n},_dragElements:new Map,_drag(n){const i=[];e.DD._dragElements.forEach((a,l)=>{const{node:o}=a,u=o.getStage();u.setPointersPositions(n),a.pointerId===void 0&&(a.pointerId=r.Util._getFirstPointerId(n));const d=u._changedPointerPositions.find(f=>f.id===a.pointerId);if(d){if(a.dragStatus!=="dragging"){const f=o.dragDistance();if(Math.max(Math.abs(d.x-a.startPointerPos.x),Math.abs(d.y-a.startPointerPos.y))<f||(o.startDrag({evt:n}),!o.isDragging()))return}o._setDragPosition(n,a),i.push(o)}}),i.forEach(a=>{a.fire("dragmove",{type:"dragmove",target:a,evt:n},!0)})},_endDragBefore(n){const i=[];e.DD._dragElements.forEach(a=>{const{node:l}=a,o=l.getStage();if(n&&o.setPointersPositions(n),!o._changedPointerPositions.find(f=>f.id===a.pointerId))return;(a.dragStatus==="dragging"||a.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,a.dragStatus="stopped");const d=a.node.getLayer()||a.node instanceof t.Konva.Stage&&a.node;d&&i.indexOf(d)===-1&&i.push(d)}),i.forEach(a=>{a.draw()})},_endDragAfter(n){e.DD._dragElements.forEach((i,a)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:n},!0),i.dragStatus!=="dragging"&&e.DD._dragElements.delete(a)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("touchcancel",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1),window.addEventListener("touchcancel",e.DD._endDragAfter,!1))}(mg)),mg}var yg={},ys={},Ky;function qr(){if(Ky)return ys;Ky=1,Object.defineProperty(ys,"__esModule",{value:!0}),ys.RGBComponent=n,ys.alphaComponent=i,ys.getNumberValidator=a,ys.getNumberOrArrayOfNumbersValidator=l,ys.getNumberOrAutoValidator=o,ys.getStringValidator=u,ys.getStringOrGradientValidator=d,ys.getFunctionValidator=f,ys.getNumberArrayValidator=v,ys.getBooleanValidator=g,ys.getComponentValidator=c;const e=Nr(),t=zi();function r(y){return t.Util._isString(y)?'"'+y+'"':Object.prototype.toString.call(y)==="[object Number]"||t.Util._isBoolean(y)?y:Object.prototype.toString.call(y)}function n(y){return y>255?255:y<0?0:Math.round(y)}function i(y){return y>1?1:y<1e-4?1e-4:y}function a(){if(e.Konva.isUnminified)return function(y,x){return t.Util._isNumber(y)||t.Util.warn(r(y)+' is a not valid value for "'+x+'" attribute. The value should be a number.'),y}}function l(y){if(e.Konva.isUnminified)return function(x,E){let S=t.Util._isNumber(x),b=t.Util._isArray(x)&&x.length==y;return!S&&!b&&t.Util.warn(r(x)+' is a not valid value for "'+E+'" attribute. The value should be a number or Array<number>('+y+")"),x}}function o(){if(e.Konva.isUnminified)return function(y,x){return t.Util._isNumber(y)||y==="auto"||t.Util.warn(r(y)+' is a not valid value for "'+x+'" attribute. The value should be a number or "auto".'),y}}function u(){if(e.Konva.isUnminified)return function(y,x){return t.Util._isString(y)||t.Util.warn(r(y)+' is a not valid value for "'+x+'" attribute. The value should be a string.'),y}}function d(){if(e.Konva.isUnminified)return function(y,x){const E=t.Util._isString(y),S=Object.prototype.toString.call(y)==="[object CanvasGradient]"||y&&y.addColorStop;return E||S||t.Util.warn(r(y)+' is a not valid value for "'+x+'" attribute. The value should be a string or a native gradient.'),y}}function f(){if(e.Konva.isUnminified)return function(y,x){return t.Util._isFunction(y)||t.Util.warn(r(y)+' is a not valid value for "'+x+'" attribute. The value should be a function.'),y}}function v(){if(e.Konva.isUnminified)return function(y,x){const E=Int8Array?Object.getPrototypeOf(Int8Array):null;return E&&y instanceof E||(t.Util._isArray(y)?y.forEach(function(S){t.Util._isNumber(S)||t.Util.warn('"'+x+'" attribute has non numeric element '+S+". Make sure that all elements are numbers.")}):t.Util.warn(r(y)+' is a not valid value for "'+x+'" attribute. The value should be a array of numbers.')),y}}function g(){if(e.Konva.isUnminified)return function(y,x){return y===!0||y===!1||t.Util.warn(r(y)+' is a not valid value for "'+x+'" attribute. The value should be a boolean.'),y}}function c(y){if(e.Konva.isUnminified)return function(x,E){return x==null||t.Util.isObject(x)||t.Util.warn(r(x)+' is a not valid value for "'+E+'" attribute. The value should be an object with properties '+y),x}}return ys}var Zy;function jr(){return Zy||(Zy=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=zi(),r=qr(),n="get",i="set";e.Factory={addGetterSetter(a,l,o,u,d){e.Factory.addGetter(a,l,o),e.Factory.addSetter(a,l,u,d),e.Factory.addOverloadedGetterSetter(a,l)},addGetter(a,l,o){const u=n+t.Util._capitalize(l);a.prototype[u]=a.prototype[u]||function(){const d=this.attrs[l];return d===void 0?o:d}},addSetter(a,l,o,u){const d=i+t.Util._capitalize(l);a.prototype[d]||e.Factory.overWriteSetter(a,l,o,u)},overWriteSetter(a,l,o,u){const d=i+t.Util._capitalize(l);a.prototype[d]=function(f){return o&&f!==void 0&&f!==null&&(f=o.call(this,f,l)),this._setAttr(l,f),u&&u.call(this),this}},addComponentsGetterSetter(a,l,o,u,d){const f=o.length,v=t.Util._capitalize,g=n+v(l),c=i+v(l);a.prototype[g]=function(){const x={};for(let E=0;E<f;E++){const S=o[E];x[S]=this.getAttr(l+v(S))}return x};const y=(0,r.getComponentValidator)(o);a.prototype[c]=function(x){const E=this.attrs[l];u&&(x=u.call(this,x,l)),y&&y.call(this,x,l);for(const S in x)x.hasOwnProperty(S)&&this._setAttr(l+v(S),x[S]);return x||o.forEach(S=>{this._setAttr(l+v(S),void 0)}),this._fireChangeEvent(l,E,x),d&&d.call(this),this},e.Factory.addOverloadedGetterSetter(a,l)},addOverloadedGetterSetter(a,l){const o=t.Util._capitalize(l),u=i+o,d=n+o;a.prototype[l]=function(){return arguments.length?(this[u](arguments[0]),this):this[d]()}},addDeprecatedGetterSetter(a,l,o,u){t.Util.error("Adding deprecated "+l);const d=n+t.Util._capitalize(l),f=l+" property is deprecated and will be removed soon. Look at Konva change log for more information.";a.prototype[d]=function(){t.Util.error(f);const v=this.attrs[l];return v===void 0?o:v},e.Factory.addSetter(a,l,u,function(){t.Util.error(f)}),e.Factory.addOverloadedGetterSetter(a,l)},backCompat(a,l){t.Util.each(l,function(o,u){const d=a.prototype[u],f=n+t.Util._capitalize(o),v=i+t.Util._capitalize(o);function g(){d.apply(this,arguments),t.Util.error('"'+o+'" method is deprecated and will be removed soon. Use ""'+u+'" instead.')}a.prototype[o]=g,a.prototype[f]=g,a.prototype[v]=g})},afterSetFilter(){this._filterUpToDate=!1}}}(yg)),yg}var Qy;function oa(){if(Qy)return ed;Qy=1,Object.defineProperty(ed,"__esModule",{value:!0}),ed.Node=void 0;const e=d0(),t=fm(),r=jr(),n=Nr(),i=zi(),a=qr(),l="absoluteOpacity",o="allEventListeners",u="absoluteTransform",d="absoluteScale",f="canvas",v="Change",g="children",c="konva",y="listening",x="mouseenter",E="mouseleave",S="pointerenter",b="pointerleave",w="touchenter",_="touchleave",A="set",M="Shape",O=" ",L="stage",R="transform",T="Stage",k="visible",C=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(O);let q=1;class G{constructor(H){this._id=q++,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(H),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(H){(H===R||H===u)&&this._cache.get(H)?this._cache.get(H).dirty=!0:H?this._cache.delete(H):this._cache.clear()}_getCache(H,V){let Y=this._cache.get(H);return(Y===void 0||(H===R||H===u)&&Y.dirty===!0)&&(Y=V.call(this),this._cache.set(H,Y)),Y}_calculate(H,V,Y){if(!this._attachedDepsListeners.get(H)){const U=V.map(D=>D+"Change.konva").join(O);this.on(U,()=>{this._clearCache(H)}),this._attachedDepsListeners.set(H,!0)}return this._getCache(H,Y)}_getCanvasCache(){return this._cache.get(f)}_clearSelfAndDescendantCache(H){this._clearCache(H),H===u&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(f)){const{scene:H,filter:V,hit:Y,buffer:U}=this._cache.get(f);i.Util.releaseCanvas(H,V,Y,U),this._cache.delete(f)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(H){const V=H||{};let Y={};(V.x===void 0||V.y===void 0||V.width===void 0||V.height===void 0)&&(Y=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let U=Math.ceil(V.width||Y.width),D=Math.ceil(V.height||Y.height),j=V.pixelRatio,z=V.x===void 0?Math.floor(Y.x):V.x,Z=V.y===void 0?Math.floor(Y.y):V.y,re=V.offset||0,W=V.drawBorder||!1,Q=V.hitCanvasPixelRatio||1;if(!U||!D){i.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const se=Math.abs(Math.round(Y.x)-z)>.5?1:0,ue=Math.abs(Math.round(Y.y)-Z)>.5?1:0;U+=re*2+se,D+=re*2+ue,z-=re,Z-=re;const le=new e.SceneCanvas({pixelRatio:j,width:U,height:D}),ye=new e.SceneCanvas({pixelRatio:j,width:0,height:0,willReadFrequently:!0}),Re=new e.HitCanvas({pixelRatio:Q,width:U,height:D}),Me=le.getContext(),Pe=Re.getContext(),de=new e.SceneCanvas({width:le.width/le.pixelRatio+Math.abs(z),height:le.height/le.pixelRatio+Math.abs(Z),pixelRatio:le.pixelRatio}),Te=de.getContext();return Re.isCache=!0,le.isCache=!0,this._cache.delete(f),this._filterUpToDate=!1,V.imageSmoothingEnabled===!1&&(le.getContext()._context.imageSmoothingEnabled=!1,ye.getContext()._context.imageSmoothingEnabled=!1),Me.save(),Pe.save(),Te.save(),Me.translate(-z,-Z),Pe.translate(-z,-Z),Te.translate(-z,-Z),de.x=z,de.y=Z,this._isUnderCache=!0,this._clearSelfAndDescendantCache(l),this._clearSelfAndDescendantCache(d),this.drawScene(le,this,de),this.drawHit(Re,this),this._isUnderCache=!1,Me.restore(),Pe.restore(),W&&(Me.save(),Me.beginPath(),Me.rect(0,0,U,D),Me.closePath(),Me.setAttr("strokeStyle","red"),Me.setAttr("lineWidth",5),Me.stroke(),Me.restore()),this._cache.set(f,{scene:le,filter:ye,hit:Re,buffer:de,x:z,y:Z}),this._requestDraw(),this}isCached(){return this._cache.has(f)}getClientRect(H){throw new Error('abstract "getClientRect" method call')}_transformedRect(H,V){const Y=[{x:H.x,y:H.y},{x:H.x+H.width,y:H.y},{x:H.x+H.width,y:H.y+H.height},{x:H.x,y:H.y+H.height}];let U=1/0,D=1/0,j=-1/0,z=-1/0;const Z=this.getAbsoluteTransform(V);return Y.forEach(function(re){const W=Z.point(re);U===void 0&&(U=j=W.x,D=z=W.y),U=Math.min(U,W.x),D=Math.min(D,W.y),j=Math.max(j,W.x),z=Math.max(z,W.y)}),{x:U,y:D,width:j-U,height:z-D}}_drawCachedSceneCanvas(H){H.save(),H._applyOpacity(this),H._applyGlobalCompositeOperation(this);const V=this._getCanvasCache();H.translate(V.x,V.y);const Y=this._getCachedSceneCanvas(),U=Y.pixelRatio;H.drawImage(Y._canvas,0,0,Y.width/U,Y.height/U),H.restore()}_drawCachedHitCanvas(H){const V=this._getCanvasCache(),Y=V.hit;H.save(),H.translate(V.x,V.y),H.drawImage(Y._canvas,0,0,Y.width/Y.pixelRatio,Y.height/Y.pixelRatio),H.restore()}_getCachedSceneCanvas(){let H=this.filters(),V=this._getCanvasCache(),Y=V.scene,U=V.filter,D=U.getContext(),j,z,Z,re;if(H){if(!this._filterUpToDate){const W=Y.pixelRatio;U.setSize(Y.width/Y.pixelRatio,Y.height/Y.pixelRatio);try{for(j=H.length,D.clear(),D.drawImage(Y._canvas,0,0,Y.getWidth()/W,Y.getHeight()/W),z=D.getImageData(0,0,U.getWidth(),U.getHeight()),Z=0;Z<j;Z++){if(re=H[Z],typeof re!="function"){i.Util.error("Filter should be type of function, but got "+typeof re+" instead. Please check correct filters");continue}re.call(this,z),D.putImageData(z,0,0)}}catch(Q){i.Util.error("Unable to apply filter. "+Q.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return U}return Y}on(H,V){if(this._cache&&this._cache.delete(o),arguments.length===3)return this._delegate.apply(this,arguments);const Y=H.split(O);for(let U=0;U<Y.length;U++){const j=Y[U].split("."),z=j[0],Z=j[1]||"";this.eventListeners[z]||(this.eventListeners[z]=[]),this.eventListeners[z].push({name:Z,handler:V})}return this}off(H,V){let Y=(H||"").split(O),U=Y.length,D,j,z,Z,re,W;if(this._cache&&this._cache.delete(o),!H)for(j in this.eventListeners)this._off(j);for(D=0;D<U;D++)if(z=Y[D],Z=z.split("."),re=Z[0],W=Z[1],re)this.eventListeners[re]&&this._off(re,W,V);else for(j in this.eventListeners)this._off(j,W,V);return this}dispatchEvent(H){const V={target:this,type:H.type,evt:H};return this.fire(H.type,V),this}addEventListener(H,V){return this.on(H,function(Y){V.call(this,Y.evt)}),this}removeEventListener(H){return this.off(H),this}_delegate(H,V,Y){const U=this;this.on(H,function(D){const j=D.target.findAncestors(V,!0,U);for(let z=0;z<j.length;z++)D=i.Util.cloneObject(D),D.currentTarget=j[z],Y.call(j[z],D)})}remove(){return this.isDragging()&&this.stopDrag(),t.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(u),this._clearSelfAndDescendantCache(l),this._clearSelfAndDescendantCache(d),this._clearSelfAndDescendantCache(L),this._clearSelfAndDescendantCache(k),this._clearSelfAndDescendantCache(y)}_remove(){this._clearCaches();const H=this.getParent();H&&H.children&&(H.children.splice(this.index,1),H._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(H){const V="get"+i.Util._capitalize(H);return i.Util._isFunction(this[V])?this[V]():this.attrs[H]}getAncestors(){let H=this.getParent(),V=[];for(;H;)V.push(H),H=H.getParent();return V}getAttrs(){return this.attrs||{}}setAttrs(H){return this._batchTransformChanges(()=>{let V,Y;if(!H)return this;for(V in H)V!==g&&(Y=A+i.Util._capitalize(V),i.Util._isFunction(this[Y])?this[Y](H[V]):this._setAttr(V,H[V]))}),this}isListening(){return this._getCache(y,this._isListening)}_isListening(H){if(!this.listening())return!1;const Y=this.getParent();return Y&&Y!==H&&this!==H?Y._isListening(H):!0}isVisible(){return this._getCache(k,this._isVisible)}_isVisible(H){if(!this.visible())return!1;const Y=this.getParent();return Y&&Y!==H&&this!==H?Y._isVisible(H):!0}shouldDrawHit(H,V=!1){if(H)return this._isVisible(H)&&this._isListening(H);const Y=this.getLayer();let U=!1;t.DD._dragElements.forEach(j=>{j.dragStatus==="dragging"&&(j.node.nodeType==="Stage"||j.node.getLayer()===Y)&&(U=!0)});const D=!V&&!n.Konva.hitOnDragEnabled&&(U||n.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!D}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let H=this.getDepth(),V=this,Y=0,U,D,j,z;function Z(W){for(U=[],D=W.length,j=0;j<D;j++)z=W[j],Y++,z.nodeType!==M&&(U=U.concat(z.getChildren().slice())),z._id===V._id&&(j=D);U.length>0&&U[0].getDepth()<=H&&Z(U)}const re=this.getStage();return V.nodeType!==T&&re&&Z(re.getChildren()),Y}getDepth(){let H=0,V=this.parent;for(;V;)H++,V=V.parent;return H}_batchTransformChanges(H){this._batchingTransformChange=!0,H(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(R),this._clearSelfAndDescendantCache(u)),this._needClearTransformCache=!1}setPosition(H){return this._batchTransformChanges(()=>{this.x(H.x),this.y(H.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const H=this.getStage();if(!H)return null;const V=H.getPointerPosition();if(!V)return null;const Y=this.getAbsoluteTransform().copy();return Y.invert(),Y.point(V)}getAbsolutePosition(H){let V=!1,Y=this.parent;for(;Y;){if(Y.isCached()){V=!0;break}Y=Y.parent}V&&!H&&(H=!0);const U=this.getAbsoluteTransform(H).getMatrix(),D=new i.Transform,j=this.offset();return D.m=U.slice(),D.translate(j.x,j.y),D.getTranslation()}setAbsolutePosition(H){const{x:V,y:Y,...U}=this._clearTransform();this.attrs.x=V,this.attrs.y=Y,this._clearCache(R);const D=this._getAbsoluteTransform().copy();return D.invert(),D.translate(H.x,H.y),H={x:this.attrs.x+D.getTranslation().x,y:this.attrs.y+D.getTranslation().y},this._setTransform(U),this.setPosition({x:H.x,y:H.y}),this._clearCache(R),this._clearSelfAndDescendantCache(u),this}_setTransform(H){let V;for(V in H)this.attrs[V]=H[V]}_clearTransform(){const H={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,H}move(H){let V=H.x,Y=H.y,U=this.x(),D=this.y();return V!==void 0&&(U+=V),Y!==void 0&&(D+=Y),this.setPosition({x:U,y:D}),this}_eachAncestorReverse(H,V){let Y=[],U=this.getParent(),D,j;if(!(V&&V._id===this._id)){for(Y.unshift(this);U&&(!V||U._id!==V._id);)Y.unshift(U),U=U.parent;for(D=Y.length,j=0;j<D;j++)H(Y[j])}}rotate(H){return this.rotation(this.rotation()+H),this}moveToTop(){if(!this.parent)return i.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const H=this.index,V=this.parent.getChildren().length;return H<V-1?(this.parent.children.splice(H,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return i.Util.warn("Node has no parent. moveUp function is ignored."),!1;const H=this.index,V=this.parent.getChildren().length;return H<V-1?(this.parent.children.splice(H,1),this.parent.children.splice(H+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return i.Util.warn("Node has no parent. moveDown function is ignored."),!1;const H=this.index;return H>0?(this.parent.children.splice(H,1),this.parent.children.splice(H-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return i.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;const H=this.index;return H>0?(this.parent.children.splice(H,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(H){if(!this.parent)return i.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(H<0||H>=this.parent.children.length)&&i.Util.warn("Unexpected value "+H+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const V=this.index;return this.parent.children.splice(V,1),this.parent.children.splice(H,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(l,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let H=this.opacity();const V=this.getParent();return V&&!V._isUnderCache&&(H*=V.getAbsoluteOpacity()),H}moveTo(H){return this.getParent()!==H&&(this._remove(),H.add(this)),this}toObject(){let H=this.getAttrs(),V,Y,U,D,j;const z={attrs:{},className:this.getClassName()};for(V in H)Y=H[V],j=i.Util.isObject(Y)&&!i.Util._isPlainObject(Y)&&!i.Util._isArray(Y),!j&&(U=typeof this[V]=="function"&&this[V],delete H[V],D=U?U.call(this):null,H[V]=Y,D!==Y&&(z.attrs[V]=Y));return i.Util._prepareToStringify(z)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(H,V,Y){const U=[];V&&this._isMatch(H)&&U.push(this);let D=this.parent;for(;D;){if(D===Y)return U;D._isMatch(H)&&U.push(D),D=D.parent}return U}isAncestorOf(H){return!1}findAncestor(H,V,Y){return this.findAncestors(H,V,Y)[0]}_isMatch(H){if(!H)return!1;if(typeof H=="function")return H(this);let V=H.replace(/ /g,"").split(","),Y=V.length,U,D;for(U=0;U<Y;U++)if(D=V[U],i.Util.isValidSelector(D)||(i.Util.warn('Selector "'+D+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),i.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),i.Util.warn("Konva is awesome, right?")),D.charAt(0)==="#"){if(this.id()===D.slice(1))return!0}else if(D.charAt(0)==="."){if(this.hasName(D.slice(1)))return!0}else if(this.className===D||this.nodeType===D)return!0;return!1}getLayer(){const H=this.getParent();return H?H.getLayer():null}getStage(){return this._getCache(L,this._getStage)}_getStage(){const H=this.getParent();return H?H.getStage():null}fire(H,V={},Y){return V.target=V.target||this,Y?this._fireAndBubble(H,V):this._fire(H,V),this}getAbsoluteTransform(H){return H?this._getAbsoluteTransform(H):this._getCache(u,this._getAbsoluteTransform)}_getAbsoluteTransform(H){let V;if(H)return V=new i.Transform,this._eachAncestorReverse(function(Y){const U=Y.transformsEnabled();U==="all"?V.multiply(Y.getTransform()):U==="position"&&V.translate(Y.x()-Y.offsetX(),Y.y()-Y.offsetY())},H),V;{V=this._cache.get(u)||new i.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(V):V.reset();const Y=this.transformsEnabled();if(Y==="all")V.multiply(this.getTransform());else if(Y==="position"){const U=this.attrs.x||0,D=this.attrs.y||0,j=this.attrs.offsetX||0,z=this.attrs.offsetY||0;V.translate(U-j,D-z)}return V.dirty=!1,V}}getAbsoluteScale(H){let V=this;for(;V;)V._isUnderCache&&(H=V),V=V.getParent();const U=this.getAbsoluteTransform(H).decompose();return{x:U.scaleX,y:U.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(R,this._getTransform)}_getTransform(){var H,V;const Y=this._cache.get(R)||new i.Transform;Y.reset();const U=this.x(),D=this.y(),j=n.Konva.getAngle(this.rotation()),z=(H=this.attrs.scaleX)!==null&&H!==void 0?H:1,Z=(V=this.attrs.scaleY)!==null&&V!==void 0?V:1,re=this.attrs.skewX||0,W=this.attrs.skewY||0,Q=this.attrs.offsetX||0,se=this.attrs.offsetY||0;return(U!==0||D!==0)&&Y.translate(U,D),j!==0&&Y.rotate(j),(re!==0||W!==0)&&Y.skew(re,W),(z!==1||Z!==1)&&Y.scale(z,Z),(Q!==0||se!==0)&&Y.translate(-1*Q,-1*se),Y.dirty=!1,Y}clone(H){let V=i.Util.cloneObject(this.attrs),Y,U,D,j,z;for(Y in H)V[Y]=H[Y];const Z=new this.constructor(V);for(Y in this.eventListeners)for(U=this.eventListeners[Y],D=U.length,j=0;j<D;j++)z=U[j],z.name.indexOf(c)<0&&(Z.eventListeners[Y]||(Z.eventListeners[Y]=[]),Z.eventListeners[Y].push(z));return Z}_toKonvaCanvas(H){H=H||{};const V=this.getClientRect(),Y=this.getStage(),U=H.x!==void 0?H.x:Math.floor(V.x),D=H.y!==void 0?H.y:Math.floor(V.y),j=H.pixelRatio||1,z=new e.SceneCanvas({width:H.width||Math.ceil(V.width)||(Y?Y.width():0),height:H.height||Math.ceil(V.height)||(Y?Y.height():0),pixelRatio:j}),Z=z.getContext(),re=new e.SceneCanvas({width:z.width/z.pixelRatio+Math.abs(U),height:z.height/z.pixelRatio+Math.abs(D),pixelRatio:z.pixelRatio});return H.imageSmoothingEnabled===!1&&(Z._context.imageSmoothingEnabled=!1),Z.save(),(U||D)&&Z.translate(-1*U,-1*D),this.drawScene(z,void 0,re),Z.restore(),z}toCanvas(H){return this._toKonvaCanvas(H)._canvas}toDataURL(H){H=H||{};const V=H.mimeType||null,Y=H.quality||null,U=this._toKonvaCanvas(H).toDataURL(V,Y);return H.callback&&H.callback(U),U}toImage(H){return new Promise((V,Y)=>{try{const U=H?.callback;U&&delete H.callback,i.Util._urlToImage(this.toDataURL(H),function(D){V(D),U?.(D)})}catch(U){Y(U)}})}toBlob(H){return new Promise((V,Y)=>{try{const U=H?.callback;U&&delete H.callback,this.toCanvas(H).toBlob(D=>{V(D),U?.(D)},H?.mimeType,H?.quality)}catch(U){Y(U)}})}setSize(H){return this.width(H.width),this.height(H.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():n.Konva.dragDistance}_off(H,V,Y){let U=this.eventListeners[H],D,j,z;for(D=0;D<U.length;D++)if(j=U[D].name,z=U[D].handler,(j!=="konva"||V==="konva")&&(!V||j===V)&&(!Y||Y===z)){if(U.splice(D,1),U.length===0){delete this.eventListeners[H];break}D--}}_fireChangeEvent(H,V,Y){this._fire(H+v,{oldVal:V,newVal:Y})}addName(H){if(!this.hasName(H)){const V=this.name(),Y=V?V+" "+H:H;this.name(Y)}return this}hasName(H){if(!H)return!1;const V=this.name();return V?(V||"").split(/\s/g).indexOf(H)!==-1:!1}removeName(H){const V=(this.name()||"").split(/\s/g),Y=V.indexOf(H);return Y!==-1&&(V.splice(Y,1),this.name(V.join(" "))),this}setAttr(H,V){const Y=this[A+i.Util._capitalize(H)];return i.Util._isFunction(Y)?Y.call(this,V):this._setAttr(H,V),this}_requestDraw(){if(n.Konva.autoDrawEnabled){const H=this.getLayer()||this.getStage();H?.batchDraw()}}_setAttr(H,V){const Y=this.attrs[H];Y===V&&!i.Util.isObject(V)||(V==null?delete this.attrs[H]:this.attrs[H]=V,this._shouldFireChangeEvents&&this._fireChangeEvent(H,Y,V),this._requestDraw())}_setComponentAttr(H,V,Y){let U;Y!==void 0&&(U=this.attrs[H],U||(this.attrs[H]=this.getAttr(H)),this.attrs[H][V]=Y,this._fireChangeEvent(H,U,Y))}_fireAndBubble(H,V,Y){V&&this.nodeType===M&&(V.target=this);const U=[x,E,S,b,w,_];if(!(U.indexOf(H)!==-1&&(Y&&(this===Y||this.isAncestorOf&&this.isAncestorOf(Y))||this.nodeType==="Stage"&&!Y))){this._fire(H,V);const j=U.indexOf(H)!==-1&&Y&&Y.isAncestorOf&&Y.isAncestorOf(this)&&!Y.isAncestorOf(this.parent);(V&&!V.cancelBubble||!V)&&this.parent&&this.parent.isListening()&&!j&&(Y&&Y.parent?this._fireAndBubble.call(this.parent,H,V,Y):this._fireAndBubble.call(this.parent,H,V))}}_getProtoListeners(H){var V,Y,U;const D=(V=this._cache.get(o))!==null&&V!==void 0?V:{};let j=D?.[H];if(j===void 0){j=[];let z=Object.getPrototypeOf(this);for(;z;){const Z=(U=(Y=z.eventListeners)===null||Y===void 0?void 0:Y[H])!==null&&U!==void 0?U:[];j.push(...Z),z=Object.getPrototypeOf(z)}D[H]=j,this._cache.set(o,D)}return j}_fire(H,V){V=V||{},V.currentTarget=this,V.type=H;const Y=this._getProtoListeners(H);if(Y)for(let D=0;D<Y.length;D++)Y[D].handler.call(this,V);const U=this.eventListeners[H];if(U)for(let D=0;D<U.length;D++)U[D].handler.call(this,V)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(H){const V=H?H.pointerId:void 0,Y=this.getStage(),U=this.getAbsolutePosition();if(!Y)return;const D=Y._getPointerById(V)||Y._changedPointerPositions[0]||U;t.DD._dragElements.set(this._id,{node:this,startPointerPos:D,offset:{x:D.x-U.x,y:D.y-U.y},dragStatus:"ready",pointerId:V})}startDrag(H,V=!0){t.DD._dragElements.has(this._id)||this._createDragElement(H);const Y=t.DD._dragElements.get(this._id);Y.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:H&&H.evt},V)}_setDragPosition(H,V){const Y=this.getStage()._getPointerById(V.pointerId);if(!Y)return;let U={x:Y.x-V.offset.x,y:Y.y-V.offset.y};const D=this.dragBoundFunc();if(D!==void 0){const j=D.call(this,U,H);j?U=j:i.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==U.x||this._lastPos.y!==U.y)&&(this.setAbsolutePosition(U),this._requestDraw()),this._lastPos=U}stopDrag(H){const V=t.DD._dragElements.get(this._id);V&&(V.dragStatus="stopped"),t.DD._endDragBefore(H),t.DD._endDragAfter(H)}setDraggable(H){this._setAttr("draggable",H),this._dragChange()}isDragging(){const H=t.DD._dragElements.get(this._id);return H?H.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(H){if(!(!(H.evt.button!==void 0)||n.Konva.dragButtons.indexOf(H.evt.button)>=0)||this.isDragging())return;let U=!1;t.DD._dragElements.forEach(D=>{this.isAncestorOf(D.node)&&(U=!0)}),U||this._createDragElement(H)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const V=t.DD._dragElements.get(this._id),Y=V&&V.dragStatus==="dragging",U=V&&V.dragStatus==="ready";Y?this.stopDrag():U&&t.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(H={x:0,y:0}){const V=this.getStage();if(!V)return!1;const Y={x:-H.x,y:-H.y,width:V.width()+2*H.x,height:V.height()+2*H.y};return i.Util.haveIntersection(Y,this.getClientRect())}static create(H,V){return i.Util._isString(H)&&(H=JSON.parse(H)),this._createNode(H,V)}static _createNode(H,V){let Y=G.prototype.getClassName.call(H),U=H.children,D,j,z;V&&(H.attrs.container=V),n.Konva[Y]||(i.Util.warn('Can not find a node with class name "'+Y+'". Fallback to "Shape".'),Y="Shape");const Z=n.Konva[Y];if(D=new Z(H.attrs),U)for(j=U.length,z=0;z<j;z++)D.add(G._createNode(U[z]));return D}}ed.Node=G,G.prototype.nodeType="Node",G.prototype._attrsAffectingSize=[],G.prototype.eventListeners={},G.prototype.on.call(G.prototype,C,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(R),this._clearSelfAndDescendantCache(u)}),G.prototype.on.call(G.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(k)}),G.prototype.on.call(G.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(y)}),G.prototype.on.call(G.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(l)});const J=r.Factory.addGetterSetter;return J(G,"zIndex"),J(G,"absolutePosition"),J(G,"position"),J(G,"x",0,(0,a.getNumberValidator)()),J(G,"y",0,(0,a.getNumberValidator)()),J(G,"globalCompositeOperation","source-over",(0,a.getStringValidator)()),J(G,"opacity",1,(0,a.getNumberValidator)()),J(G,"name","",(0,a.getStringValidator)()),J(G,"id","",(0,a.getStringValidator)()),J(G,"rotation",0,(0,a.getNumberValidator)()),r.Factory.addComponentsGetterSetter(G,"scale",["x","y"]),J(G,"scaleX",1,(0,a.getNumberValidator)()),J(G,"scaleY",1,(0,a.getNumberValidator)()),r.Factory.addComponentsGetterSetter(G,"skew",["x","y"]),J(G,"skewX",0,(0,a.getNumberValidator)()),J(G,"skewY",0,(0,a.getNumberValidator)()),r.Factory.addComponentsGetterSetter(G,"offset",["x","y"]),J(G,"offsetX",0,(0,a.getNumberValidator)()),J(G,"offsetY",0,(0,a.getNumberValidator)()),J(G,"dragDistance",void 0,(0,a.getNumberValidator)()),J(G,"width",0,(0,a.getNumberValidator)()),J(G,"height",0,(0,a.getNumberValidator)()),J(G,"listening",!0,(0,a.getBooleanValidator)()),J(G,"preventDefault",!0,(0,a.getBooleanValidator)()),J(G,"filters",void 0,function(ae){return this._filterUpToDate=!1,ae}),J(G,"visible",!0,(0,a.getBooleanValidator)()),J(G,"transformsEnabled","all",(0,a.getStringValidator)()),J(G,"size"),J(G,"dragBoundFunc"),J(G,"draggable",!1,(0,a.getBooleanValidator)()),r.Factory.backCompat(G,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"}),ed}var td={},Jy;function p0(){if(Jy)return td;Jy=1,Object.defineProperty(td,"__esModule",{value:!0}),td.Container=void 0;const e=jr(),t=oa(),r=qr();let n=class extends t.Node{constructor(){super(...arguments),this.children=[]}getChildren(a){const l=this.children||[];return a?l.filter(a):l}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(a=>{a.parent=null,a.index=0,a.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(a=>{a.parent=null,a.index=0,a.destroy()}),this.children=[],this._requestDraw(),this}add(...a){if(a.length===0)return this;if(a.length>1){for(let o=0;o<a.length;o++)this.add(a[o]);return this}const l=a[0];return l.getParent()?(l.moveTo(this),this):(this._validateAdd(l),l.index=this.getChildren().length,l.parent=this,l._clearCaches(),this.getChildren().push(l),this._fire("add",{child:l}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(a){return this._generalFind(a,!1)}findOne(a){const l=this._generalFind(a,!0);return l.length>0?l[0]:void 0}_generalFind(a,l){const o=[];return this._descendants(u=>{const d=u._isMatch(a);return d&&o.push(u),!!(d&&l)}),o}_descendants(a){let l=!1;const o=this.getChildren();for(const u of o){if(l=a(u),l)return!0;if(u.hasChildren()&&(l=u._descendants(a),l))return!0}return!1}toObject(){const a=t.Node.prototype.toObject.call(this);return a.children=[],this.getChildren().forEach(l=>{a.children.push(l.toObject())}),a}isAncestorOf(a){let l=a.getParent();for(;l;){if(l._id===this._id)return!0;l=l.getParent()}return!1}clone(a){const l=t.Node.prototype.clone.call(this,a);return this.getChildren().forEach(function(o){l.add(o.clone())}),l}getAllIntersections(a){const l=[];return this.find("Shape").forEach(o=>{o.isVisible()&&o.intersects(a)&&l.push(o)}),l}_clearSelfAndDescendantCache(a){var l;super._clearSelfAndDescendantCache(a),!this.isCached()&&((l=this.children)===null||l===void 0||l.forEach(function(o){o._clearSelfAndDescendantCache(a)}))}_setChildrenIndices(){var a;(a=this.children)===null||a===void 0||a.forEach(function(l,o){l.index=o}),this._requestDraw()}drawScene(a,l,o){const u=this.getLayer(),d=a||u&&u.getCanvas(),f=d&&d.getContext(),v=this._getCanvasCache(),g=v&&v.scene,c=d&&d.isCache;if(!this.isVisible()&&!c)return this;if(g){f.save();const y=this.getAbsoluteTransform(l).getMatrix();f.transform(y[0],y[1],y[2],y[3],y[4],y[5]),this._drawCachedSceneCanvas(f),f.restore()}else this._drawChildren("drawScene",d,l,o);return this}drawHit(a,l){if(!this.shouldDrawHit(l))return this;const o=this.getLayer(),u=a||o&&o.hitCanvas,d=u&&u.getContext(),f=this._getCanvasCache();if(f&&f.hit){d.save();const g=this.getAbsoluteTransform(l).getMatrix();d.transform(g[0],g[1],g[2],g[3],g[4],g[5]),this._drawCachedHitCanvas(d),d.restore()}else this._drawChildren("drawHit",u,l);return this}_drawChildren(a,l,o,u){var d;const f=l&&l.getContext(),v=this.clipWidth(),g=this.clipHeight(),c=this.clipFunc(),y=typeof v=="number"&&typeof g=="number"||c,x=o===this;if(y){f.save();const S=this.getAbsoluteTransform(o);let b=S.getMatrix();f.transform(b[0],b[1],b[2],b[3],b[4],b[5]),f.beginPath();let w;if(c)w=c.call(this,f,this);else{const _=this.clipX(),A=this.clipY();f.rect(_||0,A||0,v,g)}f.clip.apply(f,w),b=S.copy().invert().getMatrix(),f.transform(b[0],b[1],b[2],b[3],b[4],b[5])}const E=!x&&this.globalCompositeOperation()!=="source-over"&&a==="drawScene";E&&(f.save(),f._applyGlobalCompositeOperation(this)),(d=this.children)===null||d===void 0||d.forEach(function(S){S[a](l,o,u)}),E&&f.restore(),y&&f.restore()}getClientRect(a={}){var l;const o=a.skipTransform,u=a.relativeTo;let d,f,v,g,c={x:1/0,y:1/0,width:0,height:0};const y=this;(l=this.children)===null||l===void 0||l.forEach(function(S){if(!S.visible())return;const b=S.getClientRect({relativeTo:y,skipShadow:a.skipShadow,skipStroke:a.skipStroke});b.width===0&&b.height===0||(d===void 0?(d=b.x,f=b.y,v=b.x+b.width,g=b.y+b.height):(d=Math.min(d,b.x),f=Math.min(f,b.y),v=Math.max(v,b.x+b.width),g=Math.max(g,b.y+b.height)))});const x=this.find("Shape");let E=!1;for(let S=0;S<x.length;S++)if(x[S]._isVisible(this)){E=!0;break}return E&&d!==void 0?c={x:d,y:f,width:v-d,height:g-f}:c={x:0,y:0,width:0,height:0},o?c:this._transformedRect(c,u)}};return td.Container=n,e.Factory.addComponentsGetterSetter(n,"clip",["x","y","width","height"]),e.Factory.addGetterSetter(n,"clipX",void 0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipY",void 0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipWidth",void 0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipHeight",void 0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(n,"clipFunc"),td}var bg={},zc={},e5;function q6(){if(e5)return zc;e5=1,Object.defineProperty(zc,"__esModule",{value:!0}),zc.getCapturedShape=n,zc.createEvent=i,zc.hasPointerCapture=a,zc.setPointerCapture=l,zc.releaseCapture=o;const e=Nr(),t=new Map,r=e.Konva._global.PointerEvent!==void 0;function n(u){return t.get(u)}function i(u){return{evt:u,pointerId:u.pointerId}}function a(u,d){return t.get(u)===d}function l(u,d){o(u),d.getStage()&&(t.set(u,d),r&&d._fire("gotpointercapture",i(new PointerEvent("gotpointercapture"))))}function o(u,d){const f=t.get(u);if(!f)return;const v=f.getStage();v&&v.content,t.delete(u),r&&f._fire("lostpointercapture",i(new PointerEvent("lostpointercapture")))}return zc}var t5;function bS(){return t5||(t5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=zi(),r=jr(),n=p0(),i=Nr(),a=d0(),l=fm(),o=Nr(),u=q6(),d="Stage",f="string",v="px",g="mouseout",c="mouseleave",y="mouseover",x="mouseenter",E="mousemove",S="mousedown",b="mouseup",w="pointermove",_="pointerdown",A="pointerup",M="pointercancel",O="lostpointercapture",L="pointerout",R="pointerleave",T="pointerover",k="pointerenter",C="contextmenu",q="touchstart",G="touchend",J="touchmove",ae="touchcancel",H="wheel",V=5,Y=[[x,"_pointerenter"],[S,"_pointerdown"],[E,"_pointermove"],[b,"_pointerup"],[c,"_pointerleave"],[q,"_pointerdown"],[J,"_pointermove"],[G,"_pointerup"],[ae,"_pointercancel"],[y,"_pointerover"],[H,"_wheel"],[C,"_contextmenu"],[_,"_pointerdown"],[w,"_pointermove"],[A,"_pointerup"],[M,"_pointercancel"],[R,"_pointerleave"],[O,"_lostpointercapture"]],U={mouse:{[L]:g,[R]:c,[T]:y,[k]:x,[w]:E,[_]:S,[A]:b,[M]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[L]:"touchout",[R]:"touchleave",[T]:"touchover",[k]:"touchenter",[w]:J,[_]:q,[A]:G,[M]:ae,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[L]:L,[R]:R,[T]:T,[k]:k,[w]:w,[_]:_,[A]:A,[M]:M,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},D=W=>W.indexOf("pointer")>=0?"pointer":W.indexOf("touch")>=0?"touch":"mouse",j=W=>{const Q=D(W);if(Q==="pointer")return i.Konva.pointerEventsEnabled&&U.pointer;if(Q==="touch")return U.touch;if(Q==="mouse")return U.mouse};function z(W={}){return(W.clipFunc||W.clipWidth||W.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),W}const Z="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class re extends n.Container{constructor(Q){super(z(Q)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{z(this.attrs)}),this._checkVisibility()}_validateAdd(Q){const se=Q.getType()==="Layer",ue=Q.getType()==="FastLayer";se||ue||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const Q=this.visible()?"":"none";this.content.style.display=Q}setContainer(Q){if(typeof Q===f){let se;if(Q.charAt(0)==="."){const ue=Q.slice(1);Q=document.getElementsByClassName(ue)[0]}else Q.charAt(0)!=="#"?se=Q:se=Q.slice(1),Q=document.getElementById(se);if(!Q)throw"Can not find container in document with id "+se}return this._setAttr("container",Q),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),Q.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const Q=this.children,se=Q.length;for(let ue=0;ue<se;ue++)Q[ue].clear();return this}clone(Q){return Q||(Q={}),Q.container=typeof document<"u"&&document.createElement("div"),n.Container.prototype.clone.call(this,Q)}destroy(){super.destroy();const Q=this.content;Q&&t.Util._isInDocument(Q)&&this.container().removeChild(Q);const se=e.stages.indexOf(this);return se>-1&&e.stages.splice(se,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const Q=this._pointerPositions[0]||this._changedPointerPositions[0];return Q?{x:Q.x,y:Q.y}:(t.Util.warn(Z),null)}_getPointerById(Q){return this._pointerPositions.find(se=>se.id===Q)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(Q){Q=Q||{},Q.x=Q.x||0,Q.y=Q.y||0,Q.width=Q.width||this.width(),Q.height=Q.height||this.height();const se=new a.SceneCanvas({width:Q.width,height:Q.height,pixelRatio:Q.pixelRatio||1}),ue=se.getContext()._context,le=this.children;return(Q.x||Q.y)&&ue.translate(-1*Q.x,-1*Q.y),le.forEach(function(ye){if(!ye.isVisible())return;const Re=ye._toKonvaCanvas(Q);ue.drawImage(Re._canvas,Q.x,Q.y,Re.getWidth()/Re.getPixelRatio(),Re.getHeight()/Re.getPixelRatio())}),se}getIntersection(Q){if(!Q)return null;const se=this.children,ue=se.length,le=ue-1;for(let ye=le;ye>=0;ye--){const Re=se[ye].getIntersection(Q);if(Re)return Re}return null}_resizeDOM(){const Q=this.width(),se=this.height();this.content&&(this.content.style.width=Q+v,this.content.style.height=se+v),this.bufferCanvas.setSize(Q,se),this.bufferHitCanvas.setSize(Q,se),this.children.forEach(ue=>{ue.setSize({width:Q,height:se}),ue.draw()})}add(Q,...se){if(arguments.length>1){for(let le=0;le<arguments.length;le++)this.add(arguments[le]);return this}super.add(Q);const ue=this.children.length;return ue>V&&t.Util.warn("The stage has "+ue+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),Q.setSize({width:this.width(),height:this.height()}),Q.draw(),i.Konva.isBrowser&&this.content.appendChild(Q.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(Q){return u.hasPointerCapture(Q,this)}setPointerCapture(Q){u.setPointerCapture(Q,this)}releaseCapture(Q){u.releaseCapture(Q,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&Y.forEach(([Q,se])=>{this.content.addEventListener(Q,ue=>{this[se](ue)},{passive:!1})})}_pointerenter(Q){this.setPointersPositions(Q);const se=j(Q.type);se&&this._fire(se.pointerenter,{evt:Q,target:this,currentTarget:this})}_pointerover(Q){this.setPointersPositions(Q);const se=j(Q.type);se&&this._fire(se.pointerover,{evt:Q,target:this,currentTarget:this})}_getTargetShape(Q){let se=this[Q+"targetShape"];return se&&!se.getStage()&&(se=null),se}_pointerleave(Q){const se=j(Q.type),ue=D(Q.type);if(!se)return;this.setPointersPositions(Q);const le=this._getTargetShape(ue),ye=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;le&&ye?(le._fireAndBubble(se.pointerout,{evt:Q}),le._fireAndBubble(se.pointerleave,{evt:Q}),this._fire(se.pointerleave,{evt:Q,target:this,currentTarget:this}),this[ue+"targetShape"]=null):ye&&(this._fire(se.pointerleave,{evt:Q,target:this,currentTarget:this}),this._fire(se.pointerout,{evt:Q,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(Q){const se=j(Q.type),ue=D(Q.type);if(!se)return;this.setPointersPositions(Q);let le=!1;this._changedPointerPositions.forEach(ye=>{const Re=this.getIntersection(ye);if(l.DD.justDragged=!1,i.Konva["_"+ue+"ListenClick"]=!0,!Re||!Re.isListening()){this[ue+"ClickStartShape"]=void 0;return}i.Konva.capturePointerEventsEnabled&&Re.setPointerCapture(ye.id),this[ue+"ClickStartShape"]=Re,Re._fireAndBubble(se.pointerdown,{evt:Q,pointerId:ye.id}),le=!0;const Me=Q.type.indexOf("touch")>=0;Re.preventDefault()&&Q.cancelable&&Me&&Q.preventDefault()}),le||this._fire(se.pointerdown,{evt:Q,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(Q){const se=j(Q.type),ue=D(Q.type);if(!se||(i.Konva.isDragging()&&l.DD.node.preventDefault()&&Q.cancelable&&Q.preventDefault(),this.setPointersPositions(Q),!(!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled)))return;const ye={};let Re=!1;const Me=this._getTargetShape(ue);this._changedPointerPositions.forEach(Pe=>{const de=u.getCapturedShape(Pe.id)||this.getIntersection(Pe),Te=Pe.id,Ae={evt:Q,pointerId:Te},be=Me!==de;if(be&&Me&&(Me._fireAndBubble(se.pointerout,{...Ae},de),Me._fireAndBubble(se.pointerleave,{...Ae},de)),de){if(ye[de._id])return;ye[de._id]=!0}de&&de.isListening()?(Re=!0,be&&(de._fireAndBubble(se.pointerover,{...Ae},Me),de._fireAndBubble(se.pointerenter,{...Ae},Me),this[ue+"targetShape"]=de),de._fireAndBubble(se.pointermove,{...Ae})):Me&&(this._fire(se.pointerover,{evt:Q,target:this,currentTarget:this,pointerId:Te}),this[ue+"targetShape"]=null)}),Re||this._fire(se.pointermove,{evt:Q,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(Q){const se=j(Q.type),ue=D(Q.type);if(!se)return;this.setPointersPositions(Q);const le=this[ue+"ClickStartShape"],ye=this[ue+"ClickEndShape"],Re={};let Me=!1;this._changedPointerPositions.forEach(Pe=>{const de=u.getCapturedShape(Pe.id)||this.getIntersection(Pe);if(de){if(de.releaseCapture(Pe.id),Re[de._id])return;Re[de._id]=!0}const Te=Pe.id,Ae={evt:Q,pointerId:Te};let be=!1;i.Konva["_"+ue+"InDblClickWindow"]?(be=!0,clearTimeout(this[ue+"DblTimeout"])):l.DD.justDragged||(i.Konva["_"+ue+"InDblClickWindow"]=!0,clearTimeout(this[ue+"DblTimeout"])),this[ue+"DblTimeout"]=setTimeout(function(){i.Konva["_"+ue+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),de&&de.isListening()?(Me=!0,this[ue+"ClickEndShape"]=de,de._fireAndBubble(se.pointerup,{...Ae}),i.Konva["_"+ue+"ListenClick"]&&le&&le===de&&(de._fireAndBubble(se.pointerclick,{...Ae}),be&&ye&&ye===de&&de._fireAndBubble(se.pointerdblclick,{...Ae}))):(this[ue+"ClickEndShape"]=null,i.Konva["_"+ue+"ListenClick"]&&this._fire(se.pointerclick,{evt:Q,target:this,currentTarget:this,pointerId:Te}),be&&this._fire(se.pointerdblclick,{evt:Q,target:this,currentTarget:this,pointerId:Te}))}),Me||this._fire(se.pointerup,{evt:Q,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+ue+"ListenClick"]=!1,Q.cancelable&&ue!=="touch"&&ue!=="pointer"&&Q.preventDefault()}_contextmenu(Q){this.setPointersPositions(Q);const se=this.getIntersection(this.getPointerPosition());se&&se.isListening()?se._fireAndBubble(C,{evt:Q}):this._fire(C,{evt:Q,target:this,currentTarget:this})}_wheel(Q){this.setPointersPositions(Q);const se=this.getIntersection(this.getPointerPosition());se&&se.isListening()?se._fireAndBubble(H,{evt:Q}):this._fire(H,{evt:Q,target:this,currentTarget:this})}_pointercancel(Q){this.setPointersPositions(Q);const se=u.getCapturedShape(Q.pointerId)||this.getIntersection(this.getPointerPosition());se&&se._fireAndBubble(A,u.createEvent(Q)),u.releaseCapture(Q.pointerId)}_lostpointercapture(Q){u.releaseCapture(Q.pointerId)}setPointersPositions(Q){const se=this._getContentPosition();let ue=null,le=null;Q=Q||window.event,Q.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(Q.touches,ye=>{this._pointerPositions.push({id:ye.identifier,x:(ye.clientX-se.left)/se.scaleX,y:(ye.clientY-se.top)/se.scaleY})}),Array.prototype.forEach.call(Q.changedTouches||Q.touches,ye=>{this._changedPointerPositions.push({id:ye.identifier,x:(ye.clientX-se.left)/se.scaleX,y:(ye.clientY-se.top)/se.scaleY})})):(ue=(Q.clientX-se.left)/se.scaleX,le=(Q.clientY-se.top)/se.scaleY,this.pointerPos={x:ue,y:le},this._pointerPositions=[{x:ue,y:le,id:t.Util._getFirstPointerId(Q)}],this._changedPointerPositions=[{x:ue,y:le,id:t.Util._getFirstPointerId(Q)}])}_setPointerPosition(Q){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(Q)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const Q=this.content.getBoundingClientRect();return{top:Q.top,left:Q.left,scaleX:Q.width/this.content.clientWidth||1,scaleY:Q.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new a.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new a.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!i.Konva.isBrowser)return;const Q=this.container();if(!Q)throw"Stage has no container. A container is required.";Q.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"),Q.appendChild(this.content),this._resizeDOM()}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(Q){Q.batchDraw()}),this}}e.Stage=re,re.prototype.nodeType=d,(0,o._registerNode)(re),r.Factory.addGetterSetter(re,"container"),i.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(W=>{W.batchDraw()})})}(bg)),bg}var rd={},wg={},r5;function Wa(){return r5||(r5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=Nr(),r=zi(),n=jr(),i=oa(),a=qr(),l=Nr(),o=q6(),u="hasShadow",d="shadowRGBA",f="patternImage",v="linearGradient",g="radialGradient";let c;function y(){return c||(c=r.Util.createCanvasElement().getContext("2d"),c)}e.shapes={};function x(R){const T=this.attrs.fillRule;T?R.fill(T):R.fill()}function E(R){R.stroke()}function S(R){const T=this.attrs.fillRule;T?R.fill(T):R.fill()}function b(R){R.stroke()}function w(){this._clearCache(u)}function _(){this._clearCache(d)}function A(){this._clearCache(f)}function M(){this._clearCache(v)}function O(){this._clearCache(g)}class L extends i.Node{constructor(T){super(T);let k;for(;k=r.Util.getRandomColor(),!(k&&!(k in e.shapes)););this.colorKey=k,e.shapes[k]=this}getContext(){return r.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return r.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(u,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(f,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const k=y().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(k&&k.setTransform){const C=new r.Transform;C.translate(this.fillPatternX(),this.fillPatternY()),C.rotate(t.Konva.getAngle(this.fillPatternRotation())),C.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),C.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const q=C.getMatrix(),G=typeof DOMMatrix>"u"?{a:q[0],b:q[1],c:q[2],d:q[3],e:q[4],f:q[5]}:new DOMMatrix(q);k.setTransform(G)}return k}}_getLinearGradient(){return this._getCache(v,this.__getLinearGradient)}__getLinearGradient(){const T=this.fillLinearGradientColorStops();if(T){const k=y(),C=this.fillLinearGradientStartPoint(),q=this.fillLinearGradientEndPoint(),G=k.createLinearGradient(C.x,C.y,q.x,q.y);for(let J=0;J<T.length;J+=2)G.addColorStop(T[J],T[J+1]);return G}}_getRadialGradient(){return this._getCache(g,this.__getRadialGradient)}__getRadialGradient(){const T=this.fillRadialGradientColorStops();if(T){const k=y(),C=this.fillRadialGradientStartPoint(),q=this.fillRadialGradientEndPoint(),G=k.createRadialGradient(C.x,C.y,this.fillRadialGradientStartRadius(),q.x,q.y,this.fillRadialGradientEndRadius());for(let J=0;J<T.length;J+=2)G.addColorStop(T[J],T[J+1]);return G}}getShadowRGBA(){return this._getCache(d,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const T=r.Util.colorToRGBA(this.shadowColor());if(T)return"rgba("+T.r+","+T.g+","+T.b+","+T.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const T=this.hitStrokeWidth();return T==="auto"?this.hasStroke():this.strokeEnabled()&&!!T}intersects(T){const k=this.getStage();if(!k)return!1;const C=k.bufferHitCanvas;return C.getContext().clear(),this.drawHit(C,void 0,!0),C.context.getImageData(Math.round(T.x),Math.round(T.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(T){var k;if(!((k=this.attrs.perfectDrawEnabled)!==null&&k!==void 0?k:!0))return!1;const q=T||this.hasFill(),G=this.hasStroke(),J=this.getAbsoluteOpacity()!==1;if(q&&G&&J)return!0;const ae=this.hasShadow(),H=this.shadowForStrokeEnabled();return!!(q&&G&&ae&&H)}setStrokeHitEnabled(T){r.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),T?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const T=this.size();return{x:this._centroid?-T.width/2:0,y:this._centroid?-T.height/2:0,width:T.width,height:T.height}}getClientRect(T={}){let k=!1,C=this.getParent();for(;C;){if(C.isCached()){k=!0;break}C=C.getParent()}const q=T.skipTransform,G=T.relativeTo||k&&this.getStage()||void 0,J=this.getSelfRect(),H=!T.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,V=J.width+H,Y=J.height+H,U=!T.skipShadow&&this.hasShadow(),D=U?this.shadowOffsetX():0,j=U?this.shadowOffsetY():0,z=V+Math.abs(D),Z=Y+Math.abs(j),re=U&&this.shadowBlur()||0,W=z+re*2,Q=Z+re*2,se={width:W,height:Q,x:-(H/2+re)+Math.min(D,0)+J.x,y:-(H/2+re)+Math.min(j,0)+J.y};return q?se:this._transformedRect(se,G)}drawScene(T,k,C){const q=this.getLayer(),G=T||q.getCanvas(),J=G.getContext(),ae=this._getCanvasCache(),H=this.getSceneFunc(),V=this.hasShadow();let Y;const U=k===this;if(!this.isVisible()&&!U)return this;if(ae){J.save();const D=this.getAbsoluteTransform(k).getMatrix();return J.transform(D[0],D[1],D[2],D[3],D[4],D[5]),this._drawCachedSceneCanvas(J),J.restore(),this}if(!H)return this;if(J.save(),this._useBufferCanvas()){Y=this.getStage();const D=C||Y.bufferCanvas,j=D.getContext();j.clear(),j.save(),j._applyLineJoin(this);const z=this.getAbsoluteTransform(k).getMatrix();j.transform(z[0],z[1],z[2],z[3],z[4],z[5]),H.call(this,j,this),j.restore();const Z=D.pixelRatio;V&&J._applyShadow(this),J._applyOpacity(this),J._applyGlobalCompositeOperation(this),J.drawImage(D._canvas,D.x||0,D.y||0,D.width/Z,D.height/Z)}else{if(J._applyLineJoin(this),!U){const D=this.getAbsoluteTransform(k).getMatrix();J.transform(D[0],D[1],D[2],D[3],D[4],D[5]),J._applyOpacity(this),J._applyGlobalCompositeOperation(this)}V&&J._applyShadow(this),H.call(this,J,this)}return J.restore(),this}drawHit(T,k,C=!1){if(!this.shouldDrawHit(k,C))return this;const q=this.getLayer(),G=T||q.hitCanvas,J=G&&G.getContext(),ae=this.hitFunc()||this.sceneFunc(),H=this._getCanvasCache(),V=H&&H.hit;if(this.colorKey||r.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),V){J.save();const U=this.getAbsoluteTransform(k).getMatrix();return J.transform(U[0],U[1],U[2],U[3],U[4],U[5]),this._drawCachedHitCanvas(J),J.restore(),this}if(!ae)return this;if(J.save(),J._applyLineJoin(this),!(this===k)){const U=this.getAbsoluteTransform(k).getMatrix();J.transform(U[0],U[1],U[2],U[3],U[4],U[5])}return ae.call(this,J,this),J.restore(),this}drawHitFromCache(T=0){const k=this._getCanvasCache(),C=this._getCachedSceneCanvas(),q=k.hit,G=q.getContext(),J=q.getWidth(),ae=q.getHeight();G.clear(),G.drawImage(C._canvas,0,0,J,ae);try{const H=G.getImageData(0,0,J,ae),V=H.data,Y=V.length,U=r.Util._hexToRgb(this.colorKey);for(let D=0;D<Y;D+=4)V[D+3]>T?(V[D]=U.r,V[D+1]=U.g,V[D+2]=U.b,V[D+3]=255):V[D+3]=0;G.putImageData(H,0,0)}catch(H){r.Util.error("Unable to draw hit graph from cached scene canvas. "+H.message)}return this}hasPointerCapture(T){return o.hasPointerCapture(T,this)}setPointerCapture(T){o.setPointerCapture(T,this)}releaseCapture(T){o.releaseCapture(T,this)}}e.Shape=L,L.prototype._fillFunc=x,L.prototype._strokeFunc=E,L.prototype._fillFuncHit=S,L.prototype._strokeFuncHit=b,L.prototype._centroid=!1,L.prototype.nodeType="Shape",(0,l._registerNode)(L),L.prototype.eventListeners={},L.prototype.on.call(L.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",w),L.prototype.on.call(L.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",_),L.prototype.on.call(L.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",A),L.prototype.on.call(L.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",M),L.prototype.on.call(L.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",O),n.Factory.addGetterSetter(L,"stroke",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(L,"strokeWidth",2,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(L,"fillAfterStrokeEnabled",!1),n.Factory.addGetterSetter(L,"hitStrokeWidth","auto",(0,a.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(L,"strokeHitEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(L,"perfectDrawEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(L,"shadowForStrokeEnabled",!0,(0,a.getBooleanValidator)()),n.Factory.addGetterSetter(L,"lineJoin"),n.Factory.addGetterSetter(L,"lineCap"),n.Factory.addGetterSetter(L,"sceneFunc"),n.Factory.addGetterSetter(L,"hitFunc"),n.Factory.addGetterSetter(L,"dash"),n.Factory.addGetterSetter(L,"dashOffset",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(L,"shadowColor",void 0,(0,a.getStringValidator)()),n.Factory.addGetterSetter(L,"shadowBlur",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(L,"shadowOpacity",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(L,"shadowOffset",["x","y"]),n.Factory.addGetterSetter(L,"shadowOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(L,"shadowOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(L,"fillPatternImage"),n.Factory.addGetterSetter(L,"fill",void 0,(0,a.getStringOrGradientValidator)()),n.Factory.addGetterSetter(L,"fillPatternX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(L,"fillPatternY",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(L,"fillLinearGradientColorStops"),n.Factory.addGetterSetter(L,"strokeLinearGradientColorStops"),n.Factory.addGetterSetter(L,"fillRadialGradientStartRadius",0),n.Factory.addGetterSetter(L,"fillRadialGradientEndRadius",0),n.Factory.addGetterSetter(L,"fillRadialGradientColorStops"),n.Factory.addGetterSetter(L,"fillPatternRepeat","repeat"),n.Factory.addGetterSetter(L,"fillEnabled",!0),n.Factory.addGetterSetter(L,"strokeEnabled",!0),n.Factory.addGetterSetter(L,"shadowEnabled",!0),n.Factory.addGetterSetter(L,"dashEnabled",!0),n.Factory.addGetterSetter(L,"strokeScaleEnabled",!0),n.Factory.addGetterSetter(L,"fillPriority","color"),n.Factory.addComponentsGetterSetter(L,"fillPatternOffset",["x","y"]),n.Factory.addGetterSetter(L,"fillPatternOffsetX",0,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(L,"fillPatternOffsetY",0,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(L,"fillPatternScale",["x","y"]),n.Factory.addGetterSetter(L,"fillPatternScaleX",1,(0,a.getNumberValidator)()),n.Factory.addGetterSetter(L,"fillPatternScaleY",1,(0,a.getNumberValidator)()),n.Factory.addComponentsGetterSetter(L,"fillLinearGradientStartPoint",["x","y"]),n.Factory.addComponentsGetterSetter(L,"strokeLinearGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(L,"fillLinearGradientStartPointX",0),n.Factory.addGetterSetter(L,"strokeLinearGradientStartPointX",0),n.Factory.addGetterSetter(L,"fillLinearGradientStartPointY",0),n.Factory.addGetterSetter(L,"strokeLinearGradientStartPointY",0),n.Factory.addComponentsGetterSetter(L,"fillLinearGradientEndPoint",["x","y"]),n.Factory.addComponentsGetterSetter(L,"strokeLinearGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(L,"fillLinearGradientEndPointX",0),n.Factory.addGetterSetter(L,"strokeLinearGradientEndPointX",0),n.Factory.addGetterSetter(L,"fillLinearGradientEndPointY",0),n.Factory.addGetterSetter(L,"strokeLinearGradientEndPointY",0),n.Factory.addComponentsGetterSetter(L,"fillRadialGradientStartPoint",["x","y"]),n.Factory.addGetterSetter(L,"fillRadialGradientStartPointX",0),n.Factory.addGetterSetter(L,"fillRadialGradientStartPointY",0),n.Factory.addComponentsGetterSetter(L,"fillRadialGradientEndPoint",["x","y"]),n.Factory.addGetterSetter(L,"fillRadialGradientEndPointX",0),n.Factory.addGetterSetter(L,"fillRadialGradientEndPointY",0),n.Factory.addGetterSetter(L,"fillPatternRotation",0),n.Factory.addGetterSetter(L,"fillRule",void 0,(0,a.getStringValidator)()),n.Factory.backCompat(L,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})}(wg)),wg}var n5;function H6(){if(n5)return rd;n5=1,Object.defineProperty(rd,"__esModule",{value:!0}),rd.Layer=void 0;const e=zi(),t=p0(),r=oa(),n=jr(),i=d0(),a=qr(),l=Wa(),o=Nr(),u="#",d="beforeDraw",f="draw",v=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],g=v.length;class c extends t.Container{constructor(x){super(x),this.canvas=new i.SceneCanvas,this.hitCanvas=new i.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(x){return this.getContext().clear(x),this.getHitCanvas().getContext().clear(x),this}setZIndex(x){super.setZIndex(x);const E=this.getStage();return E&&E.content&&(E.content.removeChild(this.getNativeCanvasElement()),x<E.children.length-1?E.content.insertBefore(this.getNativeCanvasElement(),E.children[x+1].getCanvas()._canvas):E.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){r.Node.prototype.moveToTop.call(this);const x=this.getStage();return x&&x.content&&(x.content.removeChild(this.getNativeCanvasElement()),x.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!r.Node.prototype.moveUp.call(this))return!1;const E=this.getStage();return!E||!E.content?!1:(E.content.removeChild(this.getNativeCanvasElement()),this.index<E.children.length-1?E.content.insertBefore(this.getNativeCanvasElement(),E.children[this.index+1].getCanvas()._canvas):E.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(r.Node.prototype.moveDown.call(this)){const x=this.getStage();if(x){const E=x.children;x.content&&(x.content.removeChild(this.getNativeCanvasElement()),x.content.insertBefore(this.getNativeCanvasElement(),E[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(r.Node.prototype.moveToBottom.call(this)){const x=this.getStage();if(x){const E=x.children;x.content&&(x.content.removeChild(this.getNativeCanvasElement()),x.content.insertBefore(this.getNativeCanvasElement(),E[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const x=this.getNativeCanvasElement();return r.Node.prototype.remove.call(this),x&&x.parentNode&&e.Util._isInDocument(x)&&x.parentNode.removeChild(x),this}getStage(){return this.parent}setSize({width:x,height:E}){return this.canvas.setSize(x,E),this.hitCanvas.setSize(x,E),this._setSmoothEnabled(),this}_validateAdd(x){const E=x.getType();E!=="Group"&&E!=="Shape"&&e.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(x){return x=x||{},x.width=x.width||this.getWidth(),x.height=x.height||this.getHeight(),x.x=x.x!==void 0?x.x:this.x(),x.y=x.y!==void 0?x.y:this.y(),r.Node.prototype._toKonvaCanvas.call(this,x)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){e.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){e.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,e.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(x){if(!this.isListening()||!this.isVisible())return null;let E=1,S=!1;for(;;){for(let b=0;b<g;b++){const w=v[b],_=this._getIntersection({x:x.x+w.x*E,y:x.y+w.y*E}),A=_.shape;if(A)return A;if(S=!!_.antialiased,!_.antialiased)break}if(S)E+=1;else return null}}_getIntersection(x){const E=this.hitCanvas.pixelRatio,S=this.hitCanvas.context.getImageData(Math.round(x.x*E),Math.round(x.y*E),1,1).data,b=S[3];if(b===255){const w=e.Util._rgbToHex(S[0],S[1],S[2]),_=l.shapes[u+w];return _?{shape:_}:{antialiased:!0}}else if(b>0)return{antialiased:!0};return{}}drawScene(x,E,S){const b=this.getLayer(),w=x||b&&b.getCanvas();return this._fire(d,{node:this}),this.clearBeforeDraw()&&w.getContext().clear(),t.Container.prototype.drawScene.call(this,w,E,S),this._fire(f,{node:this}),this}drawHit(x,E){const S=this.getLayer(),b=x||S&&S.hitCanvas;return S&&S.clearBeforeDraw()&&S.getHitCanvas().getContext().clear(),t.Container.prototype.drawHit.call(this,b,E),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(x){e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(x)}getHitGraphEnabled(x){return e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const x=this.parent;!!this.hitCanvas._canvas.parentNode?x.content.removeChild(this.hitCanvas._canvas):x.content.appendChild(this.hitCanvas._canvas)}destroy(){return e.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}return rd.Layer=c,c.prototype.nodeType="Layer",(0,o._registerNode)(c),n.Factory.addGetterSetter(c,"imageSmoothingEnabled",!0),n.Factory.addGetterSetter(c,"clearBeforeDraw",!0),n.Factory.addGetterSetter(c,"hitGraphEnabled",!0,(0,a.getBooleanValidator)()),rd}var nd={},i5;function wS(){if(i5)return nd;i5=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.FastLayer=void 0;const e=zi(),t=H6(),r=Nr();let n=class extends t.Layer{constructor(a){super(a),this.listening(!1),e.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};return nd.FastLayer=n,n.prototype.nodeType="FastLayer",(0,r._registerNode)(n),nd}var id={},a5;function hm(){if(a5)return id;a5=1,Object.defineProperty(id,"__esModule",{value:!0}),id.Group=void 0;const e=zi(),t=p0(),r=Nr();class n extends t.Container{_validateAdd(a){const l=a.getType();l!=="Group"&&l!=="Shape"&&e.Util.throw("You may only add groups and shapes to groups.")}}return id.Group=n,n.prototype.nodeType="Group",(0,r._registerNode)(n),id}var ad={},o5;function dm(){if(o5)return ad;o5=1,Object.defineProperty(ad,"__esModule",{value:!0}),ad.Animation=void 0;const e=Nr(),t=zi(),r=function(){return e.glob.performance&&e.glob.performance.now?function(){return e.glob.performance.now()}:function(){return new Date().getTime()}}();class n{constructor(a,l){this.id=n.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:r(),frameRate:0},this.func=a,this.setLayers(l)}setLayers(a){let l=[];return a&&(l=Array.isArray(a)?a:[a]),this.layers=l,this}getLayers(){return this.layers}addLayer(a){const l=this.layers,o=l.length;for(let u=0;u<o;u++)if(l[u]._id===a._id)return!1;return this.layers.push(a),!0}isRunning(){const l=n.animations,o=l.length;for(let u=0;u<o;u++)if(l[u].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=r(),n._addAnimation(this),this}stop(){return n._removeAnimation(this),this}_updateFrameObject(a){this.frame.timeDiff=a-this.frame.lastTime,this.frame.lastTime=a,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(a){this.animations.push(a),this._handleAnimation()}static _removeAnimation(a){const l=a.id,o=this.animations,u=o.length;for(let d=0;d<u;d++)if(o[d].id===l){this.animations.splice(d,1);break}}static _runFrames(){const a={},l=this.animations;for(let o=0;o<l.length;o++){const u=l[o],d=u.layers,f=u.func;u._updateFrameObject(r());const v=d.length;let g;if(f?g=f.call(u,u.frame)!==!1:g=!0,!!g)for(let c=0;c<v;c++){const y=d[c];y._id!==void 0&&(a[y._id]=y)}}for(const o in a)a.hasOwnProperty(o)&&a[o].batchDraw()}static _animationLoop(){const a=n;a.animations.length?(a._runFrames(),t.Util.requestAnimFrame(a._animationLoop)):a.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,t.Util.requestAnimFrame(this._animationLoop))}}return ad.Animation=n,n.animations=[],n.animIdCounter=0,n.animRunning=!1,ad}var _g={},s5;function _S(){return s5||(s5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=zi(),r=dm(),n=oa(),i=Nr(),a={node:1,duration:1,easing:1,onFinish:1,yoyo:1},l=1,o=2,u=3,d=["fill","stroke","shadowColor"];let f=0;class v{constructor(y,x,E,S,b,w,_){this.prop=y,this.propFunc=x,this.begin=S,this._pos=S,this.duration=w,this._change=0,this.prevPos=0,this.yoyo=_,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=E,this._change=b-this.begin,this.pause()}fire(y){const x=this[y];x&&x()}setTime(y){y>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():y<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=y,this.update())}getTime(){return this._time}setPosition(y){this.prevPos=this._pos,this.propFunc(y),this._pos=y}getPosition(y){return y===void 0&&(y=this._time),this.func(y,this.begin,this._change,this.duration)}play(){this.state=o,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=u,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(y){this.pause(),this._time=y,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 y=this.getTimer()-this._startTime;this.state===o?this.setTime(y):this.state===u&&this.setTime(this.duration-y)}pause(){this.state=l,this.fire("onPause")}getTimer(){return new Date().getTime()}}class g{constructor(y){const x=this,E=y.node,S=E._id,b=y.easing||e.Easings.Linear,w=!!y.yoyo;let _,A;typeof y.duration>"u"?_=.3:y.duration===0?_=.001:_=y.duration,this.node=E,this._id=f++;const M=E.getLayer()||(E instanceof i.Konva.Stage?E.getLayers():null);M||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new r.Animation(function(){x.tween.onEnterFrame()},M),this.tween=new v(A,function(O){x._tweenFunc(O)},b,0,1,_*1e3,w),this._addListeners(),g.attrs[S]||(g.attrs[S]={}),g.attrs[S][this._id]||(g.attrs[S][this._id]={}),g.tweens[S]||(g.tweens[S]={});for(A in y)a[A]===void 0&&this._addAttr(A,y[A]);this.reset(),this.onFinish=y.onFinish,this.onReset=y.onReset,this.onUpdate=y.onUpdate}_addAttr(y,x){const E=this.node,S=E._id;let b,w,_,A,M;const O=g.tweens[S][y];O&&delete g.attrs[S][O][y];let L=E.getAttr(y);if(t.Util._isArray(x))if(b=[],w=Math.max(x.length,L.length),y==="points"&&x.length!==L.length&&(x.length>L.length?(A=L,L=t.Util._prepareArrayForTween(L,x,E.closed())):(_=x,x=t.Util._prepareArrayForTween(x,L,E.closed()))),y.indexOf("fill")===0)for(let R=0;R<w;R++)if(R%2===0)b.push(x[R]-L[R]);else{const T=t.Util.colorToRGBA(L[R]);M=t.Util.colorToRGBA(x[R]),L[R]=T,b.push({r:M.r-T.r,g:M.g-T.g,b:M.b-T.b,a:M.a-T.a})}else for(let R=0;R<w;R++)b.push(x[R]-L[R]);else d.indexOf(y)!==-1?(L=t.Util.colorToRGBA(L),M=t.Util.colorToRGBA(x),b={r:M.r-L.r,g:M.g-L.g,b:M.b-L.b,a:M.a-L.a}):b=x-L;g.attrs[S][this._id][y]={start:L,diff:b,end:x,trueEnd:_,trueStart:A},g.tweens[S][y]=this._id}_tweenFunc(y){const x=this.node,E=g.attrs[x._id][this._id];let S,b,w,_,A,M,O,L;for(S in E){if(b=E[S],w=b.start,_=b.diff,L=b.end,t.Util._isArray(w))if(A=[],O=Math.max(w.length,L.length),S.indexOf("fill")===0)for(M=0;M<O;M++)M%2===0?A.push((w[M]||0)+_[M]*y):A.push("rgba("+Math.round(w[M].r+_[M].r*y)+","+Math.round(w[M].g+_[M].g*y)+","+Math.round(w[M].b+_[M].b*y)+","+(w[M].a+_[M].a*y)+")");else for(M=0;M<O;M++)A.push((w[M]||0)+_[M]*y);else d.indexOf(S)!==-1?A="rgba("+Math.round(w.r+_.r*y)+","+Math.round(w.g+_.g*y)+","+Math.round(w.b+_.b*y)+","+(w.a+_.a*y)+")":A=w+_*y;x.setAttr(S,A)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const y=this.node,x=g.attrs[y._id][this._id];x.points&&x.points.trueEnd&&y.setAttr("points",x.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const y=this.node,x=g.attrs[y._id][this._id];x.points&&x.points.trueStart&&y.points(x.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(y){return this.tween.seek(y*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const y=this.node._id,x=this._id,E=g.tweens[y];this.pause(),this.anim&&this.anim.stop();for(const S in E)delete g.tweens[y][S];delete g.attrs[y][x],g.tweens[y]&&(Object.keys(g.tweens[y]).length===0&&delete g.tweens[y],Object.keys(g.attrs[y]).length===0&&delete g.attrs[y])}}e.Tween=g,g.attrs={},g.tweens={},n.Node.prototype.to=function(c){const y=c.onFinish;c.node=this,c.onFinish=function(){this.destroy(),y&&y()},new g(c).play()},e.Easings={BackEaseIn(c,y,x,E){return x*(c/=E)*c*((1.70158+1)*c-1.70158)+y},BackEaseOut(c,y,x,E){return x*((c=c/E-1)*c*((1.70158+1)*c+1.70158)+1)+y},BackEaseInOut(c,y,x,E){let S=1.70158;return(c/=E/2)<1?x/2*(c*c*(((S*=1.525)+1)*c-S))+y:x/2*((c-=2)*c*(((S*=1.525)+1)*c+S)+2)+y},ElasticEaseIn(c,y,x,E,S,b){let w=0;return c===0?y:(c/=E)===1?y+x:(b||(b=E*.3),!S||S<Math.abs(x)?(S=x,w=b/4):w=b/(2*Math.PI)*Math.asin(x/S),-(S*Math.pow(2,10*(c-=1))*Math.sin((c*E-w)*(2*Math.PI)/b))+y)},ElasticEaseOut(c,y,x,E,S,b){let w=0;return c===0?y:(c/=E)===1?y+x:(b||(b=E*.3),!S||S<Math.abs(x)?(S=x,w=b/4):w=b/(2*Math.PI)*Math.asin(x/S),S*Math.pow(2,-10*c)*Math.sin((c*E-w)*(2*Math.PI)/b)+x+y)},ElasticEaseInOut(c,y,x,E,S,b){let w=0;return c===0?y:(c/=E/2)===2?y+x:(b||(b=E*(.3*1.5)),!S||S<Math.abs(x)?(S=x,w=b/4):w=b/(2*Math.PI)*Math.asin(x/S),c<1?-.5*(S*Math.pow(2,10*(c-=1))*Math.sin((c*E-w)*(2*Math.PI)/b))+y:S*Math.pow(2,-10*(c-=1))*Math.sin((c*E-w)*(2*Math.PI)/b)*.5+x+y)},BounceEaseOut(c,y,x,E){return(c/=E)<1/2.75?x*(7.5625*c*c)+y:c<2/2.75?x*(7.5625*(c-=1.5/2.75)*c+.75)+y:c<2.5/2.75?x*(7.5625*(c-=2.25/2.75)*c+.9375)+y:x*(7.5625*(c-=2.625/2.75)*c+.984375)+y},BounceEaseIn(c,y,x,E){return x-e.Easings.BounceEaseOut(E-c,0,x,E)+y},BounceEaseInOut(c,y,x,E){return c<E/2?e.Easings.BounceEaseIn(c*2,0,x,E)*.5+y:e.Easings.BounceEaseOut(c*2-E,0,x,E)*.5+x*.5+y},EaseIn(c,y,x,E){return x*(c/=E)*c+y},EaseOut(c,y,x,E){return-x*(c/=E)*(c-2)+y},EaseInOut(c,y,x,E){return(c/=E/2)<1?x/2*c*c+y:-x/2*(--c*(c-2)-1)+y},StrongEaseIn(c,y,x,E){return x*(c/=E)*c*c*c*c+y},StrongEaseOut(c,y,x,E){return x*((c=c/E-1)*c*c*c*c+1)+y},StrongEaseInOut(c,y,x,E){return(c/=E/2)<1?x/2*c*c*c*c*c+y:x/2*((c-=2)*c*c*c*c+2)+y},Linear(c,y,x,E){return x*c/E+y}}}(_g)),_g}var l5;function Lv(){return l5||(l5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=Nr(),r=zi(),n=oa(),i=p0(),a=bS(),l=H6(),o=wS(),u=hm(),d=fm(),f=Wa(),v=dm(),g=_S(),c=U6(),y=d0();e.Konva=r.Util._assign(t.Konva,{Util:r.Util,Transform:r.Transform,Node:n.Node,Container:i.Container,Stage:a.Stage,stages:a.stages,Layer:l.Layer,FastLayer:o.FastLayer,Group:u.Group,DD:d.DD,Shape:f.Shape,shapes:f.shapes,Animation:v.Animation,Tween:g.Tween,Easings:g.Easings,Context:c.Context,Canvas:y.Canvas}),e.default=e.Konva}(pg)),pg}var od={},u5;function xS(){if(u5)return od;u5=1,Object.defineProperty(od,"__esModule",{value:!0}),od.Arc=void 0;const e=jr(),t=Wa(),r=Nr(),n=qr(),i=Nr();class a extends t.Shape{_sceneFunc(o){const u=r.Konva.getAngle(this.angle()),d=this.clockwise();o.beginPath(),o.arc(0,0,this.outerRadius(),0,u,d),o.arc(0,0,this.innerRadius(),u,0,!d),o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(o){this.outerRadius(o/2)}setHeight(o){this.outerRadius(o/2)}getSelfRect(){const o=this.innerRadius(),u=this.outerRadius(),d=this.clockwise(),f=r.Konva.getAngle(d?360-this.angle():this.angle()),v=Math.cos(Math.min(f,Math.PI)),g=1,c=Math.sin(Math.min(Math.max(Math.PI,f),3*Math.PI/2)),y=Math.sin(Math.min(f,Math.PI/2)),x=v*(v>0?o:u),E=g*u,S=c*(c>0?o:u),b=y*(y>0?u:o);return{x,y:d?-1*b:S,width:E-x,height:b-S}}}return od.Arc=a,a.prototype._centroid=!0,a.prototype.className="Arc",a.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"],(0,i._registerNode)(a),e.Factory.addGetterSetter(a,"innerRadius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(a,"outerRadius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(a,"angle",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(a,"clockwise",!1,(0,n.getBooleanValidator)()),od}var sd={},ld={},c5;function V6(){if(c5)return ld;c5=1,Object.defineProperty(ld,"__esModule",{value:!0}),ld.Line=void 0;const e=jr(),t=Nr(),r=Wa(),n=qr();function i(o,u,d,f,v,g,c){const y=Math.sqrt(Math.pow(d-o,2)+Math.pow(f-u,2)),x=Math.sqrt(Math.pow(v-d,2)+Math.pow(g-f,2)),E=c*y/(y+x),S=c*x/(y+x),b=d-E*(v-o),w=f-E*(g-u),_=d+S*(v-o),A=f+S*(g-u);return[b,w,_,A]}function a(o,u){const d=o.length,f=[];for(let v=2;v<d-2;v+=2){const g=i(o[v-2],o[v-1],o[v],o[v+1],o[v+2],o[v+3],u);isNaN(g[0])||(f.push(g[0]),f.push(g[1]),f.push(o[v]),f.push(o[v+1]),f.push(g[2]),f.push(g[3]))}return f}class l extends r.Shape{constructor(u){super(u),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(u){const d=this.points(),f=d.length,v=this.tension(),g=this.closed(),c=this.bezier();if(!f)return;let y=0;if(u.beginPath(),u.moveTo(d[0],d[1]),v!==0&&f>4){const x=this.getTensionPoints(),E=x.length;for(y=g?0:4,g||u.quadraticCurveTo(x[0],x[1],x[2],x[3]);y<E-2;)u.bezierCurveTo(x[y++],x[y++],x[y++],x[y++],x[y++],x[y++]);g||u.quadraticCurveTo(x[E-2],x[E-1],d[f-2],d[f-1])}else if(c)for(y=2;y<f;)u.bezierCurveTo(d[y++],d[y++],d[y++],d[y++],d[y++],d[y++]);else for(y=2;y<f;y+=2)u.lineTo(d[y],d[y+1]);g?(u.closePath(),u.fillStrokeShape(this)):u.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():a(this.points(),this.tension())}_getTensionPointsClosed(){const u=this.points(),d=u.length,f=this.tension(),v=i(u[d-2],u[d-1],u[0],u[1],u[2],u[3],f),g=i(u[d-4],u[d-3],u[d-2],u[d-1],u[0],u[1],f),c=a(u,f);return[v[2],v[3]].concat(c).concat([g[0],g[1],u[d-2],u[d-1],g[2],g[3],v[0],v[1],u[0],u[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let u=this.points();if(u.length<4)return{x:u[0]||0,y:u[1]||0,width:0,height:0};this.tension()!==0?u=[u[0],u[1],...this._getTensionPoints(),u[u.length-2],u[u.length-1]]:u=this.points();let d=u[0],f=u[0],v=u[1],g=u[1],c,y;for(let x=0;x<u.length/2;x++)c=u[x*2],y=u[x*2+1],d=Math.min(d,c),f=Math.max(f,c),v=Math.min(v,y),g=Math.max(g,y);return{x:d,y:v,width:f-d,height:g-v}}}return ld.Line=l,l.prototype.className="Line",l.prototype._attrsAffectingSize=["points","bezier","tension"],(0,t._registerNode)(l),e.Factory.addGetterSetter(l,"closed",!1),e.Factory.addGetterSetter(l,"bezier",!1),e.Factory.addGetterSetter(l,"tension",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(l,"points",[],(0,n.getNumberArrayValidator)()),ld}var ud={},xg={},f5;function SS(){return f5||(f5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(l,o,u)=>{let d,f;const g=u/2;d=0;for(let c=0;c<20;c++)f=g*e.tValues[20][c]+g,d+=e.cValues[20][c]*n(l,o,f);return g*d};e.getCubicArcLength=t;const r=(l,o,u)=>{u===void 0&&(u=1);const d=l[0]-2*l[1]+l[2],f=o[0]-2*o[1]+o[2],v=2*l[1]-2*l[0],g=2*o[1]-2*o[0],c=4*(d*d+f*f),y=4*(d*v+f*g),x=v*v+g*g;if(c===0)return u*Math.sqrt(Math.pow(l[2]-l[0],2)+Math.pow(o[2]-o[0],2));const E=y/(2*c),S=x/c,b=u+E,w=S-E*E,_=b*b+w>0?Math.sqrt(b*b+w):0,A=E*E+w>0?Math.sqrt(E*E+w):0,M=E+Math.sqrt(E*E+w)!==0?w*Math.log(Math.abs((b+_)/(E+A))):0;return Math.sqrt(c)/2*(b*_-E*A+M)};e.getQuadraticArcLength=r;function n(l,o,u){const d=i(1,u,l),f=i(1,u,o),v=d*d+f*f;return Math.sqrt(v)}const i=(l,o,u)=>{const d=u.length-1;let f,v;if(d===0)return 0;if(l===0){v=0;for(let g=0;g<=d;g++)v+=e.binomialCoefficients[d][g]*Math.pow(1-o,d-g)*Math.pow(o,g)*u[g];return v}else{f=new Array(d);for(let g=0;g<d;g++)f[g]=d*(u[g+1]-u[g]);return i(l-1,o,f)}},a=(l,o,u)=>{let d=1,f=l/o,v=(l-u(f))/o,g=0;for(;d>.001;){const c=u(f+v),y=Math.abs(l-c)/o;if(y<d)d=y,f+=v;else{const x=u(f-v),E=Math.abs(l-x)/o;E<d?(d=E,f-=v):v/=2}if(g++,g>500)break}return f};e.t2length=a}(xg)),xg}var h5;function pm(){if(h5)return ud;h5=1,Object.defineProperty(ud,"__esModule",{value:!0}),ud.Path=void 0;const e=jr(),t=Nr(),r=Wa(),n=SS();class i extends r.Shape{constructor(l){super(l),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=i.parsePathData(this.data()),this.pathLength=i.getPathLength(this.dataArray)}_sceneFunc(l){const o=this.dataArray;l.beginPath();let u=!1;for(let d=0;d<o.length;d++){const f=o[d].command,v=o[d].points;switch(f){case"L":l.lineTo(v[0],v[1]);break;case"M":l.moveTo(v[0],v[1]);break;case"C":l.bezierCurveTo(v[0],v[1],v[2],v[3],v[4],v[5]);break;case"Q":l.quadraticCurveTo(v[0],v[1],v[2],v[3]);break;case"A":const g=v[0],c=v[1],y=v[2],x=v[3],E=v[4],S=v[5],b=v[6],w=v[7],_=y>x?y:x,A=y>x?1:y/x,M=y>x?x/y:1;l.translate(g,c),l.rotate(b),l.scale(A,M),l.arc(0,0,_,E,E+S,1-w),l.scale(1/A,1/M),l.rotate(-b),l.translate(-g,-c);break;case"z":u=!0,l.closePath();break}}!u&&!this.hasFill()?l.strokeShape(this):l.fillStrokeShape(this)}getSelfRect(){let l=[];this.dataArray.forEach(function(c){if(c.command==="A"){const y=c.points[4],x=c.points[5],E=c.points[4]+x;let S=Math.PI/180;if(Math.abs(y-E)<S&&(S=Math.abs(y-E)),x<0)for(let b=y-S;b>E;b-=S){const w=i.getPointOnEllipticalArc(c.points[0],c.points[1],c.points[2],c.points[3],b,0);l.push(w.x,w.y)}else for(let b=y+S;b<E;b+=S){const w=i.getPointOnEllipticalArc(c.points[0],c.points[1],c.points[2],c.points[3],b,0);l.push(w.x,w.y)}}else if(c.command==="C")for(let y=0;y<=1;y+=.01){const x=i.getPointOnCubicBezier(y,c.start.x,c.start.y,c.points[0],c.points[1],c.points[2],c.points[3],c.points[4],c.points[5]);l.push(x.x,x.y)}else l=l.concat(c.points)});let o=l[0],u=l[0],d=l[1],f=l[1],v,g;for(let c=0;c<l.length/2;c++)v=l[c*2],g=l[c*2+1],isNaN(v)||(o=Math.min(o,v),u=Math.max(u,v)),isNaN(g)||(d=Math.min(d,g),f=Math.max(f,g));return{x:o,y:d,width:u-o,height:f-d}}getLength(){return this.pathLength}getPointAtLength(l){return i.getPointAtLengthOfDataArray(l,this.dataArray)}static getLineLength(l,o,u,d){return Math.sqrt((u-l)*(u-l)+(d-o)*(d-o))}static getPathLength(l){let o=0;for(let u=0;u<l.length;++u)o+=l[u].pathLength;return o}static getPointAtLengthOfDataArray(l,o){let u,d=0,f=o.length;if(!f)return null;for(;d<f&&l>o[d].pathLength;)l-=o[d].pathLength,++d;if(d===f)return u=o[d-1].points.slice(-2),{x:u[0],y:u[1]};if(l<.01)return o[d].command==="M"?(u=o[d].points.slice(0,2),{x:u[0],y:u[1]}):{x:o[d].start.x,y:o[d].start.y};const v=o[d],g=v.points;switch(v.command){case"L":return i.getPointOnLine(l,v.start.x,v.start.y,g[0],g[1]);case"C":return i.getPointOnCubicBezier((0,n.t2length)(l,i.getPathLength(o),_=>(0,n.getCubicArcLength)([v.start.x,g[0],g[2],g[4]],[v.start.y,g[1],g[3],g[5]],_)),v.start.x,v.start.y,g[0],g[1],g[2],g[3],g[4],g[5]);case"Q":return i.getPointOnQuadraticBezier((0,n.t2length)(l,i.getPathLength(o),_=>(0,n.getQuadraticArcLength)([v.start.x,g[0],g[2]],[v.start.y,g[1],g[3]],_)),v.start.x,v.start.y,g[0],g[1],g[2],g[3]);case"A":const c=g[0],y=g[1],x=g[2],E=g[3],S=g[5],b=g[6];let w=g[4];return w+=S*l/v.pathLength,i.getPointOnEllipticalArc(c,y,x,E,w,b)}return null}static getPointOnLine(l,o,u,d,f,v,g){v=v??o,g=g??u;const c=this.getLineLength(o,u,d,f);if(c<1e-10)return{x:o,y:u};if(d===o)return{x:v,y:g+(f>u?l:-l)};const y=(f-u)/(d-o),x=Math.sqrt(l*l/(1+y*y))*(d<o?-1:1),E=y*x;if(Math.abs(g-u-y*(v-o))<1e-10)return{x:v+x,y:g+E};const S=((v-o)*(d-o)+(g-u)*(f-u))/(c*c),b=o+S*(d-o),w=u+S*(f-u),_=this.getLineLength(v,g,b,w),A=Math.sqrt(l*l-_*_),M=Math.sqrt(A*A/(1+y*y))*(d<o?-1:1),O=y*M;return{x:b+M,y:w+O}}static getPointOnCubicBezier(l,o,u,d,f,v,g,c,y){function x(A){return A*A*A}function E(A){return 3*A*A*(1-A)}function S(A){return 3*A*(1-A)*(1-A)}function b(A){return(1-A)*(1-A)*(1-A)}const w=c*x(l)+v*E(l)+d*S(l)+o*b(l),_=y*x(l)+g*E(l)+f*S(l)+u*b(l);return{x:w,y:_}}static getPointOnQuadraticBezier(l,o,u,d,f,v,g){function c(b){return b*b}function y(b){return 2*b*(1-b)}function x(b){return(1-b)*(1-b)}const E=v*c(l)+d*y(l)+o*x(l),S=g*c(l)+f*y(l)+u*x(l);return{x:E,y:S}}static getPointOnEllipticalArc(l,o,u,d,f,v){const g=Math.cos(v),c=Math.sin(v),y={x:u*Math.cos(f),y:d*Math.sin(f)};return{x:l+(y.x*g-y.y*c),y:o+(y.x*c+y.y*g)}}static parsePathData(l){if(!l)return[];let o=l;const u=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];o=o.replace(new RegExp(" ","g"),",");for(let E=0;E<u.length;E++)o=o.replace(new RegExp(u[E],"g"),"|"+u[E]);const d=o.split("|"),f=[],v=[];let g=0,c=0;const y=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let x;for(let E=1;E<d.length;E++){let S=d[E],b=S.charAt(0);for(S=S.slice(1),v.length=0;x=y.exec(S);)v.push(x[0]);const w=[];for(let _=0,A=v.length;_<A;_++){if(v[_]==="00"){w.push(0,0);continue}const M=parseFloat(v[_]);isNaN(M)?w.push(0):w.push(M)}for(;w.length>0&&!isNaN(w[0]);){let _="",A=[];const M=g,O=c;let L,R,T,k,C,q,G,J,ae,H;switch(b){case"l":g+=w.shift(),c+=w.shift(),_="L",A.push(g,c);break;case"L":g=w.shift(),c=w.shift(),A.push(g,c);break;case"m":const V=w.shift(),Y=w.shift();if(g+=V,c+=Y,_="M",f.length>2&&f[f.length-1].command==="z"){for(let U=f.length-2;U>=0;U--)if(f[U].command==="M"){g=f[U].points[0]+V,c=f[U].points[1]+Y;break}}A.push(g,c),b="l";break;case"M":g=w.shift(),c=w.shift(),_="M",A.push(g,c),b="L";break;case"h":g+=w.shift(),_="L",A.push(g,c);break;case"H":g=w.shift(),_="L",A.push(g,c);break;case"v":c+=w.shift(),_="L",A.push(g,c);break;case"V":c=w.shift(),_="L",A.push(g,c);break;case"C":A.push(w.shift(),w.shift(),w.shift(),w.shift()),g=w.shift(),c=w.shift(),A.push(g,c);break;case"c":A.push(g+w.shift(),c+w.shift(),g+w.shift(),c+w.shift()),g+=w.shift(),c+=w.shift(),_="C",A.push(g,c);break;case"S":R=g,T=c,L=f[f.length-1],L.command==="C"&&(R=g+(g-L.points[2]),T=c+(c-L.points[3])),A.push(R,T,w.shift(),w.shift()),g=w.shift(),c=w.shift(),_="C",A.push(g,c);break;case"s":R=g,T=c,L=f[f.length-1],L.command==="C"&&(R=g+(g-L.points[2]),T=c+(c-L.points[3])),A.push(R,T,g+w.shift(),c+w.shift()),g+=w.shift(),c+=w.shift(),_="C",A.push(g,c);break;case"Q":A.push(w.shift(),w.shift()),g=w.shift(),c=w.shift(),A.push(g,c);break;case"q":A.push(g+w.shift(),c+w.shift()),g+=w.shift(),c+=w.shift(),_="Q",A.push(g,c);break;case"T":R=g,T=c,L=f[f.length-1],L.command==="Q"&&(R=g+(g-L.points[0]),T=c+(c-L.points[1])),g=w.shift(),c=w.shift(),_="Q",A.push(R,T,g,c);break;case"t":R=g,T=c,L=f[f.length-1],L.command==="Q"&&(R=g+(g-L.points[0]),T=c+(c-L.points[1])),g+=w.shift(),c+=w.shift(),_="Q",A.push(R,T,g,c);break;case"A":k=w.shift(),C=w.shift(),q=w.shift(),G=w.shift(),J=w.shift(),ae=g,H=c,g=w.shift(),c=w.shift(),_="A",A=this.convertEndpointToCenterParameterization(ae,H,g,c,G,J,k,C,q);break;case"a":k=w.shift(),C=w.shift(),q=w.shift(),G=w.shift(),J=w.shift(),ae=g,H=c,g+=w.shift(),c+=w.shift(),_="A",A=this.convertEndpointToCenterParameterization(ae,H,g,c,G,J,k,C,q);break}f.push({command:_||b,points:A,start:{x:M,y:O},pathLength:this.calcLength(M,O,_||b,A)})}(b==="z"||b==="Z")&&f.push({command:"z",points:[],start:void 0,pathLength:0})}return f}static calcLength(l,o,u,d){let f,v,g,c;const y=i;switch(u){case"L":return y.getLineLength(l,o,d[0],d[1]);case"C":return(0,n.getCubicArcLength)([l,d[0],d[2],d[4]],[o,d[1],d[3],d[5]],1);case"Q":return(0,n.getQuadraticArcLength)([l,d[0],d[2]],[o,d[1],d[3]],1);case"A":f=0;const x=d[4],E=d[5],S=d[4]+E;let b=Math.PI/180;if(Math.abs(x-S)<b&&(b=Math.abs(x-S)),v=y.getPointOnEllipticalArc(d[0],d[1],d[2],d[3],x,0),E<0)for(c=x-b;c>S;c-=b)g=y.getPointOnEllipticalArc(d[0],d[1],d[2],d[3],c,0),f+=y.getLineLength(v.x,v.y,g.x,g.y),v=g;else for(c=x+b;c<S;c+=b)g=y.getPointOnEllipticalArc(d[0],d[1],d[2],d[3],c,0),f+=y.getLineLength(v.x,v.y,g.x,g.y),v=g;return g=y.getPointOnEllipticalArc(d[0],d[1],d[2],d[3],S,0),f+=y.getLineLength(v.x,v.y,g.x,g.y),f}return 0}static convertEndpointToCenterParameterization(l,o,u,d,f,v,g,c,y){const x=y*(Math.PI/180),E=Math.cos(x)*(l-u)/2+Math.sin(x)*(o-d)/2,S=-1*Math.sin(x)*(l-u)/2+Math.cos(x)*(o-d)/2,b=E*E/(g*g)+S*S/(c*c);b>1&&(g*=Math.sqrt(b),c*=Math.sqrt(b));let w=Math.sqrt((g*g*(c*c)-g*g*(S*S)-c*c*(E*E))/(g*g*(S*S)+c*c*(E*E)));f===v&&(w*=-1),isNaN(w)&&(w=0);const _=w*g*S/c,A=w*-c*E/g,M=(l+u)/2+Math.cos(x)*_-Math.sin(x)*A,O=(o+d)/2+Math.sin(x)*_+Math.cos(x)*A,L=function(J){return Math.sqrt(J[0]*J[0]+J[1]*J[1])},R=function(J,ae){return(J[0]*ae[0]+J[1]*ae[1])/(L(J)*L(ae))},T=function(J,ae){return(J[0]*ae[1]<J[1]*ae[0]?-1:1)*Math.acos(R(J,ae))},k=T([1,0],[(E-_)/g,(S-A)/c]),C=[(E-_)/g,(S-A)/c],q=[(-1*E-_)/g,(-1*S-A)/c];let G=T(C,q);return R(C,q)<=-1&&(G=Math.PI),R(C,q)>=1&&(G=0),v===0&&G>0&&(G=G-2*Math.PI),v===1&&G<0&&(G=G+2*Math.PI),[M,O,g,c,k,G,x,v]}}return ud.Path=i,i.prototype.className="Path",i.prototype._attrsAffectingSize=["data"],(0,t._registerNode)(i),e.Factory.addGetterSetter(i,"data"),ud}var d5;function ES(){if(d5)return sd;d5=1,Object.defineProperty(sd,"__esModule",{value:!0}),sd.Arrow=void 0;const e=jr(),t=V6(),r=qr(),n=Nr(),i=pm();let a=class extends t.Line{_sceneFunc(o){super._sceneFunc(o);const u=Math.PI*2,d=this.points();let f=d;const v=this.tension()!==0&&d.length>4;v&&(f=this.getTensionPoints());const g=this.pointerLength(),c=d.length;let y,x;if(v){const b=[f[f.length-4],f[f.length-3],f[f.length-2],f[f.length-1],d[c-2],d[c-1]],w=i.Path.calcLength(f[f.length-4],f[f.length-3],"C",b),_=i.Path.getPointOnQuadraticBezier(Math.min(1,1-g/w),b[0],b[1],b[2],b[3],b[4],b[5]);y=d[c-2]-_.x,x=d[c-1]-_.y}else y=d[c-2]-d[c-4],x=d[c-1]-d[c-3];const E=(Math.atan2(x,y)+u)%u,S=this.pointerWidth();this.pointerAtEnding()&&(o.save(),o.beginPath(),o.translate(d[c-2],d[c-1]),o.rotate(E),o.moveTo(0,0),o.lineTo(-g,S/2),o.lineTo(-g,-S/2),o.closePath(),o.restore(),this.__fillStroke(o)),this.pointerAtBeginning()&&(o.save(),o.beginPath(),o.translate(d[0],d[1]),v?(y=(f[0]+f[2])/2-d[0],x=(f[1]+f[3])/2-d[1]):(y=d[2]-d[0],x=d[3]-d[1]),o.rotate((Math.atan2(-x,-y)+u)%u),o.moveTo(0,0),o.lineTo(-g,S/2),o.lineTo(-g,-S/2),o.closePath(),o.restore(),this.__fillStroke(o))}__fillStroke(o){const u=this.dashEnabled();u&&(this.attrs.dashEnabled=!1,o.setLineDash([])),o.fillStrokeShape(this),u&&(this.attrs.dashEnabled=!0)}getSelfRect(){const o=super.getSelfRect(),u=this.pointerWidth()/2;return{x:o.x,y:o.y-u,width:o.width,height:o.height+u*2}}};return sd.Arrow=a,a.prototype.className="Arrow",(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"pointerLength",10,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(a,"pointerWidth",10,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(a,"pointerAtBeginning",!1),e.Factory.addGetterSetter(a,"pointerAtEnding",!0),sd}var cd={},p5;function AS(){if(p5)return cd;p5=1,Object.defineProperty(cd,"__esModule",{value:!0}),cd.Circle=void 0;const e=jr(),t=Wa(),r=qr(),n=Nr();class i extends t.Shape{_sceneFunc(l){l.beginPath(),l.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),l.closePath(),l.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(l){this.radius()!==l/2&&this.radius(l/2)}setHeight(l){this.radius()!==l/2&&this.radius(l/2)}}return cd.Circle=i,i.prototype._centroid=!0,i.prototype.className="Circle",i.prototype._attrsAffectingSize=["radius"],(0,n._registerNode)(i),e.Factory.addGetterSetter(i,"radius",0,(0,r.getNumberValidator)()),cd}var fd={},g5;function PS(){if(g5)return fd;g5=1,Object.defineProperty(fd,"__esModule",{value:!0}),fd.Ellipse=void 0;const e=jr(),t=Wa(),r=qr(),n=Nr();let i=class extends t.Shape{_sceneFunc(l){const o=this.radiusX(),u=this.radiusY();l.beginPath(),l.save(),o!==u&&l.scale(1,u/o),l.arc(0,0,o,0,Math.PI*2,!1),l.restore(),l.closePath(),l.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(l){this.radiusX(l/2)}setHeight(l){this.radiusY(l/2)}};return fd.Ellipse=i,i.prototype.className="Ellipse",i.prototype._centroid=!0,i.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,n._registerNode)(i),e.Factory.addComponentsGetterSetter(i,"radius",["x","y"]),e.Factory.addGetterSetter(i,"radiusX",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(i,"radiusY",0,(0,r.getNumberValidator)()),fd}var hd={},v5;function kS(){if(v5)return hd;v5=1,Object.defineProperty(hd,"__esModule",{value:!0}),hd.Image=void 0;const e=zi(),t=jr(),r=Wa(),n=Nr(),i=qr();class a extends r.Shape{constructor(o){super(o),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",u=>{this._removeImageLoad(u.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const o=this.image();o&&o.complete||o&&o.readyState===4||o&&o.addEventListener&&o.addEventListener("load",this._loadListener)}_removeImageLoad(o){o&&o.removeEventListener&&o.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const o=!!this.cornerRadius(),u=this.hasShadow();return o&&u?!0:super._useBufferCanvas(!0)}_sceneFunc(o){const u=this.getWidth(),d=this.getHeight(),f=this.cornerRadius(),v=this.attrs.image;let g;if(v){const c=this.attrs.cropWidth,y=this.attrs.cropHeight;c&&y?g=[v,this.cropX(),this.cropY(),c,y,0,0,u,d]:g=[v,0,0,u,d]}(this.hasFill()||this.hasStroke()||f)&&(o.beginPath(),f?e.Util.drawRoundedRectPath(o,u,d,f):o.rect(0,0,u,d),o.closePath(),o.fillStrokeShape(this)),v&&(f&&o.clip(),o.drawImage.apply(o,g))}_hitFunc(o){const u=this.width(),d=this.height(),f=this.cornerRadius();o.beginPath(),f?e.Util.drawRoundedRectPath(o,u,d,f):o.rect(0,0,u,d),o.closePath(),o.fillStrokeShape(this)}getWidth(){var o,u;return(o=this.attrs.width)!==null&&o!==void 0?o:(u=this.image())===null||u===void 0?void 0:u.width}getHeight(){var o,u;return(o=this.attrs.height)!==null&&o!==void 0?o:(u=this.image())===null||u===void 0?void 0:u.height}static fromURL(o,u,d=null){const f=e.Util.createImageElement();f.onload=function(){const v=new a({image:f});u(v)},f.onerror=d,f.crossOrigin="Anonymous",f.src=o}}return hd.Image=a,a.prototype.className="Image",(0,n._registerNode)(a),t.Factory.addGetterSetter(a,"cornerRadius",0,(0,i.getNumberOrArrayOfNumbersValidator)(4)),t.Factory.addGetterSetter(a,"image"),t.Factory.addComponentsGetterSetter(a,"crop",["x","y","width","height"]),t.Factory.addGetterSetter(a,"cropX",0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(a,"cropY",0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(a,"cropWidth",0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(a,"cropHeight",0,(0,i.getNumberValidator)()),hd}var xf={},m5;function OS(){if(m5)return xf;m5=1,Object.defineProperty(xf,"__esModule",{value:!0}),xf.Tag=xf.Label=void 0;const e=jr(),t=Wa(),r=hm(),n=qr(),i=Nr(),a=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],l="Change.konva",o="none",u="up",d="right",f="down",v="left",g=a.length;class c extends r.Group{constructor(E){super(E),this.on("add.konva",function(S){this._addListeners(S.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(E){let S=this,b;const w=function(){S._sync()};for(b=0;b<g;b++)E.on(a[b]+l,w)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let E=this.getText(),S=this.getTag(),b,w,_,A,M,O,L;if(E&&S){switch(b=E.width(),w=E.height(),_=S.pointerDirection(),A=S.pointerWidth(),L=S.pointerHeight(),M=0,O=0,_){case u:M=b/2,O=-1*L;break;case d:M=b+A,O=w/2;break;case f:M=b/2,O=w+L;break;case v:M=-1*A,O=w/2;break}S.setAttrs({x:-1*M,y:-1*O,width:b,height:w}),E.setAttrs({x:-1*M,y:-1*O})}}}xf.Label=c,c.prototype.className="Label",(0,i._registerNode)(c);class y extends t.Shape{_sceneFunc(E){const S=this.width(),b=this.height(),w=this.pointerDirection(),_=this.pointerWidth(),A=this.pointerHeight(),M=this.cornerRadius();let O=0,L=0,R=0,T=0;typeof M=="number"?O=L=R=T=Math.min(M,S/2,b/2):(O=Math.min(M[0]||0,S/2,b/2),L=Math.min(M[1]||0,S/2,b/2),T=Math.min(M[2]||0,S/2,b/2),R=Math.min(M[3]||0,S/2,b/2)),E.beginPath(),E.moveTo(O,0),w===u&&(E.lineTo((S-_)/2,0),E.lineTo(S/2,-1*A),E.lineTo((S+_)/2,0)),E.lineTo(S-L,0),E.arc(S-L,L,L,Math.PI*3/2,0,!1),w===d&&(E.lineTo(S,(b-A)/2),E.lineTo(S+_,b/2),E.lineTo(S,(b+A)/2)),E.lineTo(S,b-T),E.arc(S-T,b-T,T,0,Math.PI/2,!1),w===f&&(E.lineTo((S+_)/2,b),E.lineTo(S/2,b+A),E.lineTo((S-_)/2,b)),E.lineTo(R,b),E.arc(R,b-R,R,Math.PI/2,Math.PI,!1),w===v&&(E.lineTo(0,(b+A)/2),E.lineTo(-1*_,b/2),E.lineTo(0,(b-A)/2)),E.lineTo(0,O),E.arc(O,O,O,Math.PI,Math.PI*3/2,!1),E.closePath(),E.fillStrokeShape(this)}getSelfRect(){let E=0,S=0,b=this.pointerWidth(),w=this.pointerHeight(),_=this.pointerDirection(),A=this.width(),M=this.height();return _===u?(S-=w,M+=w):_===f?M+=w:_===v?(E-=b*1.5,A+=b):_===d&&(A+=b*1.5),{x:E,y:S,width:A,height:M}}}return xf.Tag=y,y.prototype.className="Tag",(0,i._registerNode)(y),e.Factory.addGetterSetter(y,"pointerDirection",o),e.Factory.addGetterSetter(y,"pointerWidth",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(y,"pointerHeight",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(y,"cornerRadius",0,(0,n.getNumberOrArrayOfNumbersValidator)(4)),xf}var dd={},y5;function G6(){if(y5)return dd;y5=1,Object.defineProperty(dd,"__esModule",{value:!0}),dd.Rect=void 0;const e=jr(),t=Wa(),r=Nr(),n=zi(),i=qr();class a extends t.Shape{_sceneFunc(o){const u=this.cornerRadius(),d=this.width(),f=this.height();o.beginPath(),u?n.Util.drawRoundedRectPath(o,d,f,u):o.rect(0,0,d,f),o.closePath(),o.fillStrokeShape(this)}}return dd.Rect=a,a.prototype.className="Rect",(0,r._registerNode)(a),e.Factory.addGetterSetter(a,"cornerRadius",0,(0,i.getNumberOrArrayOfNumbersValidator)(4)),dd}var pd={},b5;function CS(){if(b5)return pd;b5=1,Object.defineProperty(pd,"__esModule",{value:!0}),pd.RegularPolygon=void 0;const e=jr(),t=Wa(),r=qr(),n=Nr();let i=class extends t.Shape{_sceneFunc(l){const o=this._getPoints();l.beginPath(),l.moveTo(o[0].x,o[0].y);for(let u=1;u<o.length;u++)l.lineTo(o[u].x,o[u].y);l.closePath(),l.fillStrokeShape(this)}_getPoints(){const l=this.attrs.sides,o=this.attrs.radius||0,u=[];for(let d=0;d<l;d++)u.push({x:o*Math.sin(d*2*Math.PI/l),y:-1*o*Math.cos(d*2*Math.PI/l)});return u}getSelfRect(){const l=this._getPoints();let o=l[0].x,u=l[0].y,d=l[0].x,f=l[0].y;return l.forEach(v=>{o=Math.min(o,v.x),u=Math.max(u,v.x),d=Math.min(d,v.y),f=Math.max(f,v.y)}),{x:o,y:d,width:u-o,height:f-d}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(l){this.radius(l/2)}setHeight(l){this.radius(l/2)}};return pd.RegularPolygon=i,i.prototype.className="RegularPolygon",i.prototype._centroid=!0,i.prototype._attrsAffectingSize=["radius"],(0,n._registerNode)(i),e.Factory.addGetterSetter(i,"radius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(i,"sides",0,(0,r.getNumberValidator)()),pd}var gd={},w5;function NS(){if(w5)return gd;w5=1,Object.defineProperty(gd,"__esModule",{value:!0}),gd.Ring=void 0;const e=jr(),t=Wa(),r=qr(),n=Nr(),i=Math.PI*2;let a=class extends t.Shape{_sceneFunc(o){o.beginPath(),o.arc(0,0,this.innerRadius(),0,i,!1),o.moveTo(this.outerRadius(),0),o.arc(0,0,this.outerRadius(),i,0,!0),o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(o){this.outerRadius(o/2)}setHeight(o){this.outerRadius(o/2)}};return gd.Ring=a,a.prototype.className="Ring",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,n._registerNode)(a),e.Factory.addGetterSetter(a,"innerRadius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(a,"outerRadius",0,(0,r.getNumberValidator)()),gd}var vd={},_5;function LS(){if(_5)return vd;_5=1,Object.defineProperty(vd,"__esModule",{value:!0}),vd.Sprite=void 0;const e=jr(),t=Wa(),r=dm(),n=qr(),i=Nr();let a=class extends t.Shape{constructor(o){super(o),this._updated=!0,this.anim=new r.Animation(()=>{const u=this._updated;return this._updated=!1,u}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(o){const u=this.animation(),d=this.frameIndex(),f=d*4,v=this.animations()[u],g=this.frameOffsets(),c=v[f+0],y=v[f+1],x=v[f+2],E=v[f+3],S=this.image();if((this.hasFill()||this.hasStroke())&&(o.beginPath(),o.rect(0,0,x,E),o.closePath(),o.fillStrokeShape(this)),S)if(g){const b=g[u],w=d*2;o.drawImage(S,c,y,x,E,b[w+0],b[w+1],x,E)}else o.drawImage(S,c,y,x,E,0,0,x,E)}_hitFunc(o){const u=this.animation(),d=this.frameIndex(),f=d*4,v=this.animations()[u],g=this.frameOffsets(),c=v[f+2],y=v[f+3];if(o.beginPath(),g){const x=g[u],E=d*2;o.rect(x[E+0],x[E+1],c,y)}else o.rect(0,0,c,y);o.closePath(),o.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const o=this;this.interval=setInterval(function(){o._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const o=this.getLayer();this.anim.setLayers(o),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const o=this.frameIndex(),u=this.animation(),d=this.animations(),f=d[u],v=f.length/4;o<v-1?this.frameIndex(o+1):this.frameIndex(0)}};return vd.Sprite=a,a.prototype.className="Sprite",(0,i._registerNode)(a),e.Factory.addGetterSetter(a,"animation"),e.Factory.addGetterSetter(a,"animations"),e.Factory.addGetterSetter(a,"frameOffsets"),e.Factory.addGetterSetter(a,"image"),e.Factory.addGetterSetter(a,"frameIndex",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(a,"frameRate",17,(0,n.getNumberValidator)()),e.Factory.backCompat(a,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"}),vd}var md={},x5;function TS(){if(x5)return md;x5=1,Object.defineProperty(md,"__esModule",{value:!0}),md.Star=void 0;const e=jr(),t=Wa(),r=qr(),n=Nr();let i=class extends t.Shape{_sceneFunc(l){const o=this.innerRadius(),u=this.outerRadius(),d=this.numPoints();l.beginPath(),l.moveTo(0,0-u);for(let f=1;f<d*2;f++){const v=f%2===0?u:o,g=v*Math.sin(f*Math.PI/d),c=-1*v*Math.cos(f*Math.PI/d);l.lineTo(g,c)}l.closePath(),l.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(l){this.outerRadius(l/2)}setHeight(l){this.outerRadius(l/2)}};return md.Star=i,i.prototype.className="Star",i.prototype._centroid=!0,i.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,n._registerNode)(i),e.Factory.addGetterSetter(i,"numPoints",5,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(i,"innerRadius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(i,"outerRadius",0,(0,r.getNumberValidator)()),md}var hh={},S5;function $6(){if(S5)return hh;S5=1,Object.defineProperty(hh,"__esModule",{value:!0}),hh.Text=void 0,hh.stringToArray=l;const e=zi(),t=jr(),r=Wa(),n=Nr(),i=qr(),a=Nr();function l(j){return[...j].reduce((z,Z,re,W)=>{if(new RegExp("\\p{Emoji}","u").test(Z)){const Q=W[re+1];Q&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(Q)?(z.push(Z+Q),W[re+1]=""):z.push(Z)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(Z+(W[re+1]||""))?z.push(Z+W[re+1]):re>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(Z)?z[z.length-1]+=Z:Z&&z.push(Z);return z},[])}const o="auto",u="center",d="inherit",f="justify",v="Change.konva",g="2d",c="-",y="left",x="text",E="Text",S="top",b="bottom",w="middle",_="normal",A="px ",M=" ",O="right",L="rtl",R="word",T="char",k="none",C="…",q=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],G=q.length;function J(j){return j.split(",").map(z=>{z=z.trim();const Z=z.indexOf(" ")>=0,re=z.indexOf('"')>=0||z.indexOf("'")>=0;return Z&&!re&&(z=`"${z}"`),z}).join(", ")}let ae;function H(){return ae||(ae=e.Util.createCanvasElement().getContext(g),ae)}function V(j){j.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Y(j){j.setAttr("miterLimit",2),j.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function U(j){return j=j||{},!j.fillLinearGradientColorStops&&!j.fillRadialGradientColorStops&&!j.fillPatternImage&&(j.fill=j.fill||"black"),j}class D extends r.Shape{constructor(z){super(U(z)),this._partialTextX=0,this._partialTextY=0;for(let Z=0;Z<G;Z++)this.on(q[Z]+v,this._setTextData);this._setTextData()}_sceneFunc(z){const Z=this.textArr,re=Z.length;if(!this.text())return;let W=this.padding(),Q=this.fontSize(),se=this.lineHeight()*Q,ue=this.verticalAlign(),le=this.direction(),ye=0,Re=this.align(),Me=this.getWidth(),Pe=this.letterSpacing(),de=this.fill(),Te=this.textDecoration(),Ae=Te.indexOf("underline")!==-1,be=Te.indexOf("line-through")!==-1,_e;le=le===d?z.direction:le;let xe=se/2,Le=w;if(n.Konva._fixTextRendering){const pe=this.measureSize("M");Le="alphabetic",xe=(pe.fontBoundingBoxAscent-pe.fontBoundingBoxDescent)/2+se/2}for(le===L&&z.setAttr("direction",le),z.setAttr("font",this._getContextFont()),z.setAttr("textBaseline",Le),z.setAttr("textAlign",y),ue===w?ye=(this.getHeight()-re*se-W*2)/2:ue===b&&(ye=this.getHeight()-re*se-W*2),z.translate(W,ye+W),_e=0;_e<re;_e++){let pe=0,Ce=0;const je=Z[_e],He=je.text,st=je.width,pt=je.lastInParagraph;if(z.save(),Re===O?pe+=Me-st-W*2:Re===u&&(pe+=(Me-st-W*2)/2),Ae){z.save(),z.beginPath();const ct=n.Konva._fixTextRendering?Math.round(Q/4):Math.round(Q/2),bt=pe,ht=xe+Ce+ct;z.moveTo(bt,ht);const vt=Re===f&&!pt?Me-W*2:st;z.lineTo(bt+Math.round(vt),ht),z.lineWidth=Q/15;const wr=this._getLinearGradient();z.strokeStyle=wr||de,z.stroke(),z.restore()}if(be){z.save(),z.beginPath();const ct=n.Konva._fixTextRendering?-Math.round(Q/4):0;z.moveTo(pe,xe+Ce+ct);const bt=Re===f&&!pt?Me-W*2:st;z.lineTo(pe+Math.round(bt),xe+Ce+ct),z.lineWidth=Q/15;const ht=this._getLinearGradient();z.strokeStyle=ht||de,z.stroke(),z.restore()}if(le!==L&&(Pe!==0||Re===f)){const ct=He.split(" ").length-1,bt=l(He);for(let ht=0;ht<bt.length;ht++){const vt=bt[ht];vt===" "&&!pt&&Re===f&&(pe+=(Me-W*2-st)/ct),this._partialTextX=pe,this._partialTextY=xe+Ce,this._partialText=vt,z.fillStrokeShape(this),pe+=this.measureSize(vt).width+Pe}}else Pe!==0&&z.setAttr("letterSpacing",`${Pe}px`),this._partialTextX=pe,this._partialTextY=xe+Ce,this._partialText=He,z.fillStrokeShape(this);z.restore(),re>1&&(xe+=se)}}_hitFunc(z){const Z=this.getWidth(),re=this.getHeight();z.beginPath(),z.rect(0,0,Z,re),z.closePath(),z.fillStrokeShape(this)}setText(z){const Z=e.Util._isString(z)?z:z==null?"":z+"";return this._setAttr(x,Z),this}getWidth(){return this.attrs.width===o||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===o||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(z){var Z,re,W,Q,se,ue,le,ye,Re,Me,Pe;let de=H(),Te=this.fontSize(),Ae;de.save(),de.font=this._getContextFont(),Ae=de.measureText(z),de.restore();const be=Te/100;return{actualBoundingBoxAscent:(Z=Ae.actualBoundingBoxAscent)!==null&&Z!==void 0?Z:71.58203125*be,actualBoundingBoxDescent:(re=Ae.actualBoundingBoxDescent)!==null&&re!==void 0?re:0,actualBoundingBoxLeft:(W=Ae.actualBoundingBoxLeft)!==null&&W!==void 0?W:-7.421875*be,actualBoundingBoxRight:(Q=Ae.actualBoundingBoxRight)!==null&&Q!==void 0?Q:75.732421875*be,alphabeticBaseline:(se=Ae.alphabeticBaseline)!==null&&se!==void 0?se:0,emHeightAscent:(ue=Ae.emHeightAscent)!==null&&ue!==void 0?ue:100*be,emHeightDescent:(le=Ae.emHeightDescent)!==null&&le!==void 0?le:-20*be,fontBoundingBoxAscent:(ye=Ae.fontBoundingBoxAscent)!==null&&ye!==void 0?ye:91*be,fontBoundingBoxDescent:(Re=Ae.fontBoundingBoxDescent)!==null&&Re!==void 0?Re:21*be,hangingBaseline:(Me=Ae.hangingBaseline)!==null&&Me!==void 0?Me:72.80000305175781*be,ideographicBaseline:(Pe=Ae.ideographicBaseline)!==null&&Pe!==void 0?Pe:-21*be,width:Ae.width,height:Te}}_getContextFont(){return this.fontStyle()+M+this.fontVariant()+M+(this.fontSize()+A)+J(this.fontFamily())}_addTextLine(z){this.align()===f&&(z=z.trim());const re=this._getTextWidth(z);return this.textArr.push({text:z,width:re,lastInParagraph:!1})}_getTextWidth(z){const Z=this.letterSpacing(),re=z.length;return H().measureText(z).width+Z*re}_setTextData(){let z=this.text().split(`
43
- `),Z=+this.fontSize(),re=0,W=this.lineHeight()*Z,Q=this.attrs.width,se=this.attrs.height,ue=Q!==o&&Q!==void 0,le=se!==o&&se!==void 0,ye=this.padding(),Re=Q-ye*2,Me=se-ye*2,Pe=0,de=this.wrap(),Te=de!==k,Ae=de!==T&&Te,be=this.ellipsis();this.textArr=[],H().font=this._getContextFont();const _e=be?this._getTextWidth(C):0;for(let xe=0,Le=z.length;xe<Le;++xe){let pe=z[xe],Ce=this._getTextWidth(pe);if(ue&&Ce>Re)for(;pe.length>0;){let je=0,He=l(pe).length,st="",pt=0;for(;je<He;){const ct=je+He>>>1,bt=l(pe),ht=bt.slice(0,ct+1).join(""),vt=this._getTextWidth(ht);(be&&le&&Pe+W>Me?vt+_e:vt)<=Re?(je=ct+1,st=ht,pt=vt):He=ct}if(st){if(Ae){const ht=l(pe),vt=l(st),wr=ht[vt.length],cr=wr===M||wr===c;let Pt;if(cr&&pt<=Re)Pt=vt.length;else{const $t=vt.lastIndexOf(M),$e=vt.lastIndexOf(c);Pt=Math.max($t,$e)+1}Pt>0&&(je=Pt,st=ht.slice(0,je).join(""),pt=this._getTextWidth(st))}if(st=st.trimRight(),this._addTextLine(st),re=Math.max(re,pt),Pe+=W,this._shouldHandleEllipsis(Pe)){this._tryToAddEllipsisToLastLine();break}if(pe=l(pe).slice(je).join("").trimLeft(),pe.length>0&&(Ce=this._getTextWidth(pe),Ce<=Re)){this._addTextLine(pe),Pe+=W,re=Math.max(re,Ce);break}}else break}else this._addTextLine(pe),Pe+=W,re=Math.max(re,Ce),this._shouldHandleEllipsis(Pe)&&xe<Le-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),le&&Pe+W>Me)break}this.textHeight=Z,this.textWidth=re}_shouldHandleEllipsis(z){const Z=+this.fontSize(),re=this.lineHeight()*Z,W=this.attrs.height,Q=W!==o&&W!==void 0,se=this.padding(),ue=W-se*2;return!(this.wrap()!==k)||Q&&z+re>ue}_tryToAddEllipsisToLastLine(){const z=this.attrs.width,Z=z!==o&&z!==void 0,re=this.padding(),W=z-re*2,Q=this.ellipsis(),se=this.textArr[this.textArr.length-1];!se||!Q||(Z&&(this._getTextWidth(se.text+C)<W||(se.text=se.text.slice(0,se.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(se.text+C))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const z=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,Z=this.hasShadow();return z&&Z?!0:super._useBufferCanvas()}}return hh.Text=D,D.prototype._fillFunc=V,D.prototype._strokeFunc=Y,D.prototype.className=E,D.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,a._registerNode)(D),t.Factory.overWriteSetter(D,"width",(0,i.getNumberOrAutoValidator)()),t.Factory.overWriteSetter(D,"height",(0,i.getNumberOrAutoValidator)()),t.Factory.addGetterSetter(D,"direction",d),t.Factory.addGetterSetter(D,"fontFamily","Arial"),t.Factory.addGetterSetter(D,"fontSize",12,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(D,"fontStyle",_),t.Factory.addGetterSetter(D,"fontVariant",_),t.Factory.addGetterSetter(D,"padding",0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(D,"align",y),t.Factory.addGetterSetter(D,"verticalAlign",S),t.Factory.addGetterSetter(D,"lineHeight",1,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(D,"wrap",R),t.Factory.addGetterSetter(D,"ellipsis",!1,(0,i.getBooleanValidator)()),t.Factory.addGetterSetter(D,"letterSpacing",0,(0,i.getNumberValidator)()),t.Factory.addGetterSetter(D,"text","",(0,i.getStringValidator)()),t.Factory.addGetterSetter(D,"textDecoration",""),hh}var yd={},E5;function RS(){if(E5)return yd;E5=1,Object.defineProperty(yd,"__esModule",{value:!0}),yd.TextPath=void 0;const e=zi(),t=jr(),r=Wa(),n=pm(),i=$6(),a=qr(),l=Nr(),o="",u="normal";function d(g){g.fillText(this.partialText,0,0)}function f(g){g.strokeText(this.partialText,0,0)}let v=class extends r.Shape{constructor(c){super(c),this.dummyCanvas=e.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return n.Path.getPathLength(this.dataArray)}_getPointAtLength(c){if(!this.attrs.data)return null;const y=this.pathLength;return c-1>y?null:n.Path.getPointAtLengthOfDataArray(c,this.dataArray)}_readDataAttribute(){this.dataArray=n.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(c){c.setAttr("font",this._getContextFont()),c.setAttr("textBaseline",this.textBaseline()),c.setAttr("textAlign","left"),c.save();const y=this.textDecoration(),x=this.fill(),E=this.fontSize(),S=this.glyphInfo;y==="underline"&&c.beginPath();for(let b=0;b<S.length;b++){c.save();const w=S[b].p0;c.translate(w.x,w.y),c.rotate(S[b].rotation),this.partialText=S[b].text,c.fillStrokeShape(this),y==="underline"&&(b===0&&c.moveTo(0,E/2+1),c.lineTo(E,E/2+1)),c.restore()}y==="underline"&&(c.strokeStyle=x,c.lineWidth=E/20,c.stroke()),c.restore()}_hitFunc(c){c.beginPath();const y=this.glyphInfo;if(y.length>=1){const x=y[0].p0;c.moveTo(x.x,x.y)}for(let x=0;x<y.length;x++){const E=y[x].p1;c.lineTo(E.x,E.y)}c.setAttr("lineWidth",this.fontSize()),c.setAttr("strokeStyle",this.colorKey),c.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(c){return i.Text.prototype.setText.call(this,c)}_getContextFont(){return i.Text.prototype._getContextFont.call(this)}_getTextSize(c){const x=this.dummyCanvas.getContext("2d");x.save(),x.font=this._getContextFont();const E=x.measureText(c);return x.restore(),{width:E.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:c,height:y}=this._getTextSize(this.attrs.text);if(this.textWidth=c,this.textHeight=y,this.glyphInfo=[],!this.attrs.data)return null;const x=this.letterSpacing(),E=this.align(),S=this.kerningFunc(),b=Math.max(this.textWidth+((this.attrs.text||"").length-1)*x,0);let w=0;E==="center"&&(w=Math.max(0,this.pathLength/2-b/2)),E==="right"&&(w=Math.max(0,this.pathLength-b));const _=(0,i.stringToArray)(this.text());let A=w;for(let M=0;M<_.length;M++){const O=this._getPointAtLength(A);if(!O)return;let L=this._getTextSize(_[M]).width+x;if(_[M]===" "&&E==="justify"){const G=this.text().split(" ").length-1;L+=(this.pathLength-b)/G}const R=this._getPointAtLength(A+L);if(!R)return;const T=n.Path.getLineLength(O.x,O.y,R.x,R.y);let k=0;if(S)try{k=S(_[M-1],_[M])*this.fontSize()}catch{k=0}O.x+=k,R.x+=k,this.textWidth+=k;const C=n.Path.getPointOnLine(k+T/2,O.x,O.y,R.x,R.y),q=Math.atan2(R.y-O.y,R.x-O.x);this.glyphInfo.push({transposeX:C.x,transposeY:C.y,text:_[M],rotation:q,p0:O,p1:R}),A+=L}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const c=[];this.glyphInfo.forEach(function(A){c.push(A.p0.x),c.push(A.p0.y),c.push(A.p1.x),c.push(A.p1.y)});let y=c[0]||0,x=c[0]||0,E=c[1]||0,S=c[1]||0,b,w;for(let A=0;A<c.length/2;A++)b=c[A*2],w=c[A*2+1],y=Math.min(y,b),x=Math.max(x,b),E=Math.min(E,w),S=Math.max(S,w);const _=this.fontSize();return{x:y-_/2,y:E-_/2,width:x-y+_,height:S-E+_}}destroy(){return e.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};return yd.TextPath=v,v.prototype._fillFunc=d,v.prototype._strokeFunc=f,v.prototype._fillFuncHit=d,v.prototype._strokeFuncHit=f,v.prototype.className="TextPath",v.prototype._attrsAffectingSize=["text","fontSize","data"],(0,l._registerNode)(v),t.Factory.addGetterSetter(v,"data"),t.Factory.addGetterSetter(v,"fontFamily","Arial"),t.Factory.addGetterSetter(v,"fontSize",12,(0,a.getNumberValidator)()),t.Factory.addGetterSetter(v,"fontStyle",u),t.Factory.addGetterSetter(v,"align","left"),t.Factory.addGetterSetter(v,"letterSpacing",0,(0,a.getNumberValidator)()),t.Factory.addGetterSetter(v,"textBaseline","middle"),t.Factory.addGetterSetter(v,"fontVariant",u),t.Factory.addGetterSetter(v,"text",o),t.Factory.addGetterSetter(v,"textDecoration",""),t.Factory.addGetterSetter(v,"kerningFunc",void 0),yd}var bd={},A5;function MS(){if(A5)return bd;A5=1,Object.defineProperty(bd,"__esModule",{value:!0}),bd.Transformer=void 0;const e=zi(),t=jr(),r=oa(),n=Wa(),i=G6(),a=hm(),l=Nr(),o=qr(),u=Nr(),d="tr-konva",f=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(L=>L+`.${d}`).join(" "),v="nodesRect",g=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],c={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},y="ontouchstart"in l.Konva._global;function x(L,R,T){if(L==="rotater")return T;R+=e.Util.degToRad(c[L]||0);const k=(e.Util.radToDeg(R)%360+360)%360;return e.Util._inRange(k,315+22.5,360)||e.Util._inRange(k,0,22.5)?"ns-resize":e.Util._inRange(k,45-22.5,45+22.5)?"nesw-resize":e.Util._inRange(k,90-22.5,90+22.5)?"ew-resize":e.Util._inRange(k,135-22.5,135+22.5)?"nwse-resize":e.Util._inRange(k,180-22.5,180+22.5)?"ns-resize":e.Util._inRange(k,225-22.5,225+22.5)?"nesw-resize":e.Util._inRange(k,270-22.5,270+22.5)?"ew-resize":e.Util._inRange(k,315-22.5,315+22.5)?"nwse-resize":(e.Util.error("Transformer has unknown angle for cursor detection: "+k),"pointer")}const E=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function S(L){return{x:L.x+L.width/2*Math.cos(L.rotation)+L.height/2*Math.sin(-L.rotation),y:L.y+L.height/2*Math.cos(L.rotation)+L.width/2*Math.sin(L.rotation)}}function b(L,R,T){const k=T.x+(L.x-T.x)*Math.cos(R)-(L.y-T.y)*Math.sin(R),C=T.y+(L.x-T.x)*Math.sin(R)+(L.y-T.y)*Math.cos(R);return{...L,rotation:L.rotation+R,x:k,y:C}}function w(L,R){const T=S(L);return b(L,R,T)}function _(L,R,T){let k=R;for(let C=0;C<L.length;C++){const q=l.Konva.getAngle(L[C]),G=Math.abs(q-R)%(Math.PI*2);Math.min(G,Math.PI*2-G)<T&&(k=q)}return k}let A=0;class M extends a.Group{constructor(R){super(R),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(f,this.update),this.getNode()&&this.update()}attachTo(R){return this.setNode(R),this}setNode(R){return e.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([R])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return d+this._id}setNodes(R=[]){this._nodes&&this._nodes.length&&this.detach();const T=R.filter(C=>C.isAncestorOf(this)?(e.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=R=T,R.length===1&&this.useSingleNodeRotation()?this.rotation(R[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(C=>{const q=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(C._attrsAffectingSize.length){const G=C._attrsAffectingSize.map(J=>J+"Change."+this._getEventNamespace()).join(" ");C.on(G,q)}C.on(g.map(G=>G+`.${this._getEventNamespace()}`).join(" "),q),C.on(`absoluteTransformChange.${this._getEventNamespace()}`,q),this._proxyDrag(C)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(R){let T;R.on(`dragstart.${this._getEventNamespace()}`,k=>{T=R.getAbsolutePosition(),!this.isDragging()&&R!==this.findOne(".back")&&this.startDrag(k,!1)}),R.on(`dragmove.${this._getEventNamespace()}`,k=>{if(!T)return;const C=R.getAbsolutePosition(),q=C.x-T.x,G=C.y-T.y;this.nodes().forEach(J=>{if(J===R||J.isDragging())return;const ae=J.getAbsolutePosition();J.setAbsolutePosition({x:ae.x+q,y:ae.y+G}),J.startDrag(k)}),T=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(R=>{R.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(v),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(v,this.__getNodeRect)}__getNodeShape(R,T=this.rotation(),k){const C=R.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),q=R.getAbsoluteScale(k),G=R.getAbsolutePosition(k),J=C.x*q.x-R.offsetX()*q.x,ae=C.y*q.y-R.offsetY()*q.y,H=(l.Konva.getAngle(R.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),V={x:G.x+J*Math.cos(H)+ae*Math.sin(-H),y:G.y+ae*Math.cos(H)+J*Math.sin(H),width:C.width*q.x,height:C.height*q.y,rotation:H};return b(V,-l.Konva.getAngle(T),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const T=[];this.nodes().map(H=>{const V=H.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),Y=[{x:V.x,y:V.y},{x:V.x+V.width,y:V.y},{x:V.x+V.width,y:V.y+V.height},{x:V.x,y:V.y+V.height}],U=H.getAbsoluteTransform();Y.forEach(function(D){const j=U.point(D);T.push(j)})});const k=new e.Transform;k.rotate(-l.Konva.getAngle(this.rotation()));let C=1/0,q=1/0,G=-1/0,J=-1/0;T.forEach(function(H){const V=k.point(H);C===void 0&&(C=G=V.x,q=J=V.y),C=Math.min(C,V.x),q=Math.min(q,V.y),G=Math.max(G,V.x),J=Math.max(J,V.y)}),k.invert();const ae=k.point({x:C,y:q});return{x:ae.x,y:ae.y,width:G-C,height:J-q,rotation:l.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),E.forEach(R=>{this._createAnchor(R)}),this._createAnchor("rotater")}_createAnchor(R){const T=new i.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:R+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:y?10:"auto"}),k=this;T.on("mousedown touchstart",function(C){k._handleMouseDown(C)}),T.on("dragstart",C=>{T.stopDrag(),C.cancelBubble=!0}),T.on("dragend",C=>{C.cancelBubble=!0}),T.on("mouseenter",()=>{const C=l.Konva.getAngle(this.rotation()),q=this.rotateAnchorCursor(),G=x(R,C,q);T.getStage().content&&(T.getStage().content.style.cursor=G),this._cursorChange=!0}),T.on("mouseout",()=>{T.getStage().content&&(T.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(T)}_createBack(){const R=new n.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(T,k){const C=k.getParent(),q=C.padding();T.beginPath(),T.rect(-q,-q,k.width()+q*2,k.height()+q*2),T.moveTo(k.width()/2,-q),C.rotateEnabled()&&C.rotateLineVisible()&&T.lineTo(k.width()/2,-C.rotateAnchorOffset()*e.Util._sign(k.height())-q),T.fillStrokeShape(k)},hitFunc:(T,k)=>{if(!this.shouldOverdrawWholeArea())return;const C=this.padding();T.beginPath(),T.rect(-C,-C,k.width()+C*2,k.height()+C*2),T.fillStrokeShape(k)}});this.add(R),this._proxyDrag(R),R.on("dragstart",T=>{T.cancelBubble=!0}),R.on("dragmove",T=>{T.cancelBubble=!0}),R.on("dragend",T=>{T.cancelBubble=!0}),this.on("dragmove",T=>{this.update()})}_handleMouseDown(R){if(this._transforming)return;this._movingAnchorName=R.target.name().split(" ")[0];const T=this._getNodeRect(),k=T.width,C=T.height,q=Math.sqrt(Math.pow(k,2)+Math.pow(C,2));this.sin=Math.abs(C/q),this.cos=Math.abs(k/q),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const G=R.target.getAbsolutePosition(),J=R.target.getStage().getPointerPosition();this._anchorDragOffset={x:J.x-G.x,y:J.y-G.y},A++,this._fire("transformstart",{evt:R.evt,target:this.getNode()}),this._nodes.forEach(ae=>{ae._fire("transformstart",{evt:R.evt,target:ae})})}_handleMouseMove(R){let T,k,C;const q=this.findOne("."+this._movingAnchorName),G=q.getStage();G.setPointersPositions(R);const J=G.getPointerPosition();let ae={x:J.x-this._anchorDragOffset.x,y:J.y-this._anchorDragOffset.y};const H=q.getAbsolutePosition();this.anchorDragBoundFunc()&&(ae=this.anchorDragBoundFunc()(H,ae,R)),q.setAbsolutePosition(ae);const V=q.getAbsolutePosition();if(H.x===V.x&&H.y===V.y)return;if(this._movingAnchorName==="rotater"){const W=this._getNodeRect();T=q.x()-W.width/2,k=-q.y()+W.height/2;let Q=Math.atan2(-k,T)+Math.PI/2;W.height<0&&(Q-=Math.PI);const ue=l.Konva.getAngle(this.rotation())+Q,le=l.Konva.getAngle(this.rotationSnapTolerance()),Re=_(this.rotationSnaps(),ue,le)-W.rotation,Me=w(W,Re);this._fitNodesInto(Me,R);return}const Y=this.shiftBehavior();let U;Y==="inverted"?U=this.keepRatio()&&!R.shiftKey:Y==="none"?U=this.keepRatio():U=this.keepRatio()||R.shiftKey;let D=this.centeredScaling()||R.altKey;if(this._movingAnchorName==="top-left"){if(U){const W=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};C=Math.sqrt(Math.pow(W.x-q.x(),2)+Math.pow(W.y-q.y(),2));const Q=this.findOne(".top-left").x()>W.x?-1:1,se=this.findOne(".top-left").y()>W.y?-1:1;T=C*this.cos*Q,k=C*this.sin*se,this.findOne(".top-left").x(W.x-T),this.findOne(".top-left").y(W.y-k)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(q.y());else if(this._movingAnchorName==="top-right"){if(U){const W=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};C=Math.sqrt(Math.pow(q.x()-W.x,2)+Math.pow(W.y-q.y(),2));const Q=this.findOne(".top-right").x()<W.x?-1:1,se=this.findOne(".top-right").y()>W.y?-1:1;T=C*this.cos*Q,k=C*this.sin*se,this.findOne(".top-right").x(W.x+T),this.findOne(".top-right").y(W.y-k)}var j=q.position();this.findOne(".top-left").y(j.y),this.findOne(".bottom-right").x(j.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(q.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(q.x());else if(this._movingAnchorName==="bottom-left"){if(U){const W=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};C=Math.sqrt(Math.pow(W.x-q.x(),2)+Math.pow(q.y()-W.y,2));const Q=W.x<q.x()?-1:1,se=q.y()<W.y?-1:1;T=C*this.cos*Q,k=C*this.sin*se,q.x(W.x-T),q.y(W.y+k)}j=q.position(),this.findOne(".top-left").x(j.x),this.findOne(".bottom-right").y(j.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(q.y());else if(this._movingAnchorName==="bottom-right"){if(U){const W=D?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};C=Math.sqrt(Math.pow(q.x()-W.x,2)+Math.pow(q.y()-W.y,2));const Q=this.findOne(".bottom-right").x()<W.x?-1:1,se=this.findOne(".bottom-right").y()<W.y?-1:1;T=C*this.cos*Q,k=C*this.sin*se,this.findOne(".bottom-right").x(W.x+T),this.findOne(".bottom-right").y(W.y+k)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(D=this.centeredScaling()||R.altKey,D){const W=this.findOne(".top-left"),Q=this.findOne(".bottom-right"),se=W.x(),ue=W.y(),le=this.getWidth()-Q.x(),ye=this.getHeight()-Q.y();Q.move({x:-se,y:-ue}),W.move({x:le,y:ye})}const z=this.findOne(".top-left").getAbsolutePosition();T=z.x,k=z.y;const Z=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),re=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:T,y:k,width:Z,height:re,rotation:l.Konva.getAngle(this.rotation())},R)}_handleMouseUp(R){this._removeEvents(R)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(R){var T;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const k=this.getNode();A--,this._fire("transformend",{evt:R,target:k}),(T=this.getLayer())===null||T===void 0||T.batchDraw(),k&&this._nodes.forEach(C=>{var q;C._fire("transformend",{evt:R,target:C}),(q=C.getLayer())===null||q===void 0||q.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(R,T){const k=this._getNodeRect(),C=1;if(e.Util._inRange(R.width,-this.padding()*2-C,C)){this.update();return}if(e.Util._inRange(R.height,-this.padding()*2-C,C)){this.update();return}const q=new e.Transform;if(q.rotate(l.Konva.getAngle(this.rotation())),this._movingAnchorName&&R.width<0&&this._movingAnchorName.indexOf("left")>=0){const U=q.point({x:-this.padding()*2,y:0});R.x+=U.x,R.y+=U.y,R.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=U.x,this._anchorDragOffset.y-=U.y}else if(this._movingAnchorName&&R.width<0&&this._movingAnchorName.indexOf("right")>=0){const U=q.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=U.x,this._anchorDragOffset.y-=U.y,R.width+=this.padding()*2}if(this._movingAnchorName&&R.height<0&&this._movingAnchorName.indexOf("top")>=0){const U=q.point({x:0,y:-this.padding()*2});R.x+=U.x,R.y+=U.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=U.x,this._anchorDragOffset.y-=U.y,R.height+=this.padding()*2}else if(this._movingAnchorName&&R.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const U=q.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=U.x,this._anchorDragOffset.y-=U.y,R.height+=this.padding()*2}if(this.boundBoxFunc()){const U=this.boundBoxFunc()(k,R);U?R=U:e.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const G=1e7,J=new e.Transform;J.translate(k.x,k.y),J.rotate(k.rotation),J.scale(k.width/G,k.height/G);const ae=new e.Transform,H=R.width/G,V=R.height/G;this.flipEnabled()===!1?(ae.translate(R.x,R.y),ae.rotate(R.rotation),ae.translate(R.width<0?R.width:0,R.height<0?R.height:0),ae.scale(Math.abs(H),Math.abs(V))):(ae.translate(R.x,R.y),ae.rotate(R.rotation),ae.scale(H,V));const Y=ae.multiply(J.invert());this._nodes.forEach(U=>{var D;const j=U.getParent().getAbsoluteTransform(),z=U.getTransform().copy();z.translate(U.offsetX(),U.offsetY());const Z=new e.Transform;Z.multiply(j.copy().invert()).multiply(Y).multiply(j).multiply(z);const re=Z.decompose();U.setAttrs(re),(D=U.getLayer())===null||D===void 0||D.batchDraw()}),this.rotation(e.Util._getRotation(R.rotation)),this._nodes.forEach(U=>{this._fire("transform",{evt:T,target:U}),U._fire("transform",{evt:T,target:U})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(R,T){this.findOne(R).setAttrs(T)}update(){var R;const T=this._getNodeRect();this.rotation(e.Util._getRotation(T.rotation));const k=T.width,C=T.height,q=this.enabledAnchors(),G=this.resizeEnabled(),J=this.padding(),ae=this.anchorSize(),H=this.find("._anchor");H.forEach(Y=>{Y.setAttrs({width:ae,height:ae,offsetX:ae/2,offsetY:ae/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:ae/2+J,offsetY:ae/2+J,visible:G&&q.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:k/2,y:0,offsetY:ae/2+J,visible:G&&q.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:k,y:0,offsetX:ae/2-J,offsetY:ae/2+J,visible:G&&q.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:C/2,offsetX:ae/2+J,visible:G&&q.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:k,y:C/2,offsetX:ae/2-J,visible:G&&q.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:C,offsetX:ae/2+J,offsetY:ae/2-J,visible:G&&q.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:k/2,y:C,offsetY:ae/2-J,visible:G&&q.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:k,y:C,offsetX:ae/2-J,offsetY:ae/2-J,visible:G&&q.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:k/2,y:-this.rotateAnchorOffset()*e.Util._sign(C)-J,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:k,height:C,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const V=this.anchorStyleFunc();V&&H.forEach(Y=>{V(Y)}),(R=this.getLayer())===null||R===void 0||R.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const R=this.findOne("."+this._movingAnchorName);R&&R.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),a.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return r.Node.prototype.toObject.call(this)}clone(R){return r.Node.prototype.clone.call(this,R)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}bd.Transformer=M,M.isTransforming=()=>A>0;function O(L){return L instanceof Array||e.Util.warn("enabledAnchors value should be an array"),L instanceof Array&&L.forEach(function(R){E.indexOf(R)===-1&&e.Util.warn("Unknown anchor name: "+R+". Available names are: "+E.join(", "))}),L||[]}return M.prototype.className="Transformer",(0,u._registerNode)(M),t.Factory.addGetterSetter(M,"enabledAnchors",E,O),t.Factory.addGetterSetter(M,"flipEnabled",!0,(0,o.getBooleanValidator)()),t.Factory.addGetterSetter(M,"resizeEnabled",!0),t.Factory.addGetterSetter(M,"anchorSize",10,(0,o.getNumberValidator)()),t.Factory.addGetterSetter(M,"rotateEnabled",!0),t.Factory.addGetterSetter(M,"rotateLineVisible",!0),t.Factory.addGetterSetter(M,"rotationSnaps",[]),t.Factory.addGetterSetter(M,"rotateAnchorOffset",50,(0,o.getNumberValidator)()),t.Factory.addGetterSetter(M,"rotateAnchorCursor","crosshair"),t.Factory.addGetterSetter(M,"rotationSnapTolerance",5,(0,o.getNumberValidator)()),t.Factory.addGetterSetter(M,"borderEnabled",!0),t.Factory.addGetterSetter(M,"anchorStroke","rgb(0, 161, 255)"),t.Factory.addGetterSetter(M,"anchorStrokeWidth",1,(0,o.getNumberValidator)()),t.Factory.addGetterSetter(M,"anchorFill","white"),t.Factory.addGetterSetter(M,"anchorCornerRadius",0,(0,o.getNumberValidator)()),t.Factory.addGetterSetter(M,"borderStroke","rgb(0, 161, 255)"),t.Factory.addGetterSetter(M,"borderStrokeWidth",1,(0,o.getNumberValidator)()),t.Factory.addGetterSetter(M,"borderDash"),t.Factory.addGetterSetter(M,"keepRatio",!0),t.Factory.addGetterSetter(M,"shiftBehavior","default"),t.Factory.addGetterSetter(M,"centeredScaling",!1),t.Factory.addGetterSetter(M,"ignoreStroke",!1),t.Factory.addGetterSetter(M,"padding",0,(0,o.getNumberValidator)()),t.Factory.addGetterSetter(M,"nodes"),t.Factory.addGetterSetter(M,"node"),t.Factory.addGetterSetter(M,"boundBoxFunc"),t.Factory.addGetterSetter(M,"anchorDragBoundFunc"),t.Factory.addGetterSetter(M,"anchorStyleFunc"),t.Factory.addGetterSetter(M,"shouldOverdrawWholeArea",!1),t.Factory.addGetterSetter(M,"useSingleNodeRotation",!0),t.Factory.backCompat(M,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"}),bd}var wd={},P5;function IS(){if(P5)return wd;P5=1,Object.defineProperty(wd,"__esModule",{value:!0}),wd.Wedge=void 0;const e=jr(),t=Wa(),r=Nr(),n=qr(),i=Nr();let a=class extends t.Shape{_sceneFunc(o){o.beginPath(),o.arc(0,0,this.radius(),0,r.Konva.getAngle(this.angle()),this.clockwise()),o.lineTo(0,0),o.closePath(),o.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(o){this.radius(o/2)}setHeight(o){this.radius(o/2)}};return wd.Wedge=a,a.prototype.className="Wedge",a.prototype._centroid=!0,a.prototype._attrsAffectingSize=["radius"],(0,i._registerNode)(a),e.Factory.addGetterSetter(a,"radius",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(a,"angle",0,(0,n.getNumberValidator)()),e.Factory.addGetterSetter(a,"clockwise",!1),e.Factory.backCompat(a,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"}),wd}var _d={},k5;function FS(){if(k5)return _d;k5=1,Object.defineProperty(_d,"__esModule",{value:!0}),_d.Blur=void 0;const e=jr(),t=oa(),r=qr();function n(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const i=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],a=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function l(u,d){const f=u.data,v=u.width,g=u.height;let c,y,x,E,S,b,w,_,A,M,O,L,R,T,k,C,q,G,J,ae;const H=d+d+1,V=v-1,Y=g-1,U=d+1,D=U*(U+1)/2,j=new n,z=i[d],Z=a[d];let re=null,W=j,Q=null,se=null;for(let ue=1;ue<H;ue++)W=W.next=new n,ue===U&&(re=W);W.next=j,x=y=0;for(let ue=0;ue<g;ue++){L=R=T=k=E=S=b=w=0,_=U*(C=f[y]),A=U*(q=f[y+1]),M=U*(G=f[y+2]),O=U*(J=f[y+3]),E+=D*C,S+=D*q,b+=D*G,w+=D*J,W=j;for(let le=0;le<U;le++)W.r=C,W.g=q,W.b=G,W.a=J,W=W.next;for(let le=1;le<U;le++)c=y+((V<le?V:le)<<2),E+=(W.r=C=f[c])*(ae=U-le),S+=(W.g=q=f[c+1])*ae,b+=(W.b=G=f[c+2])*ae,w+=(W.a=J=f[c+3])*ae,L+=C,R+=q,T+=G,k+=J,W=W.next;Q=j,se=re;for(let le=0;le<v;le++)f[y+3]=J=w*z>>Z,J!==0?(J=255/J,f[y]=(E*z>>Z)*J,f[y+1]=(S*z>>Z)*J,f[y+2]=(b*z>>Z)*J):f[y]=f[y+1]=f[y+2]=0,E-=_,S-=A,b-=M,w-=O,_-=Q.r,A-=Q.g,M-=Q.b,O-=Q.a,c=x+((c=le+d+1)<V?c:V)<<2,L+=Q.r=f[c],R+=Q.g=f[c+1],T+=Q.b=f[c+2],k+=Q.a=f[c+3],E+=L,S+=R,b+=T,w+=k,Q=Q.next,_+=C=se.r,A+=q=se.g,M+=G=se.b,O+=J=se.a,L-=C,R-=q,T-=G,k-=J,se=se.next,y+=4;x+=v}for(let ue=0;ue<v;ue++){R=T=k=L=S=b=w=E=0,y=ue<<2,_=U*(C=f[y]),A=U*(q=f[y+1]),M=U*(G=f[y+2]),O=U*(J=f[y+3]),E+=D*C,S+=D*q,b+=D*G,w+=D*J,W=j;for(let ye=0;ye<U;ye++)W.r=C,W.g=q,W.b=G,W.a=J,W=W.next;let le=v;for(let ye=1;ye<=d;ye++)y=le+ue<<2,E+=(W.r=C=f[y])*(ae=U-ye),S+=(W.g=q=f[y+1])*ae,b+=(W.b=G=f[y+2])*ae,w+=(W.a=J=f[y+3])*ae,L+=C,R+=q,T+=G,k+=J,W=W.next,ye<Y&&(le+=v);y=ue,Q=j,se=re;for(let ye=0;ye<g;ye++)c=y<<2,f[c+3]=J=w*z>>Z,J>0?(J=255/J,f[c]=(E*z>>Z)*J,f[c+1]=(S*z>>Z)*J,f[c+2]=(b*z>>Z)*J):f[c]=f[c+1]=f[c+2]=0,E-=_,S-=A,b-=M,w-=O,_-=Q.r,A-=Q.g,M-=Q.b,O-=Q.a,c=ue+((c=ye+U)<Y?c:Y)*v<<2,E+=L+=Q.r=f[c],S+=R+=Q.g=f[c+1],b+=T+=Q.b=f[c+2],w+=k+=Q.a=f[c+3],Q=Q.next,_+=C=se.r,A+=q=se.g,M+=G=se.b,O+=J=se.a,L-=C,R-=q,T-=G,k-=J,se=se.next,y+=v}}const o=function(d){const f=Math.round(this.blurRadius());f>0&&l(d,f)};return _d.Blur=o,e.Factory.addGetterSetter(t.Node,"blurRadius",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),_d}var xd={},O5;function jS(){if(O5)return xd;O5=1,Object.defineProperty(xd,"__esModule",{value:!0}),xd.Brighten=void 0;const e=jr(),t=oa(),r=qr(),n=function(i){const a=this.brightness()*255,l=i.data,o=l.length;for(let u=0;u<o;u+=4)l[u]+=a,l[u+1]+=a,l[u+2]+=a};return xd.Brighten=n,e.Factory.addGetterSetter(t.Node,"brightness",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),xd}var Sd={},C5;function DS(){if(C5)return Sd;C5=1,Object.defineProperty(Sd,"__esModule",{value:!0}),Sd.Contrast=void 0;const e=jr(),t=oa(),r=qr(),n=function(i){const a=Math.pow((this.contrast()+100)/100,2),l=i.data,o=l.length;let u=150,d=150,f=150;for(let v=0;v<o;v+=4)u=l[v],d=l[v+1],f=l[v+2],u/=255,u-=.5,u*=a,u+=.5,u*=255,d/=255,d-=.5,d*=a,d+=.5,d*=255,f/=255,f-=.5,f*=a,f+=.5,f*=255,u=u<0?0:u>255?255:u,d=d<0?0:d>255?255:d,f=f<0?0:f>255?255:f,l[v]=u,l[v+1]=d,l[v+2]=f};return Sd.Contrast=n,e.Factory.addGetterSetter(t.Node,"contrast",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Sd}var Ed={},N5;function BS(){if(N5)return Ed;N5=1,Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.Emboss=void 0;const e=jr(),t=oa(),r=zi(),n=qr(),i=function(a){const l=this.embossStrength()*10,o=this.embossWhiteLevel()*255,u=this.embossDirection(),d=this.embossBlend(),f=a.data,v=a.width,g=a.height,c=v*4;let y=0,x=0,E=g;switch(u){case"top-left":y=-1,x=-1;break;case"top":y=-1,x=0;break;case"top-right":y=-1,x=1;break;case"right":y=0,x=1;break;case"bottom-right":y=1,x=1;break;case"bottom":y=1,x=0;break;case"bottom-left":y=1,x=-1;break;case"left":y=0,x=-1;break;default:r.Util.error("Unknown emboss direction: "+u)}do{const S=(E-1)*c;let b=y;E+b<1&&(b=0),E+b>g&&(b=0);const w=(E-1+b)*v*4;let _=v;do{const A=S+(_-1)*4;let M=x;_+M<1&&(M=0),_+M>v&&(M=0);const O=w+(_-1+M)*4,L=f[A]-f[O],R=f[A+1]-f[O+1],T=f[A+2]-f[O+2];let k=L;const C=k>0?k:-k,q=R>0?R:-R,G=T>0?T:-T;if(q>C&&(k=R),G>C&&(k=T),k*=l,d){const J=f[A]+k,ae=f[A+1]+k,H=f[A+2]+k;f[A]=J>255?255:J<0?0:J,f[A+1]=ae>255?255:ae<0?0:ae,f[A+2]=H>255?255:H<0?0:H}else{let J=o-k;J<0?J=0:J>255&&(J=255),f[A]=f[A+1]=f[A+2]=J}}while(--_)}while(--E)};return Ed.Emboss=i,e.Factory.addGetterSetter(t.Node,"embossStrength",.5,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"embossWhiteLevel",.5,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"embossDirection","top-left",void 0,e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"embossBlend",!1,void 0,e.Factory.afterSetFilter),Ed}var Ad={},L5;function zS(){if(L5)return Ad;L5=1,Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.Enhance=void 0;const e=jr(),t=oa(),r=qr();function n(a,l,o,u,d){const f=o-l,v=d-u;if(f===0)return u+v/2;if(v===0)return u;let g=(a-l)/f;return g=v*g+u,g}const i=function(a){const l=a.data,o=l.length;let u=l[0],d=u,f,v=l[1],g=v,c,y=l[2],x=y,E;const S=this.enhance();if(S===0)return;for(let L=0;L<o;L+=4)f=l[L+0],f<u?u=f:f>d&&(d=f),c=l[L+1],c<v?v=c:c>g&&(g=c),E=l[L+2],E<y?y=E:E>x&&(x=E);d===u&&(d=255,u=0),g===v&&(g=255,v=0),x===y&&(x=255,y=0);let b,w,_,A,M,O;if(S>0)b=d+S*(255-d),w=u-S*(u-0),_=g+S*(255-g),A=v-S*(v-0),M=x+S*(255-x),O=y-S*(y-0);else{const L=(d+u)*.5;b=d+S*(d-L),w=u+S*(u-L);const R=(g+v)*.5;_=g+S*(g-R),A=v+S*(v-R);const T=(x+y)*.5;M=x+S*(x-T),O=y+S*(y-T)}for(let L=0;L<o;L+=4)l[L+0]=n(l[L+0],u,d,w,b),l[L+1]=n(l[L+1],v,g,A,_),l[L+2]=n(l[L+2],y,x,O,M)};return Ad.Enhance=i,e.Factory.addGetterSetter(t.Node,"enhance",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Ad}var Pd={},T5;function US(){if(T5)return Pd;T5=1,Object.defineProperty(Pd,"__esModule",{value:!0}),Pd.Grayscale=void 0;const e=function(t){const r=t.data,n=r.length;for(let i=0;i<n;i+=4){const a=.34*r[i]+.5*r[i+1]+.16*r[i+2];r[i]=a,r[i+1]=a,r[i+2]=a}};return Pd.Grayscale=e,Pd}var kd={},R5;function qS(){if(R5)return kd;R5=1,Object.defineProperty(kd,"__esModule",{value:!0}),kd.HSL=void 0;const e=jr(),t=oa(),r=qr();e.Factory.addGetterSetter(t.Node,"hue",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"saturation",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"luminance",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter);const n=function(i){const a=i.data,l=a.length,o=1,u=Math.pow(2,this.saturation()),d=Math.abs(this.hue()+360)%360,f=this.luminance()*127,v=o*u*Math.cos(d*Math.PI/180),g=o*u*Math.sin(d*Math.PI/180),c=.299*o+.701*v+.167*g,y=.587*o-.587*v+.33*g,x=.114*o-.114*v-.497*g,E=.299*o-.299*v-.328*g,S=.587*o+.413*v+.035*g,b=.114*o-.114*v+.293*g,w=.299*o-.3*v+1.25*g,_=.587*o-.586*v-1.05*g,A=.114*o+.886*v-.2*g;let M,O,L,R;for(let T=0;T<l;T+=4)M=a[T+0],O=a[T+1],L=a[T+2],R=a[T+3],a[T+0]=c*M+y*O+x*L+f,a[T+1]=E*M+S*O+b*L+f,a[T+2]=w*M+_*O+A*L+f,a[T+3]=R};return kd.HSL=n,kd}var Od={},M5;function HS(){if(M5)return Od;M5=1,Object.defineProperty(Od,"__esModule",{value:!0}),Od.HSV=void 0;const e=jr(),t=oa(),r=qr(),n=function(i){const a=i.data,l=a.length,o=Math.pow(2,this.value()),u=Math.pow(2,this.saturation()),d=Math.abs(this.hue()+360)%360,f=o*u*Math.cos(d*Math.PI/180),v=o*u*Math.sin(d*Math.PI/180),g=.299*o+.701*f+.167*v,c=.587*o-.587*f+.33*v,y=.114*o-.114*f-.497*v,x=.299*o-.299*f-.328*v,E=.587*o+.413*f+.035*v,S=.114*o-.114*f+.293*v,b=.299*o-.3*f+1.25*v,w=.587*o-.586*f-1.05*v,_=.114*o+.886*f-.2*v;for(let A=0;A<l;A+=4){const M=a[A+0],O=a[A+1],L=a[A+2],R=a[A+3];a[A+0]=g*M+c*O+y*L,a[A+1]=x*M+E*O+S*L,a[A+2]=b*M+w*O+_*L,a[A+3]=R}};return Od.HSV=n,e.Factory.addGetterSetter(t.Node,"hue",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"saturation",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"value",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Od}var Cd={},I5;function VS(){if(I5)return Cd;I5=1,Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.Invert=void 0;const e=function(t){const r=t.data,n=r.length;for(let i=0;i<n;i+=4)r[i]=255-r[i],r[i+1]=255-r[i+1],r[i+2]=255-r[i+2]};return Cd.Invert=e,Cd}var Nd={},F5;function GS(){if(F5)return Nd;F5=1,Object.defineProperty(Nd,"__esModule",{value:!0}),Nd.Kaleidoscope=void 0;const e=jr(),t=oa(),r=zi(),n=qr(),i=function(o,u,d){const f=o.data,v=u.data,g=o.width,c=o.height,y=d.polarCenterX||g/2,x=d.polarCenterY||c/2;let E=Math.sqrt(y*y+x*x),S=g-y,b=c-x;const w=Math.sqrt(S*S+b*b);E=w>E?w:E;const _=c,A=g,M=360/A*Math.PI/180;for(let O=0;O<A;O+=1){const L=Math.sin(O*M),R=Math.cos(O*M);for(let T=0;T<_;T+=1){S=Math.floor(y+E*T/_*R),b=Math.floor(x+E*T/_*L);let k=(b*g+S)*4;const C=f[k+0],q=f[k+1],G=f[k+2],J=f[k+3];k=(O+T*g)*4,v[k+0]=C,v[k+1]=q,v[k+2]=G,v[k+3]=J}}},a=function(o,u,d){const f=o.data,v=u.data,g=o.width,c=o.height,y=d.polarCenterX||g/2,x=d.polarCenterY||c/2;let E=Math.sqrt(y*y+x*x),S=g-y,b=c-x;const w=Math.sqrt(S*S+b*b);E=w>E?w:E;const _=c,A=g,M=0;let O,L;for(S=0;S<g;S+=1)for(b=0;b<c;b+=1){const R=S-y,T=b-x,k=Math.sqrt(R*R+T*T)*_/E;let C=(Math.atan2(T,R)*180/Math.PI+360+M)%360;C=C*A/360,O=Math.floor(C),L=Math.floor(k);let q=(L*g+O)*4;const G=f[q+0],J=f[q+1],ae=f[q+2],H=f[q+3];q=(b*g+S)*4,v[q+0]=G,v[q+1]=J,v[q+2]=ae,v[q+3]=H}},l=function(o){const u=o.width,d=o.height;let f,v,g,c,y,x,E,S,b,w,_=Math.round(this.kaleidoscopePower());const A=Math.round(this.kaleidoscopeAngle()),M=Math.floor(u*(A%360)/360);if(_<1)return;const O=r.Util.createCanvasElement();O.width=u,O.height=d;const L=O.getContext("2d").getImageData(0,0,u,d);r.Util.releaseCanvas(O),i(o,L,{polarCenterX:u/2,polarCenterY:d/2});let R=u/Math.pow(2,_);for(;R<=8;)R=R*2,_-=1;R=Math.ceil(R);let T=R,k=0,C=T,q=1;for(M+R>u&&(k=T,C=0,q=-1),v=0;v<d;v+=1)for(f=k;f!==C;f+=q)g=Math.round(f+M)%u,b=(u*v+g)*4,y=L.data[b+0],x=L.data[b+1],E=L.data[b+2],S=L.data[b+3],w=(u*v+f)*4,L.data[w+0]=y,L.data[w+1]=x,L.data[w+2]=E,L.data[w+3]=S;for(v=0;v<d;v+=1)for(T=Math.floor(R),c=0;c<_;c+=1){for(f=0;f<T+1;f+=1)b=(u*v+f)*4,y=L.data[b+0],x=L.data[b+1],E=L.data[b+2],S=L.data[b+3],w=(u*v+T*2-f-1)*4,L.data[w+0]=y,L.data[w+1]=x,L.data[w+2]=E,L.data[w+3]=S;T*=2}a(L,o,{})};return Nd.Kaleidoscope=l,e.Factory.addGetterSetter(t.Node,"kaleidoscopePower",2,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"kaleidoscopeAngle",0,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),Nd}var Ld={},j5;function $S(){if(j5)return Ld;j5=1,Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.Mask=void 0;const e=jr(),t=oa(),r=qr();function n(g,c,y){let x=(y*g.width+c)*4;const E=[];return E.push(g.data[x++],g.data[x++],g.data[x++],g.data[x++]),E}function i(g,c){return Math.sqrt(Math.pow(g[0]-c[0],2)+Math.pow(g[1]-c[1],2)+Math.pow(g[2]-c[2],2))}function a(g){const c=[0,0,0];for(let y=0;y<g.length;y++)c[0]+=g[y][0],c[1]+=g[y][1],c[2]+=g[y][2];return c[0]/=g.length,c[1]/=g.length,c[2]/=g.length,c}function l(g,c){const y=n(g,0,0),x=n(g,g.width-1,0),E=n(g,0,g.height-1),S=n(g,g.width-1,g.height-1),b=c||10;if(i(y,x)<b&&i(x,S)<b&&i(S,E)<b&&i(E,y)<b){const w=a([x,y,S,E]),_=[];for(let A=0;A<g.width*g.height;A++){const M=i(w,[g.data[A*4],g.data[A*4+1],g.data[A*4+2]]);_[A]=M<b?0:255}return _}}function o(g,c){for(let y=0;y<g.width*g.height;y++)g.data[4*y+3]=c[y]}function u(g,c,y){const x=[1,1,1,1,0,1,1,1,1],E=Math.round(Math.sqrt(x.length)),S=Math.floor(E/2),b=[];for(let w=0;w<y;w++)for(let _=0;_<c;_++){const A=w*c+_;let M=0;for(let O=0;O<E;O++)for(let L=0;L<E;L++){const R=w+O-S,T=_+L-S;if(R>=0&&R<y&&T>=0&&T<c){const k=R*c+T,C=x[O*E+L];M+=g[k]*C}}b[A]=M===255*8?255:0}return b}function d(g,c,y){const x=[1,1,1,1,1,1,1,1,1],E=Math.round(Math.sqrt(x.length)),S=Math.floor(E/2),b=[];for(let w=0;w<y;w++)for(let _=0;_<c;_++){const A=w*c+_;let M=0;for(let O=0;O<E;O++)for(let L=0;L<E;L++){const R=w+O-S,T=_+L-S;if(R>=0&&R<y&&T>=0&&T<c){const k=R*c+T,C=x[O*E+L];M+=g[k]*C}}b[A]=M>=255*4?255:0}return b}function f(g,c,y){const x=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],E=Math.round(Math.sqrt(x.length)),S=Math.floor(E/2),b=[];for(let w=0;w<y;w++)for(let _=0;_<c;_++){const A=w*c+_;let M=0;for(let O=0;O<E;O++)for(let L=0;L<E;L++){const R=w+O-S,T=_+L-S;if(R>=0&&R<y&&T>=0&&T<c){const k=R*c+T,C=x[O*E+L];M+=g[k]*C}}b[A]=M}return b}const v=function(g){const c=this.threshold();let y=l(g,c);return y&&(y=u(y,g.width,g.height),y=d(y,g.width,g.height),y=f(y,g.width,g.height),o(g,y)),g};return Ld.Mask=v,e.Factory.addGetterSetter(t.Node,"threshold",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Ld}var Td={},D5;function WS(){if(D5)return Td;D5=1,Object.defineProperty(Td,"__esModule",{value:!0}),Td.Noise=void 0;const e=jr(),t=oa(),r=qr(),n=function(i){const a=this.noise()*255,l=i.data,o=l.length,u=a/2;for(let d=0;d<o;d+=4)l[d+0]+=u-2*u*Math.random(),l[d+1]+=u-2*u*Math.random(),l[d+2]+=u-2*u*Math.random()};return Td.Noise=n,e.Factory.addGetterSetter(t.Node,"noise",.2,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Td}var Rd={},B5;function YS(){if(B5)return Rd;B5=1,Object.defineProperty(Rd,"__esModule",{value:!0}),Rd.Pixelate=void 0;const e=jr(),t=zi(),r=oa(),n=qr(),i=function(a){let l=Math.ceil(this.pixelSize()),o=a.width,u=a.height,d=Math.ceil(o/l),f=Math.ceil(u/l),v=a.data;if(l<=0){t.Util.error("pixelSize value can not be <= 0");return}for(let g=0;g<d;g+=1)for(let c=0;c<f;c+=1){let y=0,x=0,E=0,S=0;const b=g*l,w=b+l,_=c*l,A=_+l;let M=0;for(let O=b;O<w;O+=1)if(!(O>=o))for(let L=_;L<A;L+=1){if(L>=u)continue;const R=(o*L+O)*4;y+=v[R+0],x+=v[R+1],E+=v[R+2],S+=v[R+3],M+=1}y=y/M,x=x/M,E=E/M,S=S/M;for(let O=b;O<w;O+=1)if(!(O>=o))for(let L=_;L<A;L+=1){if(L>=u)continue;const R=(o*L+O)*4;v[R+0]=y,v[R+1]=x,v[R+2]=E,v[R+3]=S}}};return Rd.Pixelate=i,e.Factory.addGetterSetter(r.Node,"pixelSize",8,(0,n.getNumberValidator)(),e.Factory.afterSetFilter),Rd}var Md={},z5;function XS(){if(z5)return Md;z5=1,Object.defineProperty(Md,"__esModule",{value:!0}),Md.Posterize=void 0;const e=jr(),t=oa(),r=qr(),n=function(i){const a=Math.round(this.levels()*254)+1,l=i.data,o=l.length,u=255/a;for(let d=0;d<o;d+=1)l[d]=Math.floor(l[d]/u)*u};return Md.Posterize=n,e.Factory.addGetterSetter(t.Node,"levels",.5,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Md}var Id={},U5;function KS(){if(U5)return Id;U5=1,Object.defineProperty(Id,"__esModule",{value:!0}),Id.RGB=void 0;const e=jr(),t=oa(),r=qr(),n=function(i){const a=i.data,l=a.length,o=this.red(),u=this.green(),d=this.blue();for(let f=0;f<l;f+=4){const v=(.34*a[f]+.5*a[f+1]+.16*a[f+2])/255;a[f]=v*o,a[f+1]=v*u,a[f+2]=v*d,a[f+3]=a[f+3]}};return Id.RGB=n,e.Factory.addGetterSetter(t.Node,"red",0,function(i){return this._filterUpToDate=!1,i>255?255:i<0?0:Math.round(i)}),e.Factory.addGetterSetter(t.Node,"green",0,function(i){return this._filterUpToDate=!1,i>255?255:i<0?0:Math.round(i)}),e.Factory.addGetterSetter(t.Node,"blue",0,r.RGBComponent,e.Factory.afterSetFilter),Id}var Fd={},q5;function ZS(){if(q5)return Fd;q5=1,Object.defineProperty(Fd,"__esModule",{value:!0}),Fd.RGBA=void 0;const e=jr(),t=oa(),r=qr(),n=function(i){const a=i.data,l=a.length,o=this.red(),u=this.green(),d=this.blue(),f=this.alpha();for(let v=0;v<l;v+=4){const g=1-f;a[v]=o*f+a[v]*g,a[v+1]=u*f+a[v+1]*g,a[v+2]=d*f+a[v+2]*g}};return Fd.RGBA=n,e.Factory.addGetterSetter(t.Node,"red",0,function(i){return this._filterUpToDate=!1,i>255?255:i<0?0:Math.round(i)}),e.Factory.addGetterSetter(t.Node,"green",0,function(i){return this._filterUpToDate=!1,i>255?255:i<0?0:Math.round(i)}),e.Factory.addGetterSetter(t.Node,"blue",0,r.RGBComponent,e.Factory.afterSetFilter),e.Factory.addGetterSetter(t.Node,"alpha",1,function(i){return this._filterUpToDate=!1,i>1?1:i<0?0:i}),Fd}var jd={},H5;function QS(){if(H5)return jd;H5=1,Object.defineProperty(jd,"__esModule",{value:!0}),jd.Sepia=void 0;const e=function(t){const r=t.data,n=r.length;for(let i=0;i<n;i+=4){const a=r[i+0],l=r[i+1],o=r[i+2];r[i+0]=Math.min(255,a*.393+l*.769+o*.189),r[i+1]=Math.min(255,a*.349+l*.686+o*.168),r[i+2]=Math.min(255,a*.272+l*.534+o*.131)}};return jd.Sepia=e,jd}var Dd={},V5;function JS(){if(V5)return Dd;V5=1,Object.defineProperty(Dd,"__esModule",{value:!0}),Dd.Solarize=void 0;const e=function(t){const r=t.data,n=t.width,i=t.height,a=n*4;let l=i;do{const o=(l-1)*a;let u=n;do{const d=o+(u-1)*4;let f=r[d],v=r[d+1],g=r[d+2];f>127&&(f=255-f),v>127&&(v=255-v),g>127&&(g=255-g),r[d]=f,r[d+1]=v,r[d+2]=g}while(--u)}while(--l)};return Dd.Solarize=e,Dd}var Bd={},G5;function eE(){if(G5)return Bd;G5=1,Object.defineProperty(Bd,"__esModule",{value:!0}),Bd.Threshold=void 0;const e=jr(),t=oa(),r=qr(),n=function(i){const a=this.threshold()*255,l=i.data,o=l.length;for(let u=0;u<o;u+=1)l[u]=l[u]<a?0:255};return Bd.Threshold=n,e.Factory.addGetterSetter(t.Node,"threshold",.5,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),Bd}var $5;function tE(){if($5)return Jh;$5=1,Object.defineProperty(Jh,"__esModule",{value:!0}),Jh.Konva=void 0;const e=Lv(),t=xS(),r=ES(),n=AS(),i=PS(),a=kS(),l=OS(),o=V6(),u=pm(),d=G6(),f=CS(),v=NS(),g=LS(),c=TS(),y=$6(),x=RS(),E=MS(),S=IS(),b=FS(),w=jS(),_=DS(),A=BS(),M=zS(),O=US(),L=qS(),R=HS(),T=VS(),k=GS(),C=$S(),q=WS(),G=YS(),J=XS(),ae=KS(),H=ZS(),V=QS(),Y=JS(),U=eE();return Jh.Konva=e.Konva.Util._assign(e.Konva,{Arc:t.Arc,Arrow:r.Arrow,Circle:n.Circle,Ellipse:i.Ellipse,Image:a.Image,Label:l.Label,Tag:l.Tag,Line:o.Line,Path:u.Path,Rect:d.Rect,RegularPolygon:f.RegularPolygon,Ring:v.Ring,Sprite:g.Sprite,Star:c.Star,Text:y.Text,TextPath:x.TextPath,Transformer:E.Transformer,Wedge:S.Wedge,Filters:{Blur:b.Blur,Brighten:w.Brighten,Contrast:_.Contrast,Emboss:A.Emboss,Enhance:M.Enhance,Grayscale:O.Grayscale,HSL:L.HSL,HSV:R.HSV,Invert:T.Invert,Kaleidoscope:k.Kaleidoscope,Mask:C.Mask,Noise:q.Noise,Pixelate:G.Pixelate,Posterize:J.Posterize,RGB:ae.RGB,RGBA:H.RGBA,Sepia:V.Sepia,Solarize:Y.Solarize,Threshold:U.Threshold}}),Jh}var rE=S1.exports,W5;function nE(){if(W5)return S1.exports;W5=1,Object.defineProperty(rE,"__esModule",{value:!0});const e=tE();return S1.exports=e.Konva,S1.exports}var iE=nE();const sr=lc(iE);var a1={exports:{}},Y5;function aE(){return Y5||(Y5=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var r=Lv();Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return r.Konva}});const n=Lv();e.exports=n.Konva}(a1,a1.exports)),a1.exports}var oE=aE();const sp=lc(oE);var Sg={exports:{}};/**
44
- * @license React
45
- * react-reconciler.production.min.js
46
- *
47
- * Copyright (c) Facebook, Inc. and its affiliates.
48
- *
49
- * This source code is licensed under the MIT license found in the
50
- * LICENSE file in the root directory of this source tree.
51
- */var Eg,X5;function sE(){return X5||(X5=1,Eg=function(t){var r={},n=vp(),i=em(),a=Object.assign;function l(p){for(var m="https://reactjs.org/docs/error-decoder.html?invariant="+p,I=1;I<arguments.length;I++)m+="&args[]="+encodeURIComponent(arguments[I]);return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),d=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),y=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),_=Symbol.for("react.offscreen"),A=Symbol.iterator;function M(p){return p===null||typeof p!="object"?null:(p=A&&p[A]||p["@@iterator"],typeof p=="function"?p:null)}function O(p){if(p==null)return null;if(typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case f:return"Fragment";case d:return"Portal";case g:return"Profiler";case v:return"StrictMode";case E:return"Suspense";case S:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case y:return(p.displayName||"Context")+".Consumer";case c:return(p._context.displayName||"Context")+".Provider";case x:var m=p.render;return p=p.displayName,p||(p=m.displayName||m.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case b:return m=p.displayName||null,m!==null?m:O(p.type)||"Memo";case w:m=p._payload,p=p._init;try{return O(p(m))}catch{}}return null}function L(p){var m=p.type;switch(p.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 p=m.render,p=p.displayName||p.name||"",m.displayName||(p!==""?"ForwardRef("+p+")":"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===v?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof m=="function")return m.displayName||m.name||null;if(typeof m=="string")return m}return null}function R(p){var m=p,I=p;if(p.alternate)for(;m.return;)m=m.return;else{p=m;do m=p,(m.flags&4098)!==0&&(I=m.return),p=m.return;while(p)}return m.tag===3?I:null}function T(p){if(R(p)!==p)throw Error(l(188))}function k(p){var m=p.alternate;if(!m){if(m=R(p),m===null)throw Error(l(188));return m!==p?null:p}for(var I=p,$=m;;){var ee=I.return;if(ee===null)break;var oe=ee.alternate;if(oe===null){if($=ee.return,$!==null){I=$;continue}break}if(ee.child===oe.child){for(oe=ee.child;oe;){if(oe===I)return T(ee),p;if(oe===$)return T(ee),m;oe=oe.sibling}throw Error(l(188))}if(I.return!==$.return)I=ee,$=oe;else{for(var Ee=!1,We=ee.child;We;){if(We===I){Ee=!0,I=ee,$=oe;break}if(We===$){Ee=!0,$=ee,I=oe;break}We=We.sibling}if(!Ee){for(We=oe.child;We;){if(We===I){Ee=!0,I=oe,$=ee;break}if(We===$){Ee=!0,$=oe,I=ee;break}We=We.sibling}if(!Ee)throw Error(l(189))}}if(I.alternate!==$)throw Error(l(190))}if(I.tag!==3)throw Error(l(188));return I.stateNode.current===I?p:m}function C(p){return p=k(p),p!==null?q(p):null}function q(p){if(p.tag===5||p.tag===6)return p;for(p=p.child;p!==null;){var m=q(p);if(m!==null)return m;p=p.sibling}return null}function G(p){if(p.tag===5||p.tag===6)return p;for(p=p.child;p!==null;){if(p.tag!==4){var m=G(p);if(m!==null)return m}p=p.sibling}return null}var J=Array.isArray,ae=t.getPublicInstance,H=t.getRootHostContext,V=t.getChildHostContext,Y=t.prepareForCommit,U=t.resetAfterCommit,D=t.createInstance,j=t.appendInitialChild,z=t.finalizeInitialChildren,Z=t.prepareUpdate,re=t.shouldSetTextContent,W=t.createTextInstance,Q=t.scheduleTimeout,se=t.cancelTimeout,ue=t.noTimeout,le=t.isPrimaryRenderer,ye=t.supportsMutation,Re=t.supportsPersistence,Me=t.supportsHydration,Pe=t.getInstanceFromNode,de=t.preparePortalMount,Te=t.getCurrentEventPriority,Ae=t.detachDeletedInstance,be=t.supportsMicrotasks,_e=t.scheduleMicrotask,xe=t.supportsTestSelectors,Le=t.findFiberRoot,pe=t.getBoundingRect,Ce=t.getTextContent,je=t.isHiddenSubtree,He=t.matchAccessibilityRole,st=t.setFocusIfFocusable,pt=t.setupIntersectionObserver,ct=t.appendChild,bt=t.appendChildToContainer,ht=t.commitTextUpdate,vt=t.commitMount,wr=t.commitUpdate,cr=t.insertBefore,Pt=t.insertInContainerBefore,$t=t.removeChild,$e=t.removeChildFromContainer,ze=t.resetTextContent,kt=t.hideInstance,St=t.hideTextInstance,er=t.unhideInstance,jt=t.unhideTextInstance,vr=t.clearContainer,Xt=t.cloneInstance,lr=t.createContainerChildSet,Oi=t.appendChildToContainerChildSet,Zn=t.finalizeContainerChildren,vi=t.replaceContainerChildren,mn=t.cloneHiddenInstance,Yt=t.cloneHiddenTextInstance,sa=t.canHydrateInstance,Ra=t.canHydrateTextInstance,Un=t.canHydrateSuspenseInstance,Ui=t.isSuspenseInstancePending,Rr=t.isSuspenseInstanceFallback,yn=t.getSuspenseInstanceFallbackErrorDetails,An=t.registerSuspenseInstanceRetry,ba=t.getNextHydratableSibling,Mo=t.getFirstHydratableChild,wa=t.getFirstHydratableChildWithinContainer,Ya=t.getFirstHydratableChildWithinSuspenseInstance,Qn=t.hydrateInstance,_a=t.hydrateTextInstance,xa=t.hydrateSuspenseInstance,Io=t.getNextHydratableInstanceAfterSuspenseInstance,Ci=t.commitHydratedContainer,Xa=t.commitHydratedSuspenseInstance,Ps=t.clearSuspenseBoundary,Ko=t.clearSuspenseBoundaryFromContainer,Vl=t.shouldDeleteUnhydratedTailInstances,cf=t.didNotMatchHydratedContainerTextInstance,bn=t.didNotMatchHydratedTextInstance,Gl;function Zo(p){if(Gl===void 0)try{throw Error()}catch(I){var m=I.stack.trim().match(/\n( *(at )?)/);Gl=m&&m[1]||""}return`
52
- `+Gl+p}var Sa=!1;function Qo(p,m){if(!p||Sa)return"";Sa=!0;var I=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(yt){var $=yt}Reflect.construct(p,[],m)}else{try{m.call()}catch(yt){$=yt}p.call(m.prototype)}else{try{throw Error()}catch(yt){$=yt}p()}}catch(yt){if(yt&&$&&typeof yt.stack=="string"){for(var ee=yt.stack.split(`
53
- `),oe=$.stack.split(`
54
- `),Ee=ee.length-1,We=oe.length-1;1<=Ee&&0<=We&&ee[Ee]!==oe[We];)We--;for(;1<=Ee&&0<=We;Ee--,We--)if(ee[Ee]!==oe[We]){if(Ee!==1||We!==1)do if(Ee--,We--,0>We||ee[Ee]!==oe[We]){var rt=`
55
- `+ee[Ee].replace(" at new "," at ");return p.displayName&&rt.includes("<anonymous>")&&(rt=rt.replace("<anonymous>",p.displayName)),rt}while(1<=Ee&&0<=We);break}}}finally{Sa=!1,Error.prepareStackTrace=I}return(p=p?p.displayName||p.name:"")?Zo(p):""}var cc=Object.prototype.hasOwnProperty,$s=[],po=-1;function oi(p){return{current:p}}function an(p){0>po||(p.current=$s[po],$s[po]=null,po--)}function mr(p,m){po++,$s[po]=p.current,p.current=m}var Jo={},Er=oi(Jo),qi=oi(!1),Ka=Jo;function Hi(p,m){var I=p.type.contextTypes;if(!I)return Jo;var $=p.stateNode;if($&&$.__reactInternalMemoizedUnmaskedChildContext===m)return $.__reactInternalMemoizedMaskedChildContext;var ee={},oe;for(oe in I)ee[oe]=m[oe];return $&&(p=p.stateNode,p.__reactInternalMemoizedUnmaskedChildContext=m,p.__reactInternalMemoizedMaskedChildContext=ee),ee}function Pn(p){return p=p.childContextTypes,p!=null}function Vi(){an(qi),an(Er)}function Ws(p,m,I){if(Er.current!==Jo)throw Error(l(168));mr(Er,m),mr(qi,I)}function qn(p,m,I){var $=p.stateNode;if(m=m.childContextTypes,typeof $.getChildContext!="function")return I;$=$.getChildContext();for(var ee in $)if(!(ee in m))throw Error(l(108,L(p)||"Unknown",ee));return a({},I,$)}function es(p){return p=(p=p.stateNode)&&p.__reactInternalMemoizedMergedChildContext||Jo,Ka=Er.current,mr(Er,p),mr(qi,qi.current),!0}function Ru(p,m,I){var $=p.stateNode;if(!$)throw Error(l(169));I?(p=qn(p,m,Ka),$.__reactInternalMemoizedMergedChildContext=p,an(qi),an(Er),mr(Er,p)):an(qi),mr(qi,I)}var Ea=Math.clz32?Math.clz32:$l,hl=Math.log,ts=Math.LN2;function $l(p){return p>>>=0,p===0?32:31-(hl(p)/ts|0)|0}var Ar=64,go=4194304;function rs(p){switch(p&-p){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 p&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return p&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return p}}function Ys(p,m){var I=p.pendingLanes;if(I===0)return 0;var $=0,ee=p.suspendedLanes,oe=p.pingedLanes,Ee=I&268435455;if(Ee!==0){var We=Ee&~ee;We!==0?$=rs(We):(oe&=Ee,oe!==0&&($=rs(oe)))}else Ee=I&~ee,Ee!==0?$=rs(Ee):oe!==0&&($=rs(oe));if($===0)return 0;if(m!==0&&m!==$&&(m&ee)===0&&(ee=$&-$,oe=m&-m,ee>=oe||ee===16&&(oe&4194240)!==0))return m;if(($&4)!==0&&($|=I&16),m=p.entangledLanes,m!==0)for(p=p.entanglements,m&=$;0<m;)I=31-Ea(m),ee=1<<I,$|=p[I],m&=~ee;return $}function fc(p,m){switch(p){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 hc(p,m){for(var I=p.suspendedLanes,$=p.pingedLanes,ee=p.expirationTimes,oe=p.pendingLanes;0<oe;){var Ee=31-Ea(oe),We=1<<Ee,rt=ee[Ee];rt===-1?((We&I)===0||(We&$)!==0)&&(ee[Ee]=fc(We,m)):rt<=m&&(p.expiredLanes|=We),oe&=~We}}function Xs(p){return p=p.pendingLanes&-1073741825,p!==0?p:p&1073741824?1073741824:0}function ns(){var p=Ar;return Ar<<=1,(Ar&4194240)===0&&(Ar=64),p}function Za(p){for(var m=[],I=0;31>I;I++)m.push(p);return m}function Ma(p,m,I){p.pendingLanes|=m,m!==536870912&&(p.suspendedLanes=0,p.pingedLanes=0),p=p.eventTimes,m=31-Ea(m),p[m]=I}function Ia(p,m){var I=p.pendingLanes&~m;p.pendingLanes=m,p.suspendedLanes=0,p.pingedLanes=0,p.expiredLanes&=m,p.mutableReadLanes&=m,p.entangledLanes&=m,m=p.entanglements;var $=p.eventTimes;for(p=p.expirationTimes;0<I;){var ee=31-Ea(I),oe=1<<ee;m[ee]=0,$[ee]=-1,p[ee]=-1,I&=~oe}}function Fa(p,m){var I=p.entangledLanes|=m;for(p=p.entanglements;I;){var $=31-Ea(I),ee=1<<$;ee&m|p[$]&m&&(p[$]|=m),I&=~ee}}var xt=0;function Ks(p){return p&=-p,1<p?4<p?(p&268435455)!==0?16:536870912:4:1}var vo=i.unstable_scheduleCallback,dc=i.unstable_cancelCallback,pc=i.unstable_shouldYield,Qa=i.unstable_requestPaint,pn=i.unstable_now,Wl=i.unstable_ImmediatePriority,Yl=i.unstable_UserBlockingPriority,ks=i.unstable_NormalPriority,Mu=i.unstable_IdlePriority,ja=null,mi=null;function Fo(p){if(mi&&typeof mi.onCommitFiberRoot=="function")try{mi.onCommitFiberRoot(ja,p,void 0,(p.current.flags&128)===128)}catch{}}function Xl(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var Aa=typeof Object.is=="function"?Object.is:Xl,Ja=null,mo=!1,yo=!1;function Zs(p){Ja===null?Ja=[p]:Ja.push(p)}function dl(p){mo=!0,Zs(p)}function Jn(){if(!yo&&Ja!==null){yo=!0;var p=0,m=xt;try{var I=Ja;for(xt=1;p<I.length;p++){var $=I[p];do $=$(!0);while($!==null)}Ja=null,mo=!1}catch(ee){throw Ja!==null&&(Ja=Ja.slice(p+1)),vo(Wl,Jn),ee}finally{xt=m,yo=!1}}return null}var Da=[],eo=0,Os=null,yi=0,kn=[],X=0,fe=null,Ne=1,Fe="";function Ge(p,m){Da[eo++]=yi,Da[eo++]=Os,Os=p,yi=m}function lt(p,m,I){kn[X++]=Ne,kn[X++]=Fe,kn[X++]=fe,fe=p;var $=Ne;p=Fe;var ee=32-Ea($)-1;$&=~(1<<ee),I+=1;var oe=32-Ea(m)+ee;if(30<oe){var Ee=ee-ee%5;oe=($&(1<<Ee)-1).toString(32),$>>=Ee,ee-=Ee,Ne=1<<32-Ea(m)+ee|I<<ee|$,Fe=oe+p}else Ne=1<<oe|I<<ee|$,Fe=p}function ft(p){p.return!==null&&(Ge(p,1),lt(p,1,0))}function Lt(p){for(;p===Os;)Os=Da[--eo],Da[eo]=null,yi=Da[--eo],Da[eo]=null;for(;p===fe;)fe=kn[--X],kn[X]=null,Fe=kn[--X],kn[X]=null,Ne=kn[--X],kn[X]=null}var Et=null,Ut=null,Rt=!1,Pr=!1,Mr=null;function ei(p,m){var I=$o(5,null,null,0);I.elementType="DELETED",I.stateNode=m,I.return=p,m=p.deletions,m===null?(p.deletions=[I],p.flags|=16):m.push(I)}function Hr(p,m){switch(p.tag){case 5:return m=sa(m,p.type,p.pendingProps),m!==null?(p.stateNode=m,Et=p,Ut=Mo(m),!0):!1;case 6:return m=Ra(m,p.pendingProps),m!==null?(p.stateNode=m,Et=p,Ut=null,!0):!1;case 13:if(m=Un(m),m!==null){var I=fe!==null?{id:Ne,overflow:Fe}:null;return p.memoizedState={dehydrated:m,treeContext:I,retryLane:1073741824},I=$o(18,null,null,0),I.stateNode=m,I.return=p,p.child=I,Et=p,Ut=null,!0}return!1;default:return!1}}function ti(p){return(p.mode&1)!==0&&(p.flags&128)===0}function Hn(p){if(Rt){var m=Ut;if(m){var I=m;if(!Hr(p,m)){if(ti(p))throw Error(l(418));m=ba(I);var $=Et;m&&Hr(p,m)?ei($,I):(p.flags=p.flags&-4097|2,Rt=!1,Et=p)}}else{if(ti(p))throw Error(l(418));p.flags=p.flags&-4097|2,Rt=!1,Et=p}}}function Ni(p){for(p=p.return;p!==null&&p.tag!==5&&p.tag!==3&&p.tag!==13;)p=p.return;Et=p}function bo(p){if(!Me||p!==Et)return!1;if(!Rt)return Ni(p),Rt=!0,!1;if(p.tag!==3&&(p.tag!==5||Vl(p.type)&&!re(p.type,p.memoizedProps))){var m=Ut;if(m){if(ti(p))throw Cs(),Error(l(418));for(;m;)ei(p,m),m=ba(m)}}if(Ni(p),p.tag===13){if(!Me)throw Error(l(316));if(p=p.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(l(317));Ut=Io(p)}else Ut=Et?ba(p.stateNode):null;return!0}function Cs(){for(var p=Ut;p;)p=ba(p)}function Ns(){Me&&(Ut=Et=null,Pr=Rt=!1)}function Kl(p){Mr===null?Mr=[p]:Mr.push(p)}var pl=o.ReactCurrentBatchConfig;function Ba(p,m){if(Aa(p,m))return!0;if(typeof p!="object"||p===null||typeof m!="object"||m===null)return!1;var I=Object.keys(p),$=Object.keys(m);if(I.length!==$.length)return!1;for($=0;$<I.length;$++){var ee=I[$];if(!cc.call(m,ee)||!Aa(p[ee],m[ee]))return!1}return!0}function Iu(p){switch(p.tag){case 5:return Zo(p.type);case 16:return Zo("Lazy");case 13:return Zo("Suspense");case 19:return Zo("SuspenseList");case 0:case 2:case 15:return p=Qo(p.type,!1),p;case 11:return p=Qo(p.type.render,!1),p;case 1:return p=Qo(p.type,!0),p;default:return""}}function wo(p,m,I){if(p=I.ref,p!==null&&typeof p!="function"&&typeof p!="object"){if(I._owner){if(I=I._owner,I){if(I.tag!==1)throw Error(l(309));var $=I.stateNode}if(!$)throw Error(l(147,p));var ee=$,oe=""+p;return m!==null&&m.ref!==null&&typeof m.ref=="function"&&m.ref._stringRef===oe?m.ref:(m=function(Ee){var We=ee.refs;Ee===null?delete We[oe]:We[oe]=Ee},m._stringRef=oe,m)}if(typeof p!="string")throw Error(l(284));if(!I._owner)throw Error(l(290,p))}return p}function jo(p,m){throw p=Object.prototype.toString.call(m),Error(l(31,p==="[object Object]"?"object with keys {"+Object.keys(m).join(", ")+"}":p))}function bi(p){var m=p._init;return m(p._payload)}function is(p){function m(et,Xe){if(p){var at=et.deletions;at===null?(et.deletions=[Xe],et.flags|=16):at.push(Xe)}}function I(et,Xe){if(!p)return null;for(;Xe!==null;)m(et,Xe),Xe=Xe.sibling;return null}function $(et,Xe){for(et=new Map;Xe!==null;)Xe.key!==null?et.set(Xe.key,Xe):et.set(Xe.index,Xe),Xe=Xe.sibling;return et}function ee(et,Xe){return et=pu(et,Xe),et.index=0,et.sibling=null,et}function oe(et,Xe,at){return et.index=at,p?(at=et.alternate,at!==null?(at=at.index,at<Xe?(et.flags|=2,Xe):at):(et.flags|=2,Xe)):(et.flags|=1048576,Xe)}function Ee(et){return p&&et.alternate===null&&(et.flags|=2),et}function We(et,Xe,at,Ct){return Xe===null||Xe.tag!==6?(Xe=Lc(at,et.mode,Ct),Xe.return=et,Xe):(Xe=ee(Xe,at),Xe.return=et,Xe)}function rt(et,Xe,at,Ct){var Qt=at.type;return Qt===f?Bt(et,Xe,at.props.children,Ct,at.key):Xe!==null&&(Xe.elementType===Qt||typeof Qt=="object"&&Qt!==null&&Qt.$$typeof===w&&bi(Qt)===Xe.type)?(Ct=ee(Xe,at.props),Ct.ref=wo(et,Xe,at),Ct.return=et,Ct):(Ct=nh(at.type,at.key,at.props,null,et.mode,Ct),Ct.ref=wo(et,Xe,at),Ct.return=et,Ct)}function yt(et,Xe,at,Ct){return Xe===null||Xe.tag!==4||Xe.stateNode.containerInfo!==at.containerInfo||Xe.stateNode.implementation!==at.implementation?(Xe=ih(at,et.mode,Ct),Xe.return=et,Xe):(Xe=ee(Xe,at.children||[]),Xe.return=et,Xe)}function Bt(et,Xe,at,Ct,Qt){return Xe===null||Xe.tag!==7?(Xe=Na(at,et.mode,Ct,Qt),Xe.return=et,Xe):(Xe=ee(Xe,at),Xe.return=et,Xe)}function pr(et,Xe,at){if(typeof Xe=="string"&&Xe!==""||typeof Xe=="number")return Xe=Lc(""+Xe,et.mode,at),Xe.return=et,Xe;if(typeof Xe=="object"&&Xe!==null){switch(Xe.$$typeof){case u:return at=nh(Xe.type,Xe.key,Xe.props,null,et.mode,at),at.ref=wo(et,null,Xe),at.return=et,at;case d:return Xe=ih(Xe,et.mode,at),Xe.return=et,Xe;case w:var Ct=Xe._init;return pr(et,Ct(Xe._payload),at)}if(J(Xe)||M(Xe))return Xe=Na(Xe,et.mode,at,null),Xe.return=et,Xe;jo(et,Xe)}return null}function Ot(et,Xe,at,Ct){var Qt=Xe!==null?Xe.key:null;if(typeof at=="string"&&at!==""||typeof at=="number")return Qt!==null?null:We(et,Xe,""+at,Ct);if(typeof at=="object"&&at!==null){switch(at.$$typeof){case u:return at.key===Qt?rt(et,Xe,at,Ct):null;case d:return at.key===Qt?yt(et,Xe,at,Ct):null;case w:return Qt=at._init,Ot(et,Xe,Qt(at._payload),Ct)}if(J(at)||M(at))return Qt!==null?null:Bt(et,Xe,at,Ct,null);jo(et,at)}return null}function Nn(et,Xe,at,Ct,Qt){if(typeof Ct=="string"&&Ct!==""||typeof Ct=="number")return et=et.get(at)||null,We(Xe,et,""+Ct,Qt);if(typeof Ct=="object"&&Ct!==null){switch(Ct.$$typeof){case u:return et=et.get(Ct.key===null?at:Ct.key)||null,rt(Xe,et,Ct,Qt);case d:return et=et.get(Ct.key===null?at:Ct.key)||null,yt(Xe,et,Ct,Qt);case w:var xr=Ct._init;return Nn(et,Xe,at,xr(Ct._payload),Qt)}if(J(Ct)||M(Ct))return et=et.get(at)||null,Bt(Xe,et,Ct,Qt,null);jo(Xe,Ct)}return null}function dn(et,Xe,at,Ct){for(var Qt=null,xr=null,gr=Xe,Ur=Xe=0,ea=null;gr!==null&&Ur<at.length;Ur++){gr.index>Ur?(ea=gr,gr=null):ea=gr.sibling;var Fr=Ot(et,gr,at[Ur],Ct);if(Fr===null){gr===null&&(gr=ea);break}p&&gr&&Fr.alternate===null&&m(et,gr),Xe=oe(Fr,Xe,Ur),xr===null?Qt=Fr:xr.sibling=Fr,xr=Fr,gr=ea}if(Ur===at.length)return I(et,gr),Rt&&Ge(et,Ur),Qt;if(gr===null){for(;Ur<at.length;Ur++)gr=pr(et,at[Ur],Ct),gr!==null&&(Xe=oe(gr,Xe,Ur),xr===null?Qt=gr:xr.sibling=gr,xr=gr);return Rt&&Ge(et,Ur),Qt}for(gr=$(et,gr);Ur<at.length;Ur++)ea=Nn(gr,et,Ur,at[Ur],Ct),ea!==null&&(p&&ea.alternate!==null&&gr.delete(ea.key===null?Ur:ea.key),Xe=oe(ea,Xe,Ur),xr===null?Qt=ea:xr.sibling=ea,xr=ea);return p&&gr.forEach(function(Ha){return m(et,Ha)}),Rt&&Ge(et,Ur),Qt}function uo(et,Xe,at,Ct){var Qt=M(at);if(typeof Qt!="function")throw Error(l(150));if(at=Qt.call(at),at==null)throw Error(l(151));for(var xr=Qt=null,gr=Xe,Ur=Xe=0,ea=null,Fr=at.next();gr!==null&&!Fr.done;Ur++,Fr=at.next()){gr.index>Ur?(ea=gr,gr=null):ea=gr.sibling;var Ha=Ot(et,gr,Fr.value,Ct);if(Ha===null){gr===null&&(gr=ea);break}p&&gr&&Ha.alternate===null&&m(et,gr),Xe=oe(Ha,Xe,Ur),xr===null?Qt=Ha:xr.sibling=Ha,xr=Ha,gr=ea}if(Fr.done)return I(et,gr),Rt&&Ge(et,Ur),Qt;if(gr===null){for(;!Fr.done;Ur++,Fr=at.next())Fr=pr(et,Fr.value,Ct),Fr!==null&&(Xe=oe(Fr,Xe,Ur),xr===null?Qt=Fr:xr.sibling=Fr,xr=Fr);return Rt&&Ge(et,Ur),Qt}for(gr=$(et,gr);!Fr.done;Ur++,Fr=at.next())Fr=Nn(gr,et,Ur,Fr.value,Ct),Fr!==null&&(p&&Fr.alternate!==null&&gr.delete(Fr.key===null?Ur:Fr.key),Xe=oe(Fr,Xe,Ur),xr===null?Qt=Fr:xr.sibling=Fr,xr=Fr);return p&&gr.forEach(function(M0){return m(et,M0)}),Rt&&Ge(et,Ur),Qt}function il(et,Xe,at,Ct){if(typeof at=="object"&&at!==null&&at.type===f&&at.key===null&&(at=at.props.children),typeof at=="object"&&at!==null){switch(at.$$typeof){case u:e:{for(var Qt=at.key,xr=Xe;xr!==null;){if(xr.key===Qt){if(Qt=at.type,Qt===f){if(xr.tag===7){I(et,xr.sibling),Xe=ee(xr,at.props.children),Xe.return=et,et=Xe;break e}}else if(xr.elementType===Qt||typeof Qt=="object"&&Qt!==null&&Qt.$$typeof===w&&bi(Qt)===xr.type){I(et,xr.sibling),Xe=ee(xr,at.props),Xe.ref=wo(et,xr,at),Xe.return=et,et=Xe;break e}I(et,xr);break}else m(et,xr);xr=xr.sibling}at.type===f?(Xe=Na(at.props.children,et.mode,Ct,at.key),Xe.return=et,et=Xe):(Ct=nh(at.type,at.key,at.props,null,et.mode,Ct),Ct.ref=wo(et,Xe,at),Ct.return=et,et=Ct)}return Ee(et);case d:e:{for(xr=at.key;Xe!==null;){if(Xe.key===xr)if(Xe.tag===4&&Xe.stateNode.containerInfo===at.containerInfo&&Xe.stateNode.implementation===at.implementation){I(et,Xe.sibling),Xe=ee(Xe,at.children||[]),Xe.return=et,et=Xe;break e}else{I(et,Xe);break}else m(et,Xe);Xe=Xe.sibling}Xe=ih(at,et.mode,Ct),Xe.return=et,et=Xe}return Ee(et);case w:return xr=at._init,il(et,Xe,xr(at._payload),Ct)}if(J(at))return dn(et,Xe,at,Ct);if(M(at))return uo(et,Xe,at,Ct);jo(et,at)}return typeof at=="string"&&at!==""||typeof at=="number"?(at=""+at,Xe!==null&&Xe.tag===6?(I(et,Xe.sibling),Xe=ee(Xe,at),Xe.return=et,et=Xe):(I(et,Xe),Xe=Lc(at,et.mode,Ct),Xe.return=et,et=Xe),Ee(et)):I(et,Xe)}return il}var Pa=is(!0),gl=is(!1),Qs=oi(null),Li=null,Ls=null,Js=null;function Zl(){Js=Ls=Li=null}function si(p,m,I){le?(mr(Qs,m._currentValue),m._currentValue=I):(mr(Qs,m._currentValue2),m._currentValue2=I)}function la(p){var m=Qs.current;an(Qs),le?p._currentValue=m:p._currentValue2=m}function Do(p,m,I){for(;p!==null;){var $=p.alternate;if((p.childLanes&m)!==m?(p.childLanes|=m,$!==null&&($.childLanes|=m)):$!==null&&($.childLanes&m)!==m&&($.childLanes|=m),p===I)break;p=p.return}}function as(p,m){Li=p,Js=Ls=null,p=p.dependencies,p!==null&&p.firstContext!==null&&((p.lanes&m)!==0&&(ci=!0),p.firstContext=null)}function li(p){var m=le?p._currentValue:p._currentValue2;if(Js!==p)if(p={context:p,memoizedValue:m,next:null},Ls===null){if(Li===null)throw Error(l(308));Ls=p,Li.dependencies={lanes:0,firstContext:p}}else Ls=Ls.next=p;return m}var to=null;function Gi(p){to===null?to=[p]:to.push(p)}function ua(p,m,I,$){var ee=m.interleaved;return ee===null?(I.next=I,Gi(m)):(I.next=ee.next,ee.next=I),m.interleaved=I,$i(p,$)}function $i(p,m){p.lanes|=m;var I=p.alternate;for(I!==null&&(I.lanes|=m),I=p,p=p.return;p!==null;)p.childLanes|=m,I=p.alternate,I!==null&&(I.childLanes|=m),I=p,p=p.return;return I.tag===3?I.stateNode:null}var Vn=!1;function os(p){p.updateQueue={baseState:p.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ql(p,m){p=p.updateQueue,m.updateQueue===p&&(m.updateQueue={baseState:p.baseState,firstBaseUpdate:p.firstBaseUpdate,lastBaseUpdate:p.lastBaseUpdate,shared:p.shared,effects:p.effects})}function ca(p,m){return{eventTime:p,lane:m,tag:0,payload:null,callback:null,next:null}}function Jr(p,m,I){var $=p.updateQueue;if($===null)return null;if($=$.shared,(rr&2)!==0){var ee=$.pending;return ee===null?m.next=m:(m.next=ee.next,ee.next=m),$.pending=m,$i(p,I)}return ee=$.interleaved,ee===null?(m.next=m,Gi($)):(m.next=ee.next,ee.next=m),$.interleaved=m,$i(p,I)}function vl(p,m,I){if(m=m.updateQueue,m!==null&&(m=m.shared,(I&4194240)!==0)){var $=m.lanes;$&=p.pendingLanes,I|=$,m.lanes=I,Fa(p,I)}}function ka(p,m){var I=p.updateQueue,$=p.alternate;if($!==null&&($=$.updateQueue,I===$)){var ee=null,oe=null;if(I=I.firstBaseUpdate,I!==null){do{var Ee={eventTime:I.eventTime,lane:I.lane,tag:I.tag,payload:I.payload,callback:I.callback,next:null};oe===null?ee=oe=Ee:oe=oe.next=Ee,I=I.next}while(I!==null);oe===null?ee=oe=m:oe=oe.next=m}else ee=oe=m;I={baseState:$.baseState,firstBaseUpdate:ee,lastBaseUpdate:oe,shared:$.shared,effects:$.effects},p.updateQueue=I;return}p=I.lastBaseUpdate,p===null?I.firstBaseUpdate=m:p.next=m,I.lastBaseUpdate=m}function Wi(p,m,I,$){var ee=p.updateQueue;Vn=!1;var oe=ee.firstBaseUpdate,Ee=ee.lastBaseUpdate,We=ee.shared.pending;if(We!==null){ee.shared.pending=null;var rt=We,yt=rt.next;rt.next=null,Ee===null?oe=yt:Ee.next=yt,Ee=rt;var Bt=p.alternate;Bt!==null&&(Bt=Bt.updateQueue,We=Bt.lastBaseUpdate,We!==Ee&&(We===null?Bt.firstBaseUpdate=yt:We.next=yt,Bt.lastBaseUpdate=rt))}if(oe!==null){var pr=ee.baseState;Ee=0,Bt=yt=rt=null,We=oe;do{var Ot=We.lane,Nn=We.eventTime;if(($&Ot)===Ot){Bt!==null&&(Bt=Bt.next={eventTime:Nn,lane:0,tag:We.tag,payload:We.payload,callback:We.callback,next:null});e:{var dn=p,uo=We;switch(Ot=m,Nn=I,uo.tag){case 1:if(dn=uo.payload,typeof dn=="function"){pr=dn.call(Nn,pr,Ot);break e}pr=dn;break e;case 3:dn.flags=dn.flags&-65537|128;case 0:if(dn=uo.payload,Ot=typeof dn=="function"?dn.call(Nn,pr,Ot):dn,Ot==null)break e;pr=a({},pr,Ot);break e;case 2:Vn=!0}}We.callback!==null&&We.lane!==0&&(p.flags|=64,Ot=ee.effects,Ot===null?ee.effects=[We]:Ot.push(We))}else Nn={eventTime:Nn,lane:Ot,tag:We.tag,payload:We.payload,callback:We.callback,next:null},Bt===null?(yt=Bt=Nn,rt=pr):Bt=Bt.next=Nn,Ee|=Ot;if(We=We.next,We===null){if(We=ee.shared.pending,We===null)break;Ot=We,We=Ot.next,Ot.next=null,ee.lastBaseUpdate=Ot,ee.shared.pending=null}}while(!0);if(Bt===null&&(rt=pr),ee.baseState=rt,ee.firstBaseUpdate=yt,ee.lastBaseUpdate=Bt,m=ee.shared.interleaved,m!==null){ee=m;do Ee|=ee.lane,ee=ee.next;while(ee!==m)}else oe===null&&(ee.shared.lanes=0);Is|=Ee,p.lanes=Ee,p.memoizedState=pr}}function ml(p,m,I){if(p=m.effects,m.effects=null,p!==null)for(m=0;m<p.length;m++){var $=p[m],ee=$.callback;if(ee!==null){if($.callback=null,$=I,typeof ee!="function")throw Error(l(191,ee));ee.call($)}}}var _o={},Yi=oi(_o),Bo=oi(_o),za=oi(_o);function Ti(p){if(p===_o)throw Error(l(174));return p}function xo(p,m){mr(za,m),mr(Bo,p),mr(Yi,_o),p=H(m),an(Yi),mr(Yi,p)}function zo(){an(Yi),an(Bo),an(za)}function Oa(p){var m=Ti(za.current),I=Ti(Yi.current);m=V(I,p.type,m),I!==m&&(mr(Bo,p),mr(Yi,m))}function So(p){Bo.current===p&&(an(Yi),an(Bo))}var tr=oi(0);function en(p){for(var m=p;m!==null;){if(m.tag===13){var I=m.memoizedState;if(I!==null&&(I=I.dehydrated,I===null||Ui(I)||Rr(I)))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===p)break;for(;m.sibling===null;){if(m.return===null||m.return===p)return null;m=m.return}m.sibling.return=m.return,m=m.sibling}return null}var Ln=[];function Tn(){for(var p=0;p<Ln.length;p++){var m=Ln[p];le?m._workInProgressVersionPrimary=null:m._workInProgressVersionSecondary=null}Ln.length=0}var Gn=o.ReactCurrentDispatcher,Eo=o.ReactCurrentBatchConfig,Xi=0,on=null,ri=null,ui=null,yl=!1,Jl=!1,eu=0,bl=0;function wi(){throw Error(l(321))}function el(p,m){if(m===null)return!1;for(var I=0;I<m.length&&I<p.length;I++)if(!Aa(p[I],m[I]))return!1;return!0}function tu(p,m,I,$,ee,oe){if(Xi=oe,on=m,m.memoizedState=null,m.updateQueue=null,m.lanes=0,Gn.current=p===null||p.memoizedState===null?zu:Al,p=I($,ee),Jl){oe=0;do{if(Jl=!1,eu=0,25<=oe)throw Error(l(301));oe+=1,ui=ri=null,m.updateQueue=null,Gn.current=df,p=I($,ee)}while(Jl)}if(Gn.current=Rs,m=ri!==null&&ri.next!==null,Xi=0,ui=ri=on=null,yl=!1,m)throw Error(l(300));return p}function Fu(){var p=eu!==0;return eu=0,p}function Ua(){var p={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ui===null?on.memoizedState=ui=p:ui=ui.next=p,ui}function Ri(){if(ri===null){var p=on.alternate;p=p!==null?p.memoizedState:null}else p=ri.next;var m=ui===null?on.memoizedState:ui.next;if(m!==null)ui=m,ri=p;else{if(p===null)throw Error(l(310));ri=p,p={memoizedState:ri.memoizedState,baseState:ri.baseState,baseQueue:ri.baseQueue,queue:ri.queue,next:null},ui===null?on.memoizedState=ui=p:ui=ui.next=p}return ui}function Uo(p,m){return typeof m=="function"?m(p):m}function ju(p){var m=Ri(),I=m.queue;if(I===null)throw Error(l(311));I.lastRenderedReducer=p;var $=ri,ee=$.baseQueue,oe=I.pending;if(oe!==null){if(ee!==null){var Ee=ee.next;ee.next=oe.next,oe.next=Ee}$.baseQueue=ee=oe,I.pending=null}if(ee!==null){oe=ee.next,$=$.baseState;var We=Ee=null,rt=null,yt=oe;do{var Bt=yt.lane;if((Xi&Bt)===Bt)rt!==null&&(rt=rt.next={lane:0,action:yt.action,hasEagerState:yt.hasEagerState,eagerState:yt.eagerState,next:null}),$=yt.hasEagerState?yt.eagerState:p($,yt.action);else{var pr={lane:Bt,action:yt.action,hasEagerState:yt.hasEagerState,eagerState:yt.eagerState,next:null};rt===null?(We=rt=pr,Ee=$):rt=rt.next=pr,on.lanes|=Bt,Is|=Bt}yt=yt.next}while(yt!==null&&yt!==oe);rt===null?Ee=$:rt.next=We,Aa($,m.memoizedState)||(ci=!0),m.memoizedState=$,m.baseState=Ee,m.baseQueue=rt,I.lastRenderedState=$}if(p=I.interleaved,p!==null){ee=p;do oe=ee.lane,on.lanes|=oe,Is|=oe,ee=ee.next;while(ee!==p)}else ee===null&&(I.lanes=0);return[m.memoizedState,I.dispatch]}function wl(p){var m=Ri(),I=m.queue;if(I===null)throw Error(l(311));I.lastRenderedReducer=p;var $=I.dispatch,ee=I.pending,oe=m.memoizedState;if(ee!==null){I.pending=null;var Ee=ee=ee.next;do oe=p(oe,Ee.action),Ee=Ee.next;while(Ee!==ee);Aa(oe,m.memoizedState)||(ci=!0),m.memoizedState=oe,m.baseQueue===null&&(m.baseState=oe),I.lastRenderedState=oe}return[oe,$]}function gc(){}function vc(p,m){var I=on,$=Ri(),ee=m(),oe=!Aa($.memoizedState,ee);if(oe&&($.memoizedState=ee,ci=!0),$=$.queue,Sl(bc.bind(null,I,$,p),[p]),$.getSnapshot!==m||oe||ui!==null&&ui.memoizedState.tag&1){if(I.flags|=2048,_i(9,yc.bind(null,I,$,ee,m),void 0,null),Or===null)throw Error(l(349));(Xi&30)!==0||mc(I,m,ee)}return ee}function mc(p,m,I){p.flags|=16384,p={getSnapshot:m,value:I},m=on.updateQueue,m===null?(m={lastEffect:null,stores:null},on.updateQueue=m,m.stores=[p]):(I=m.stores,I===null?m.stores=[p]:I.push(p))}function yc(p,m,I,$){m.value=I,m.getSnapshot=$,wc(m)&&qo(p)}function bc(p,m,I){return I(function(){wc(m)&&qo(p)})}function wc(p){var m=p.getSnapshot;p=p.value;try{var I=m();return!Aa(p,I)}catch{return!0}}function qo(p){var m=$i(p,1);m!==null&&ma(m,p,1,-1)}function _l(p){var m=Ua();return typeof p=="function"&&(p=p()),m.memoizedState=m.baseState=p,p={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Uo,lastRenderedState:p},m.queue=p,p=p.dispatch=Hh.bind(null,on,p),[m.memoizedState,p]}function _i(p,m,I,$){return p={tag:p,create:m,destroy:I,deps:$,next:null},m=on.updateQueue,m===null?(m={lastEffect:null,stores:null},on.updateQueue=m,m.lastEffect=p.next=p):(I=m.lastEffect,I===null?m.lastEffect=p.next=p:($=I.next,I.next=p,p.next=$,m.lastEffect=p)),p}function ro(){return Ri().memoizedState}function xl(p,m,I,$){var ee=Ua();on.flags|=p,ee.memoizedState=_i(1|m,I,void 0,$===void 0?null:$)}function Ho(p,m,I,$){var ee=Ri();$=$===void 0?null:$;var oe=void 0;if(ri!==null){var Ee=ri.memoizedState;if(oe=Ee.destroy,$!==null&&el($,Ee.deps)){ee.memoizedState=_i(m,I,oe,$);return}}on.flags|=p,ee.memoizedState=_i(1|m,I,oe,$)}function ff(p,m){return xl(8390656,8,p,m)}function Sl(p,m){return Ho(2048,8,p,m)}function ru(p,m){return Ho(4,2,p,m)}function sn(p,m){return Ho(4,4,p,m)}function Du(p,m){if(typeof m=="function")return p=p(),m(p),function(){m(null)};if(m!=null)return p=p(),m.current=p,function(){m.current=null}}function El(p,m,I){return I=I!=null?I.concat([p]):null,Ho(4,4,Du.bind(null,m,p),I)}function Ts(){}function nu(p,m){var I=Ri();m=m===void 0?null:m;var $=I.memoizedState;return $!==null&&m!==null&&el(m,$[1])?$[0]:(I.memoizedState=[p,m],p)}function iu(p,m){var I=Ri();m=m===void 0?null:m;var $=I.memoizedState;return $!==null&&m!==null&&el(m,$[1])?$[0]:(p=p(),I.memoizedState=[p,m],p)}function au(p,m,I){return(Xi&21)===0?(p.baseState&&(p.baseState=!1,ci=!0),p.memoizedState=I):(Aa(I,m)||(I=ns(),on.lanes|=I,Is|=I,p.baseState=!0),m)}function _c(p,m){var I=xt;xt=I!==0&&4>I?I:4,p(!0);var $=Eo.transition;Eo.transition={};try{p(!1),m()}finally{xt=I,Eo.transition=$}}function tl(){return Ri().memoizedState}function Xf(p,m,I){var $=di(p);if(I={lane:$,action:I,hasEagerState:!1,eagerState:null,next:null},Kf(p))hf(m,I);else if(I=ua(p,m,I,$),I!==null){var ee=gn();ma(I,p,$,ee),Bu(I,m,$)}}function Hh(p,m,I){var $=di(p),ee={lane:$,action:I,hasEagerState:!1,eagerState:null,next:null};if(Kf(p))hf(m,ee);else{var oe=p.alternate;if(p.lanes===0&&(oe===null||oe.lanes===0)&&(oe=m.lastRenderedReducer,oe!==null))try{var Ee=m.lastRenderedState,We=oe(Ee,I);if(ee.hasEagerState=!0,ee.eagerState=We,Aa(We,Ee)){var rt=m.interleaved;rt===null?(ee.next=ee,Gi(m)):(ee.next=rt.next,rt.next=ee),m.interleaved=ee;return}}catch{}finally{}I=ua(p,m,ee,$),I!==null&&(ee=gn(),ma(I,p,$,ee),Bu(I,m,$))}}function Kf(p){var m=p.alternate;return p===on||m!==null&&m===on}function hf(p,m){Jl=yl=!0;var I=p.pending;I===null?m.next=m:(m.next=I.next,I.next=m),p.pending=m}function Bu(p,m,I){if((I&4194240)!==0){var $=m.lanes;$&=p.pendingLanes,I|=$,m.lanes=I,Fa(p,I)}}var Rs={readContext:li,useCallback:wi,useContext:wi,useEffect:wi,useImperativeHandle:wi,useInsertionEffect:wi,useLayoutEffect:wi,useMemo:wi,useReducer:wi,useRef:wi,useState:wi,useDebugValue:wi,useDeferredValue:wi,useTransition:wi,useMutableSource:wi,useSyncExternalStore:wi,useId:wi,unstable_isNewReconciler:!1},zu={readContext:li,useCallback:function(p,m){return Ua().memoizedState=[p,m===void 0?null:m],p},useContext:li,useEffect:ff,useImperativeHandle:function(p,m,I){return I=I!=null?I.concat([p]):null,xl(4194308,4,Du.bind(null,m,p),I)},useLayoutEffect:function(p,m){return xl(4194308,4,p,m)},useInsertionEffect:function(p,m){return xl(4,2,p,m)},useMemo:function(p,m){var I=Ua();return m=m===void 0?null:m,p=p(),I.memoizedState=[p,m],p},useReducer:function(p,m,I){var $=Ua();return m=I!==void 0?I(m):m,$.memoizedState=$.baseState=m,p={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:p,lastRenderedState:m},$.queue=p,p=p.dispatch=Xf.bind(null,on,p),[$.memoizedState,p]},useRef:function(p){var m=Ua();return p={current:p},m.memoizedState=p},useState:_l,useDebugValue:Ts,useDeferredValue:function(p){return Ua().memoizedState=p},useTransition:function(){var p=_l(!1),m=p[0];return p=_c.bind(null,p[1]),Ua().memoizedState=p,[m,p]},useMutableSource:function(){},useSyncExternalStore:function(p,m,I){var $=on,ee=Ua();if(Rt){if(I===void 0)throw Error(l(407));I=I()}else{if(I=m(),Or===null)throw Error(l(349));(Xi&30)!==0||mc($,m,I)}ee.memoizedState=I;var oe={value:I,getSnapshot:m};return ee.queue=oe,ff(bc.bind(null,$,oe,p),[p]),$.flags|=2048,_i(9,yc.bind(null,$,oe,I,m),void 0,null),I},useId:function(){var p=Ua(),m=Or.identifierPrefix;if(Rt){var I=Fe,$=Ne;I=($&~(1<<32-Ea($)-1)).toString(32)+I,m=":"+m+"R"+I,I=eu++,0<I&&(m+="H"+I.toString(32)),m+=":"}else I=bl++,m=":"+m+"r"+I.toString(32)+":";return p.memoizedState=m},unstable_isNewReconciler:!1},Al={readContext:li,useCallback:nu,useContext:li,useEffect:Sl,useImperativeHandle:El,useInsertionEffect:ru,useLayoutEffect:sn,useMemo:iu,useReducer:ju,useRef:ro,useState:function(){return ju(Uo)},useDebugValue:Ts,useDeferredValue:function(p){var m=Ri();return au(m,ri.memoizedState,p)},useTransition:function(){var p=ju(Uo)[0],m=Ri().memoizedState;return[p,m]},useMutableSource:gc,useSyncExternalStore:vc,useId:tl,unstable_isNewReconciler:!1},df={readContext:li,useCallback:nu,useContext:li,useEffect:Sl,useImperativeHandle:El,useInsertionEffect:ru,useLayoutEffect:sn,useMemo:iu,useReducer:wl,useRef:ro,useState:function(){return wl(Uo)},useDebugValue:Ts,useDeferredValue:function(p){var m=Ri();return ri===null?m.memoizedState=p:au(m,ri.memoizedState,p)},useTransition:function(){var p=wl(Uo)[0],m=Ri().memoizedState;return[p,m]},useMutableSource:gc,useSyncExternalStore:vc,useId:tl,unstable_isNewReconciler:!1};function no(p,m){if(p&&p.defaultProps){m=a({},m),p=p.defaultProps;for(var I in p)m[I]===void 0&&(m[I]=p[I]);return m}return m}function xc(p,m,I,$){m=p.memoizedState,I=I($,m),I=I==null?m:a({},m,I),p.memoizedState=I,p.lanes===0&&(p.updateQueue.baseState=I)}var Uu={isMounted:function(p){return(p=p._reactInternals)?R(p)===p:!1},enqueueSetState:function(p,m,I){p=p._reactInternals;var $=gn(),ee=di(p),oe=ca($,ee);oe.payload=m,I!=null&&(oe.callback=I),m=Jr(p,oe,ee),m!==null&&(ma(m,p,ee,$),vl(m,p,ee))},enqueueReplaceState:function(p,m,I){p=p._reactInternals;var $=gn(),ee=di(p),oe=ca($,ee);oe.tag=1,oe.payload=m,I!=null&&(oe.callback=I),m=Jr(p,oe,ee),m!==null&&(ma(m,p,ee,$),vl(m,p,ee))},enqueueForceUpdate:function(p,m){p=p._reactInternals;var I=gn(),$=di(p),ee=ca(I,$);ee.tag=2,m!=null&&(ee.callback=m),m=Jr(p,ee,$),m!==null&&(ma(m,p,$,I),vl(m,p,$))}};function Zf(p,m,I,$,ee,oe,Ee){return p=p.stateNode,typeof p.shouldComponentUpdate=="function"?p.shouldComponentUpdate($,oe,Ee):m.prototype&&m.prototype.isPureReactComponent?!Ba(I,$)||!Ba(ee,oe):!0}function Qf(p,m,I){var $=!1,ee=Jo,oe=m.contextType;return typeof oe=="object"&&oe!==null?oe=li(oe):(ee=Pn(m)?Ka:Er.current,$=m.contextTypes,oe=($=$!=null)?Hi(p,ee):Jo),m=new m(I,oe),p.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Uu,p.stateNode=m,m._reactInternals=p,$&&(p=p.stateNode,p.__reactInternalMemoizedUnmaskedChildContext=ee,p.__reactInternalMemoizedMaskedChildContext=oe),m}function Sc(p,m,I,$){p=m.state,typeof m.componentWillReceiveProps=="function"&&m.componentWillReceiveProps(I,$),typeof m.UNSAFE_componentWillReceiveProps=="function"&&m.UNSAFE_componentWillReceiveProps(I,$),m.state!==p&&Uu.enqueueReplaceState(m,m.state,null)}function Ki(p,m,I,$){var ee=p.stateNode;ee.props=I,ee.state=p.memoizedState,ee.refs={},os(p);var oe=m.contextType;typeof oe=="object"&&oe!==null?ee.context=li(oe):(oe=Pn(m)?Ka:Er.current,ee.context=Hi(p,oe)),ee.state=p.memoizedState,oe=m.getDerivedStateFromProps,typeof oe=="function"&&(xc(p,m,oe,I),ee.state=p.memoizedState),typeof m.getDerivedStateFromProps=="function"||typeof ee.getSnapshotBeforeUpdate=="function"||typeof ee.UNSAFE_componentWillMount!="function"&&typeof ee.componentWillMount!="function"||(m=ee.state,typeof ee.componentWillMount=="function"&&ee.componentWillMount(),typeof ee.UNSAFE_componentWillMount=="function"&&ee.UNSAFE_componentWillMount(),m!==ee.state&&Uu.enqueueReplaceState(ee,ee.state,null),Wi(p,I,ee,$),ee.state=p.memoizedState),typeof ee.componentDidMount=="function"&&(p.flags|=4194308)}function Zi(p,m){try{var I="",$=m;do I+=Iu($),$=$.return;while($);var ee=I}catch(oe){ee=`
56
- Error generating stack: `+oe.message+`
57
- `+oe.stack}return{value:p,source:m,stack:ee,digest:null}}function fa(p,m,I){return{value:p,source:null,stack:I??null,digest:m??null}}function Ao(p,m){try{console.error(m.value)}catch(I){setTimeout(function(){throw I})}}var ou=typeof WeakMap=="function"?WeakMap:Map;function Qi(p,m,I){I=ca(-1,I),I.tag=3,I.payload={element:null};var $=m.value;return I.callback=function(){Fn||(Fn=!0,jn=$),Ao(p,m)},I}function Ca(p,m,I){I=ca(-1,I),I.tag=3;var $=p.type.getDerivedStateFromError;if(typeof $=="function"){var ee=m.value;I.payload=function(){return $(ee)},I.callback=function(){Ao(p,m)}}var oe=p.stateNode;return oe!==null&&typeof oe.componentDidCatch=="function"&&(I.callback=function(){Ao(p,m),typeof $!="function"&&(ao===null?ao=new Set([this]):ao.add(this));var Ee=m.stack;this.componentDidCatch(m.value,{componentStack:Ee!==null?Ee:""})}),I}function Jf(p,m,I){var $=p.pingCache;if($===null){$=p.pingCache=new ou;var ee=new Set;$.set(m,ee)}else ee=$.get(m),ee===void 0&&(ee=new Set,$.set(m,ee));ee.has(I)||(ee.add(I),p=Np.bind(null,p,m,I),m.then(p,p))}function eh(p){do{var m;if((m=p.tag===13)&&(m=p.memoizedState,m=m!==null?m.dehydrated!==null:!0),m)return p;p=p.return}while(p!==null);return null}function Ms(p,m,I,$,ee){return(p.mode&1)===0?(p===m?p.flags|=65536:(p.flags|=128,I.flags|=131072,I.flags&=-52805,I.tag===1&&(I.alternate===null?I.tag=17:(m=ca(-1,1),m.tag=2,Jr(I,m,1))),I.lanes|=1),p):(p.flags|=65536,p.lanes=ee,p)}var su=o.ReactCurrentOwner,ci=!1;function xi(p,m,I,$){m.child=p===null?gl(m,null,I,$):Pa(m,p.child,I,$)}function Ec(p,m,I,$,ee){I=I.render;var oe=m.ref;return as(m,ee),$=tu(p,m,I,$,oe,ee),I=Fu(),p!==null&&!ci?(m.updateQueue=p.updateQueue,m.flags&=-2053,p.lanes&=~ee,te(p,m,ee)):(Rt&&I&&ft(m),m.flags|=1,xi(p,m,$,ee),m.child)}function ss(p,m,I,$,ee){if(p===null){var oe=I.type;return typeof oe=="function"&&!Cc(oe)&&oe.defaultProps===void 0&&I.compare===null&&I.defaultProps===void 0?(m.tag=15,m.type=oe,Po(p,m,oe,$,ee)):(p=nh(I.type,null,$,m,m.mode,ee),p.ref=m.ref,p.return=m,m.child=p)}if(oe=p.child,(p.lanes&ee)===0){var Ee=oe.memoizedProps;if(I=I.compare,I=I!==null?I:Ba,I(Ee,$)&&p.ref===m.ref)return te(p,m,ee)}return m.flags|=1,p=pu(oe,$),p.ref=m.ref,p.return=m,m.child=p}function Po(p,m,I,$,ee){if(p!==null){var oe=p.memoizedProps;if(Ba(oe,$)&&p.ref===m.ref)if(ci=!1,m.pendingProps=$=oe,(p.lanes&ee)!==0)(p.flags&131072)!==0&&(ci=!0);else return m.lanes=p.lanes,te(p,m,ee)}return ls(p,m,I,$,ee)}function Yr(p,m,I){var $=m.pendingProps,ee=$.children,oe=p!==null?p.memoizedState:null;if($.mode==="hidden")if((m.mode&1)===0)m.memoizedState={baseLanes:0,cachePool:null,transitions:null},mr(Vo,ii),ii|=I;else{if((I&1073741824)===0)return p=oe!==null?oe.baseLanes|I:I,m.lanes=m.childLanes=1073741824,m.memoizedState={baseLanes:p,cachePool:null,transitions:null},m.updateQueue=null,mr(Vo,ii),ii|=p,null;m.memoizedState={baseLanes:0,cachePool:null,transitions:null},$=oe!==null?oe.baseLanes:I,mr(Vo,ii),ii|=$}else oe!==null?($=oe.baseLanes|I,m.memoizedState=null):$=I,mr(Vo,ii),ii|=$;return xi(p,m,ee,I),m.child}function tn(p,m){var I=m.ref;(p===null&&I!==null||p!==null&&p.ref!==I)&&(m.flags|=512,m.flags|=2097152)}function ls(p,m,I,$,ee){var oe=Pn(I)?Ka:Er.current;return oe=Hi(m,oe),as(m,ee),I=tu(p,m,I,$,oe,ee),$=Fu(),p!==null&&!ci?(m.updateQueue=p.updateQueue,m.flags&=-2053,p.lanes&=~ee,te(p,m,ee)):(Rt&&$&&ft(m),m.flags|=1,xi(p,m,I,ee),m.child)}function Mi(p,m,I,$,ee){if(Pn(I)){var oe=!0;es(m)}else oe=!1;if(as(m,ee),m.stateNode===null)B(p,m),Qf(m,I,$),Ki(m,I,$,ee),$=!0;else if(p===null){var Ee=m.stateNode,We=m.memoizedProps;Ee.props=We;var rt=Ee.context,yt=I.contextType;typeof yt=="object"&&yt!==null?yt=li(yt):(yt=Pn(I)?Ka:Er.current,yt=Hi(m,yt));var Bt=I.getDerivedStateFromProps,pr=typeof Bt=="function"||typeof Ee.getSnapshotBeforeUpdate=="function";pr||typeof Ee.UNSAFE_componentWillReceiveProps!="function"&&typeof Ee.componentWillReceiveProps!="function"||(We!==$||rt!==yt)&&Sc(m,Ee,$,yt),Vn=!1;var Ot=m.memoizedState;Ee.state=Ot,Wi(m,$,Ee,ee),rt=m.memoizedState,We!==$||Ot!==rt||qi.current||Vn?(typeof Bt=="function"&&(xc(m,I,Bt,$),rt=m.memoizedState),(We=Vn||Zf(m,I,We,$,Ot,rt,yt))?(pr||typeof Ee.UNSAFE_componentWillMount!="function"&&typeof Ee.componentWillMount!="function"||(typeof Ee.componentWillMount=="function"&&Ee.componentWillMount(),typeof Ee.UNSAFE_componentWillMount=="function"&&Ee.UNSAFE_componentWillMount()),typeof Ee.componentDidMount=="function"&&(m.flags|=4194308)):(typeof Ee.componentDidMount=="function"&&(m.flags|=4194308),m.memoizedProps=$,m.memoizedState=rt),Ee.props=$,Ee.state=rt,Ee.context=yt,$=We):(typeof Ee.componentDidMount=="function"&&(m.flags|=4194308),$=!1)}else{Ee=m.stateNode,Ql(p,m),We=m.memoizedProps,yt=m.type===m.elementType?We:no(m.type,We),Ee.props=yt,pr=m.pendingProps,Ot=Ee.context,rt=I.contextType,typeof rt=="object"&&rt!==null?rt=li(rt):(rt=Pn(I)?Ka:Er.current,rt=Hi(m,rt));var Nn=I.getDerivedStateFromProps;(Bt=typeof Nn=="function"||typeof Ee.getSnapshotBeforeUpdate=="function")||typeof Ee.UNSAFE_componentWillReceiveProps!="function"&&typeof Ee.componentWillReceiveProps!="function"||(We!==pr||Ot!==rt)&&Sc(m,Ee,$,rt),Vn=!1,Ot=m.memoizedState,Ee.state=Ot,Wi(m,$,Ee,ee);var dn=m.memoizedState;We!==pr||Ot!==dn||qi.current||Vn?(typeof Nn=="function"&&(xc(m,I,Nn,$),dn=m.memoizedState),(yt=Vn||Zf(m,I,yt,$,Ot,dn,rt)||!1)?(Bt||typeof Ee.UNSAFE_componentWillUpdate!="function"&&typeof Ee.componentWillUpdate!="function"||(typeof Ee.componentWillUpdate=="function"&&Ee.componentWillUpdate($,dn,rt),typeof Ee.UNSAFE_componentWillUpdate=="function"&&Ee.UNSAFE_componentWillUpdate($,dn,rt)),typeof Ee.componentDidUpdate=="function"&&(m.flags|=4),typeof Ee.getSnapshotBeforeUpdate=="function"&&(m.flags|=1024)):(typeof Ee.componentDidUpdate!="function"||We===p.memoizedProps&&Ot===p.memoizedState||(m.flags|=4),typeof Ee.getSnapshotBeforeUpdate!="function"||We===p.memoizedProps&&Ot===p.memoizedState||(m.flags|=1024),m.memoizedProps=$,m.memoizedState=dn),Ee.props=$,Ee.state=dn,Ee.context=rt,$=yt):(typeof Ee.componentDidUpdate!="function"||We===p.memoizedProps&&Ot===p.memoizedState||(m.flags|=4),typeof Ee.getSnapshotBeforeUpdate!="function"||We===p.memoizedProps&&Ot===p.memoizedState||(m.flags|=1024),$=!1)}return ha(p,m,I,$,oe,ee)}function ha(p,m,I,$,ee,oe){tn(p,m);var Ee=(m.flags&128)!==0;if(!$&&!Ee)return ee&&Ru(m,I,!1),te(p,m,oe);$=m.stateNode,su.current=m;var We=Ee&&typeof I.getDerivedStateFromError!="function"?null:$.render();return m.flags|=1,p!==null&&Ee?(m.child=Pa(m,p.child,null,oe),m.child=Pa(m,null,We,oe)):xi(p,m,We,oe),m.memoizedState=$.state,ee&&Ru(m,I,!0),m.child}function rl(p){var m=p.stateNode;m.pendingContext?Ws(p,m.pendingContext,m.pendingContext!==m.context):m.context&&Ws(p,m.context,!1),xo(p,m.containerInfo)}function Pl(p,m,I,$,ee){return Ns(),Kl(ee),m.flags|=256,xi(p,m,I,$),m.child}var da={dehydrated:null,treeContext:null,retryLane:0};function lu(p){return{baseLanes:p,cachePool:null,transitions:null}}function pf(p,m,I){var $=m.pendingProps,ee=tr.current,oe=!1,Ee=(m.flags&128)!==0,We;if((We=Ee)||(We=p!==null&&p.memoizedState===null?!1:(ee&2)!==0),We?(oe=!0,m.flags&=-129):(p===null||p.memoizedState!==null)&&(ee|=1),mr(tr,ee&1),p===null)return Hn(m),p=m.memoizedState,p!==null&&(p=p.dehydrated,p!==null)?((m.mode&1)===0?m.lanes=1:Rr(p)?m.lanes=8:m.lanes=1073741824,null):(Ee=$.children,p=$.fallback,oe?($=m.mode,oe=m.child,Ee={mode:"hidden",children:Ee},($&1)===0&&oe!==null?(oe.childLanes=0,oe.pendingProps=Ee):oe=Nc(Ee,$,0,null),p=Na(p,$,I,null),oe.return=m,p.return=m,oe.sibling=p,m.child=oe,m.child.memoizedState=lu(I),m.memoizedState=da,p):qu(m,Ee));if(ee=p.memoizedState,ee!==null&&(We=ee.dehydrated,We!==null))return th(p,m,Ee,$,We,ee,I);if(oe){oe=$.fallback,Ee=m.mode,ee=p.child,We=ee.sibling;var rt={mode:"hidden",children:$.children};return(Ee&1)===0&&m.child!==ee?($=m.child,$.childLanes=0,$.pendingProps=rt,m.deletions=null):($=pu(ee,rt),$.subtreeFlags=ee.subtreeFlags&14680064),We!==null?oe=pu(We,oe):(oe=Na(oe,Ee,I,null),oe.flags|=2),oe.return=m,$.return=m,$.sibling=oe,m.child=$,$=oe,oe=m.child,Ee=p.child.memoizedState,Ee=Ee===null?lu(I):{baseLanes:Ee.baseLanes|I,cachePool:null,transitions:Ee.transitions},oe.memoizedState=Ee,oe.childLanes=p.childLanes&~I,m.memoizedState=da,$}return oe=p.child,p=oe.sibling,$=pu(oe,{mode:"visible",children:$.children}),(m.mode&1)===0&&($.lanes=I),$.return=m,$.sibling=null,p!==null&&(I=m.deletions,I===null?(m.deletions=[p],m.flags|=16):I.push(p)),m.child=$,m.memoizedState=null,$}function qu(p,m){return m=Nc({mode:"visible",children:m},p.mode,0,null),m.return=p,p.child=m}function us(p,m,I,$){return $!==null&&Kl($),Pa(m,p.child,null,I),p=qu(m,m.pendingProps.children),p.flags|=2,m.memoizedState=null,p}function th(p,m,I,$,ee,oe,Ee){if(I)return m.flags&256?(m.flags&=-257,$=fa(Error(l(422))),us(p,m,Ee,$)):m.memoizedState!==null?(m.child=p.child,m.flags|=128,null):(oe=$.fallback,ee=m.mode,$=Nc({mode:"visible",children:$.children},ee,0,null),oe=Na(oe,ee,Ee,null),oe.flags|=2,$.return=m,oe.return=m,$.sibling=oe,m.child=$,(m.mode&1)!==0&&Pa(m,p.child,null,Ee),m.child.memoizedState=lu(Ee),m.memoizedState=da,oe);if((m.mode&1)===0)return us(p,m,Ee,null);if(Rr(ee))return $=yn(ee).digest,oe=Error(l(419)),$=fa(oe,$,void 0),us(p,m,Ee,$);if(I=(Ee&p.childLanes)!==0,ci||I){if($=Or,$!==null){switch(Ee&-Ee){case 4:ee=2;break;case 16:ee=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:ee=32;break;case 536870912:ee=268435456;break;default:ee=0}ee=(ee&($.suspendedLanes|Ee))!==0?0:ee,ee!==0&&ee!==oe.retryLane&&(oe.retryLane=ee,$i(p,ee),ma($,p,ee,-1))}return lo(),$=fa(Error(l(421))),us(p,m,Ee,$)}return Ui(ee)?(m.flags|=128,m.child=p.child,m=Tp.bind(null,p),An(ee,m),null):(p=oe.treeContext,Me&&(Ut=Ya(ee),Et=m,Rt=!0,Mr=null,Pr=!1,p!==null&&(kn[X++]=Ne,kn[X++]=Fe,kn[X++]=fe,Ne=p.id,Fe=p.overflow,fe=m)),m=qu(m,$.children),m.flags|=4096,m)}function cs(p,m,I){p.lanes|=m;var $=p.alternate;$!==null&&($.lanes|=m),Do(p.return,m,I)}function kl(p,m,I,$,ee){var oe=p.memoizedState;oe===null?p.memoizedState={isBackwards:m,rendering:null,renderingStartTime:0,last:$,tail:I,tailMode:ee}:(oe.isBackwards=m,oe.rendering=null,oe.renderingStartTime=0,oe.last=$,oe.tail=I,oe.tailMode=ee)}function N(p,m,I){var $=m.pendingProps,ee=$.revealOrder,oe=$.tail;if(xi(p,m,$.children,I),$=tr.current,($&2)!==0)$=$&1|2,m.flags|=128;else{if(p!==null&&(p.flags&128)!==0)e:for(p=m.child;p!==null;){if(p.tag===13)p.memoizedState!==null&&cs(p,I,m);else if(p.tag===19)cs(p,I,m);else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===m)break e;for(;p.sibling===null;){if(p.return===null||p.return===m)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}$&=1}if(mr(tr,$),(m.mode&1)===0)m.memoizedState=null;else switch(ee){case"forwards":for(I=m.child,ee=null;I!==null;)p=I.alternate,p!==null&&en(p)===null&&(ee=I),I=I.sibling;I=ee,I===null?(ee=m.child,m.child=null):(ee=I.sibling,I.sibling=null),kl(m,!1,ee,I,oe);break;case"backwards":for(I=null,ee=m.child,m.child=null;ee!==null;){if(p=ee.alternate,p!==null&&en(p)===null){m.child=ee;break}p=ee.sibling,ee.sibling=I,I=ee,ee=p}kl(m,!0,I,null,oe);break;case"together":kl(m,!1,null,null,void 0);break;default:m.memoizedState=null}return m.child}function B(p,m){(m.mode&1)===0&&p!==null&&(p.alternate=null,m.alternate=null,m.flags|=2)}function te(p,m,I){if(p!==null&&(m.dependencies=p.dependencies),Is|=m.lanes,(I&m.childLanes)===0)return null;if(p!==null&&m.child!==p.child)throw Error(l(153));if(m.child!==null){for(p=m.child,I=pu(p,p.pendingProps),m.child=I,I.return=m;p.sibling!==null;)p=p.sibling,I=I.sibling=pu(p,p.pendingProps),I.return=m;I.sibling=null}return m.child}function ie(p,m,I){switch(m.tag){case 3:rl(m),Ns();break;case 5:Oa(m);break;case 1:Pn(m.type)&&es(m);break;case 4:xo(m,m.stateNode.containerInfo);break;case 10:si(m,m.type._context,m.memoizedProps.value);break;case 13:var $=m.memoizedState;if($!==null)return $.dehydrated!==null?(mr(tr,tr.current&1),m.flags|=128,null):(I&m.child.childLanes)!==0?pf(p,m,I):(mr(tr,tr.current&1),p=te(p,m,I),p!==null?p.sibling:null);mr(tr,tr.current&1);break;case 19:if($=(I&m.childLanes)!==0,(p.flags&128)!==0){if($)return N(p,m,I);m.flags|=128}var ee=m.memoizedState;if(ee!==null&&(ee.rendering=null,ee.tail=null,ee.lastEffect=null),mr(tr,tr.current),$)break;return null;case 22:case 23:return m.lanes=0,Yr(p,m,I)}return te(p,m,I)}function he(p){p.flags|=4}function ve(p,m){if(p!==null&&p.child===m.child)return!0;if((m.flags&16)!==0)return!1;for(p=m.child;p!==null;){if((p.flags&12854)!==0||(p.subtreeFlags&12854)!==0)return!1;p=p.sibling}return!0}var me,we,Se,Oe;if(ye)me=function(p,m){for(var I=m.child;I!==null;){if(I.tag===5||I.tag===6)j(p,I.stateNode);else if(I.tag!==4&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===m)break;for(;I.sibling===null;){if(I.return===null||I.return===m)return;I=I.return}I.sibling.return=I.return,I=I.sibling}},we=function(){},Se=function(p,m,I,$,ee){if(p=p.memoizedProps,p!==$){var oe=m.stateNode,Ee=Ti(Yi.current);I=Z(oe,I,p,$,ee,Ee),(m.updateQueue=I)&&he(m)}},Oe=function(p,m,I,$){I!==$&&he(m)};else if(Re){me=function(p,m,I,$){for(var ee=m.child;ee!==null;){if(ee.tag===5){var oe=ee.stateNode;I&&$&&(oe=mn(oe,ee.type,ee.memoizedProps,ee)),j(p,oe)}else if(ee.tag===6)oe=ee.stateNode,I&&$&&(oe=Yt(oe,ee.memoizedProps,ee)),j(p,oe);else if(ee.tag!==4){if(ee.tag===22&&ee.memoizedState!==null)oe=ee.child,oe!==null&&(oe.return=ee),me(p,ee,!0,!0);else if(ee.child!==null){ee.child.return=ee,ee=ee.child;continue}}if(ee===m)break;for(;ee.sibling===null;){if(ee.return===null||ee.return===m)return;ee=ee.return}ee.sibling.return=ee.return,ee=ee.sibling}};var De=function(p,m,I,$){for(var ee=m.child;ee!==null;){if(ee.tag===5){var oe=ee.stateNode;I&&$&&(oe=mn(oe,ee.type,ee.memoizedProps,ee)),Oi(p,oe)}else if(ee.tag===6)oe=ee.stateNode,I&&$&&(oe=Yt(oe,ee.memoizedProps,ee)),Oi(p,oe);else if(ee.tag!==4){if(ee.tag===22&&ee.memoizedState!==null)oe=ee.child,oe!==null&&(oe.return=ee),De(p,ee,!0,!0);else if(ee.child!==null){ee.child.return=ee,ee=ee.child;continue}}if(ee===m)break;for(;ee.sibling===null;){if(ee.return===null||ee.return===m)return;ee=ee.return}ee.sibling.return=ee.return,ee=ee.sibling}};we=function(p,m){var I=m.stateNode;if(!ve(p,m)){p=I.containerInfo;var $=lr(p);De($,m,!1,!1),I.pendingChildren=$,he(m),Zn(p,$)}},Se=function(p,m,I,$,ee){var oe=p.stateNode,Ee=p.memoizedProps;if((p=ve(p,m))&&Ee===$)m.stateNode=oe;else{var We=m.stateNode,rt=Ti(Yi.current),yt=null;Ee!==$&&(yt=Z(We,I,Ee,$,ee,rt)),p&&yt===null?m.stateNode=oe:(oe=Xt(oe,yt,I,Ee,$,m,p,We),z(oe,I,$,ee,rt)&&he(m),m.stateNode=oe,p?he(m):me(oe,m,!1,!1))}},Oe=function(p,m,I,$){I!==$?(p=Ti(za.current),I=Ti(Yi.current),m.stateNode=W($,p,I,m),he(m)):m.stateNode=p.stateNode}}else we=function(){},Se=function(){},Oe=function(){};function Ze(p,m){if(!Rt)switch(p.tailMode){case"hidden":m=p.tail;for(var I=null;m!==null;)m.alternate!==null&&(I=m),m=m.sibling;I===null?p.tail=null:I.sibling=null;break;case"collapsed":I=p.tail;for(var $=null;I!==null;)I.alternate!==null&&($=I),I=I.sibling;$===null?m||p.tail===null?p.tail=null:p.tail.sibling=null:$.sibling=null}}function ke(p){var m=p.alternate!==null&&p.alternate.child===p.child,I=0,$=0;if(m)for(var ee=p.child;ee!==null;)I|=ee.lanes|ee.childLanes,$|=ee.subtreeFlags&14680064,$|=ee.flags&14680064,ee.return=p,ee=ee.sibling;else for(ee=p.child;ee!==null;)I|=ee.lanes|ee.childLanes,$|=ee.subtreeFlags,$|=ee.flags,ee.return=p,ee=ee.sibling;return p.subtreeFlags|=$,p.childLanes=I,m}function qe(p,m,I){var $=m.pendingProps;switch(Lt(m),m.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ke(m),null;case 1:return Pn(m.type)&&Vi(),ke(m),null;case 3:return I=m.stateNode,zo(),an(qi),an(Er),Tn(),I.pendingContext&&(I.context=I.pendingContext,I.pendingContext=null),(p===null||p.child===null)&&(bo(m)?he(m):p===null||p.memoizedState.isDehydrated&&(m.flags&256)===0||(m.flags|=1024,Mr!==null&&(Hu(Mr),Mr=null))),we(p,m),ke(m),null;case 5:So(m),I=Ti(za.current);var ee=m.type;if(p!==null&&m.stateNode!=null)Se(p,m,ee,$,I),p.ref!==m.ref&&(m.flags|=512,m.flags|=2097152);else{if(!$){if(m.stateNode===null)throw Error(l(166));return ke(m),null}if(p=Ti(Yi.current),bo(m)){if(!Me)throw Error(l(175));p=Qn(m.stateNode,m.type,m.memoizedProps,I,p,m,!Pr),m.updateQueue=p,p!==null&&he(m)}else{var oe=D(ee,$,I,p,m);me(oe,m,!1,!1),m.stateNode=oe,z(oe,ee,$,I,p)&&he(m)}m.ref!==null&&(m.flags|=512,m.flags|=2097152)}return ke(m),null;case 6:if(p&&m.stateNode!=null)Oe(p,m,p.memoizedProps,$);else{if(typeof $!="string"&&m.stateNode===null)throw Error(l(166));if(p=Ti(za.current),I=Ti(Yi.current),bo(m)){if(!Me)throw Error(l(176));if(p=m.stateNode,I=m.memoizedProps,($=_a(p,I,m,!Pr))&&(ee=Et,ee!==null))switch(ee.tag){case 3:cf(ee.stateNode.containerInfo,p,I,(ee.mode&1)!==0);break;case 5:bn(ee.type,ee.memoizedProps,ee.stateNode,p,I,(ee.mode&1)!==0)}$&&he(m)}else m.stateNode=W($,p,I,m)}return ke(m),null;case 13:if(an(tr),$=m.memoizedState,p===null||p.memoizedState!==null&&p.memoizedState.dehydrated!==null){if(Rt&&Ut!==null&&(m.mode&1)!==0&&(m.flags&128)===0)Cs(),Ns(),m.flags|=98560,ee=!1;else if(ee=bo(m),$!==null&&$.dehydrated!==null){if(p===null){if(!ee)throw Error(l(318));if(!Me)throw Error(l(344));if(ee=m.memoizedState,ee=ee!==null?ee.dehydrated:null,!ee)throw Error(l(317));xa(ee,m)}else Ns(),(m.flags&128)===0&&(m.memoizedState=null),m.flags|=4;ke(m),ee=!1}else Mr!==null&&(Hu(Mr),Mr=null),ee=!0;if(!ee)return m.flags&65536?m:null}return(m.flags&128)!==0?(m.lanes=I,m):(I=$!==null,I!==(p!==null&&p.memoizedState!==null)&&I&&(m.child.flags|=8192,(m.mode&1)!==0&&(p===null||(tr.current&1)!==0?ln===0&&(ln=3):lo())),m.updateQueue!==null&&(m.flags|=4),ke(m),null);case 4:return zo(),we(p,m),p===null&&de(m.stateNode.containerInfo),ke(m),null;case 10:return la(m.type._context),ke(m),null;case 17:return Pn(m.type)&&Vi(),ke(m),null;case 19:if(an(tr),ee=m.memoizedState,ee===null)return ke(m),null;if($=(m.flags&128)!==0,oe=ee.rendering,oe===null)if($)Ze(ee,!1);else{if(ln!==0||p!==null&&(p.flags&128)!==0)for(p=m.child;p!==null;){if(oe=en(p),oe!==null){for(m.flags|=128,Ze(ee,!1),p=oe.updateQueue,p!==null&&(m.updateQueue=p,m.flags|=4),m.subtreeFlags=0,p=I,I=m.child;I!==null;)$=I,ee=p,$.flags&=14680066,oe=$.alternate,oe===null?($.childLanes=0,$.lanes=ee,$.child=null,$.subtreeFlags=0,$.memoizedProps=null,$.memoizedState=null,$.updateQueue=null,$.dependencies=null,$.stateNode=null):($.childLanes=oe.childLanes,$.lanes=oe.lanes,$.child=oe.child,$.subtreeFlags=0,$.deletions=null,$.memoizedProps=oe.memoizedProps,$.memoizedState=oe.memoizedState,$.updateQueue=oe.updateQueue,$.type=oe.type,ee=oe.dependencies,$.dependencies=ee===null?null:{lanes:ee.lanes,firstContext:ee.firstContext}),I=I.sibling;return mr(tr,tr.current&1|2),m.child}p=p.sibling}ee.tail!==null&&pn()>fu&&(m.flags|=128,$=!0,Ze(ee,!1),m.lanes=4194304)}else{if(!$)if(p=en(oe),p!==null){if(m.flags|=128,$=!0,p=p.updateQueue,p!==null&&(m.updateQueue=p,m.flags|=4),Ze(ee,!0),ee.tail===null&&ee.tailMode==="hidden"&&!oe.alternate&&!Rt)return ke(m),null}else 2*pn()-ee.renderingStartTime>fu&&I!==1073741824&&(m.flags|=128,$=!0,Ze(ee,!1),m.lanes=4194304);ee.isBackwards?(oe.sibling=m.child,m.child=oe):(p=ee.last,p!==null?p.sibling=oe:m.child=oe,ee.last=oe)}return ee.tail!==null?(m=ee.tail,ee.rendering=m,ee.tail=m.sibling,ee.renderingStartTime=pn(),m.sibling=null,p=tr.current,mr(tr,$?p&1|2:p&1),m):(ke(m),null);case 22:case 23:return du(),I=m.memoizedState!==null,p!==null&&p.memoizedState!==null!==I&&(m.flags|=8192),I&&(m.mode&1)!==0?(ii&1073741824)!==0&&(ke(m),ye&&m.subtreeFlags&6&&(m.flags|=8192)):ke(m),null;case 24:return null;case 25:return null}throw Error(l(156,m.tag))}function Ke(p,m){switch(Lt(m),m.tag){case 1:return Pn(m.type)&&Vi(),p=m.flags,p&65536?(m.flags=p&-65537|128,m):null;case 3:return zo(),an(qi),an(Er),Tn(),p=m.flags,(p&65536)!==0&&(p&128)===0?(m.flags=p&-65537|128,m):null;case 5:return So(m),null;case 13:if(an(tr),p=m.memoizedState,p!==null&&p.dehydrated!==null){if(m.alternate===null)throw Error(l(340));Ns()}return p=m.flags,p&65536?(m.flags=p&-65537|128,m):null;case 19:return an(tr),null;case 4:return zo(),null;case 10:return la(m.type._context),null;case 22:case 23:return du(),null;case 24:return null;default:return null}}var it=!1,Ye=!1,nt=typeof WeakSet=="function"?WeakSet:Set,Ue=null;function ot(p,m){var I=p.ref;if(I!==null)if(typeof I=="function")try{I(null)}catch($){Bn(p,m,$)}else I.current=null}function ut(p,m,I){try{I()}catch($){Bn(p,m,$)}}var qt=!1;function Mt(p,m){for(Y(p.containerInfo),Ue=m;Ue!==null;)if(p=Ue,m=p.child,(p.subtreeFlags&1028)!==0&&m!==null)m.return=p,Ue=m;else for(;Ue!==null;){p=Ue;try{var I=p.alternate;if((p.flags&1024)!==0)switch(p.tag){case 0:case 11:case 15:break;case 1:if(I!==null){var $=I.memoizedProps,ee=I.memoizedState,oe=p.stateNode,Ee=oe.getSnapshotBeforeUpdate(p.elementType===p.type?$:no(p.type,$),ee);oe.__reactInternalSnapshotBeforeUpdate=Ee}break;case 3:ye&&vr(p.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(We){Bn(p,p.return,We)}if(m=p.sibling,m!==null){m.return=p.return,Ue=m;break}Ue=p.return}return I=qt,qt=!1,I}function ar(p,m,I){var $=m.updateQueue;if($=$!==null?$.lastEffect:null,$!==null){var ee=$=$.next;do{if((ee.tag&p)===p){var oe=ee.destroy;ee.destroy=void 0,oe!==void 0&&ut(m,I,oe)}ee=ee.next}while(ee!==$)}}function It(p,m){if(m=m.updateQueue,m=m!==null?m.lastEffect:null,m!==null){var I=m=m.next;do{if((I.tag&p)===p){var $=I.create;I.destroy=$()}I=I.next}while(I!==m)}}function _r(p){var m=p.ref;if(m!==null){var I=p.stateNode;switch(p.tag){case 5:p=ae(I);break;default:p=I}typeof m=="function"?m(p):m.current=p}}function Rn(p){var m=p.alternate;m!==null&&(p.alternate=null,Rn(m)),p.child=null,p.deletions=null,p.sibling=null,p.tag===5&&(m=p.stateNode,m!==null&&Ae(m)),p.stateNode=null,p.return=null,p.dependencies=null,p.memoizedProps=null,p.memoizedState=null,p.pendingProps=null,p.stateNode=null,p.updateQueue=null}function fr(p){return p.tag===5||p.tag===3||p.tag===4}function Tt(p){e:for(;;){for(;p.sibling===null;){if(p.return===null||fr(p.return))return null;p=p.return}for(p.sibling.return=p.return,p=p.sibling;p.tag!==5&&p.tag!==6&&p.tag!==18;){if(p.flags&2||p.child===null||p.tag===4)continue e;p.child.return=p,p=p.child}if(!(p.flags&2))return p.stateNode}}function _t(p,m,I){var $=p.tag;if($===5||$===6)p=p.stateNode,m?Pt(I,p,m):bt(I,p);else if($!==4&&(p=p.child,p!==null))for(_t(p,m,I),p=p.sibling;p!==null;)_t(p,m,I),p=p.sibling}function Mn(p,m,I){var $=p.tag;if($===5||$===6)p=p.stateNode,m?cr(I,p,m):ct(I,p);else if($!==4&&(p=p.child,p!==null))for(Mn(p,m,I),p=p.sibling;p!==null;)Mn(p,m,I),p=p.sibling}var Dt=null,or=!1;function kr(p,m,I){for(I=I.child;I!==null;)fi(p,m,I),I=I.sibling}function fi(p,m,I){if(mi&&typeof mi.onCommitFiberUnmount=="function")try{mi.onCommitFiberUnmount(ja,I)}catch{}switch(I.tag){case 5:Ye||ot(I,m);case 6:if(ye){var $=Dt,ee=or;Dt=null,kr(p,m,I),Dt=$,or=ee,Dt!==null&&(or?$e(Dt,I.stateNode):$t(Dt,I.stateNode))}else kr(p,m,I);break;case 18:ye&&Dt!==null&&(or?Ko(Dt,I.stateNode):Ps(Dt,I.stateNode));break;case 4:ye?($=Dt,ee=or,Dt=I.stateNode.containerInfo,or=!0,kr(p,m,I),Dt=$,or=ee):(Re&&($=I.stateNode.containerInfo,ee=lr($),vi($,ee)),kr(p,m,I));break;case 0:case 11:case 14:case 15:if(!Ye&&($=I.updateQueue,$!==null&&($=$.lastEffect,$!==null))){ee=$=$.next;do{var oe=ee,Ee=oe.destroy;oe=oe.tag,Ee!==void 0&&((oe&2)!==0||(oe&4)!==0)&&ut(I,m,Ee),ee=ee.next}while(ee!==$)}kr(p,m,I);break;case 1:if(!Ye&&(ot(I,m),$=I.stateNode,typeof $.componentWillUnmount=="function"))try{$.props=I.memoizedProps,$.state=I.memoizedState,$.componentWillUnmount()}catch(We){Bn(I,m,We)}kr(p,m,I);break;case 21:kr(p,m,I);break;case 22:I.mode&1?(Ye=($=Ye)||I.memoizedState!==null,kr(p,m,I),Ye=$):kr(p,m,I);break;default:kr(p,m,I)}}function ni(p){var m=p.updateQueue;if(m!==null){p.updateQueue=null;var I=p.stateNode;I===null&&(I=p.stateNode=new nt),m.forEach(function($){var ee=L0.bind(null,p,$);I.has($)||(I.add($),$.then(ee,ee))})}}function Ir(p,m){var I=m.deletions;if(I!==null)for(var $=0;$<I.length;$++){var ee=I[$];try{var oe=p,Ee=m;if(ye){var We=Ee;e:for(;We!==null;){switch(We.tag){case 5:Dt=We.stateNode,or=!1;break e;case 3:Dt=We.stateNode.containerInfo,or=!0;break e;case 4:Dt=We.stateNode.containerInfo,or=!0;break e}We=We.return}if(Dt===null)throw Error(l(160));fi(oe,Ee,ee),Dt=null,or=!1}else fi(oe,Ee,ee);var rt=ee.alternate;rt!==null&&(rt.return=null),ee.return=null}catch(yt){Bn(ee,m,yt)}}if(m.subtreeFlags&12854)for(m=m.child;m!==null;)hi(m,p),m=m.sibling}function hi(p,m){var I=p.alternate,$=p.flags;switch(p.tag){case 0:case 11:case 14:case 15:if(Ir(m,p),hn(p),$&4){try{ar(3,p,p.return),It(3,p)}catch(Ot){Bn(p,p.return,Ot)}try{ar(5,p,p.return)}catch(Ot){Bn(p,p.return,Ot)}}break;case 1:Ir(m,p),hn(p),$&512&&I!==null&&ot(I,I.return);break;case 5:if(Ir(m,p),hn(p),$&512&&I!==null&&ot(I,I.return),ye){if(p.flags&32){var ee=p.stateNode;try{ze(ee)}catch(Ot){Bn(p,p.return,Ot)}}if($&4&&(ee=p.stateNode,ee!=null)){var oe=p.memoizedProps;if(I=I!==null?I.memoizedProps:oe,$=p.type,m=p.updateQueue,p.updateQueue=null,m!==null)try{wr(ee,m,$,I,oe,p)}catch(Ot){Bn(p,p.return,Ot)}}}break;case 6:if(Ir(m,p),hn(p),$&4&&ye){if(p.stateNode===null)throw Error(l(162));ee=p.stateNode,oe=p.memoizedProps,I=I!==null?I.memoizedProps:oe;try{ht(ee,I,oe)}catch(Ot){Bn(p,p.return,Ot)}}break;case 3:if(Ir(m,p),hn(p),$&4){if(ye&&Me&&I!==null&&I.memoizedState.isDehydrated)try{Ci(m.containerInfo)}catch(Ot){Bn(p,p.return,Ot)}if(Re){ee=m.containerInfo,oe=m.pendingChildren;try{vi(ee,oe)}catch(Ot){Bn(p,p.return,Ot)}}}break;case 4:if(Ir(m,p),hn(p),$&4&&Re){oe=p.stateNode,ee=oe.containerInfo,oe=oe.pendingChildren;try{vi(ee,oe)}catch(Ot){Bn(p,p.return,Ot)}}break;case 13:Ir(m,p),hn(p),ee=p.child,ee.flags&8192&&(oe=ee.memoizedState!==null,ee.stateNode.isHidden=oe,!oe||ee.alternate!==null&&ee.alternate.memoizedState!==null||(cu=pn())),$&4&&ni(p);break;case 22:var Ee=I!==null&&I.memoizedState!==null;if(p.mode&1?(Ye=(I=Ye)||Ee,Ir(m,p),Ye=I):Ir(m,p),hn(p),$&8192){if(I=p.memoizedState!==null,(p.stateNode.isHidden=I)&&!Ee&&(p.mode&1)!==0)for(Ue=p,$=p.child;$!==null;){for(m=Ue=$;Ue!==null;){Ee=Ue;var We=Ee.child;switch(Ee.tag){case 0:case 11:case 14:case 15:ar(4,Ee,Ee.return);break;case 1:ot(Ee,Ee.return);var rt=Ee.stateNode;if(typeof rt.componentWillUnmount=="function"){var yt=Ee,Bt=Ee.return;try{var pr=yt;rt.props=pr.memoizedProps,rt.state=pr.memoizedState,rt.componentWillUnmount()}catch(Ot){Bn(yt,Bt,Ot)}}break;case 5:ot(Ee,Ee.return);break;case 22:if(Ee.memoizedState!==null){wn(m);continue}}We!==null?(We.return=Ee,Ue=We):wn(m)}$=$.sibling}if(ye){e:if($=null,ye)for(m=p;;){if(m.tag===5){if($===null){$=m;try{ee=m.stateNode,I?kt(ee):er(m.stateNode,m.memoizedProps)}catch(Ot){Bn(p,p.return,Ot)}}}else if(m.tag===6){if($===null)try{oe=m.stateNode,I?St(oe):jt(oe,m.memoizedProps)}catch(Ot){Bn(p,p.return,Ot)}}else if((m.tag!==22&&m.tag!==23||m.memoizedState===null||m===p)&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===p)break e;for(;m.sibling===null;){if(m.return===null||m.return===p)break e;$===m&&($=null),m=m.return}$===m&&($=null),m.sibling.return=m.return,m=m.sibling}}}break;case 19:Ir(m,p),hn(p),$&4&&ni(p);break;case 21:break;default:Ir(m,p),hn(p)}}function hn(p){var m=p.flags;if(m&2){try{if(ye){e:{for(var I=p.return;I!==null;){if(fr(I)){var $=I;break e}I=I.return}throw Error(l(160))}switch($.tag){case 5:var ee=$.stateNode;$.flags&32&&(ze(ee),$.flags&=-33);var oe=Tt(p);Mn(p,oe,ee);break;case 3:case 4:var Ee=$.stateNode.containerInfo,We=Tt(p);_t(p,We,Ee);break;default:throw Error(l(161))}}}catch(rt){Bn(p,p.return,rt)}p.flags&=-3}m&4096&&(p.flags&=-4097)}function On(p,m,I){Ue=p,Sr(p)}function Sr(p,m,I){for(var $=(p.mode&1)!==0;Ue!==null;){var ee=Ue,oe=ee.child;if(ee.tag===22&&$){var Ee=ee.memoizedState!==null||it;if(!Ee){var We=ee.alternate,rt=We!==null&&We.memoizedState!==null||Ye;We=it;var yt=Ye;if(it=Ee,(Ye=rt)&&!yt)for(Ue=ee;Ue!==null;)Ee=Ue,rt=Ee.child,Ee.tag===22&&Ee.memoizedState!==null?Br(ee):rt!==null?(rt.return=Ee,Ue=rt):Br(ee);for(;oe!==null;)Ue=oe,Sr(oe),oe=oe.sibling;Ue=ee,it=We,Ye=yt}Dr(p)}else(ee.subtreeFlags&8772)!==0&&oe!==null?(oe.return=ee,Ue=oe):Dr(p)}}function Dr(p){for(;Ue!==null;){var m=Ue;if((m.flags&8772)!==0){var I=m.alternate;try{if((m.flags&8772)!==0)switch(m.tag){case 0:case 11:case 15:Ye||It(5,m);break;case 1:var $=m.stateNode;if(m.flags&4&&!Ye)if(I===null)$.componentDidMount();else{var ee=m.elementType===m.type?I.memoizedProps:no(m.type,I.memoizedProps);$.componentDidUpdate(ee,I.memoizedState,$.__reactInternalSnapshotBeforeUpdate)}var oe=m.updateQueue;oe!==null&&ml(m,oe,$);break;case 3:var Ee=m.updateQueue;if(Ee!==null){if(I=null,m.child!==null)switch(m.child.tag){case 5:I=ae(m.child.stateNode);break;case 1:I=m.child.stateNode}ml(m,Ee,I)}break;case 5:var We=m.stateNode;I===null&&m.flags&4&&vt(We,m.type,m.memoizedProps,m);break;case 6:break;case 4:break;case 12:break;case 13:if(Me&&m.memoizedState===null){var rt=m.alternate;if(rt!==null){var yt=rt.memoizedState;if(yt!==null){var Bt=yt.dehydrated;Bt!==null&&Xa(Bt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(l(163))}Ye||m.flags&512&&_r(m)}catch(pr){Bn(m,m.return,pr)}}if(m===p){Ue=null;break}if(I=m.sibling,I!==null){I.return=m.return,Ue=I;break}Ue=m.return}}function wn(p){for(;Ue!==null;){var m=Ue;if(m===p){Ue=null;break}var I=m.sibling;if(I!==null){I.return=m.return,Ue=I;break}Ue=m.return}}function Br(p){for(;Ue!==null;){var m=Ue;try{switch(m.tag){case 0:case 11:case 15:var I=m.return;try{It(4,m)}catch(rt){Bn(m,I,rt)}break;case 1:var $=m.stateNode;if(typeof $.componentDidMount=="function"){var ee=m.return;try{$.componentDidMount()}catch(rt){Bn(m,ee,rt)}}var oe=m.return;try{_r(m)}catch(rt){Bn(m,oe,rt)}break;case 5:var Ee=m.return;try{_r(m)}catch(rt){Bn(m,Ee,rt)}}}catch(rt){Bn(m,m.return,rt)}if(m===p){Ue=null;break}var We=m.sibling;if(We!==null){We.return=m.return,Ue=We;break}Ue=m.return}}var _n=0,xn=1,Xr=2,Si=3,Vr=4;if(typeof Symbol=="function"&&Symbol.for){var Gr=Symbol.for;_n=Gr("selector.component"),xn=Gr("selector.has_pseudo_class"),Xr=Gr("selector.role"),Si=Gr("selector.test_id"),Vr=Gr("selector.text")}function $n(p){var m=Pe(p);if(m!=null){if(typeof m.memoizedProps["data-testname"]!="string")throw Error(l(364));return m}if(p=Le(p),p===null)throw Error(l(362));return p.stateNode.current}function Ei(p,m){switch(m.$$typeof){case _n:if(p.type===m.value)return!0;break;case xn:e:{m=m.value,p=[p,0];for(var I=0;I<p.length;){var $=p[I++],ee=p[I++],oe=m[ee];if($.tag!==5||!je($)){for(;oe!=null&&Ei($,oe);)ee++,oe=m[ee];if(ee===m.length){m=!0;break e}else for($=$.child;$!==null;)p.push($,ee),$=$.sibling}}m=!1}return m;case Xr:if(p.tag===5&&He(p.stateNode,m.value))return!0;break;case Vr:if((p.tag===5||p.tag===6)&&(p=Ce(p),p!==null&&0<=p.indexOf(m.value)))return!0;break;case Si:if(p.tag===5&&(p=p.memoizedProps["data-testname"],typeof p=="string"&&p.toLowerCase()===m.value.toLowerCase()))return!0;break;default:throw Error(l(365))}return!1}function pa(p){switch(p.$$typeof){case _n:return"<"+(O(p.value)||"Unknown")+">";case xn:return":has("+(pa(p)||"")+")";case Xr:return'[role="'+p.value+'"]';case Vr:return'"'+p.value+'"';case Si:return'[data-testname="'+p.value+'"]';default:throw Error(l(365))}}function Wn(p,m){var I=[];p=[p,0];for(var $=0;$<p.length;){var ee=p[$++],oe=p[$++],Ee=m[oe];if(ee.tag!==5||!je(ee)){for(;Ee!=null&&Ei(ee,Ee);)oe++,Ee=m[oe];if(oe===m.length)I.push(ee);else for(ee=ee.child;ee!==null;)p.push(ee,oe),ee=ee.sibling}}return I}function In(p,m){if(!xe)throw Error(l(363));p=$n(p),p=Wn(p,m),m=[],p=Array.from(p);for(var I=0;I<p.length;){var $=p[I++];if($.tag===5)je($)||m.push($.stateNode);else for($=$.child;$!==null;)p.push($),$=$.sibling}return m}var ga=Math.ceil,Kr=o.ReactCurrentDispatcher,Ii=o.ReactCurrentOwner,zr=o.ReactCurrentBatchConfig,rr=0,Or=null,yr=null,Cn=0,ii=0,Vo=oi(0),ln=0,uu=null,Is=0,un=0,io=0,Ol=null,va=null,cu=0,fu=1/0,Fi=null;function rn(){fu=pn()+500}var Fn=!1,jn=null,ao=null,ko=!1,oo=null,Ac=0,Dn=0,hu=null,nl=-1,so=0;function gn(){return(rr&6)!==0?pn():nl!==-1?nl:nl=pn()}function di(p){return(p.mode&1)===0?1:(rr&2)!==0&&Cn!==0?Cn&-Cn:pl.transition!==null?(so===0&&(so=ns()),so):(p=xt,p!==0?p:Te())}function ma(p,m,I,$){if(50<Dn)throw Dn=0,hu=null,Error(l(185));Ma(p,I,$),((rr&2)===0||p!==Or)&&(p===Or&&((rr&2)===0&&(un|=I),ln===4&&fs(p,Cn)),Ji(p,$),I===1&&rr===0&&(m.mode&1)===0&&(rn(),mo&&Jn()))}function Ji(p,m){var I=p.callbackNode;hc(p,m);var $=Ys(p,p===Or?Cn:0);if($===0)I!==null&&dc(I),p.callbackNode=null,p.callbackPriority=0;else if(m=$&-$,p.callbackPriority!==m){if(I!=null&&dc(I),m===1)p.tag===0?dl(gf.bind(null,p)):Zs(gf.bind(null,p)),be?_e(function(){(rr&6)===0&&Jn()}):vo(Wl,Jn),I=null;else{switch(Ks($)){case 1:I=Wl;break;case 4:I=Yl;break;case 16:I=ks;break;case 536870912:I=Mu;break;default:I=ks}I=Gh(I,Fs.bind(null,p))}p.callbackPriority=m,p.callbackNode=I}}function Fs(p,m){if(nl=-1,so=0,(rr&6)!==0)throw Error(l(327));var I=p.callbackNode;if(Nl()&&p.callbackNode!==I)return null;var $=Ys(p,p===Or?Cn:0);if($===0)return null;if(($&30)!==0||($&p.expiredLanes)!==0||m)m=ds(p,$);else{m=$;var ee=rr;rr|=2;var oe=hs();(Or!==p||Cn!==m)&&(Fi=null,rn(),Go(p,m));do try{Oc();break}catch(We){qa(p,We)}while(!0);Zl(),Kr.current=oe,rr=ee,yr!==null?m=0:(Or=null,Cn=0,m=ln)}if(m!==0){if(m===2&&(ee=Xs(p),ee!==0&&($=ee,m=Pc(p,ee))),m===1)throw I=uu,Go(p,0),fs(p,$),Ji(p,pn()),I;if(m===6)fs(p,$);else{if(ee=p.current.alternate,($&30)===0&&!rh(ee)&&(m=ds(p,$),m===2&&(oe=Xs(p),oe!==0&&($=oe,m=Pc(p,oe))),m===1))throw I=uu,Go(p,0),fs(p,$),Ji(p,pn()),I;switch(p.finishedWork=ee,p.finishedLanes=$,m){case 0:case 1:throw Error(l(345));case 2:ps(p,va,Fi);break;case 3:if(fs(p,$),($&130023424)===$&&(m=cu+500-pn(),10<m)){if(Ys(p,0)!==0)break;if(ee=p.suspendedLanes,(ee&$)!==$){gn(),p.pingedLanes|=p.suspendedLanes&ee;break}p.timeoutHandle=Q(ps.bind(null,p,va,Fi),m);break}ps(p,va,Fi);break;case 4:if(fs(p,$),($&4194240)===$)break;for(m=p.eventTimes,ee=-1;0<$;){var Ee=31-Ea($);oe=1<<Ee,Ee=m[Ee],Ee>ee&&(ee=Ee),$&=~oe}if($=ee,$=pn()-$,$=(120>$?120:480>$?480:1080>$?1080:1920>$?1920:3e3>$?3e3:4320>$?4320:1960*ga($/1960))-$,10<$){p.timeoutHandle=Q(ps.bind(null,p,va,Fi),$);break}ps(p,va,Fi);break;case 5:ps(p,va,Fi);break;default:throw Error(l(329))}}}return Ji(p,pn()),p.callbackNode===I?Fs.bind(null,p):null}function Pc(p,m){var I=Ol;return p.current.memoizedState.isDehydrated&&(Go(p,m).flags|=256),p=ds(p,m),p!==2&&(m=va,va=I,m!==null&&Hu(m)),p}function Hu(p){va===null?va=p:va.push.apply(va,p)}function rh(p){for(var m=p;;){if(m.flags&16384){var I=m.updateQueue;if(I!==null&&(I=I.stores,I!==null))for(var $=0;$<I.length;$++){var ee=I[$],oe=ee.getSnapshot;ee=ee.value;try{if(!Aa(oe(),ee))return!1}catch{return!1}}}if(I=m.child,m.subtreeFlags&16384&&I!==null)I.return=m,m=I;else{if(m===p)break;for(;m.sibling===null;){if(m.return===null||m.return===p)return!0;m=m.return}m.sibling.return=m.return,m=m.sibling}}return!0}function fs(p,m){for(m&=~io,m&=~un,p.suspendedLanes|=m,p.pingedLanes&=~m,p=p.expirationTimes;0<m;){var I=31-Ea(m),$=1<<I;p[I]=-1,m&=~$}}function gf(p){if((rr&6)!==0)throw Error(l(327));Nl();var m=Ys(p,0);if((m&1)===0)return Ji(p,pn()),null;var I=ds(p,m);if(p.tag!==0&&I===2){var $=Xs(p);$!==0&&(m=$,I=Pc(p,$))}if(I===1)throw I=uu,Go(p,0),fs(p,m),Ji(p,pn()),I;if(I===6)throw Error(l(345));return p.finishedWork=p.current.alternate,p.finishedLanes=m,ps(p,va,Fi),Ji(p,pn()),null}function Cl(p){oo!==null&&oo.tag===0&&(rr&6)===0&&Nl();var m=rr;rr|=1;var I=zr.transition,$=xt;try{if(zr.transition=null,xt=1,p)return p()}finally{xt=$,zr.transition=I,rr=m,(rr&6)===0&&Jn()}}function du(){ii=Vo.current,an(Vo)}function Go(p,m){p.finishedWork=null,p.finishedLanes=0;var I=p.timeoutHandle;if(I!==ue&&(p.timeoutHandle=ue,se(I)),yr!==null)for(I=yr.return;I!==null;){var $=I;switch(Lt($),$.tag){case 1:$=$.type.childContextTypes,$!=null&&Vi();break;case 3:zo(),an(qi),an(Er),Tn();break;case 5:So($);break;case 4:zo();break;case 13:an(tr);break;case 19:an(tr);break;case 10:la($.type._context);break;case 22:case 23:du()}I=I.return}if(Or=p,yr=p=pu(p.current,null),Cn=ii=m,ln=0,uu=null,io=un=Is=0,va=Ol=null,to!==null){for(m=0;m<to.length;m++)if(I=to[m],$=I.interleaved,$!==null){I.interleaved=null;var ee=$.next,oe=I.pending;if(oe!==null){var Ee=oe.next;oe.next=ee,$.next=Ee}I.pending=$}to=null}return p}function qa(p,m){do{var I=yr;try{if(Zl(),Gn.current=Rs,yl){for(var $=on.memoizedState;$!==null;){var ee=$.queue;ee!==null&&(ee.pending=null),$=$.next}yl=!1}if(Xi=0,ui=ri=on=null,Jl=!1,eu=0,Ii.current=null,I===null||I.return===null){ln=1,uu=m,yr=null;break}e:{var oe=p,Ee=I.return,We=I,rt=m;if(m=Cn,We.flags|=32768,rt!==null&&typeof rt=="object"&&typeof rt.then=="function"){var yt=rt,Bt=We,pr=Bt.tag;if((Bt.mode&1)===0&&(pr===0||pr===11||pr===15)){var Ot=Bt.alternate;Ot?(Bt.updateQueue=Ot.updateQueue,Bt.memoizedState=Ot.memoizedState,Bt.lanes=Ot.lanes):(Bt.updateQueue=null,Bt.memoizedState=null)}var Nn=eh(Ee);if(Nn!==null){Nn.flags&=-257,Ms(Nn,Ee,We,oe,m),Nn.mode&1&&Jf(oe,yt,m),m=Nn,rt=yt;var dn=m.updateQueue;if(dn===null){var uo=new Set;uo.add(rt),m.updateQueue=uo}else dn.add(rt);break e}else{if((m&1)===0){Jf(oe,yt,m),lo();break e}rt=Error(l(426))}}else if(Rt&&We.mode&1){var il=eh(Ee);if(il!==null){(il.flags&65536)===0&&(il.flags|=256),Ms(il,Ee,We,oe,m),Kl(Zi(rt,We));break e}}oe=rt=Zi(rt,We),ln!==4&&(ln=2),Ol===null?Ol=[oe]:Ol.push(oe),oe=Ee;do{switch(oe.tag){case 3:oe.flags|=65536,m&=-m,oe.lanes|=m;var et=Qi(oe,rt,m);ka(oe,et);break e;case 1:We=rt;var Xe=oe.type,at=oe.stateNode;if((oe.flags&128)===0&&(typeof Xe.getDerivedStateFromError=="function"||at!==null&&typeof at.componentDidCatch=="function"&&(ao===null||!ao.has(at)))){oe.flags|=65536,m&=-m,oe.lanes|=m;var Ct=Ca(oe,We,m);ka(oe,Ct);break e}}oe=oe.return}while(oe!==null)}Vu(I)}catch(Qt){m=Qt,yr===I&&I!==null&&(yr=I=I.return);continue}break}while(!0)}function hs(){var p=Kr.current;return Kr.current=Rs,p===null?Rs:p}function lo(){(ln===0||ln===3||ln===2)&&(ln=4),Or===null||(Is&268435455)===0&&(un&268435455)===0||fs(Or,Cn)}function ds(p,m){var I=rr;rr|=2;var $=hs();(Or!==p||Cn!==m)&&(Fi=null,Go(p,m));do try{kc();break}catch(ee){qa(p,ee)}while(!0);if(Zl(),rr=I,Kr.current=$,yr!==null)throw Error(l(261));return Or=null,Cn=0,ln}function kc(){for(;yr!==null;)vf(yr)}function Oc(){for(;yr!==null&&!pc();)vf(yr)}function vf(p){var m=Rp(p.alternate,p,ii);p.memoizedProps=p.pendingProps,m===null?Vu(p):yr=m,Ii.current=null}function Vu(p){var m=p;do{var I=m.alternate;if(p=m.return,(m.flags&32768)===0){if(I=qe(I,m,ii),I!==null){yr=I;return}}else{if(I=Ke(I,m),I!==null){I.flags&=32767,yr=I;return}if(p!==null)p.flags|=32768,p.subtreeFlags=0,p.deletions=null;else{ln=6,yr=null;return}}if(m=m.sibling,m!==null){yr=m;return}yr=m=p}while(m!==null);ln===0&&(ln=5)}function ps(p,m,I){var $=xt,ee=zr.transition;try{zr.transition=null,xt=1,Cp(p,m,I,$)}finally{zr.transition=ee,xt=$}return null}function Cp(p,m,I,$){do Nl();while(oo!==null);if((rr&6)!==0)throw Error(l(327));I=p.finishedWork;var ee=p.finishedLanes;if(I===null)return null;if(p.finishedWork=null,p.finishedLanes=0,I===p.current)throw Error(l(177));p.callbackNode=null,p.callbackPriority=0;var oe=I.lanes|I.childLanes;if(Ia(p,oe),p===Or&&(yr=Or=null,Cn=0),(I.subtreeFlags&2064)===0&&(I.flags&2064)===0||ko||(ko=!0,Gh(ks,function(){return Nl(),null})),oe=(I.flags&15990)!==0,(I.subtreeFlags&15990)!==0||oe){oe=zr.transition,zr.transition=null;var Ee=xt;xt=1;var We=rr;rr|=4,Ii.current=null,Mt(p,I),hi(I,p),U(p.containerInfo),p.current=I,On(I),Qa(),rr=We,xt=Ee,zr.transition=oe}else p.current=I;if(ko&&(ko=!1,oo=p,Ac=ee),oe=p.pendingLanes,oe===0&&(ao=null),Fo(I.stateNode),Ji(p,pn()),m!==null)for($=p.onRecoverableError,I=0;I<m.length;I++)ee=m[I],$(ee.value,{componentStack:ee.stack,digest:ee.digest});if(Fn)throw Fn=!1,p=jn,jn=null,p;return(Ac&1)!==0&&p.tag!==0&&Nl(),oe=p.pendingLanes,(oe&1)!==0?p===hu?Dn++:(Dn=0,hu=p):Dn=0,Jn(),null}function Nl(){if(oo!==null){var p=Ks(Ac),m=zr.transition,I=xt;try{if(zr.transition=null,xt=16>p?16:p,oo===null)var $=!1;else{if(p=oo,oo=null,Ac=0,(rr&6)!==0)throw Error(l(331));var ee=rr;for(rr|=4,Ue=p.current;Ue!==null;){var oe=Ue,Ee=oe.child;if((Ue.flags&16)!==0){var We=oe.deletions;if(We!==null){for(var rt=0;rt<We.length;rt++){var yt=We[rt];for(Ue=yt;Ue!==null;){var Bt=Ue;switch(Bt.tag){case 0:case 11:case 15:ar(8,Bt,oe)}var pr=Bt.child;if(pr!==null)pr.return=Bt,Ue=pr;else for(;Ue!==null;){Bt=Ue;var Ot=Bt.sibling,Nn=Bt.return;if(Rn(Bt),Bt===yt){Ue=null;break}if(Ot!==null){Ot.return=Nn,Ue=Ot;break}Ue=Nn}}}var dn=oe.alternate;if(dn!==null){var uo=dn.child;if(uo!==null){dn.child=null;do{var il=uo.sibling;uo.sibling=null,uo=il}while(uo!==null)}}Ue=oe}}if((oe.subtreeFlags&2064)!==0&&Ee!==null)Ee.return=oe,Ue=Ee;else e:for(;Ue!==null;){if(oe=Ue,(oe.flags&2048)!==0)switch(oe.tag){case 0:case 11:case 15:ar(9,oe,oe.return)}var et=oe.sibling;if(et!==null){et.return=oe.return,Ue=et;break e}Ue=oe.return}}var Xe=p.current;for(Ue=Xe;Ue!==null;){Ee=Ue;var at=Ee.child;if((Ee.subtreeFlags&2064)!==0&&at!==null)at.return=Ee,Ue=at;else e:for(Ee=Xe;Ue!==null;){if(We=Ue,(We.flags&2048)!==0)try{switch(We.tag){case 0:case 11:case 15:It(9,We)}}catch(Qt){Bn(We,We.return,Qt)}if(We===Ee){Ue=null;break e}var Ct=We.sibling;if(Ct!==null){Ct.return=We.return,Ue=Ct;break e}Ue=We.return}}if(rr=ee,Jn(),mi&&typeof mi.onPostCommitFiberRoot=="function")try{mi.onPostCommitFiberRoot(ja,p)}catch{}$=!0}return $}finally{xt=I,zr.transition=m}}return!1}function Vh(p,m,I){m=Zi(I,m),m=Qi(p,m,1),p=Jr(p,m,1),m=gn(),p!==null&&(Ma(p,1,m),Ji(p,m))}function Bn(p,m,I){if(p.tag===3)Vh(p,p,I);else for(;m!==null;){if(m.tag===3){Vh(m,p,I);break}else if(m.tag===1){var $=m.stateNode;if(typeof m.type.getDerivedStateFromError=="function"||typeof $.componentDidCatch=="function"&&(ao===null||!ao.has($))){p=Zi(I,p),p=Ca(m,p,1),m=Jr(m,p,1),p=gn(),m!==null&&(Ma(m,1,p),Ji(m,p));break}}m=m.return}}function Np(p,m,I){var $=p.pingCache;$!==null&&$.delete(m),m=gn(),p.pingedLanes|=p.suspendedLanes&I,Or===p&&(Cn&I)===I&&(ln===4||ln===3&&(Cn&130023424)===Cn&&500>pn()-cu?Go(p,0):io|=I),Ji(p,m)}function Lp(p,m){m===0&&((p.mode&1)===0?m=1:(m=go,go<<=1,(go&130023424)===0&&(go=4194304)));var I=gn();p=$i(p,m),p!==null&&(Ma(p,m,I),Ji(p,I))}function Tp(p){var m=p.memoizedState,I=0;m!==null&&(I=m.retryLane),Lp(p,I)}function L0(p,m){var I=0;switch(p.tag){case 13:var $=p.stateNode,ee=p.memoizedState;ee!==null&&(I=ee.retryLane);break;case 19:$=p.stateNode;break;default:throw Error(l(314))}$!==null&&$.delete(m),Lp(p,I)}var Rp;Rp=function(p,m,I){if(p!==null)if(p.memoizedProps!==m.pendingProps||qi.current)ci=!0;else{if((p.lanes&I)===0&&(m.flags&128)===0)return ci=!1,ie(p,m,I);ci=(p.flags&131072)!==0}else ci=!1,Rt&&(m.flags&1048576)!==0&&lt(m,yi,m.index);switch(m.lanes=0,m.tag){case 2:var $=m.type;B(p,m),p=m.pendingProps;var ee=Hi(m,Er.current);as(m,I),ee=tu(null,m,$,p,ee,I);var oe=Fu();return m.flags|=1,typeof ee=="object"&&ee!==null&&typeof ee.render=="function"&&ee.$$typeof===void 0?(m.tag=1,m.memoizedState=null,m.updateQueue=null,Pn($)?(oe=!0,es(m)):oe=!1,m.memoizedState=ee.state!==null&&ee.state!==void 0?ee.state:null,os(m),ee.updater=Uu,m.stateNode=ee,ee._reactInternals=m,Ki(m,$,p,I),m=ha(null,m,$,!0,oe,I)):(m.tag=0,Rt&&oe&&ft(m),xi(null,m,ee,I),m=m.child),m;case 16:$=m.elementType;e:{switch(B(p,m),p=m.pendingProps,ee=$._init,$=ee($._payload),m.type=$,ee=m.tag=T0($),p=no($,p),ee){case 0:m=ls(null,m,$,p,I);break e;case 1:m=Mi(null,m,$,p,I);break e;case 11:m=Ec(null,m,$,p,I);break e;case 14:m=ss(null,m,$,no($.type,p),I);break e}throw Error(l(306,$,""))}return m;case 0:return $=m.type,ee=m.pendingProps,ee=m.elementType===$?ee:no($,ee),ls(p,m,$,ee,I);case 1:return $=m.type,ee=m.pendingProps,ee=m.elementType===$?ee:no($,ee),Mi(p,m,$,ee,I);case 3:e:{if(rl(m),p===null)throw Error(l(387));$=m.pendingProps,oe=m.memoizedState,ee=oe.element,Ql(p,m),Wi(m,$,null,I);var Ee=m.memoizedState;if($=Ee.element,Me&&oe.isDehydrated)if(oe={element:$,isDehydrated:!1,cache:Ee.cache,pendingSuspenseBoundaries:Ee.pendingSuspenseBoundaries,transitions:Ee.transitions},m.updateQueue.baseState=oe,m.memoizedState=oe,m.flags&256){ee=Zi(Error(l(423)),m),m=Pl(p,m,$,I,ee);break e}else if($!==ee){ee=Zi(Error(l(424)),m),m=Pl(p,m,$,I,ee);break e}else for(Me&&(Ut=wa(m.stateNode.containerInfo),Et=m,Rt=!0,Mr=null,Pr=!1),I=gl(m,null,$,I),m.child=I;I;)I.flags=I.flags&-3|4096,I=I.sibling;else{if(Ns(),$===ee){m=te(p,m,I);break e}xi(p,m,$,I)}m=m.child}return m;case 5:return Oa(m),p===null&&Hn(m),$=m.type,ee=m.pendingProps,oe=p!==null?p.memoizedProps:null,Ee=ee.children,re($,ee)?Ee=null:oe!==null&&re($,oe)&&(m.flags|=32),tn(p,m),xi(p,m,Ee,I),m.child;case 6:return p===null&&Hn(m),null;case 13:return pf(p,m,I);case 4:return xo(m,m.stateNode.containerInfo),$=m.pendingProps,p===null?m.child=Pa(m,null,$,I):xi(p,m,$,I),m.child;case 11:return $=m.type,ee=m.pendingProps,ee=m.elementType===$?ee:no($,ee),Ec(p,m,$,ee,I);case 7:return xi(p,m,m.pendingProps,I),m.child;case 8:return xi(p,m,m.pendingProps.children,I),m.child;case 12:return xi(p,m,m.pendingProps.children,I),m.child;case 10:e:{if($=m.type._context,ee=m.pendingProps,oe=m.memoizedProps,Ee=ee.value,si(m,$,Ee),oe!==null)if(Aa(oe.value,Ee)){if(oe.children===ee.children&&!qi.current){m=te(p,m,I);break e}}else for(oe=m.child,oe!==null&&(oe.return=m);oe!==null;){var We=oe.dependencies;if(We!==null){Ee=oe.child;for(var rt=We.firstContext;rt!==null;){if(rt.context===$){if(oe.tag===1){rt=ca(-1,I&-I),rt.tag=2;var yt=oe.updateQueue;if(yt!==null){yt=yt.shared;var Bt=yt.pending;Bt===null?rt.next=rt:(rt.next=Bt.next,Bt.next=rt),yt.pending=rt}}oe.lanes|=I,rt=oe.alternate,rt!==null&&(rt.lanes|=I),Do(oe.return,I,m),We.lanes|=I;break}rt=rt.next}}else if(oe.tag===10)Ee=oe.type===m.type?null:oe.child;else if(oe.tag===18){if(Ee=oe.return,Ee===null)throw Error(l(341));Ee.lanes|=I,We=Ee.alternate,We!==null&&(We.lanes|=I),Do(Ee,I,m),Ee=oe.sibling}else Ee=oe.child;if(Ee!==null)Ee.return=oe;else for(Ee=oe;Ee!==null;){if(Ee===m){Ee=null;break}if(oe=Ee.sibling,oe!==null){oe.return=Ee.return,Ee=oe;break}Ee=Ee.return}oe=Ee}xi(p,m,ee.children,I),m=m.child}return m;case 9:return ee=m.type,$=m.pendingProps.children,as(m,I),ee=li(ee),$=$(ee),m.flags|=1,xi(p,m,$,I),m.child;case 14:return $=m.type,ee=no($,m.pendingProps),ee=no($.type,ee),ss(p,m,$,ee,I);case 15:return Po(p,m,m.type,m.pendingProps,I);case 17:return $=m.type,ee=m.pendingProps,ee=m.elementType===$?ee:no($,ee),B(p,m),m.tag=1,Pn($)?(p=!0,es(m)):p=!1,as(m,I),Qf(m,$,ee),Ki(m,$,ee,I),ha(null,m,$,!0,p,I);case 19:return N(p,m,I);case 22:return Yr(p,m,I)}throw Error(l(156,m.tag))};function Gh(p,m){return vo(p,m)}function Mp(p,m,I,$){this.tag=p,this.key=I,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=$,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $o(p,m,I,$){return new Mp(p,m,I,$)}function Cc(p){return p=p.prototype,!(!p||!p.isReactComponent)}function T0(p){if(typeof p=="function")return Cc(p)?1:0;if(p!=null){if(p=p.$$typeof,p===x)return 11;if(p===b)return 14}return 2}function pu(p,m){var I=p.alternate;return I===null?(I=$o(p.tag,m,p.key,p.mode),I.elementType=p.elementType,I.type=p.type,I.stateNode=p.stateNode,I.alternate=p,p.alternate=I):(I.pendingProps=m,I.type=p.type,I.flags=0,I.subtreeFlags=0,I.deletions=null),I.flags=p.flags&14680064,I.childLanes=p.childLanes,I.lanes=p.lanes,I.child=p.child,I.memoizedProps=p.memoizedProps,I.memoizedState=p.memoizedState,I.updateQueue=p.updateQueue,m=p.dependencies,I.dependencies=m===null?null:{lanes:m.lanes,firstContext:m.firstContext},I.sibling=p.sibling,I.index=p.index,I.ref=p.ref,I}function nh(p,m,I,$,ee,oe){var Ee=2;if($=p,typeof p=="function")Cc(p)&&(Ee=1);else if(typeof p=="string")Ee=5;else e:switch(p){case f:return Na(I.children,ee,oe,m);case v:Ee=8,ee|=8;break;case g:return p=$o(12,I,m,ee|2),p.elementType=g,p.lanes=oe,p;case E:return p=$o(13,I,m,ee),p.elementType=E,p.lanes=oe,p;case S:return p=$o(19,I,m,ee),p.elementType=S,p.lanes=oe,p;case _:return Nc(I,ee,oe,m);default:if(typeof p=="object"&&p!==null)switch(p.$$typeof){case c:Ee=10;break e;case y:Ee=9;break e;case x:Ee=11;break e;case b:Ee=14;break e;case w:Ee=16,$=null;break e}throw Error(l(130,p==null?p:typeof p,""))}return m=$o(Ee,I,m,ee),m.elementType=p,m.type=$,m.lanes=oe,m}function Na(p,m,I,$){return p=$o(7,p,$,m),p.lanes=I,p}function Nc(p,m,I,$){return p=$o(22,p,$,m),p.elementType=_,p.lanes=I,p.stateNode={isHidden:!1},p}function Lc(p,m,I){return p=$o(6,p,null,m),p.lanes=I,p}function ih(p,m,I){return m=$o(4,p.children!==null?p.children:[],p.key,m),m.lanes=I,m.stateNode={containerInfo:p.containerInfo,pendingChildren:null,implementation:p.implementation},m}function Ip(p,m,I,$,ee){this.tag=m,this.containerInfo=p,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ue,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Za(0),this.expirationTimes=Za(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Za(0),this.identifierPrefix=$,this.onRecoverableError=ee,Me&&(this.mutableSourceEagerHydrationData=null)}function $h(p,m,I,$,ee,oe,Ee,We,rt){return p=new Ip(p,m,I,We,rt),m===1?(m=1,oe===!0&&(m|=8)):m=0,oe=$o(3,null,null,m),p.current=oe,oe.stateNode=p,oe.memoizedState={element:$,isDehydrated:I,cache:null,transitions:null,pendingSuspenseBoundaries:null},os(oe),p}function ah(p){if(!p)return Jo;p=p._reactInternals;e:{if(R(p)!==p||p.tag!==1)throw Error(l(170));var m=p;do{switch(m.tag){case 3:m=m.stateNode.context;break e;case 1:if(Pn(m.type)){m=m.stateNode.__reactInternalMemoizedMergedChildContext;break e}}m=m.return}while(m!==null);throw Error(l(171))}if(p.tag===1){var I=p.type;if(Pn(I))return qn(p,I,m)}return m}function Gu(p){var m=p._reactInternals;if(m===void 0)throw typeof p.render=="function"?Error(l(188)):(p=Object.keys(p).join(","),Error(l(268,p)));return p=C(m),p===null?null:p.stateNode}function oh(p,m){if(p=p.memoizedState,p!==null&&p.dehydrated!==null){var I=p.retryLane;p.retryLane=I!==0&&I<m?I:m}}function Tc(p,m){oh(p,m),(p=p.alternate)&&oh(p,m)}function R0(p){return p=C(p),p===null?null:p.stateNode}function Fp(){return null}return r.attemptContinuousHydration=function(p){if(p.tag===13){var m=$i(p,134217728);if(m!==null){var I=gn();ma(m,p,134217728,I)}Tc(p,134217728)}},r.attemptDiscreteHydration=function(p){if(p.tag===13){var m=$i(p,1);if(m!==null){var I=gn();ma(m,p,1,I)}Tc(p,1)}},r.attemptHydrationAtCurrentPriority=function(p){if(p.tag===13){var m=di(p),I=$i(p,m);if(I!==null){var $=gn();ma(I,p,m,$)}Tc(p,m)}},r.attemptSynchronousHydration=function(p){switch(p.tag){case 3:var m=p.stateNode;if(m.current.memoizedState.isDehydrated){var I=rs(m.pendingLanes);I!==0&&(Fa(m,I|1),Ji(m,pn()),(rr&6)===0&&(rn(),Jn()))}break;case 13:Cl(function(){var $=$i(p,1);if($!==null){var ee=gn();ma($,p,1,ee)}}),Tc(p,1)}},r.batchedUpdates=function(p,m){var I=rr;rr|=1;try{return p(m)}finally{rr=I,rr===0&&(rn(),mo&&Jn())}},r.createComponentSelector=function(p){return{$$typeof:_n,value:p}},r.createContainer=function(p,m,I,$,ee,oe,Ee){return $h(p,m,!1,null,I,$,ee,oe,Ee)},r.createHasPseudoClassSelector=function(p){return{$$typeof:xn,value:p}},r.createHydrationContainer=function(p,m,I,$,ee,oe,Ee,We,rt){return p=$h(I,$,!0,p,ee,oe,Ee,We,rt),p.context=ah(null),I=p.current,$=gn(),ee=di(I),oe=ca($,ee),oe.callback=m??null,Jr(I,oe,ee),p.current.lanes=ee,Ma(p,ee,$),Ji(p,$),p},r.createPortal=function(p,m,I){var $=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:$==null?null:""+$,children:p,containerInfo:m,implementation:I}},r.createRoleSelector=function(p){return{$$typeof:Xr,value:p}},r.createTestNameSelector=function(p){return{$$typeof:Si,value:p}},r.createTextSelector=function(p){return{$$typeof:Vr,value:p}},r.deferredUpdates=function(p){var m=xt,I=zr.transition;try{return zr.transition=null,xt=16,p()}finally{xt=m,zr.transition=I}},r.discreteUpdates=function(p,m,I,$,ee){var oe=xt,Ee=zr.transition;try{return zr.transition=null,xt=1,p(m,I,$,ee)}finally{xt=oe,zr.transition=Ee,rr===0&&rn()}},r.findAllNodes=In,r.findBoundingRects=function(p,m){if(!xe)throw Error(l(363));m=In(p,m),p=[];for(var I=0;I<m.length;I++)p.push(pe(m[I]));for(m=p.length-1;0<m;m--){I=p[m];for(var $=I.x,ee=$+I.width,oe=I.y,Ee=oe+I.height,We=m-1;0<=We;We--)if(m!==We){var rt=p[We],yt=rt.x,Bt=yt+rt.width,pr=rt.y,Ot=pr+rt.height;if($>=yt&&oe>=pr&&ee<=Bt&&Ee<=Ot){p.splice(m,1);break}else if($!==yt||I.width!==rt.width||Ot<oe||pr>Ee){if(!(oe!==pr||I.height!==rt.height||Bt<$||yt>ee)){yt>$&&(rt.width+=yt-$,rt.x=$),Bt<ee&&(rt.width=ee-yt),p.splice(m,1);break}}else{pr>oe&&(rt.height+=pr-oe,rt.y=oe),Ot<Ee&&(rt.height=Ee-pr),p.splice(m,1);break}}}return p},r.findHostInstance=Gu,r.findHostInstanceWithNoPortals=function(p){return p=k(p),p=p!==null?G(p):null,p===null?null:p.stateNode},r.findHostInstanceWithWarning=function(p){return Gu(p)},r.flushControlled=function(p){var m=rr;rr|=1;var I=zr.transition,$=xt;try{zr.transition=null,xt=1,p()}finally{xt=$,zr.transition=I,rr=m,rr===0&&(rn(),Jn())}},r.flushPassiveEffects=Nl,r.flushSync=Cl,r.focusWithin=function(p,m){if(!xe)throw Error(l(363));for(p=$n(p),m=Wn(p,m),m=Array.from(m),p=0;p<m.length;){var I=m[p++];if(!je(I)){if(I.tag===5&&st(I.stateNode))return!0;for(I=I.child;I!==null;)m.push(I),I=I.sibling}}return!1},r.getCurrentUpdatePriority=function(){return xt},r.getFindAllNodesFailureDescription=function(p,m){if(!xe)throw Error(l(363));var I=0,$=[];p=[$n(p),0];for(var ee=0;ee<p.length;){var oe=p[ee++],Ee=p[ee++],We=m[Ee];if((oe.tag!==5||!je(oe))&&(Ei(oe,We)&&($.push(pa(We)),Ee++,Ee>I&&(I=Ee)),Ee<m.length))for(oe=oe.child;oe!==null;)p.push(oe,Ee),oe=oe.sibling}if(I<m.length){for(p=[];I<m.length;I++)p.push(pa(m[I]));return`findAllNodes was able to match part of the selector:
58
- `+($.join(" > ")+`
59
-
60
- No matching component was found for:
61
- `)+p.join(" > ")}return null},r.getPublicRootInstance=function(p){if(p=p.current,!p.child)return null;switch(p.child.tag){case 5:return ae(p.child.stateNode);default:return p.child.stateNode}},r.injectIntoDevTools=function(p){if(p={bundleType:p.bundleType,version:p.version,rendererPackageName:p.rendererPackageName,rendererConfig:p.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:R0,findFiberByHostInstance:p.findFiberByHostInstance||Fp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")p=!1;else{var m=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(m.isDisabled||!m.supportsFiber)p=!0;else{try{ja=m.inject(p),mi=m}catch{}p=!!m.checkDCE}}return p},r.isAlreadyRendering=function(){return!1},r.observeVisibleRects=function(p,m,I,$){if(!xe)throw Error(l(363));p=In(p,m);var ee=pt(p,I,$).disconnect;return{disconnect:function(){ee()}}},r.registerMutableSourceForHydration=function(p,m){var I=m._getVersion;I=I(m._source),p.mutableSourceEagerHydrationData==null?p.mutableSourceEagerHydrationData=[m,I]:p.mutableSourceEagerHydrationData.push(m,I)},r.runWithPriority=function(p,m){var I=xt;try{return xt=p,m()}finally{xt=I}},r.shouldError=function(){return null},r.shouldSuspend=function(){return!1},r.updateContainer=function(p,m,I,$){var ee=m.current,oe=gn(),Ee=di(ee);return I=ah(I),m.context===null?m.context=I:m.pendingContext=I,m=ca(oe,Ee),m.payload={element:p},$=$===void 0?null:$,$!==null&&(m.callback=$),p=Jr(ee,m,Ee),p!==null&&(ma(p,ee,Ee,oe),vl(p,ee,Ee)),Ee},r}),Eg}var K5;function lE(){return K5||(K5=1,Sg.exports=sE()),Sg.exports}var uE=lE();const cE=lc(uE);var Ag={exports:{}},Uc={};/**
62
- * @license React
63
- * react-reconciler-constants.production.min.js
64
- *
65
- * Copyright (c) Facebook, Inc. and its affiliates.
66
- *
67
- * This source code is licensed under the MIT license found in the
68
- * LICENSE file in the root directory of this source tree.
69
- */var Z5;function fE(){return Z5||(Z5=1,Uc.ConcurrentRoot=1,Uc.ContinuousEventPriority=4,Uc.DefaultEventPriority=16,Uc.DiscreteEventPriority=1,Uc.IdleEventPriority=536870912,Uc.LegacyRoot=0),Uc}var Q5;function hE(){return Q5||(Q5=1,Ag.exports=fE()),Ag.exports}var W6=hE(),dE=Nr();const J5={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let eb=!1,tb=!1;const gm=".react-konva-event",pE=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
70
- Position of a node will be changed during drag&drop, so you should update state of the react app as well.
71
- Consider to add onDragMove or onDragEnd events.
72
- For more info see: https://github.com/konvajs/react-konva/issues/256
73
- `,gE=`ReactKonva: You are using "zIndex" attribute for a Konva node.
74
- react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
75
- For more info see: https://github.com/konvajs/react-konva/issues/194
76
- `,vE={};function g0(e,t,r=vE){if(!eb&&"zIndex"in t&&(console.warn(gE),eb=!0),!tb&&t.draggable){var n=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;n&&!i&&(console.warn(pE),tb=!0)}for(var a in r)if(!J5[a]){var l=a.slice(0,2)==="on",o=r[a]!==t[a];if(l&&o){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,r[a])}var d=!t.hasOwnProperty(a);d&&e.setAttr(a,void 0)}var f=t._useStrictMode,v={},g=!1;const c={};for(var a in t)if(!J5[a]){var l=a.slice(0,2)==="on",y=r[a]!==t[a];if(l&&y){var u=a.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[a]&&(c[u]=t[a])}!l&&(t[a]!==r[a]||f&&t[a]!==e.getAttr(a))&&(g=!0,v[a]=t[a])}g&&(e.setAttrs(v),sf(e));for(var u in c)e.on(u+gm,c[u])}function sf(e){if(!dE.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}var Pg=em();const Y6={},mE={};sp.Node.prototype._applyProps=g0;function yE(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),sf(e)}function bE(e,t,r){let n=sp[e];n||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),n=sp.Group);const i={},a={};for(var l in t){var o=l.slice(0,2)==="on";o?a[l]=t[l]:i[l]=t[l]}const u=new n(i);return g0(u,a),u}function wE(e,t,r){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function _E(e,t,r){return!1}function xE(e){return e}function SE(){return null}function EE(){return null}function AE(e,t,r,n){return mE}function PE(){}function kE(e){}function OE(e,t){return!1}function CE(){return Y6}function NE(){return Y6}const LE=setTimeout,TE=clearTimeout,RE=-1;function ME(e,t){return!1}const IE=!1,FE=!0,jE=!0;function DE(e,t){t.parent===e?t.moveToTop():e.add(t),sf(e)}function BE(e,t){t.parent===e?t.moveToTop():e.add(t),sf(e)}function X6(e,t,r){t._remove(),e.add(t),t.setZIndex(r.getZIndex()),sf(e)}function zE(e,t,r){X6(e,t,r)}function UE(e,t){t.destroy(),t.off(gm),sf(e)}function qE(e,t){t.destroy(),t.off(gm),sf(e)}function HE(e,t,r){console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`)}function VE(e,t,r){}function GE(e,t,r,n,i){g0(e,i,n)}function $E(e){e.hide(),sf(e)}function WE(e){}function YE(e,t){(t.visible==null||t.visible)&&e.show()}function XE(e,t){}function KE(e){}function ZE(){}const QE=()=>W6.DefaultEventPriority,JE=Object.freeze(Object.defineProperty({__proto__:null,appendChild:DE,appendChildToContainer:BE,appendInitialChild:yE,cancelTimeout:TE,clearContainer:KE,commitMount:VE,commitTextUpdate:HE,commitUpdate:GE,createInstance:bE,createTextInstance:wE,detachDeletedInstance:ZE,finalizeInitialChildren:_E,getChildHostContext:NE,getCurrentEventPriority:QE,getPublicInstance:xE,getRootHostContext:CE,hideInstance:$E,hideTextInstance:WE,idlePriority:Pg.unstable_IdlePriority,insertBefore:X6,insertInContainerBefore:zE,isPrimaryRenderer:IE,noTimeout:RE,now:Pg.unstable_now,prepareForCommit:SE,preparePortalMount:EE,prepareUpdate:AE,removeChild:UE,removeChildFromContainer:qE,resetAfterCommit:PE,resetTextContent:kE,run:Pg.unstable_runWithPriority,scheduleTimeout:LE,shouldDeprioritizeSubtree:OE,shouldSetTextContent:ME,supportsMutation:jE,unhideInstance:YE,unhideTextInstance:XE,warnsIfNotActing:FE},Symbol.toStringTag,{value:"Module"}));var eA=Object.defineProperty,tA=Object.defineProperties,rA=Object.getOwnPropertyDescriptors,rb=Object.getOwnPropertySymbols,nA=Object.prototype.hasOwnProperty,iA=Object.prototype.propertyIsEnumerable,nb=(e,t,r)=>t in e?eA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ib=(e,t)=>{for(var r in t||(t={}))nA.call(t,r)&&nb(e,r,t[r]);if(rb)for(var r of rb(t))iA.call(t,r)&&nb(e,r,t[r]);return e},aA=(e,t)=>tA(e,rA(t)),ab,ob;typeof window<"u"&&((ab=window.document)!=null&&ab.createElement||((ob=window.navigator)==null?void 0:ob.product)==="ReactNative")?Pi.useLayoutEffect:Pi.useEffect;function K6(e,t,r){if(!e)return;if(r(e)===!0)return e;let n=e.child;for(;n;){const i=K6(n,t,r);if(i)return i;n=n.sibling}}function Z6(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const sb=console.error;console.error=function(){const e=[...arguments].join("");if(e?.startsWith("Warning:")&&e.includes("useContext")){console.error=sb;return}return sb.apply(this,arguments)};const vm=Z6(Pi.createContext(null));class Q6 extends Pi.Component{render(){return Pi.createElement(vm.Provider,{value:this._reactInternals},this.props.children)}}function oA(){const e=Pi.useContext(vm);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=Pi.useId();return Pi.useMemo(()=>{for(const n of[e,e?.alternate]){if(!n)continue;const i=K6(n,!1,a=>{let l=a.memoizedState;for(;l;){if(l.memoizedState===t)return!0;l=l.next}});if(i)return i}},[e,t])}function sA(){const e=oA(),[t]=Pi.useState(()=>new Map);t.clear();let r=e;for(;r;){if(r.type&&typeof r.type=="object"){const i=r.type._context===void 0&&r.type.Provider===r.type?r.type:r.type._context;i&&i!==vm&&!t.has(i)&&t.set(i,Pi.useContext(Z6(i)))}r=r.return}return t}function J6(){const e=sA();return Pi.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>n=>Pi.createElement(t,null,Pi.createElement(r.Provider,aA(ib({},n),{value:e.get(r)}))),t=>Pi.createElement(Q6,ib({},t))),[e])}function lA(e){const t=ce.useRef({});return ce.useLayoutEffect(()=>{t.current=e}),ce.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const uA=e=>{const t=ce.useRef(),r=ce.useRef(),n=ce.useRef(),i=lA(e),a=J6(),l=o=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(o):u.current=o)};return ce.useLayoutEffect(()=>(r.current=new sp.Stage({width:e.width,height:e.height,container:t.current}),l(r.current),n.current=$d.createContainer(r.current,W6.LegacyRoot,!1,null),$d.updateContainer(ce.createElement(a,{},e.children),n.current),()=>{sp.isBrowser&&(l(null),$d.updateContainer(null,n.current,null),r.current.destroy())}),[]),ce.useLayoutEffect(()=>{l(r.current),g0(r.current,e,i),$d.updateContainer(ce.createElement(a,{},e.children),n.current,null)}),ce.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},cA="Layer",vn="Group",V1="Label",En="Rect",fA="Circle",Yc="Line",bu="Image",Au="Text",mm="Arc",G1="Tag",Tv="Path",lp="Transformer",$d=cE(JE);$d.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:ce.version,rendererPackageName:"react-konva"});const hA=ce.forwardRef((e,t)=>ce.createElement(Q6,{},ce.createElement(uA,{...e,forwardedRef:t})));var kg,lb;function dA(){if(lb)return kg;lb=1;var e=vp();return kg=function(r,n,i){const a=e.useRef("loading"),l=e.useRef(),[o,u]=e.useState(0),d=e.useRef(),f=e.useRef(),v=e.useRef();return(d.current!==r||f.current!==n||v.current!==i)&&(a.current="loading",l.current=void 0,d.current=r,f.current=n,v.current=i),e.useLayoutEffect(function(){if(!r)return;var g=document.createElement("img");function c(){g.decode().catch(()=>{}).finally(()=>{a.current="loaded",l.current=g,u(Math.random())})}function y(){a.current="failed",l.current=void 0,u(Math.random())}return g.addEventListener("load",c),g.addEventListener("error",y),n&&(g.crossOrigin=n),i&&(g.referrerPolicy=i),g.src=r,function(){g.removeEventListener("load",c),g.removeEventListener("error",y)}},[r,n,i]),[l.current,a.current]},kg}var pA=dA();const ym=lc(pA);var gA=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};const vA=e=>{const t=window.getComputedStyle(e).position;return!(t==="absolute"||t==="relative")};function mA(e=()=>{}){const t=ce.useRef(e);return t.current=e,ce.useCallback((...r)=>t.current.apply(null,r),[])}const $1=({children:e,groupProps:t,divProps:r,transform:n,transformFunc:i,parentNodeFunc:a})=>{const l=J6(),o=ce.useRef(null),[u]=ce.useState(()=>document.createElement("div")),d=ce.useMemo(()=>Uw.createRoot(u),[u]),f=n??!0,v=mA(()=>{if(f&&o.current){let E=o.current.getAbsoluteTransform().decompose();i&&(E=i(E)),u.style.position="absolute",u.style.zIndex="10",u.style.top="0px",u.style.left="0px",u.style.transform=`translate(${E.x}px, ${E.y}px) rotate(${E.rotation}deg) scaleX(${E.scaleX}) scaleY(${E.scaleY})`,u.style.transformOrigin="top left"}else u.style.position="",u.style.zIndex="",u.style.top="",u.style.left="",u.style.transform="",u.style.transformOrigin="";const g=r||{},{style:c}=g,y=gA(g,["style"]);Object.assign(u.style,c),Object.assign(u,y)});return ce.useLayoutEffect(()=>{var g;const c=o.current;if(!c)return;const y=a?a({stage:c.getStage()}):(g=c.getStage())===null||g===void 0?void 0:g.container();if(y)return y.appendChild(u),f&&vA(y)&&(y.style.position="relative"),c.on("absoluteTransformChange",v),v(),()=>{var x;c.off("absoluteTransformChange",v),(x=u.parentNode)===null||x===void 0||x.removeChild(u)}},[f,a]),ce.useLayoutEffect(()=>{v()},[r,i]),ce.useLayoutEffect(()=>{queueMicrotask(()=>{B6.flushSync(()=>{d.render(ce.createElement(l,null,e))})})}),ce.useLayoutEffect(()=>()=>{setTimeout(()=>{d.unmount()})},[]),ce.createElement(vn,Object.assign({ref:o},t))},bm=({selector:e,enabled:t,children:r})=>{const n=ce.useRef(null),i=ce.useRef(null),a=ce.useRef(null),l=t??!0;return ce.useLayoutEffect(()=>{if(!n.current||!i.current)return;a.current=i.current;const u=n.current.getStage().findOne(e);l&&u?i.current.moveTo(u):i.current.moveTo(n.current);const d=n.current.getLayer();if(d&&(d.batchDraw(),u)){const f=u.getLayer();if(!f)return;f.batchDraw()}},[e,l]),ce.useEffect(()=>()=>{var o;(o=a.current)===null||o===void 0||o.destroy()},[]),ce.createElement(vn,{name:"_outer_portal",ref:n},ce.createElement(vn,{name:"_inner_portal",ref:i},r))};function e8(e,t,r){const n=t-1,i=r[r8(n,r.length)];return i.marker!=="Z"?i:e8(e,n,r)}function t8(e,t,r){const n=t+1,i=r[r8(n,r.length)];return i.marker==="Z"?t8(e,n,r):i}function yA(e,t,r){let n=r[t-1]||{values:{x:0,y:0}};if(e.marker===e.marker.toLowerCase())switch(e.marker=e.marker.toUpperCase(),e.marker){case"M":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"L":case"A":e.values.x+=n.values.x,e.values.y+=n.values.y;break;case"H":e.marker="L",e.values.x+=n.values.x,e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x,e.values.y+=n.values.y;break;case"C":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"S":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x2+=n.values.x,e.values.y2+=n.values.y;break;case"Q":e.values.x+=n.values.x,e.values.y+=n.values.y,e.values.x1+=n.values.x,e.values.y1+=n.values.y;break;case"T":e.values.x+=n.values.x,e.values.y+=n.values.y;break}else if(e.marker===e.marker.toUpperCase())switch(e.marker){case"H":e.marker="L",e.values.y=n.values.y;break;case"V":e.marker="L",e.values.x=n.values.x;break}if(e.marker==="Z"){let i=function(l,o){return l[o].marker==="M"?l[o]:i(l,o-1)},a=i(r,t);e.values.x=a.values.x,e.values.y=a.values.y}return e}function bA(e,t){const r=[];switch(e.toUpperCase()){case"M":for(let n=0;n<t.length;n+=2){let i;e===e.toUpperCase()?i=n===0?"M":"L":i=n===0?"m":"l",r.push({marker:i,values:{x:t[n],y:t[n+1]}})}break;case"L":for(let n=0;n<t.length;n+=2)r.push({marker:e,values:{x:t[n],y:t[n+1]}});break;case"H":for(let n=0;n<t.length;n++)r.push({marker:e,values:{x:t[n],y:0}});break;case"V":for(let n=0;n<t.length;n++)r.push({marker:e,values:{x:0,y:t[n]}});break;case"C":for(let n=0;n<t.length;n+=6)r.push({marker:e,values:{x1:t[n],y1:t[n+1],x2:t[n+2],y2:t[n+3],x:t[n+4],y:t[n+5]}});break;case"S":for(let n=0;n<t.length;n+=4)r.push({marker:e,values:{x2:t[n],y2:t[n+1],x:t[n+2],y:t[n+3]}});break;case"Q":for(let n=0;n<t.length;n+=4)r.push({marker:e,values:{x1:t[n],y1:t[n+1],x:t[n+2],y:t[n+3]}});break;case"T":for(let n=0;n<t.length;n+=2)r.push({marker:e,values:{x:t[n],y:t[n+1]}});break;case"A":for(let n=0;n<t.length;n+=7)r.push({marker:e,values:{radiusX:t[n],radiusY:t[n+1],rotation:t[n+2],largeArc:t[n+3],sweep:t[n+4],x:t[n+5],y:t[n+6]}});break;case"Z":r.push({marker:e,values:{x:0,y:0}});break}return r}function r8(e,t){return(e%t+t)%t}function wA(e,t,r){if(t!==0&&e.marker==="L"){let n=r[t-1];["x","y"].every(a=>Math.round(Math.abs(n.values[a]-e.values[a]))===0)&&(e.overlap=!0)}return e}function Rv(e,t){const r=["x","y"].every(n=>Math.round(Math.abs(e[t].values[n]-e[0].values[n]))===0);e[t].marker==="L"&&r&&(e[t].overlap=!0,Rv(e,t-1)),e[t].marker==="Z"&&Rv(e,t-1)}function _A(e,t,r){const n=cb(e.values,r.values),i=cb(t.values,e.values);return Math.min(i,n)}function ub(e,t){return Math.atan2(t.x-e.x,t.y-e.y)}function cb(e,t){const r=e.x-t.x,n=e.y-t.y;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2))}function fb(e,t){return Math.sin(e)*t}function hb(e,t){return Math.cos(e)*t}function db(e,t){const r=t/Math.tan(e);return r===1/0||r===-1/0||isNaN(r)?t:r}function xA(e,t){return t*Math.tan(e)}function SA(e,t){let r,n=0,i=e*(180/Math.PI);return i<0&&i>=-180||i>180&&i<360?r=db(e/2,-t):(r=db(e/2,t),n=1,r===1/0&&(r=t)),{offset:r,sweepFlag:n}}function EA(e){const t=["radiusX","radiusY","rotation","largeArc","sweep","x1","y1","x2","y2","x","y"];return e.map(r=>{let n="";if(r.marker!=="Z"){const i=Object.keys(r.values);n=t.filter(a=>i.indexOf(a)!==-1).map(a=>r.values[a]).join()}return`${r.marker}${n}`}).join("").trim()}function AA(e){const t=/[MmLlSsQqLlHhVvCcSsQqTtAaZz]/g,r=/-?[0-9]*\.?\d+/g;return[...e.matchAll(t)].map(n=>({marker:n[0],index:n.index})).reduceRight((n,i)=>{const a=e.substring(i.index,n.length?n[n.length-1].index:e.length);return n.concat([{marker:i.marker,index:i.index,chunk:a.length>0?a.substr(1,a.length-1):a}])},[]).reverse().flatMap(n=>{const i=n.chunk.match(r),a=i?i.map(parseFloat):[];return bA(n.marker,a)}).map(yA)}function PA(e,t,r){let n=[],i=[];return e.forEach(a=>{a.marker==="M"&&n.push([]),n[n.length-1].push(a)}),n.forEach(a=>{a.map(wA),Rv(a,a.length-1);const l=a[a.length-1].marker=="Z";a.filter(o=>!o.overlap).map((o,u,d)=>{const v=e8(o,u,d),g=t8(o,u,d),c=ub(o.values,v.values),y=ub(o.values,g.values),x=y-c,E=x*(180/Math.PI),S=_A(o,v,g),b=Math.abs(xA(x/2,S/2)),w=Math.min(t,b),_=SA(x,w),A=_.offset,M=_.sweepFlag,O=(u==0||u==d.length-1)&&!l;switch(o.marker){case"M":case"L":const L=[o.values.x+fb(c,A),o.values.y+hb(c,A)],R=[o.values.x+fb(y,A),o.values.y+hb(y,A)];O?i.push({marker:o.marker,values:o.values}):i.push({marker:o.marker,values:{x:parseFloat(L[0].toFixed(3)),y:parseFloat(L[1].toFixed(3))}}),!O&&(g.marker==="L"||g.marker==="M")&&i.push({marker:"A",radius:w,values:{radiusX:parseFloat(w.toFixed(3)),radiusY:parseFloat(w.toFixed(3)),rotation:E,largeArc:0,sweep:M,x:parseFloat(R[0].toFixed(3)),y:parseFloat(R[1].toFixed(3))}});break;case"C":case"S":case"Q":case"T":case"A":case"Z":i.push({marker:o.marker,values:o.values});break}})}),{path:EA(i),commands:i}}var o1={},pb;function kA(){if(pb)return o1;pb=1;var e=e||{};e.stringify=function(){var t={"visit_linear-gradient":function(r){return t.visit_gradient(r)},"visit_repeating-linear-gradient":function(r){return t.visit_gradient(r)},"visit_radial-gradient":function(r){return t.visit_gradient(r)},"visit_repeating-radial-gradient":function(r){return t.visit_gradient(r)},visit_gradient:function(r){var n=t.visit(r.orientation);return n&&(n+=", "),r.type+"("+n+t.visit(r.colorStops)+")"},visit_shape:function(r){var n=r.value,i=t.visit(r.at),a=t.visit(r.style);return a&&(n+=" "+a),i&&(n+=" at "+i),n},"visit_default-radial":function(r){var n="",i=t.visit(r.at);return i&&(n+=i),n},"visit_extent-keyword":function(r){var n=r.value,i=t.visit(r.at);return i&&(n+=" at "+i),n},"visit_position-keyword":function(r){return r.value},visit_position:function(r){return t.visit(r.value.x)+" "+t.visit(r.value.y)},"visit_%":function(r){return r.value+"%"},visit_em:function(r){return r.value+"em"},visit_px:function(r){return r.value+"px"},visit_calc:function(r){return"calc("+r.value+")"},visit_literal:function(r){return t.visit_color(r.value,r)},visit_hex:function(r){return t.visit_color("#"+r.value,r)},visit_rgb:function(r){return t.visit_color("rgb("+r.value.join(", ")+")",r)},visit_rgba:function(r){return t.visit_color("rgba("+r.value.join(", ")+")",r)},visit_hsl:function(r){return t.visit_color("hsl("+r.value[0]+", "+r.value[1]+"%, "+r.value[2]+"%)",r)},visit_hsla:function(r){return t.visit_color("hsla("+r.value[0]+", "+r.value[1]+"%, "+r.value[2]+"%, "+r.value[3]+")",r)},visit_var:function(r){return t.visit_color("var("+r.value+")",r)},visit_color:function(r,n){var i=r,a=t.visit(n.length);return a&&(i+=" "+a),i},visit_angular:function(r){return r.value+"deg"},visit_directional:function(r){return"to "+r.value},visit_array:function(r){var n="",i=r.length;return r.forEach(function(a,l){n+=t.visit(a),l<i-1&&(n+=", ")}),n},visit_object:function(r){return r.width&&r.height?t.visit(r.width)+" "+t.visit(r.height):""},visit:function(r){if(!r)return"";if(r instanceof Array)return t.visit_array(r);if(typeof r=="object"&&!r.type)return t.visit_object(r);if(r.type){var n=t["visit_"+r.type];if(n)return n(r);throw Error("Missing visitor visit_"+r.type)}else throw Error("Invalid node.")}};return function(r){return t.visit(r)}}();var e=e||{};return e.parse=function(){var t={linearGradient:/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,repeatingLinearGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,radialGradient:/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,repeatingRadialGradient:/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,radianValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-zA-Z0-9-,\s\#]+)/,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i},r="";function n(z){var Z=new Error(r+": "+z);throw Z.source=r,Z}function i(){var z=a();return r.length>0&&n("Invalid input not EOF"),z}function a(){return _(l)}function l(){return o("linear-gradient",t.linearGradient,d)||o("repeating-linear-gradient",t.repeatingLinearGradient,d)||o("radial-gradient",t.radialGradient,g)||o("repeating-radial-gradient",t.repeatingRadialGradient,g)}function o(z,Z,re){return u(Z,function(W){var Q=re();return Q&&(D(t.comma)||n("Missing comma before color stops")),{type:z,orientation:Q,colorStops:_(A)}})}function u(z,Z){var re=D(z);if(re){D(t.startCall)||n("Missing (");var W=Z(re);return D(t.endCall)||n("Missing )"),W}}function d(){var z=f();if(z)return z;var Z=U("position-keyword",t.positionKeywords,1);return Z?{type:"directional",value:Z.value}:v()}function f(){return U("directional",t.sideOrCorner,1)}function v(){return U("angular",t.angleValue,1)||U("angular",t.radianValue,1)}function g(){var z,Z=c(),re;return Z&&(z=[],z.push(Z),re=r,D(t.comma)&&(Z=c(),Z?z.push(Z):r=re)),z}function c(){var z=y()||x();if(z)z.at=S();else{var Z=E();if(Z){z=Z;var re=S();re&&(z.at=re)}else{var W=S();if(W)z={type:"default-radial",at:W};else{var Q=b();Q&&(z={type:"default-radial",at:Q})}}}return z}function y(){var z=U("shape",/^(circle)/i,0);return z&&(z.style=Y()||E()),z}function x(){var z=U("shape",/^(ellipse)/i,0);return z&&(z.style=b()||ae()||E()),z}function E(){return U("extent-keyword",t.extentKeywords,1)}function S(){if(U("position",/^at/,0)){var z=b();return z||n("Missing positioning value"),z}}function b(){var z=w();if(z.x||z.y)return{type:"position",value:z}}function w(){return{x:ae(),y:ae()}}function _(z){var Z=z(),re=[];if(Z)for(re.push(Z);D(t.comma);)Z=z(),Z?re.push(Z):n("One extra comma");return re}function A(){var z=M();return z||n("Expected color definition"),z.length=ae(),z}function M(){return L()||q()||C()||T()||R()||k()||O()}function O(){return U("literal",t.literalColor,0)}function L(){return U("hex",t.hexColor,1)}function R(){return u(t.rgbColor,function(){return{type:"rgb",value:_(J)}})}function T(){return u(t.rgbaColor,function(){return{type:"rgba",value:_(J)}})}function k(){return u(t.varColor,function(){return{type:"var",value:G()}})}function C(){return u(t.hslColor,function(){var z=D(t.percentageValue);z&&n("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");var Z=J();D(t.comma);var re=D(t.percentageValue),W=re?re[1]:null;D(t.comma),re=D(t.percentageValue);var Q=re?re[1]:null;return(!W||!Q)&&n("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[Z,W,Q]}})}function q(){return u(t.hslaColor,function(){var z=J();D(t.comma);var Z=D(t.percentageValue),re=Z?Z[1]:null;D(t.comma),Z=D(t.percentageValue);var W=Z?Z[1]:null;D(t.comma);var Q=J();return(!re||!W)&&n("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[z,re,W,Q]}})}function G(){return D(t.variableName)[1]}function J(){return D(t.number)[1]}function ae(){return U("%",t.percentageValue,1)||H()||V()||Y()}function H(){return U("position-keyword",t.positionKeywords,1)}function V(){return u(t.calcValue,function(){for(var z=1,Z=0;z>0&&Z<r.length;){var re=r.charAt(Z);re==="("?z++:re===")"&&z--,Z++}z>0&&n("Missing closing parenthesis in calc() expression");var W=r.substring(0,Z-1);return j(Z-1),{type:"calc",value:W}})}function Y(){return U("px",t.pixelValue,1)||U("em",t.emValue,1)}function U(z,Z,re){var W=D(Z);if(W)return{type:z,value:W[re]}}function D(z){var Z,re;return re=/^[\n\r\t\s]+/.exec(r),re&&j(re[0].length),Z=z.exec(r),Z&&j(Z[0].length),Z}function j(z){r=r.substr(z)}return function(z){return r=z.toString().trim(),r.endsWith(";")&&(r=r.slice(0,-1)),i()}}(),o1.parse=e.parse,o1.stringify=e.stringify,o1}var OA=kA();const CA=lc(OA),v0=e=>e.indexOf("linear-gradient")>=0,NA=e=>e.type==="hex"?"#"+e.value:e.type==="literal"?e.value:`${e.type}(${e.value.join(",")})`,n8=e=>{if(!v0(e))return{rotation:0,stops:[{offset:0,color:e},{offset:1,color:e}]};const t=CA.parse(e)[0];return{rotation:parseFloat(t.orientation.value),stops:t.colorStops.map((r,n)=>({color:NA(r),offset:r.length?parseFloat(r.length.value)/100:n/(t.colorStops.length-1)}))}},tf=(e,t=e.fill,r="fill")=>ce.useMemo(()=>{if(!v0(t))return{[r]:t};const{stops:n,rotation:i}=n8(t),a=e.a.width/2,l=e.a.height/2,o=(i%180+180)%180,u=o>45&&o<135?e.a.width:e.a.height,d=sr.Util.degToRad(i)-Math.PI/2,f=[];return n.forEach(({offset:v,color:g})=>{f.push(v,g)}),r==="fill"?{fillLinearGradientStartPointX:a-u/2*Math.cos(d),fillLinearGradientStartPointY:l-u/2*Math.sin(d),fillLinearGradientColorStops:f,fillLinearGradientEndPointX:a+u/2*Math.cos(d),fillLinearGradientEndPointY:l+u/2*Math.sin(d),fill:n[1].color,fillPriority:"linear-gradient"}:{strokeLinearGradientStartPointX:a-u/2*Math.cos(d),strokeLinearGradientStartPointY:l-u/2*Math.sin(d),strokeLinearGradientColorStops:f,strokeLinearGradientEndPointX:a+u/2*Math.cos(d),strokeLinearGradientEndPointY:l+u/2*Math.sin(d)}},[t,e.width,e.height]);let W1=!1;const LA=(e=!W1)=>{W1=e},TA=()=>W1;function xp(e,t){const r=ce.useRef();ce.useLayoutEffect(()=>{r.current&&r.current.destroy()},[t]),ce.useLayoutEffect(()=>{if(!W1)return;const n=e.current.opacity();return n?(e.current.opacity(0),r.current=new sr.Tween({node:e.current,opacity:n,onFinish:()=>{var i;(i=r.current)===null||i===void 0||i.destroy()}}),r.current.play(),()=>{var i;(i=r.current)===null||i===void 0||i.destroy()}):void 0},[])}let Y1=0,Mv=[],i8=3e4;const RA=e=>{i8=e};let a8=6e3;const MA=e=>{a8=e},IA=()=>a8;function Rh(e){Y1+=1;let t=!1,r=!1;const n=setTimeout(()=>{t||(Sp(`Timeout loading asset ${e}`),console.error("Timeout triggered for loader. Some assets may not have loaded.",e),t=!0,gb())},i8);return()=>{r?console.error("Finish called twice! That is not expected. id: ",e):(r=!0,t||(clearTimeout(n),gb()))}}function gb(){Y1-=1,Y1===0&&(Mv.forEach(e=>e()),Mv=[])}function FA(){return new Promise(e=>{return t=()=>{TA()?setTimeout(e,300):e(!0)},void(Y1===0?t():Mv.push(t));var t})}let o8=[];function jA(e){o8.push(e)}function Sp(e){o8.forEach(t=>t(e))}$r(["Roboto","Amatic SC","Press Start 2P","Marck Script","Rubik Mono One"]);$r({value:!1});const wm=$r([]);function DA(e){wm.push(e)}var BA="Some test text;?#D-ПРИВЕТ!1230o9u8i7y6t5r4e3w2q1";let Og;function dh(e,t="Arial",r="normal",n="normal"){Og||(Og=document.createElement("canvas"));var i=Og.getContext("2d");return i.font=`${r} ${n} 40px '${e}', ${t}`,i.measureText(BA).width}const E1={Arial:!0},vb=e=>!!E1[e];async function mh(e,t,r){var n;if(E1[e])return;const i=!!(!((n=document.fonts)===null||n===void 0)&&n.load),a=dh("Arial","Arial",t,r);if(i)try{if(await document.fonts.load(`16px '${e}', ${t} ${r}`),a!==dh(e,"Arial",t,r))return void(E1[e]=!0)}catch{}const l=dh("Times","Times",t,r),o=dh(e,"Arial",t,r),u=Math.min(6e3,IA())/60;for(let d=0;d<u;d++){const f=dh(e,"Arial",t,r),v=dh(e,"Times",t,r);if(f!==o||f!==a||v!==l)return await new Promise(g=>setTimeout(g,60)),void(E1[e]=!0);await new Promise(g=>setTimeout(g,60))}console.warn(`Timeout for loading font "${e}". Looks like polotno can't load it. Is it a correct font family?`),Sp(`Timeout for loading font "${e}"`)}const mb={};let s8="400,400italic,700,700italic";function zA(){return s8}function l8(e){return`https://fonts.googleapis.com/css?family=${e.replace(/ /g,"+")}:${s8}`}function u8(e){if(mb[e])return;const t=l8(e),r=document.createElement("link");r.type="text/css",r.href=t,r.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(r),mb[e]=!0}const yb={};let Sf;function c8(e){const t=e.fontFamily;if(yb[t]||!e.url&&!e.styles)return;const r=e.styles||(e.url?[{src:`url("${e.url}")`}]:[]),n=(Sf||(Sf=document.getElementById("polotno-font-style"),Sf||(Sf=document.createElement("style"),Sf.id="polotno-font-style",document.head.appendChild(Sf)),Sf)).sheet;r.forEach(i=>{n.insertRule(`
77
- @font-face{
78
- font-family:'${t}';
79
- src:${i.src};
80
- font-style:${i.fontStyle||"normal"};
81
- font-weight:${i.fontWeight||"normal"};
82
- font-display:swap; /* optional but recommended */
83
- }`,n.cssRules.length)}),yb[e.fontFamily]=!0}const gi=$r({imageDownScalingEnabled:!0,removeBackgroundEnabled:!0,htmlRenderEnabled:!1,forceTextFitEnabled:!1,textVerticalResizeEnabled:!1,textOverflow:"resize",textSplitAllowed:!1,animationsEnabled:!1}),UA=Wr(e=>{gi.textVerticalResizeEnabled=e}),qA=Wr(e=>{gi.removeBackgroundEnabled=e}),HA=Wr(e=>{gi.htmlRenderEnabled=e}),VA=Wr(e=>{gi.imageDownScalingEnabled=e});Wr(e=>{console.warn("useDownScaling is deprecated. Use setDownScalingEnabled instead."),VA(e)});Wr(e=>{console.warn("setForceTextFit is deprecated. Use setTextOverflow instead."),gi.textOverflow="change-font-size"});const f8=Wr(e=>{gi.textOverflow=e}),GA=Wr(e=>{gi.textSplitAllowed=e});Wr(e=>{gi.animationsEnabled=e});function Pu(e=""){return(e.match(/<\/p>/gi)||[]).length>1&&(e=e.replace(/<\/p>/gi,(t,r,n)=>(n.slice(r+t.length).match(/<\/p>/gi)||[]).length>0?`
84
- `:t)),e.replace(/(<([^>]+)>)/gi,"")}function $A(e){return e?/<[a-z][a-z0-9]*(\s[^>]*)?>[^<]*<\/[a-z][a-z0-9]*>/i.test(e)?e=(e=e.replace(/<(?![a-z/!])/gi,"&lt;")).replace(/([^a-z0-9"'\s/])>/gi,"$1&gt;"):e.replace(/</g,"&lt;").replace(/>/g,"&gt;"):""}const WA={warm:e=>t=>{const r=t.data;e=Math.max(0,Math.min(1,e));for(let n=0;n<r.length;n+=4)r[n]=Math.min(r[n]+30*e,255),r[n+1]=Math.min(r[n+1]+15*e,255);return t},cold:e=>t=>{const r=t.data;e=Math.max(0,Math.min(1,e));for(let n=0;n<r.length;n+=4)r[n]=Math.min(r[n]-15*e,255),r[n+1]=Math.min(r[n+1]-10*e,255),r[n+2]=Math.min(r[n+2]+15*e,255);return t},natural:e=>t=>{const r=t.data;e=Math.max(0,Math.min(1,e));for(let n=0;n<r.length;n+=4){r[n]=Math.min(r[n]*(1+.1*e),255),r[n+1]=Math.min(r[n+1]*(1+.1*e),255),r[n+2]=Math.min(r[n+2]*(1+.1*e),255);const i=(r[n]+r[n+1]+r[n+2])/3;r[n]=Math.min((r[n]-i)*(1+.2*e)+i,255),r[n+1]=Math.min((r[n+1]-i)*(1+.2*e)+i,255),r[n+2]=Math.min((r[n+2]-i)*(1+.2*e)+i,255)}return t},temperature:e=>t=>{const r=t.data;e=Math.max(-1,Math.min(1,e));for(let n=0;n<r.length;n+=4){const i=r[n],a=(r[n+1],r[n+2]);r[n]=Math.min(Math.max(i+15*e,0),255),r[n+2]=Math.min(Math.max(a-15*e,0),255)}return t},contrast:e=>t=>{const r=t.data,n=100*(e=Math.max(-1,Math.min(1,e))),i=259*(n+255)/(255*(259-n));for(let a=0;a<r.length;a+=4)r[a]=Math.min(Math.max(i*(r[a]-128)+128,0),255),r[a+1]=Math.min(Math.max(i*(r[a+1]-128)+128,0),255),r[a+2]=Math.min(Math.max(i*(r[a+2]-128)+128,0),255);return t},shadows:e=>t=>{const r=t.data;e=Math.max(-1,Math.min(1,e));for(let n=0;n<r.length;n+=4){const i=(r[n]+r[n+1]+r[n+2])/3;if(i<128){const a=1+e*(1-i/128)*2;r[n]=Math.min(Math.max(r[n]*a,0),255),r[n+1]=Math.min(Math.max(r[n+1]*a,0),255),r[n+2]=Math.min(Math.max(r[n+2]*a,0),255)}}return t},white:e=>t=>{const r=t.data;e=Math.max(-1,Math.min(1,e));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],l=r[n+2],o=(i+a+l)/3;if(o>128){const u=1+e*((o-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(l*u,0),255)}}return t},black:e=>t=>{const r=t.data;e=Math.max(-1,Math.min(1,e));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],l=r[n+2],o=(i+a+l)/3;if(o<128){const u=1+e*((128-o)/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(l*u,0),255)}}return t},vibrance:e=>t=>{const r=t.data;e=Math.max(-1,Math.min(1,e));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],l=r[n+2],o=Math.max(i,a,l),u=e<0?(1-(o===0?0:(o-(i+a+l)/3)/o))*e*1.5:.5*e;r[n]=Math.min(Math.max(i-(o-i)*u,0),255),r[n+1]=Math.min(Math.max(a-(o-a)*u,0),255),r[n+2]=Math.min(Math.max(l-(o-l)*u,0),255)}return t},saturation:e=>t=>{const r=t.data;e=Math.max(-1,Math.min(1,e));for(let n=0;n<r.length;n+=4){const i=r[n],a=r[n+1],l=r[n+2],o=.2126*i+.7152*a+.0722*l;r[n]=Math.min(Math.max(o+(i-o)*(1+e),0),255),r[n+1]=Math.min(Math.max(o+(a-o)*(1+e),0),255),r[n+2]=Math.min(Math.max(o+(l-o)*(1+e),0),255)}return t}};function _s(e,t){var r;const n={filters:[]},i={};t.brightnessEnabled&&(n.filters.push(sr.Filters.Brighten),n.brightness=t.brightness),t.blurEnabled&&(n.filters.push(sr.Filters.Blur),n.blurRadius=t.blurRadius,t.type==="text"&&t.lineHeight<1&&(i.offset=t.fontSize)),t.sepiaEnabled&&n.filters.push(sr.Filters.Sepia),t.grayscaleEnabled&&n.filters.push(sr.Filters.Grayscale),t.filters.forEach((a,l)=>{const o=WA[l];o&&n.filters.push(o(a.intensity))}),e.setAttrs(n),n.filters.length?e.cache(Object.assign(Object.assign({},i),{pixelRatio:t.store._elementsPixelRatio})):e.clearCache(),(r=e.getLayer())===null||r===void 0||r.batchDraw()}const lf=()=>"ontouchstart"in window||navigator.maxTouchPoints>0;var bb={},h8="warn";function YA(e){h8=e}function XA(){return h8}var Ta;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(Ta||(Ta={}));var Iv=function(e,t){return Iv=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])},Iv(e,t)};function Kn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Iv(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Nu=function(){return Nu=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Nu.apply(this,arguments)};function KA(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function Zd(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function rf(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,a=[],l;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){l={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(l)throw l.error}}return a}function Bf(e,t,r){if(arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function d8(e){return Tr(e).type}function p8(e,t){return Tr(e).onSnapshot(t)}function wb(e,t){Tr(e).applyPatches(S8(t))}function Fv(e,t){return Tr(e).applySnapshot(t)}function wu(e,t){t===void 0&&(t=!0);var r=Tr(e);return t?r.snapshot:r.type.getSnapshot(r,!1)}function s1(e,t){for(var r=Tr(e).parent;r;){if(t.is(r.storedValue))return!0;r=r.parent}return!1}function kf(e,t){for(var r=Tr(e).parent;r;){if(t.is(r.storedValue))return r.storedValue;r=r.parent}throw new Zt("Failed to find the parent of ".concat(Tr(e)," of a given type"))}function ZA(e){return Tr(e).root.storedValue}function QA(e){return Tr(e).path}function JA(e,t){var r=wP(Tr(e),t);return r?r.value:void 0}function eP(e){return Tr(e).identifier}function Lf(e){return Tr(e).detach(),e}function Cg(e){var t=Tr(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function _b(e){return Tr(e).observableIsAlive}var g8=function(){function e(t,r,n,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:ho.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(r,n)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(t){var r=this.isAlive;this._state=t;var n=this.isAlive;this.aliveAtom&&r!==n&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._hookSubscribers&&this._hookSubscribers.emit(t,this,t)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this._hookSubscribers||(this._hookSubscribers=new P8),this._hookSubscribers.register(t,r)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){this._parent=t,this._subpath=r,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.pathAtom||(this.pathAtom=F1("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?Rf(this._subpath):""),this.parent.getEscapedPath(t)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==ho.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===ho.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=F1("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.state===ho.CREATED){if(this.parent){if(this.parent.state!==ho.FINALIZED)return;this.fireHook(Ta.afterAttach)}this.state=ho.FINALIZED,t&&t()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=ho.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(Ta.beforeDestroy)}}),e}(),up=function(e){Kn(t,e);function t(r,n,i,a,l){var o=e.call(this,r,n,i,a)||this;try{o.storedValue=r.createNewInstance(l)}catch(u){throw o.state=ho.DEAD,u}return o.state=ho.CREATED,o.finalizeCreation(),o}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw new Zt("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.parent!==r,a=this.subpath!==n;!i&&!a||(this.environment=void 0,this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===ho.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.fireInternalHook(r)}}),t}(g8);up.prototype.die=Wr(up.prototype.die);var tP=1,Il;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(Il||(Il={}));var Bs;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(Bs||(Bs={}));var rP={onError:function(e){throw e}},xs=function(e){Kn(t,e);function t(r,n,i,a,l){var o=e.call(this,r,n,i,a)||this;if(Object.defineProperty(o,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++tP}),Object.defineProperty(o,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(o,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(o,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:Il.UNINITIALIZED}),Object.defineProperty(o,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o._snapshotComputed=qf(function(){return o.getSnapshot()}),o.unbox=o.unbox.bind(o),o._initialSnapshot=l,o.identifierAttribute=r.identifierAttribute,n||(o.identifierCache=new mP),o._childNodes=r.initializeChildNodes(o,o._initialSnapshot),o.identifier=null,o.unnormalizedIdentifier=null,o.identifierAttribute&&o._initialSnapshot){var u=o._initialSnapshot[o.identifierAttribute];if(u===void 0){var d=o._childNodes[o.identifierAttribute];d&&(u=d.value)}if(typeof u!="string"&&typeof u!="number")throw new Zt("Instance identifier '".concat(o.identifierAttribute,"' for type '").concat(o.type.name,"' must be a string or a number"));o.identifier=Ep(u),o.unnormalizedIdentifier=u}return n?n.root.identifierCache.addNodeToCache(o):o.identifierCache.addNodeToCache(o),o}return Object.defineProperty(t.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applyPatches(r)}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.createObservableInstanceIfNeeded(),this._applySnapshot(r)}}),Object.defineProperty(t.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=!0),this._observableInstanceState===Il.UNINITIALIZED&&this.createObservableInstance(r)}}),Object.defineProperty(t.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n,i,a,l;r===void 0&&(r=!0),this._observableInstanceState=Il.CREATING;for(var o=[],u=this.parent;u&&u._observableInstanceState===Il.UNINITIALIZED;)o.unshift(u),u=u.parent;try{for(var d=Zd(o),f=d.next();!f.done;f=d.next()){var v=f.value;v.createObservableInstanceIfNeeded(!1)}}catch(x){n={error:x}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}var g=this.type;try{this.storedValue=g.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,g.finalizeNewInstance(this,this.storedValue)}catch(x){throw this.state=ho.DEAD,x}finally{this._isRunningAction=!1}if(this._observableInstanceState=Il.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=Fh,this.state=ho.CREATED,r){this.fireHook(Ta.afterCreate),this.finalizeCreation();try{for(var c=Zd(o.reverse()),y=c.next();!y.done;y=c.next()){var v=y.value;v.fireHook(Ta.afterCreate),v.finalizeCreation()}}catch(x){a={error:x}}finally{try{y&&!y.done&&(l=c.return)&&l.call(c)}finally{if(a)throw a.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var r=this.parent;return r?r.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(Ta.beforeDetach);var r=this.state;this.state=ho.DETACHING;var n=this.root,i=n.environment,a=n.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=r}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r!==this.parent,a=n!==this.subpath;!i&&!a||(i?(this.environment=void 0,r.root.identifierCache.mergeCache(this),this.baseSetParent(r,n),this.fireHook(Ta.afterAttach)):a&&this.baseSetParent(this.parent,n))}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.fireInternalHook(r);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[r];typeof i=="function"&&(tc?tc(function(){i.apply(n.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===Il.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(t.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var r=this.type,n=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=r.processInitialSnapshot(n,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(t.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(t.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=XA();if(!this.isAlive&&n!=="ignore"){var i=this._getAssertAliveError(r);switch(n){case"error":throw new Zt(i);case"warn":NP(i)}}}}),Object.defineProperty(t.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getEscapedPath(!1)||this.pathUponDeath||"",i=r.subpath&&Rf(r.subpath)||"",a=r.actionContext||aP();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var l="";if(a&&a.name!=null){var o=a&&a.context&&QA(a.context)||n;l="".concat(o,".").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(l,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.assertAlive({subpath:r}),this._autoUnbox=!1;try{return this._observableInstanceState===Il.CREATED?this.type.getChildNode(this,r):this._childNodes[r]}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(Fh),this._autoUnbox=!1;try{return this._observableInstanceState===Il.CREATED?this.type.getChildren(this):_8(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.type.getChildType(r)}}),Object.defineProperty(t.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.assertAlive(r),!this.isRunningAction()&&this.isProtected)throw new Zt("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this.type.removeChild(this,r)}}),Object.defineProperty(t.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r&&(this.assertAlive({subpath:r.subpath||r.subpathUponDeath}),this._autoUnbox?r.value:r)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=(this.isAlive?this.path:this.pathUponDeath)||"<root>",n=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(r).concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this.baseFinalizeCreation(function(){var n,i;try{for(var a=Zd(r.getChildren()),l=a.next();!l.done;l=a.next()){var o=l.value;o.finalizeCreation()}}catch(u){n={error:u}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}r.fireInternalHook(Ta.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new Zt("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(t.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;this._applyPatches=cp(this.storedValue,"@APPLY_PATCHES",function(n){n.forEach(function(i){if(!i.path){r.type.applySnapshot(r,i.value);return}var a=k8(i.path),l=w8(r,a.slice(0,-1));l.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=cp(this.storedValue,"@APPLY_SNAPSHOT",function(n){if(n!==r.snapshot)return r.type.applySnapshot(r,n)}),Tf(this.storedValue,"$treenode",this),Tf(this.storedValue,"toJSON",bP)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===ho.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==Il.UNINITIALIZED&&(this.getChildren().forEach(function(r){r.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(Bs.Dispose),this._internalEventsClear(Bs.Dispose))}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(n){n.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var r=this.snapshot;this._snapshotUponDeath=r,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._addSnapshotReaction(),this._internalEventsRegister(Bs.Snapshot,r)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEventsEmit(Bs.Snapshot,r)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsRegister(Bs.Patch,r)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._internalEventsHasSubscribers(Bs.Patch)){var i=n.path.substr(this.path.length)+(r.path?"/"+r.path:""),a=PP({},r,{path:i}),l=rf(TP(a),2),o=l[0],u=l[1];this._internalEventsEmit(Bs.Patch,o,u)}this.parent&&this.parent.emitPatch(r,n)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._internalEventsHas(Bs.Dispose,r)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this.hasDisposer(r)){this._internalEventsRegister(Bs.Dispose,r,!0);return}throw new Zt("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(t.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._internalEventsHas(Bs.Dispose,r))throw new Zt("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(Bs.Dispose,r)}}),Object.defineProperty(t.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(this.middlewares){var n=this.middlewares.indexOf(r);n>=0&&this.middlewares.splice(n,1)}}}),Object.defineProperty(t.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={handler:r,includeHooks:n};return this.middlewares?this.middlewares.push(a):this.middlewares=[a],function(){i.removeMiddleware(a)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this.assertWritable({subpath:r}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,r,n)}}),Object.defineProperty(t.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;if(!this._hasSnapshotReaction){var n=w6(function(){return r.snapshot},function(i){return r.emitSnapshot(i)},rP);this.addDisposer(n),this._hasSnapshotReaction=!0}}}),Object.defineProperty(t.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return!!this._internalEvents&&this._internalEvents.hasSubscribers(r)}}),Object.defineProperty(t.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new P8),this._internalEvents.register(r,n,i)}}),Object.defineProperty(t.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!!this._internalEvents&&this._internalEvents.has(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){this._internalEvents&&this._internalEvents.unregister(r,n)}}),Object.defineProperty(t.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(r){for(var n,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];this._internalEvents&&(n=this._internalEvents).emit.apply(n,Bf([r],rf(i),!1))}}),Object.defineProperty(t.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(r){this._internalEvents&&this._internalEvents.clear(r)}}),Object.defineProperty(t.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),t}(g8);xs.prototype.createObservableInstance=Wr(xs.prototype.createObservableInstance);xs.prototype.detach=Wr(xs.prototype.detach);xs.prototype.die=Wr(xs.prototype.die);var v8,Qr;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(Qr||(Qr={}));var m8="cannotDetermine",nP=Symbol("$type"),oc=function(){function e(t){Object.defineProperty(this,v8,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return ac(this,t),this.instantiate(null,"",r,t).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){throw new Zt("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=b8(t);if(n){var i=d8(t);return this.isAssignableFrom(i)?Ss():Es(r,t)}return this.isValidSnapshot(t,r)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.validate(t,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new Zt("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new Zt("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new Zt("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new Zt("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();v8=nP;oc.prototype.create=Wr(oc.prototype.create);var Mh=function(e){Kn(t,e);function t(r){var n=e.call(this,r)||this;return Object.defineProperty(n,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r===void 0&&(r=this.getDefaultSnapshot()),e.prototype.create.call(this,r,n)}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.createObservableInstanceIfNeeded(),r.storedValue}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return!r.identifierAttribute||r.identifier===Ep(n[r.identifierAttribute])}}),Object.defineProperty(t.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return r.isDetaching?!1:r.snapshot===n||ki(n)&&Tr(n)===r?!0:r.type===this&&E8(n)&&!ki(n)&&this.isMatchingSnapshotId(r,n)?(r.applySnapshot(n),!0):!1}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var l=this.tryToReconcileNode(r,n);if(l)return r.setParent(i,a),r;if(r.die(),ki(n)&&this.isAssignableFrom(d8(n))){var o=Tr(n);return o.setParent(i,a),o}return this.instantiate(i,a,void 0,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(oc);Mh.prototype.create=Wr(Mh.prototype.create);var Gf=function(e){Kn(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this&&r.storedValue===n)return r;var l=this.instantiate(i,a,void 0,n);return r.die(),l}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(oc);function sc(e){return typeof e=="object"&&e&&e.isType===!0}var iP=1,Qd;function aP(){return Qd}function oP(){return iP++}function sP(e,t){var r=Tr(e.context);e.type==="action"&&r.assertAlive({actionContext:e});var n=r._isRunningAction;r._isRunningAction=!0;var i=Qd;Qd=e;try{return cP(r,e,t)}finally{Qd=i,r._isRunningAction=n}}function lP(e){if(e)return e.type==="action"?e:e.parentActionEvent}function cp(e,t,r){var n=function(){var i=oP(),a=Qd,l=lP(a);return sP({type:"action",name:t,id:i,args:CP(arguments),context:e,tree:ZA(e),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?Bf(Bf([],rf(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:l},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}var uP=function(){function e(t,r){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),r.$mst_middleware&&this.middlewares.push(r.$mst_middleware);for(var n=t;n;)n.middlewares&&this.middlewares.push(n.middlewares),n=n.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.middlewares[this.arrayIndex];if(t){var r=t[this.inArrayIndex++];return r||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e}();function cP(e,t,r){var n=new uP(e,r);if(n.isEmpty)return Wr(r).apply(null,t.args);var i=null;function a(l){var o=n.getNextMiddleware(),u=o&&o.handler;if(!u)return Wr(r).apply(null,l.args);if(!o.includeHooks&&Ta[l.name])return a(l);function d(v,g){i=a(v),g&&(i=g(i))}function f(v){i=v}return u(l,d,f),i}return a(t)}function fP(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: ".concat(t,">")}}function y8(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):ki(e)?"<".concat(e,">"):"`".concat(fP(e),"`")}function hP(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function dP(e){var t=e.value,r=e.context[e.context.length-1].type,n=e.context.map(function(o){var u=o.path;return u}).filter(function(o){return o.length>0}).join("/"),i=n.length>0?'at path "/'.concat(n,'" '):"",a=ki(t)?"value of type ".concat(Tr(t).type.name,":"):fp(t)?"value":"snapshot",l=r&&ki(t)&&r.is(Tr(t).snapshot);return"".concat(i).concat(a," ").concat(y8(t)," is not assignable ").concat(r?"to type: `".concat(r.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(r?QP(r)||fp(t)?".":", expected an instance of `".concat(r.name,"` or a snapshot like `").concat(r.describe(),"` instead.")+(l?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function _m(e,t,r){return e.concat([{path:t,type:r}])}function Ss(){return Ih}function Es(e,t,r){return[{context:e,value:t,message:r}]}function m0(e){return e.reduce(function(t,r){return t.concat(r)},[])}function ac(e,t){LP()&&pP(e,t)}function pP(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw new Zt(gP(e,t,r))}function gP(e,t,r){if(r.length!==0)return"Error while converting ".concat(hP(y8(t))," to `").concat(e.name,`\`:
85
-
86
- `)+r.map(dP).join(`
87
- `)}var vP=0,mP=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:vP++}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:$r.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:$r.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t);this.lastCacheModificationPerId.set(t,r===void 0?1:r+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.lastCacheModificationPerId.get(t)||0;return"".concat(this.cacheId,"-").concat(r)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){if(r===void 0&&(r=!0),t.identifierAttribute){var n=t.identifier;this.cache.has(n)||this.cache.set(n,$r.array([],y0));var i=this.cache.get(n);if(i.indexOf(t)!==-1)throw new Zt("Already registered");i.push(t),r&&this.updateLastCacheModificationPerId(n)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;k6(t.identifierCache.cache).forEach(function(n){return n.forEach(function(i){r.addNodeToCache(i)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(t.identifierAttribute){var r=t.identifier,n=this.cache.get(r);n&&(n.remove(t),n.length||this.cache.delete(r),this.updateLastCacheModificationPerId(t.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,n=new e,i=t.path+"/";return jx(this.cache).forEach(function(a){for(var l=rf(a,2),o=l[0],u=l[1],d=!1,f=u.length-1;f>=0;f--){var v=u[f];(v===t||v.path.indexOf(i)===0)&&(n.addNodeToCache(v,!1),u.splice(f,1),u.length||r.cache.delete(o),d=!0)}d&&r.updateLastCacheModificationPerId(o)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);return n?n.some(function(i){return t.isAssignableFrom(i.type)}):!1}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.cache.get(r);if(!n)return null;var i=n.filter(function(a){return t.isAssignableFrom(a.type)});switch(i.length){case 0:return null;case 1:return i[0];default:throw new Zt("Cannot resolve a reference to type '".concat(t.name,"' with id: '").concat(r,"' unambigously, there are multiple candidates: ").concat(i.map(function(a){return a.path}).join(", ")))}}}),e}();function xm(e,t,r,n,i){var a=b8(i);if(a){if(a.parent)throw new Zt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(t?t.path:"","/").concat(r,"', but it lives already at '").concat(a.path,"'"));return t&&a.setParent(t,r),a}return new xs(e,t,r,n,i)}function uf(e,t,r,n,i){return new up(e,t,r,n,i)}function yP(e){return e instanceof up||e instanceof xs}var ho;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CREATED=1]="CREATED",e[e.FINALIZED=2]="FINALIZED",e[e.DETACHING=3]="DETACHING",e[e.DEAD=4]="DEAD"})(ho||(ho={}));function ki(e){return!!(e&&e.$treenode)}function Tr(e){if(!ki(e))throw new Zt("Value ".concat(e," is no MST Node"));return e.$treenode}function b8(e){return e&&e.$treenode||null}function bP(){return Tr(this).snapshot}function wP(e,t,r){return r===void 0&&(r=!0),w8(e,k8(t),r)}function w8(e,t,r){r===void 0&&(r=!0);var n=e;try{for(var i=0;i<t.length;i++){var a=t[i];if(a===".."){if(n=n.parent,n)continue}else{if(a===".")continue;if(n){if(n instanceof up){var l=n.value;ki(l)&&(n=Tr(l))}if(n instanceof xs){var o=n.getChildType(a);if(o&&(n=n.getChildNode(a),n))continue}}}throw new Zt("Could not resolve '".concat(a,"' in path '").concat(xb(t.slice(0,i))||"/","' while resolving '").concat(xb(t),"'"))}}catch(u){if(!r)return;throw u}return n}function _8(e){if(!e)return Ih;var t=Object.keys(e);if(!t.length)return Ih;var r=new Array(t.length);return t.forEach(function(n,i){r[i]=e[n]}),r}var _P=Object.toString(),Ih=Object.freeze([]),Fh=Object.freeze({}),y0=ux().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(y0);var Zt=function(e){Kn(t,e);function t(r){return r===void 0&&(r="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(r))||this}return t}(Error);function xP(e){return e}var SP=Number.isInteger;function EP(e){return Number(e)===e&&e%1!==0}function AP(e){return Number.isFinite(e)}function x8(e){return Array.isArray(e)||Lu(e)}function S8(e){return e?x8(e)?e:[e]:Ih}function PP(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n];for(var a in i)e[a]=i[a]}return e}function xh(e){var t;if(e===null||typeof e!="object")return!1;var r=Object.getPrototypeOf(e);return r==null?!0:((t=r.constructor)===null||t===void 0?void 0:t.toString())===_P}function E8(e){return e!==null&&typeof e=="object"&&!(e instanceof Date)&&!(e instanceof RegExp)}function fp(e,t){return t===void 0&&(t=!0),e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||t&&e instanceof Date}function A8(e){return typeof e!="function"}function kP(e,t,r){Ul(e)?C6(e,t,r):Object.defineProperty(e,t,r)}function Tf(e,t,r){kP(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}var OP=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this;return r===void 0&&(r=!1),r?this.handlers.unshift(t):this.handlers.push(t),function(){n.unregister(t)}}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.handlers.indexOf(t)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.handlers.indexOf(t);r>=0&&this.handlers.splice(r,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this.handlers.slice();n.forEach(function(i){return i.apply(void 0,Bf([],rf(t),!1))})}}),e}(),P8=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.eventHandlers&&this.eventHandlers[t];return!!r&&r.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){n===void 0&&(n=!1),this.eventHandlers||(this.eventHandlers={});var i=this.eventHandlers[t];return i||(i=this.eventHandlers[t]=new OP),i.register(r,n)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];return!!n&&n.has(r)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var n=this.eventHandlers&&this.eventHandlers[t];n&&n.unregister(r)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.eventHandlers&&delete this.eventHandlers[t]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this.eventHandlers&&this.eventHandlers[t];a&&(r=a).emit.apply(r,Bf([],rf(n),!1))}}),e}();function CP(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}function Ng(e,t){return e.indexOf(t)===0}function NP(e){console.warn(new Error("[mobx-state-tree] ".concat(e)))}function LP(){return typeof process<"u"&&bb&&bb.ENABLE_TYPE_CHECK==="true"}function TP(e){if(!("oldValue"in e))throw new Zt("Patches without `oldValue` field cannot be inversed");return[RP(e),MP(e)]}function RP(e){switch(e.op){case"add":return{op:"add",path:e.path,value:e.value};case"remove":return{op:"remove",path:e.path};case"replace":return{op:"replace",path:e.path,value:e.value}}}function MP(e){switch(e.op){case"add":return{op:"remove",path:e.path};case"remove":return{op:"add",path:e.path,value:e.oldValue};case"replace":return{op:"replace",path:e.path,value:e.oldValue}}}function IP(e){return typeof e=="number"}function Rf(e){return IP(e)===!0?""+e:e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function FP(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function xb(e){if(e.length===0)return"";var t=function(r){return r.map(Rf).join("/")};return e[0]==="."||e[0]===".."?t(e):"/"+t(e)}function k8(e){var t=e.split("/").map(FP),r=e===""||e==="."||e===".."||Ng(e,"/")||Ng(e,"./")||Ng(e,"../");if(!r)throw new Zt("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return t[0]===""&&t.shift(),t}var Lg=Symbol("$preProcessorFailed"),jP=function(e){Kn(t,e);function t(r,n,i){var a=e.call(this,i||r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|Qr.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(t.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._processors.preProcessor?this._processors.preProcessor.call(null,r):r}}),Object.defineProperty(t.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(r){try{return this.preProcessSnapshot(r)}catch{return Lg}}}),Object.defineProperty(t.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._processors.postProcessor?this._processors.postProcessor.call(null,r,n.storedValue):r}}),Object.defineProperty(t.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;DP(r.type,this,"create"),r instanceof xs&&(r.hasSnapshotPostProcessor=!!this._processors.postProcessor);var i=r.getSnapshot;r.getSnapshot=function(){return n.postProcessSnapshot(i.call(r),r)},ik(this._subtype)||(r.getReconciliationType=function(){return n})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var l=ki(a)?a:this.preProcessSnapshot(a),o=this._subtype.instantiate(r,n,i,l);return this._fixNode(o),o}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var l=this._subtype.reconcile(r,ki(n)?n:this.preProcessSnapshot(n),i,a);return l!==r&&this._fixNode(l),l}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=!0);var i=this._subtype.getSnapshot(r);return n?this.postProcessSnapshot(i,r):i}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.preProcessSnapshotSafe(r);return i===Lg?Es(n,r,"Failed to preprocess value"):this._subtype.validate(i,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=sc(r)?this._subtype:ki(r)?wu(r,!1):this.preProcessSnapshotSafe(r);return n===Lg?!1:this._subtype.validate(n,[{path:"",type:this._subtype}]).length===0}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!(this._subtype instanceof Mh))return!1;var i=this.preProcessSnapshot(n);return this._subtype.isMatchingSnapshotId(r,i)}}),t}(oc);function DP(e,t){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var l=Zd(i),o=l.next();!o.done;o=l.next()){var u=o.value;e[u]=t[u].bind(t)}}catch(d){r={error:d}}finally{try{o&&!o.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}function BP(e,t,r){return new jP(e,t,r)}var Sb="Map.put can only be used to store complex values that have an identifier type attribute";function O8(e,t){var r,n,i=e.getSubTypes();if(i===m8)return!1;if(i){var a=S8(i);try{for(var l=Zd(a),o=l.next();!o.done;o=l.next()){var u=o.value;if(!O8(u,t))return!1}}catch(d){r={error:d}}finally{try{o&&!o.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}return e instanceof hp&&t.push(e),!0}var Gc;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.YES=1]="YES",e[e.NO=2]="NO"})(Gc||(Gc={}));var zP=function(e){Kn(t,e);function t(r,n){return e.call(this,r,$r.ref.enhancer,n)||this}return Object.defineProperty(t.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.get.call(this,""+r)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.has.call(this,""+r)}}),Object.defineProperty(t.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return e.prototype.delete.call(this,""+r)}}),Object.defineProperty(t.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return e.prototype.set.call(this,""+r,n)}}),Object.defineProperty(t.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!r)throw new Zt("Map.put cannot be used to set empty values");if(ki(r)){var n=Tr(r);if(n.identifier===null)throw new Zt(Sb);return this.set(n.identifier,r),r}else if(E8(r)){var i=Tr(this),a=i.type;if(a.identifierMode!==Gc.YES)throw new Zt(Sb);var l=a.mapIdentifierAttribute,o=r[l];if(!Sm(o)){var u=this.put(a.getChildType().create(r,i.environment));return this.put(wu(u))}var d=Ep(o);return this.set(d,r),this.get(d)}else throw new Zt("Map.put can only be used to store complex values")}}),t}(lm),X1=function(e){Kn(t,e);function t(r,n,i){i===void 0&&(i=[]);var a=e.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:Gc.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:Qr.Map}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a._determineIdentifierMode(),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._determineIdentifierMode(),xm(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===Gc.UNKNOWN){var r=[];if(O8(this._subType,r)){var n=r.reduce(function(i,a){if(!a.identifierAttribute)return i;if(i&&i!==a.identifierAttribute)throw new Zt("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=Gc.YES,this.mapIdentifierAttribute=n):this.identifierMode=Gc.NO}}}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type._subType,a={};return Object.keys(n).forEach(function(l){a[l]=i.instantiate(r,l,void 0,n[l])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new zP(r,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){A6(n,r.unbox);var i=r.type;i.hookInitializers.forEach(function(a){var l=a(n);Object.keys(l).forEach(function(o){var u=l[o],d=cp(n,o,u);Tf(n,o,d)})}),am(n,this.willChange),om(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return k6(r.storedValue)}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=r.storedValue.get(""+n);if(!i)throw new Zt("Not a child "+n);return i}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Tr(r.object),i=r.name;n.assertWritable({subpath:i});var a=n.type,l=a._subType;switch(r.type){case"update":{var o=r.newValue,u=r.object.get(i);if(o===u)return null;ac(l,o),r.newValue=l.reconcile(n.getChildNode(i),r.newValue,n,i),a.processIdentifier(i,r.newValue)}break;case"add":ac(l,r.newValue),r.newValue=l.instantiate(n,i,void 0,r.newValue),a.processIdentifier(i,r.newValue);break}return r}}),Object.defineProperty(t.prototype,"processIdentifier",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.identifierMode===Gc.YES&&n instanceof xs){var i=n.identifier;if(i!==r)throw new Zt("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(i,"', but expected: '").concat(r,"'"))}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return r.getChildren().forEach(function(i){n[i.subpath]=i.snapshot}),n}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Tr(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:Rf(r.name),value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"add":return void n.emitPatch({op:"add",path:Rf(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:Rf(r.name),oldValue:i},n)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue;switch(i.op){case"add":case"replace":a.set(n,i.value);break;case"remove":a.delete(n);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ac(this,n);var i=r.storedValue,a={};if(Array.from(i.keys()).forEach(function(o){a[o]=!1}),n)for(var l in n)i.set(l,n[l]),a[""+l]=!0;Object.keys(a).forEach(function(o){a[o]===!1&&i.delete(o)})}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return xh(r)?m0(Object.keys(r).map(function(a){return i._subType.validate(r[a],_m(n,a,i._subType))})):Es(n,r,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Fh}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.delete(n)}}),t}(Mh);X1.prototype.applySnapshot=Wr(X1.prototype.applySnapshot);function UP(e){return new X1("Map<string, ".concat(e.name,">"),e)}var K1=function(e){Kn(t,e);function t(r,n,i){i===void 0&&(i=[]);var a=e.call(this,r)||this;return Object.defineProperty(a,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Qr.Array}),Object.defineProperty(a,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),a.hookInitializers=i,a}return Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.hookInitializers.length>0?this.hookInitializers.concat(r):[r];return new t(this.name,this._subType,n)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return xm(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n=[]);var i=r.type._subType,a={};return n.forEach(function(l,o){var u=""+o;a[u]=i.instantiate(r,u,void 0,l)}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Nu(Nu({},y0),{name:this.name});return $r.array(_8(r),n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Cu(n).dehancer=r.unbox;var i=r.type;i.hookInitializers.forEach(function(a){var l=a(n);Object.keys(l).forEach(function(o){var u=l[o],d=cp(n,o,u);Tf(n,o,d)})}),am(n,this.willChange),om(n,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue.slice()}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=Number(n);if(i<r.storedValue.length)return r.storedValue[i];throw new Zt("Not a child: "+n)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Tr(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 l=Eb(n,i,[a[r.index]],[r.newValue],[r.index]);if(!l)return null;r.newValue=l[0]}break;case"splice":{var o=r.index,u=r.removedCount,d=r.added,f=Eb(n,i,a.slice(o,o+u),d,d.map(function(g,c){return o+c}));if(!f)return null;r.added=f;for(var v=o+u;v<a.length;v++)a[v].setParent(n,""+(v+d.length-u))}break}return r}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.getChildren().map(function(n){return n.snapshot})}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=[];return Object.keys(r).forEach(function(i){n.push(r[i].getSnapshot())}),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Tr(r.object);switch(r.type){case"update":return void n.emitPatch({op:"replace",path:""+r.index,value:r.newValue.snapshot,oldValue:r.oldValue?r.oldValue.snapshot:void 0},n);case"splice":if(r.removedCount&&r.addedCount===r.object.length)return void n.emitPatch({op:"replace",path:"",value:n.snapshot,oldValue:r.removed.map(function(a){return a.snapshot})},n);for(var i=r.removedCount-1;i>=0;i--)n.emitPatch({op:"remove",path:""+(r.index+i),oldValue:r.removed[i].snapshot},n);for(var i=0;i<r.addedCount;i++)n.emitPatch({op:"add",path:""+(r.index+i),value:r.added[i].snapshot,oldValue:void 0},n);return}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=r.storedValue,l=n==="-"?a.length:Number(n);switch(i.op){case"replace":a[l]=i.value;break;case"add":a.splice(l,0,i.value);break;case"remove":a.splice(l,1);break}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ac(this,n);var i=r.storedValue;i.replace(n)}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;return x8(r)?m0(r.map(function(a,l){return i._subType.validate(a,_m(n,""+l,i._subType))})):Es(n,r,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Ih}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue.splice(Number(n),1)}}),t}(Mh);K1.prototype.applySnapshot=Wr(K1.prototype.applySnapshot);function qP(e){return new K1("".concat(e.name,"[]"),e)}function Eb(e,t,r,n,i){for(var a=!0,l=0;;l++){var o=l<=n.length-1,u=r[l],d=o?n[l]:void 0,f=""+i[l];if(yP(d)&&(d=d.storedValue),!u&&!o)break;if(!o)a=!1,r.splice(l,1),u instanceof xs&&u.createObservableInstanceIfNeeded(),u.die(),l--;else if(u)if(Ab(u,d))r[l]=Tg(t,e,f,d,u);else{for(var g=void 0,c=l;c<r.length;c++)if(Ab(r[c],d)){g=r.splice(c,1)[0];break}a=!1;var v=Tg(t,e,f,d,g);r.splice(l,0,v)}else{if(ki(d)&&Tr(d).parent===e)throw new Zt("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e.path,"/").concat(f,"', but it lives already at '").concat(Tr(d).path,"'"));a=!1;var v=Tg(t,e,f,d);r.splice(l,0,v)}}return a?null:r}function Tg(e,t,r,n,i){ac(e,n);function a(){if(ki(n)){var o=Tr(n);if(o.assertAlive(Fh),o.parent!==null&&o.parent===t)return o.setParent(t,r),o}return i?e.reconcile(i,n,t,r):e.instantiate(t,r,void 0,n)}var l=a();return i&&i!==l&&(i instanceof xs&&i.createObservableInstanceIfNeeded(),i.die()),l}function Ab(e,t){if(!e.isAlive)return!1;if(ki(t)){var r=Tr(t);return r.isAlive&&r===e}if(e.snapshot===t)return!0;if(!(e instanceof xs))return!1;var n=e.getReconciliationType();return e.identifier!==null&&e.identifierAttribute&&xh(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}var Pb="preProcessSnapshot",kb="postProcessSnapshot";function HP(){return Tr(this).toString()}var Ob={name:"AnonymousModel",properties:{},initializers:Ih};function VP(e){var t=Object.keys(e),r=new Set;return t.forEach(function(n){if(r.has(n))throw new Zt("".concat(n," is declared twice in the model. Model should not contain the same keys"));r.add(n)}),t.reduce(function(n,i){if(i in Ta)throw new Zt("Hook '".concat(i,"' was defined as property. Hooks should be defined as part of the actions"));var a=Object.getOwnPropertyDescriptor(e,i);if("get"in a)throw new Zt("Getters are not supported as properties. Please use views instead");var l=a.value;if(l==null)throw new Zt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(fp(l))n[i]=Mf(ZP(l),l);else if(l instanceof X1)n[i]=Mf(l,{});else if(l instanceof K1)n[i]=Mf(l,[]);else if(!sc(l))throw new Zt("Invalid type definition for property '".concat(i,"', cannot infer a type from a value like '").concat(l,"' (").concat(typeof l,")"));return n},Nu({},e))}var hp=function(e){Kn(t,e);function t(r){var n=e.call(this,r.name||Ob.name)||this;return Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Qr.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(l){return a(i(l))}}):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(l){return i(a(l))}}):n.cloneAndEnhance({postProcessor:i})}}),Object.assign(n,Ob,r),n.properties=VP(n.properties),n.properties,n.propertyNames=Object.keys(n.properties),n.identifierAttribute=n._getIdentifierAttribute(),n}return Object.defineProperty(t.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=void 0;return this.forAllProps(function(n,i){if(i.flags&Qr.Identifier){if(r)throw new Zt("Cannot define property '".concat(n,"' as object identifier, property '").concat(r,"' is already defined as identifier property"));r=n}}),r}}),Object.defineProperty(t.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return new t({name:r.name||this.name,properties:Object.assign({},this.properties,r.properties),initializers:this.initializers.concat(r.initializers||[]),preProcessor:r.preProcessor||this.preProcessor,postProcessor:r.postProcessor||this.postProcessor})}}),Object.defineProperty(t.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateActions(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateActions",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!xh(n))throw new Zt("actions initializer should return a plain object containing actions");Object.keys(n).forEach(function(i){if(i===Pb)throw new Zt("Cannot define action '".concat(Pb,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(i===kb)throw new Zt("Cannot define action '".concat(kb,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var a=n[i],l=r[i];if(i in Ta&&l){var o=a;a=function(){l.apply(null,arguments),o.apply(null,arguments)}}var u=a.$mst_middleware,d=a.bind(n);d._isFlowAction=a._isFlowAction||!1,d.$mst_middleware=u;var f=cp(r,i,d);n[i]=f,Tf(r,i,f)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;if(typeof r!="function")throw new Zt("You passed an ".concat(typeof r," to volatile state as an argument, when function is expected"));var i=function(a){return n.instantiateVolatileState(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!xh(n))throw new Zt("volatile state initializer should return a plain object containing state");O6(r,n)}}),Object.defineProperty(t.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){var l=r(a),o=l.actions,u=l.views,d=l.state,f=KA(l,["actions","views","state"]);for(var v in f)throw new Zt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(v,"'"));return d&&n.instantiateVolatileState(a,d),u&&n.instantiateViews(a,u),o&&n.instantiateActions(a,o),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=function(a){return n.instantiateViews(a,r(a)),a};return this.cloneAndEnhance({initializers:[i]})}}),Object.defineProperty(t.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(!xh(n))throw new Zt("views initializer should return a plain object containing views");Object.getOwnPropertyNames(n).forEach(function(i){var a,l=Object.getOwnPropertyDescriptor(n,i);if("get"in l)C6(r,i,l),L6(r,(a={},a[i]=qf,a));else if(typeof l.value=="function")Tf(r,i,l.value);else throw new Zt("A view member should either be a function or getter based property")})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var l=ki(a)?a:this.applySnapshotPreProcessor(a);return xm(this,r,n,i,l)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){n===void 0&&(n={});var i=r.type,a={};return i.forAllProps(function(l,o){a[l]=o.instantiate(r,l,void 0,n[l])}),a}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=Nu(Nu({},y0),{name:this.name});return $r.object(r,Fh,n)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){Tf(n,"toString",HP),this.forAllProps(function(i){A6(n,i,r.unbox)}),this.initializers.reduce(function(i,a){return a(i)},n),am(n,this.willChange),om(n,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Tr(n.object),a=n.name;i.assertWritable({subpath:a});var l=i.type.properties[a];return l&&(ac(l,n.newValue),n.newValue=l.reconcile(i.getChildNode(a),n.newValue,i,a)),n}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r,i=Tr(n.object),a=i.type.properties[n.name];if(a){var l=n.oldValue?n.oldValue.snapshot:void 0;i.emitPatch({op:"replace",path:Rf(n.name),value:n.newValue.snapshot,oldValue:l},i)}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,i=[];return this.forAllProps(function(a){i.push(n.getChildNode(r,a))}),i}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i;if(!(n in this.properties))throw new Zt("Not a value property: "+n);var a=Cu(r.storedValue,n),l=(i=a.raw)===null||i===void 0?void 0:i.call(a);if(!l)throw new Zt("Node not available for property "+n);return l}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this;n===void 0&&(n=!0);var a={};return this.forAllProps(function(l,o){try{var u=Th(r.storedValue,l);u.reportObserved()}catch{throw new Zt("".concat(l," property is declared twice"))}a[l]=i.getChildNode(r,l).snapshot}),n?this.applySnapshotPostProcessor(a):a}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n={};return Object.keys(r).forEach(function(i){n[i]=r[i].getSnapshot()}),this.applySnapshotPostProcessor(n)}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){if(!(i.op==="replace"||i.op==="add"))throw new Zt("object does not support operation ".concat(i.op));r.storedValue[n]=i.value}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){ac(this,n);var i=this.applySnapshotPreProcessor(n);this.forAllProps(function(a){r.storedValue[a]=i[a]})}}),Object.defineProperty(t.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.preProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.postProcessor;return n?n.call(null,r):r}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.properties[r]}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.applySnapshotPreProcessor(r);return xh(a)?m0(this.propertyNames.map(function(l){return i.properties[l].validate(a[l],_m(n,l,i.properties[l]))})):Es(n,a,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;this.propertyNames.forEach(function(i){return r(i,n.properties[i])})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;return"{ "+this.propertyNames.map(function(n){return n+": "+r.properties[n].describe()}).join("; ")+" }"}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Fh}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){r.storedValue[n]=void 0}}),t}(Mh);hp.prototype.applySnapshot=Wr(hp.prototype.applySnapshot);function GP(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():"AnonymousModel",n=e.shift()||{};return new hp({name:r,properties:n})}function $P(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string",n=r?e[0]:"AnonymousModel";return r&&e.shift(),e.reduce(function(i,a){return i.cloneAndEnhance({name:i.name+"_"+a.name,properties:a.properties,initializers:a.initializers,preProcessor:function(l){return a.applySnapshotPreProcessor(i.applySnapshotPreProcessor(l))},postProcessor:function(l){return a.applySnapshotPostProcessor(i.applySnapshotPostProcessor(l))}})}).named(n)}function WP(e){return sc(e)&&(e.flags&Qr.Object)>0}var uc=function(e){Kn(t,e);function t(r,n,i,a){a===void 0&&(a=xP);var l=e.call(this,r)||this;return Object.defineProperty(l,"flags",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(l,"checker",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(l,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:a}),l.flags=n,l}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return uf(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.initializer(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(fp(r)&&this.checker(r))return Ss();var i=this.name==="Date"?"Date or a unix milliseconds timestamp":this.name;return Es(n,r,"Value is not a ".concat(i))}}),t}(Gf),C8=new uc("string",Qr.String,function(e){return typeof e=="string"}),N8=new uc("number",Qr.Number,function(e){return typeof e=="number"}),YP=new uc("integer",Qr.Integer,function(e){return SP(e)}),XP=new uc("float",Qr.Float,function(e){return EP(e)}),KP=new uc("finite",Qr.Finite,function(e){return AP(e)}),L8=new uc("boolean",Qr.Boolean,function(e){return typeof e=="boolean"}),T8=new uc("null",Qr.Null,function(e){return e===null}),R8=new uc("undefined",Qr.Undefined,function(e){return e===void 0}),M8=new uc("Date",Qr.Date,function(e){return typeof e=="number"||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});M8.getSnapshot=function(e){return e.storedValue.getTime()};var I8=M8;function ZP(e){switch(typeof e){case"string":return C8;case"number":return N8;case"boolean":return L8;case"object":if(e instanceof Date)return I8}throw new Zt("Cannot determine primitive type from value "+e)}function QP(e){return sc(e)&&(e.flags&(Qr.String|Qr.Number|Qr.Integer|Qr.Boolean|Qr.Date))>0}var JP=function(e){Kn(t,e);function t(r){var n=e.call(this,JSON.stringify(r))||this;return Object.defineProperty(n,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Qr.Literal}),n.value=r,n}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return uf(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return fp(r)&&r===this.value?Ss():Es(n,r,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),t}(Gf);function F8(e){return new JP(e)}var ek=function(e){Kn(t,e);function t(r,n,i,a){var l=e.call(this,r)||this;return Object.defineProperty(l,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(l,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(l,"_message",{enumerable:!0,configurable:!0,writable:!0,value:a}),l}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|Qr.Refinement},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this._subtype.validate(r,n);if(i.length>0)return i;var a=ki(r)?Tr(r).snapshot:r;return this._predicate(a)?Ss():Es(n,r,this._message(r))}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(oc);function tk(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=typeof e[0]=="string"?e.shift():sc(e[0])?e[0].name:null,n=e[0],i=e[1],a=e[2]?e[2]:function(l){return"Value does not respect the refinement predicate"};return new ek(r,n,i,a)}function rk(e,t){var r=typeof e=="string"?t:e,n=b0.apply(void 0,Bf([],rf(r.map(function(i){return F8(""+i)})),!1));return typeof e=="string"&&(n.name=e),n}var nk=function(e){Kn(t,e);function t(r,n,i){var a=e.call(this,r)||this;return Object.defineProperty(a,"_types",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),i=Nu({eager:!0,dispatcher:void 0},i),a._dispatcher=i.dispatcher,i.eager||(a._eager=!1),a}return Object.defineProperty(t.prototype,"flags",{get:function(){var r=Qr.Union;return this._types.forEach(function(n){r|=n.flags}),r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._types.some(function(n){return n.isAssignableFrom(r)})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(r){return r.describe()}).join(" | ")+")"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var l=this.determineType(a,void 0);if(!l)throw new Zt("No matching type for union "+this.describe());return l.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var l=this.determineType(n,r.getReconciliationType());if(!l)throw new Zt("No matching type for union "+this.describe());return l.reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this._dispatcher?this._dispatcher(r):n?n.is(r)?n:this._types.filter(function(i){return i!==n}).find(function(i){return i.is(r)}):this._types.find(function(i){return i.is(r)})}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this._dispatcher)return this._dispatcher(r).validate(r,n);for(var i=[],a=0,l=0;l<this._types.length;l++){var o=this._types[l],u=o.validate(r,n);if(u.length===0){if(this._eager)return Ss();a++}else i.push(u)}return a===1?Ss():Es(n,r,"No type is applicable for the union").concat(m0(i))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(oc);function b0(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=sc(e)?void 0:e,i=sc(e)?Bf([e],rf(t),!1):t,a="("+i.map(function(l){return l.name}).join(" | ")+")";return new nk(a,i,n)}function ik(e){return sc(e)&&(e.flags&Qr.Union)>0}var ak=function(e){Kn(t,e);function t(r,n,i){var a=e.call(this,r.name)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:i}),a}return Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|Qr.Optional},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(this.optionalValues.indexOf(a)>=0){var l=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(r,n,i,l)}return this._subtype.instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this._subtype.reconcile(r,this.optionalValues.indexOf(n)<0&&this._subtype.is(n)?n:this.getDefaultInstanceOrSnapshot(),i,a)}}),Object.defineProperty(t.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=typeof this._defaultValue=="function"?this._defaultValue():this._defaultValue;return typeof this._defaultValue=="function"&&ac(this,r),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.optionalValues.indexOf(r)>=0?Ss():this._subtype.validate(r,n)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this._subtype.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(oc);function ok(e,t){if(typeof t!="function"&&ki(t))throw new Zt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}function Mf(e,t,r){return ok(e,t),new ak(e,t,r||sk)}var sk=[void 0],lk=Mf(R8,void 0),uk=Mf(T8,null);function j8(e){return b0(e,lk)}function ck(e){return b0(e,uk)}var fk=function(e){Kn(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i}return Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|Qr.Late},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(!this._subType){var n=void 0;try{n=this._definition()}catch(i){if(i instanceof ReferenceError)n=void 0;else throw i}if(r&&n===void 0)throw new Zt("Late type seems to be used too early, the definition (still) returns undefined");n&&(this._subType=n)}return this._subType}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).instantiate(r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.getSubType(!0).reconcile(r,n,i,a)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r?r.name:"<uknown late type>"}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this.getSubType(!1);return i?i.validate(r,n):Ss()}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this.getSubType(!1);return n?n.isAssignableFrom(r):!1}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this.getSubType(!1);return r||m8}}),t}(oc);function hk(e,t){var r=typeof e=="string"?e:"late(".concat(e.toString(),")"),n=typeof e=="string"?t:e;return new fk(r,n)}function dk(e,t){return new pk(e,t)}var pk=function(e){Kn(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Qr.Lazy}),Object.defineProperty(i,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:$r.array()}),Cy(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(Wr(function(a){i.loadedType=a,i.pendingNodeList.forEach(function(l){l.parent&&i.loadedType&&l.parent.applyPatches([{op:"replace",path:"/".concat(l.subpath),value:l.snapshot}])})}))}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var l=this;if(this.loadedType)return this.loadedType.instantiate(r,n,i,a);var o=uf(this,r,n,i,a);return this.pendingNodeList.push(o),Cy(function(){return!o.isAlive},function(){return l.pendingNodeList.splice(l.pendingNodeList.indexOf(o),1)}),o}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return this.loadedType?this.loadedType.validate(r,n):A8(r)?Ss():Es(n,r,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return this.loadedType?(r.die(),this.loadedType.instantiate(i,a,i.environment,n)):e.prototype.reconcile.call(this,r,n,i,a)}}),t}(Gf),D8=function(e){Kn(t,e);function t(r){var n=e.call(this,r?"frozen(".concat(r.name,")"):"frozen")||this;return Object.defineProperty(n,"subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Qr.Frozen}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){return uf(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return A8(r)?this.subType?this.subType.validate(r,n):Ss():Es(n,r,"Value is not serializable and cannot be frozen")}}),t}(Gf),Cb=new D8;function gk(e){return arguments.length===0?Cb:sc(e)?new D8(e):Mf(Cb,e)}function vk(e){switch(e){case Ta.beforeDestroy:return"destroy";case Ta.beforeDetach:return"detach";default:return}}var mk=function(){function e(t,r){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Sm(t))this.identifier=t;else if(ki(t)){var n=Tr(t);if(!n.identifierAttribute)throw new Zt("Can only store references with a defined identifier attribute.");var i=n.unnormalizedIdentifier;if(i==null)throw new Zt("Can only store references to tree nodes with a defined identifier.");this.identifier=i}else throw new Zt("Can only store references to tree nodes or identifiers, got: '".concat(t,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=Ep(this.identifier),n=t.root,i=n.identifierCache.getLastCacheModificationPerId(r);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==i){var a=this.targetType,l=n.identifierCache.resolve(a,r);if(!l)throw new yk("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(t.path,")"));this.resolvedReference={node:l,lastCacheModification:i}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),yk=function(e){Kn(t,e);function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return t}(Error),B8=function(e){Kn(t,e);function t(r,n){var i=e.call(this,"reference(".concat(r.name,")"))||this;return Object.defineProperty(i,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Qr.Reference}),i}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.targetType.isAssignableFrom(r)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return Sm(r)?Ss():Es(n,r,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(t.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var l=n.parent;if(!(!l||!l.isAlive)){var o=l.storedValue;o&&this.onInvalidated({cause:r,parent:o,invalidTarget:a?a.storedValue:void 0,invalidId:i,replaceRef:function(u){wb(n.root.storedValue,{op:"replace",value:u,path:n.path})},removeRef:function(){WP(l.type)?this.replaceRef(void 0):wb(n.root.storedValue,{op:"remove",path:n.path})}})}}}),Object.defineProperty(t.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){var i=this,a=this.getValue(r);if(a){var l=Tr(a),o=function(f,v){var g=vk(v);g&&i.fireInvalidated(g,r,n,l)},u=l.registerHook(Ta.beforeDetach,o),d=l.registerHook(Ta.beforeDestroy,o);return function(){u(),d()}}}}),Object.defineProperty(t.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i){var a=this;if(this.onInvalidated){var l;r.registerHook(Ta.beforeDestroy,function(){l&&l()});var o=function(u){l&&l();var d=r.parent,f=d&&d.storedValue;if(d&&d.isAlive&&f){var v=void 0;i?v=!!i.get(n,f):v=r.root.identifierCache.has(a.targetType,Ep(n)),v?l=a.addTargetNodeWatcher(r,n):u||a.fireInvalidated("invalidSnapshotReference",r,n,null)}};r.state===ho.FINALIZED?o(!0):(r.isRoot||r.root.registerHook(Ta.afterCreationFinalization,function(){r.parent&&r.parent.createObservableInstanceIfNeeded()}),r.registerHook(Ta.afterAttach,function(){o(!1)}))}}}),t}(Gf),bk=function(e){Kn(t,e);function t(r,n){return e.call(this,r,n)||this}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=r.storedValue;return n.resolvedValue}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=r.storedValue;return n.identifier}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var l=ki(a)?eP(a):a,o=new mk(a,this.targetType),u=uf(this,r,n,i,o);return o.node=u,this.watchTargetNodeForInvalidations(u,l,void 0),u}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r.isDetaching&&r.type===this){var l=ki(n),o=r.storedValue;if(!l&&o.identifier===n||l&&o.resolvedValue===n)return r.setParent(i,a),r}var u=this.instantiate(i,a,void 0,n);return r.die(),u}}),t}(B8),wk=function(e){Kn(t,e);function t(r,n,i){var a=e.call(this,r,i)||this;return Object.defineProperty(a,"options",{enumerable:!0,configurable:!0,writable:!0,value:n}),a}return Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(r.isAlive){var n=this.options.get(r.storedValue,r.parent?r.parent.storedValue:null);return n}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var l=ki(a)?this.options.set(a,r?r.storedValue:null):a,o=uf(this,r,n,i,l);return this.watchTargetNodeForInvalidations(o,l,this.options),o}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var l=ki(n)?this.options.set(n,r?r.storedValue:null):n;if(!r.isDetaching&&r.type===this&&r.storedValue===l)return r.setParent(i,a),r;var o=this.instantiate(i,a,void 0,l);return r.die(),o}}),t}(B8);function z8(e,t){var r=t||void 0,n=t?t.onInvalidated:void 0;return r&&(r.get||r.set)?new wk(e,{get:r.get,set:r.set},n):new bk(e,n)}function _k(e,t){var r=z8(e,Nu(Nu({},t),{onInvalidated:function(n){t&&t.onInvalidated&&t.onInvalidated(n),n.removeRef()}}));return t&&t.acceptsUndefined===!1?r:j8(r)}var U8=function(e){Kn(t,e);function t(r,n){var i=e.call(this,r)||this;return Object.defineProperty(i,"validType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Qr.Identifier}),i}return Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(!r||!(r.type instanceof hp))throw new Zt("Identifier types can only be instantiated as direct child of a model type");return uf(this,r,n,i,a)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){if(r.storedValue!==n)throw new Zt("Tried to change identifier from '".concat(r.storedValue,"' to '").concat(n,"'. Changing identifiers is not allowed."));return r.setParent(i,a),r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){return typeof r!==this.validType?Es(n,r,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):Ss()}}),t}(Gf),xk=function(e){Kn(t,e);function t(){var r=e.call(this,"identifier","string")||this;return Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Qr.Identifier}),r}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t}(U8),Sk=function(e){Kn(t,e);function t(){return e.call(this,"identifierNumber","number")||this}return Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return r.storedValue}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),t}(U8),Ek=new xk,Ak=new Sk;function Ep(e){return""+e}function Sm(e){return typeof e=="string"||typeof e=="number"}function Pk(e){return new kk(e)}var kk=function(e){Kn(t,e);function t(r){var n=e.call(this,r.name)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:Qr.Custom}),n}return Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n){if(this.options.isTargetType(r))return Ss();var i=this.options.getValidationMessage(r);return i?Es(n,r,"Invalid value for type '".concat(this.name,"': ").concat(i)):Ss()}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(r){return this.options.toSnapshot(r.storedValue)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var l=this.options.isTargetType(a)?a:this.options.fromSnapshot(a,r&&r.root.environment);return uf(this,r,n,i,l)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(r,n,i,a){var l=!this.options.isTargetType(n);if(!r.isDetaching){var o=r.type===this&&(l?n===r.snapshot:n===r.storedValue);if(o)return r.setParent(i,a),r}var u=l?this.options.fromSnapshot(n,i.root.environment):n,d=this.instantiate(i,a,void 0,u);return r.die(),d}}),t}(Gf),Jt={enumeration:rk,model:GP,compose:$P,custom:Pk,reference:z8,safeReference:_k,union:b0,optional:Mf,literal:F8,maybe:j8,maybeNull:ck,refinement:tk,string:C8,boolean:L8,number:N8,integer:YP,float:XP,finite:KP,Date:I8,map:UP,array:qP,frozen:gk,identifier:Ek,identifierNumber:Ak,late:hk,lazy:dk,undefined:R8,null:T8,snapshotProcessor:BP};function q8({oldText:e,newText:t,element:r}){if(!(t.length/Math.max(20,e.length)>=4))return r.fontSize;const n=r.width*r.page.computedHeight/t.length,i=1.5*Math.sqrt(n),a=r.fontSize;return Math.min(a,Math.max(5,Math.round(i)))}let Ef;function Ok(){return Ef||(Ef=document.getElementById("polotno-text-style"),Ef||(Ef=document.createElement("style"),Ef.id="polotno-text-style",document.head.appendChild(Ef)),Ef)}sr._fixTextRendering=!0;const Nb={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 Ck(e){var t="֑-߿‏‫‮יִ-﷽ﹰ-ﻼ";return new RegExp("^[^"+t+"]*?["+t+"]").test(e)}function Nk(e){e=e.replace(/\s/g,"");let t=0;for(var r=0;r<e.length;r++)Ck(e[r])&&(t+=1);return t>e.length/2}function w0(e){return Nk(e)?"rtl":"ltr"}const Lk=Yn(({textNodeRef:e,element:t,onBlur:r,selectAll:n,cursorPosition:i})=>{const[a,l]=ce.useState(Nb),o=e.current;ce.useLayoutEffect(()=>{const g={};g.width=o.width()-2*o.padding()+"px",g.height=o.height()-2*o.padding()+o.fontSize()*o.lineHeight()+"px",g.fontSize=o.fontSize()+"px",g.lineHeight=o.lineHeight()+.01,g.fontFamily=o.fontFamily(),g.textAlign=o.align(),g.color=o.fill(),g.fontWeight=t.fontWeight,g.fontStyle=t.fontStyle,g.letterSpacing=t.letterSpacing+"em",g.opacity=Math.max(t.a.opacity,.2),g.textTransform=t.textTransform;const c=`
88
- .polotno-input::placeholder {
89
- color: ${a.color};
90
- opacity: 0.6;
91
- }
92
- `,y=Ok();y.innerHTML="",y.appendChild(document.createTextNode(c)),JSON.stringify(g)!==JSON.stringify(a)&&l(g)});const u=ce.useRef(null);ce.useLayoutEffect(()=>{var g;const c=u.current;if(!c)return;(g=u.current)===null||g===void 0||g.focus();const y=i||c.value.length;c.selectionStart=c.selectionEnd=y,n&&(c?.select(),document.execCommand("selectAll",!1,null))},[]),ce.useEffect(()=>{window.addEventListener("blur",r);const g=c=>{var y;!((y=u.current)===null||y===void 0)&&y.contains(c.target)||r()};return window.addEventListener("touchstart",g),()=>{window.removeEventListener("blur",r),window.removeEventListener("touchstart",g)}},[]);let d=0;const f=o.textArr.length*o.lineHeight()*o.fontSize();t.verticalAlign==="middle"&&(d=(t.a.height-f)/2),t.verticalAlign==="bottom"&&(d=t.a.height-f);const v=Pu(t.text);return ce.createElement("textarea",{className:"polotno-input",ref:u,dir:w0(v),style:Object.assign(Object.assign(Object.assign({},Nb),a),{paddingTop:d+"px"}),value:v,onChange:g=>{const c=q8({oldText:t.text,newText:g.target.value,element:t});t.set({text:g.target.value,fontSize:c})},placeholder:t.placeholder,onBlur:r})}),Tk=e=>ce.createElement($1,null,ce.createElement(Lk,Object.assign({},e))),H8=(e,t)=>{const[r,n]=ce.useReducer(l=>l+1,0),i=ce.useRef(vb(t)),a=ce.useRef(null);return ce.useLayoutEffect(()=>{if(i.current=vb(t),i.current)return;let l=!0;return(async()=>{i.current=!1,n();const o=Rh(`text ${t}`);await e.loadFont(t),l?(a.current=o,i.current=!0,n()):o()})(),()=>{a.current&&(a.current(),a.current=null),l=!1}},[t]),ce.useEffect(()=>{i.current&&setTimeout(()=>{a.current&&(a.current(),a.current=null)})},[i.current]),[i.current]},V8=({fontLoaded:e,fontFamily:t,fontSize:r,lineHeight:n})=>ce.useMemo(()=>{if(typeof n=="number")return n;const i=document.createElement("div");i.style.fontFamily=t,i.style.fontSize=r+"px",i.style.lineHeight=n,i.innerText="Test text",document.body.appendChild(i);const a=i.offsetHeight;return document.body.removeChild(i),a/r},[e,t,r,n]);function G8(e){const t=ce.useRef(e),r=ce.useRef(e);return ce.useMemo(()=>{r.current=t.current,t.current=e},[e]),r.current}const Rk=Yn(({element:e,store:t})=>{const r=ce.useRef(null),n=ce.useRef(null),{editorEnabled:i,selectAll:a}=(C=>{const[q,G]=ce.useState(!1),J=ce.useRef(!1);return ce.useEffect(()=>{var ae=!0;return setTimeout(()=>{ae&&(C._editModeEnabled&&(J.current=!0),G(!0),setTimeout(()=>{J.current=!1},50))},50),()=>{ae=!1}},[]),{editorEnabled:q&&C._editModeEnabled,selectAll:J.current}})(e),[l,o]=ce.useState(!1),u=ce.useRef(e.a.height),d=t.selectedShapes.indexOf(e)>=0&&e.selectable,{textVerticalResizeEnabled:f}=gi,v=G8(e.fontFamily),[g,c]=ce.useState([]);ce.useEffect(()=>{var C,q;const G=(q=(C=r.current)===null||C===void 0?void 0:C.textArr)!==null&&q!==void 0?q:[];JSON.stringify(G)!==JSON.stringify(g)&&c(G)}),ce.useEffect(()=>{if(e.a.width)return;const C=r.current;C.width(600),e.set({width:1.4*C.getTextWidth()})},[]),ce.useEffect(()=>{d||e.text!==""||!e.removable||e.placeholder||t.deleteElements([e.id])},[d]),ce.useLayoutEffect(()=>Ou(()=>{const C=r.current;_s(C,e)}));const[y]=H8(t,e.fontFamily);let x=Pu(e.text);e.textTransform==="uppercase"&&(x=x.toUpperCase());const E=()=>{const C=r.current.clone({height:void 0}),q=Math.ceil(C.fontSize()*C.lineHeight()*C.textArr.length+1);return C.destroy(),q};ce.useLayoutEffect(()=>{if(!y)return;const{textOverflow:C,textSplitAllowed:q}=gi;if(!e.a.height){const G=E();return void t.history.ignore(()=>{e.set({height:G})})}if(!t.isPlaying)if(C!=="change-font-size"||l){if(C==="resize"){const G=E();f&&e.a.height<G&&t.history.ignore(()=>{var J;_b(e)&&e.set({height:G}),(J=r.current)===null||J===void 0||J.height(G)},!1,!0),f||e.a.height===G||l||t.history.ignore(()=>{var J;_b(e)&&e.set({height:G}),(J=r.current)===null||J===void 0||J.height(G)},!1,!0)}}else{const G=function(ae,H,V=!1){const Y=ae.fontSize(),U=ae.height(),D=Pu(H.text);let j=H.a.fontSize;ae.height(void 0);const z=Math.round(2*H.a.fontSize)-1;for(let Z=1;Z<z;Z++){const re=H.a.height&&ae.height()>H.a.height;let W=D.split(`
93
- `).join(" ").split(/[\s-]+/).reduce((ue,le)=>/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFFEF\u4E00-\u9FAF\uAC00-\uD7AF]/.test(le)?ue.concat(le.split("")):ue.concat(le),[]),Q=ae.textArr.map(ue=>ue.text).join(";");const se=W.find(ue=>!Q.includes(ue)||(Q=Q.replace(ue,""),!1));if(!(re||se&&!V))break;j-=.5,ae.fontSize(j)}return ae.fontSize(Y),ae.height(U),j}(r.current,e,q);if(G!==e.a.fontSize)return void t.history.ignore(()=>{e.set({fontSize:G})},!1,!0);const J=E();e.a.height===J||f||t.history.ignore(()=>{e.set({height:J})},!1,!0)}}),ce.useLayoutEffect(()=>{const C=r.current;C&&(C.width(C.width()+1e-8),C.width(C.width()-1e-8),C._setTextData(),_s(C,e))},[y]);const S=ce.useRef(null),b=ce.useRef(0),w=C=>{C.evt.preventDefault(),t.selectedShapes.find(G=>G===e)&&e.contentEditable&&(b.current=function(G){var J;const ae=G.target,H=function(z){var Z=z.getAbsoluteTransform().copy();Z.invert();var re=z.getStage().getPointerPosition();return Z.point(re)}(ae),V=ae.textArr,Y=Math.floor(H.y/(ae.fontSize()*ae.lineHeight())),U=V.slice(0,Y).reduce((z,Z)=>z+Z.text.length,Y),D=(J=V[Y])!==null&&J!==void 0?J:V[0];let j=0;return ae.align()==="right"?j=ae.width()-D.width:ae.align()==="center"&&(j=ae.width()/2-D.width/2),U+Math.round((H.x-j)/D.width*D.text.length)}(C),e.toggleEditMode())},_=!x&&e.placeholder?.6:e.a.opacity;xp(r,_);const A=V8({fontLoaded:y,fontFamily:e.fontFamily,fontSize:e.a.fontSize,lineHeight:e.lineHeight}),M=e.selectable||t.role==="admin",O=tf(e),L=ce.useMemo(()=>e.backgroundEnabled?function({lines:C,lineHeight:q,width:G,align:J="left",padding:ae=0,cornerRadius:H=0}){var V;C.forEach((j,z)=>{j.cx=G/2,J==="right"?j.cx=G-j.width/2:J==="left"&&(j.cx=j.width/2),J!=="justify"||j.lastInParagraph||(j.width=G),J==="justify"&&(j.cx=j.width/2)});let Y=`M ${(V=C[0])===null||V===void 0?void 0:V.cx} ${-ae}`;C.forEach((j,z)=>{const{cx:Z}=j,re=C[z-1];re&&re.width>j.width?Y+=` L ${Z+j.width/2+ae} ${z*q+ae}`:Y+=` L ${Z+j.width/2+ae} ${z*q-ae}`;const W=C[z+1];W&&W.width>j.width?Y+=` L ${Z+j.width/2+ae} ${(z+1)*q-ae}`:Y+=` L ${Z+j.width/2+ae} ${(z+1)*q+ae}`});for(var U=C.length-1;U>=0;U--){const j=C[U],{cx:z}=j,Z=C[U+1];Z&&Z.width>j.width?Y+=` L ${z-j.width/2-ae} ${(U+1)*q-ae}`:Y+=` L ${z-j.width/2-ae} ${(U+1)*q+ae}`;const re=C[U-1];re&&re.width>j.width?Y+=` L ${z-j.width/2-ae} ${U*q+ae}`:Y+=` L ${z-j.width/2-ae} ${U*q-ae}`}Y+=" Z";const D=AA(Y);return PA(D,H).path}({lines:JSON.parse(JSON.stringify(g)),cornerRadius:e.backgroundCornerRadius*(e.a.fontSize*A*.5),lineHeight:A*e.a.fontSize,padding:e.backgroundPadding*(e.a.fontSize*A*.5),width:e.a.width,align:e.align}):"",[e.backgroundEnabled,e.backgroundCornerRadius,e.a.fontSize,A,e.backgroundPadding,e.a.width,e.align,g]),R=lf();let T=0;e.verticalAlign==="middle"?T=(e.a.height-g.length*A*e.a.fontSize)/2:e.verticalAlign==="bottom"&&(T=e.a.height-g.length*A*e.a.fontSize);const k=y?e.fontFamily:v===e.fontFamily?"Arial":e.fontFamily;return ce.createElement(ce.Fragment,null,ce.createElement(Tv,{ref:n,x:e.a.x,y:e.a.y,rotation:e.a.rotation,hideInExport:!e.showInExport,listening:!1,visible:e.backgroundEnabled,opacity:e.backgroundOpacity*_,data:L,fill:e.backgroundColor,offsetY:-T}),ce.createElement(Au,Object.assign({ref:r,id:e.id,name:"element",hideInExport:!e.showInExport,editModeEnabled:e._editModeEnabled,x:e.a.x,y:e.a.y,rotation:e.a.rotation,width:e.a.width,height:e.a.height,text:x||e.placeholder,direction:w0(x)},O,{stroke:e.stroke,lineJoin:"round",strokeWidth:e.strokeWidth,fillAfterStrokeEnabled:!0,fontSize:e.a.fontSize,fontFamily:k,fontStyle:e.fontStyle+" "+e.fontWeight,textDecoration:e.textDecoration,align:e.align,verticalAlign:e.verticalAlign,draggable:R?e.draggable&&d:e.draggable,preventDefault:!R||d,opacity:_,visible:!e._editModeEnabled,ellipsis:gi.textOverflow==="ellipsis",shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,lineHeight:A,letterSpacing:e.letterSpacing*e.a.fontSize,listening:M,onDragMove:C=>{e.set({x:C.target.x(),y:C.target.y()})},onDragEnd:C=>{e.set({x:C.target.x(),y:C.target.y()})},onClick:w,onTap:w,onTransformStart:()=>{o(!0),u.current=r.current.height()},onTransform:C=>{var q,G,J;const ae=C.target;(q=n.current)===null||q===void 0||q.setAttrs({x:ae.x(),y:ae.y(),rotation:ae.rotation(),scale:ae.scale()});const H=((G=ae.getStage())===null||G===void 0?void 0:G.findOne("Transformer")).getActiveAnchor();if(H==="middle-left"||H==="middle-right"){const Y=ae.scaleX(),U=ae.width()*Y,D=e.a.fontSize;let j=U;U<D&&(j=D,S.current&&ae.position(S.current)),ae.width(j),ae.scaleX(1),ae.scaleY(1);const z=E();if(gi.textOverflow!=="ellipsis"){const re=Math.max(z,u.current);ae.height(re),e.set({height:ae.height()})}const Z=gi.textVerticalResizeEnabled?Math.max(z,u.current):E();e.set({x:ae.x(),width:ae.width(),rotation:ae.rotation(),height:Z}),_s(ae,e)}if(H==="top-center"||H==="bottom-center"){let Y=gi.textOverflow==="resize"?E():A*e.a.fontSize;C.target.height(Math.max(Y,C.target.height()*C.target.scaleY())),C.target.scaleY(1)}S.current=C.target.position();const V=C.target.scaleX();(J=n.current)===null||J===void 0||J.setAttrs({scaleX:1,scaleY:1}),C.target.scaleX(1),C.target.scaleY(1),e.set({fontSize:e.a.fontSize*V,width:C.target.width()*V,x:C.target.x(),y:C.target.y(),rotation:C.target.rotation(),height:C.target.height()*V,shadowBlur:e.shadowBlur*V,shadowOffsetX:e.shadowOffsetX*V,shadowOffsetY:e.shadowOffsetY*V,strokeWidth:e.strokeWidth*V})},onTransformEnd:C=>{var q;const G=C.target.scaleX();C.target.scaleX(1),C.target.scaleY(1),e.set({fontSize:Math.round(e.a.fontSize*G),width:Math.ceil(C.target.width()*G),x:C.target.x(),y:C.target.y(),rotation:C.target.rotation(),height:C.target.height()*G,shadowBlur:e.shadowBlur*G,shadowOffsetX:e.shadowOffsetX*G,shadowOffsetY:e.shadowOffsetY*G,strokeWidth:e.strokeWidth*G}),(q=n.current)===null||q===void 0||q.setAttrs({scaleX:1,scaleY:1}),o(!1)}})),i&&ce.createElement(vn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation},ce.createElement(Tk,{textNodeRef:r,element:e,selectAll:a,cursorPosition:b.current,onBlur:()=>{e.toggleEditMode(!1)}})))});var Rg={exports:{}},Mg={exports:{}},Lb;function Em(){return Lb||(Lb=1,function(e,t){e.exports=r;function r(i){return n.bind(null,i)}function n(i){var a=[].slice.call(arguments,1);a.unshift("["+i+"]"),process.stderr.write(a.join(" ")+`
94
- `)}}(Mg)),Mg.exports}var Tb;function $8(){return Tb||(Tb=1,function(e,t){Em()("lex"),e.exports=r;function r(n){var i="",a,l=0,o=-1,u=0,d=1,f="before-selector",v=[f],g={},c=[],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 x(){return L(),n[o]}function E(H){return H?v[v.length-1-H]:f}function S(H){var V=o+1;return H===n.slice(V,V+H.length)}function b(H){var V=n.slice(o).indexOf(H);return V>0?V:!1}function w(H){return H===_(1)}function _(H){return n[o+(H||1)]}function A(){var H=v.pop();return f=v[v.length-1],H}function M(H){return f=H,v.push(f),v.length}function O(H){var V=f;return v[v.length-1]=f=H,V}function L(H){if((H||1)==1)n[o]==`
95
- `?(d++,l=1):l++,o++;else{var V=n.slice(o,o+H).split(`
96
- `);V.length>1&&(d+=V.length-1,l=1),l+=V[V.length-1].length,o=o+H}}function R(){g.end={line:d,col:l},c.push(g),i="",g={}}function T(H){g={type:H,start:{line:d,col:l}}}for(;a=x();)switch(a){case" ":switch(E()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":i+=a;break}break;case`
97
- `:case" ":case"\r":case"\f":switch(E()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":i+=a;break;case"at-value":a===`
98
- `&&(g.value=i.trim(),R(),A());break}break;case":":switch(E()){case"name":g.name=i.trim(),i="",O("before-value");break;case"before-selector":i+=a,T("selector"),M("selector");break;case"before-value":O("value"),i+=a;break;default:i+=a;break}break;case";":switch(E()){case"name":case"before-value":case"value":i.trim().length>0&&(g.value=i.trim(),R()),O("before-name");break;case"value-paren":i+=a;break;case"at-value":g.value=i.trim(),R(),A();break;case"before-name":break;default:i+=a;break}break;case"{":switch(E()){case"selector":if(_(-1)==="\\"){i+=a;break}g.text=i.trim(),R(),O("before-name"),u=u+1;break;case"at-group":switch(g.name=i.trim(),g.type){case"font-face":case"viewport":case"page":M("before-name");break;default:M("before-selector")}R(),u=u+1;break;case"name":case"at-rule":g.name=i.trim(),R(),M("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(E()){case"before-name":case"name":case"before-value":case"value":i&&(g.value=i.trim()),g.name&&g.value&&R(),T("end"),R(),A(),E()==="at-group"&&(T("at-group-end"),R(),A()),u>0&&(u=u-1);break;case"at-group":case"before-selector":case"selector":if(_(-1)==="\\"){i+=a;break}u>0&&E(1)==="at-group"&&(T("at-group-end"),R()),u>1&&A(),u>0&&(u=u-1);break;case"double-string":case"single-string":case"comment":i+=a;break}break;case'"':case"'":switch(E()){case"double-string":a==='"'&&_(-1)!=="\\"&&A();break;case"single-string":a==="'"&&_(-1)!=="\\"&&A();break;case"before-at-value":O("at-value"),M(a==='"'?"double-string":"single-string");break;case"before-value":O("value"),M(a==='"'?"double-string":"single-string");break;case"comment":break;default:_(-1)!=="\\"&&M(a==='"'?"double-string":"single-string")}i+=a;break;case"/":switch(E()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":case"selector":case"name":case"value":if(w("*")){var k=b("*/");k&&L(k+1)}else E()=="before-value"&&O("value"),i+=a;break;default:w("*")?(T("comment"),M("comment"),L()):i+=a;break}break;case"*":switch(E()){case"comment":w("/")?(g.text=i,L(),R(),A()):i+=a;break;case"before-selector":i+=a,T("selector"),M("selector");break;case"before-value":O("value"),i+=a;break;default:i+=a}break;case"@":switch(E()){case"comment":case"double-string":case"single-string":i+=a;break;case"before-value":O("value"),i+=a;break;default:for(var C=!1,q,G,J=0,ae=y.length;!C&&J<ae;++J)G=y[J],q=G.name||G,S(q)&&(C=!0,T(q),M(G.state||"at-group"),L(q.length),G.prefix&&(g.prefix=G.prefix),G.type&&(g.type=G.type));C||(i+=a);break}break;case"(":switch(E()){case"value":M("value-paren");break;case"before-value":O("value");break}i+=a;break;case")":switch(E()){case"value-paren":A();break;case"before-value":O("value");break}i+=a;break;default:switch(E()){case"before-selector":T("selector"),M("selector");break;case"before-name":T("property"),O("name");break;case"before-value":O("value");break;case"before-at-value":O("at-value");break}i+=a;break}return c}}(Rg)),Rg.exports}var Ig={exports:{}},Rb;function Mk(){return Rb||(Rb=1,function(e,t){Em()("parse");var r=$8();e.exports=o;var n,i,a,l;function o(A,M){M||(M={}),n=!!M.comments,a=!!M.position,i=0,l=Array.isArray(A)?A.slice():r(A);for(var O,L=[],R;R=d();)O=S(R),O&&L.push(O);return{type:"stylesheet",stylesheet:{rules:L}}}function u(A,M){M||(M={});for(var O,L=["type","name","value"],R={},T=0;T<L.length;++T)O=L[T],A[O]&&(R[O]=M[O]||A[O]);for(L=Object.keys(M),T=0;T<L.length;++T)O=L[T],R[O]||(R[O]=M[O]);return a&&(R.position={start:A.start,end:A.end}),R}function d(){var A=l.shift();return A}function f(A){i=i+1;var M={};switch(A.type){case"font-face":case"viewport":M.declarations=w();break;case"page":M.prefix=A.prefix,M.declarations=w();break;default:M.prefix=A.prefix,M.rules=_()}return u(A,M)}function v(A){return u(A)}function g(A){return u(A)}function c(A){return u(A,{text:A.text})}function y(A){return u(A)}function x(A){return u(A)}function E(A){function M(O){return O.trim()}return u(A,{type:"rule",selectors:A.text.split(",").map(M),declarations:w()})}function S(A){switch(A.type){case"property":return x(A);case"selector":return E(A);case"at-group-end":i=i-1;return;case"media":case"keyframes":return f(A);case"comment":if(n)return c(A);break;case"charset":return g(A);case"import":return v(A);case"namespace":return y(A);case"font-face":case"supports":case"viewport":case"document":case"page":return f(A)}}function b(A){for(var M,O=[],L;(L=d())&&A&&A(L);)M=S(L),M&&O.push(M);return L&&L.type!=="end"&&l.unshift(L),O}function w(){return b(function(A){return A.type==="property"||A.type==="comment"})}function _(){return b(function(){return i})}}(Ig)),Ig.exports}var Fg={exports:{}},Mb;function Ik(){return Mb||(Mb=1,function(e,t){Em()("stringify");var r,n,i,a,l,o;e.exports=u;function u(_,A){A||(A={}),i=A.indentation||"",n=!!A.compress,r=!!A.comments,a=1,n?l=o="":(l=`
99
- `,o=" ");var M=y(_.stylesheet.rules,b).join(`
100
- `).trim();return M}function d(_){if(_){a+=_;return}return n?"":Array(a).join(i||"")}function f(_){return"@"+_.type+" "+_.value+";"+l}function v(_){var A="",M=_.prefix||"";_.name&&(A=" "+_.name);var O=_.type!=="page";return"@"+M+_.type+A+o+x(_,O)+l}function g(_){return r?"/*"+(_.text||"")+"*/"+l:""}function c(_){var A;return _.selectors?A=_.selectors.join(","+l):(A="@"+_.type,A+=_.name?" "+_.name:""),d()+A+o+x(_)+l}function y(_,A){return _.reduce(function(M,O){var L=O.type==="comment"?g(O):A(O);return L&&M.push(L),M},[])}function x(_,A){var M=_.declarations,O=S;return _.rules&&(M=_.rules,O=c),M=E(M,O),M&&(M=l+M+(A?"":l)),"{"+M+d()+"}"}function E(_,A){if(!_)return"";d(1);var M=y(_,A);return d(-1),M.length?M.join(l):""}function S(_){if(_.type==="property")return w(_)}function b(_){switch(_.type){case"rule":return c(_);case"media":case"keyframes":return v(_);case"comment":return g(_);case"import":case"charset":case"namespace":return f(_);case"font-face":case"supports":case"viewport":case"document":case"page":return v(_)}}function w(_){var A=_.name?_.name+":"+o:"";return d()+A+_.value+";"}}(Fg)),Fg.exports}var jg,Ib;function Fk(){return Ib||(Ib=1,jg={lex:$8(),parse:Mk(),stringify:Ik()}),jg}var jk=Fk();const Dk=lc(jk);function Bk(e){for(;e.parentNode;){if(e.nodeName==="defs")return!0;e=e.parentNode}return!1}function zk(e){const t={};return e.querySelectorAll("style").forEach(r=>{const n=Dk.parse(r.textContent).stylesheet.rules;for(let i of n)i.selectors&&i.selectors.forEach(a=>{const l=t[a]||{};i.declarations.forEach(o=>{l[o.name]=o.value}),t[a]=l})}),t}function W8(e,t){var r;const n={fill:"",stroke:""},i=((r=e.getAttribute("class"))===null||r===void 0?void 0:r.split(" "))||[],a=e.getAttribute("id");let l={};if(a&&t[`#${a}`]?l=t[`#${a}`]:i.forEach(o=>{t[`.${o}`]&&(l=Object.assign(Object.assign({},l),t[`.${o}`]))}),t[e.nodeName]&&(l=Object.assign(Object.assign({},l),t[e.nodeName])),e.getAttribute("fill")&&e.getAttribute("fill")!=="none"?n.fill=e.getAttribute("fill"):l.fill&&l.fill!=="none"&&(n.fill=l.fill),e.getAttribute("stroke")&&e.getAttribute("stroke")!=="none"?n.stroke=e.getAttribute("stroke"):l.stroke&&l.stroke!=="none"&&(n.stroke=l.stroke),!n.fill&&e.style.fill&&e.style.fill!=="none"&&(n.fill=e.style.fill),!n.stroke&&e.style.stroke&&e.style.stroke!=="none"&&(n.stroke=e.style.stroke),!n.stroke&&!n.fill){const o=e.ownerSVGElement,u=o&&o!==e&&W8(o,t);u?.fill==="currentColor"||u?.stroke==="currentColor"||(n.fill="black")}return n}const Uk=["path","rect","circle","line","polygon","polyline","ellipse","text"];function qk(e){for(var t=[],r=e.getElementsByTagName("*"),n=0,i=r.length;n<i;n++){const a=r[n];Bk(a)||(a.getAttribute("fill")!==null&&t.push(a),(a.getAttribute("stroke")!==null||a.style&&a.style.fill||Uk.indexOf(a.nodeName)>=0)&&t.push(a))}return t}async function Hk(e){const t=await fetch(e);return $f(await t.text())}async function Ap(e){return await(await fetch(e,{mode:"cors"})).text()}function $f(e){return"data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(e)))}function Am(e){var t=new DOMParser().parseFromString(e,"image/svg+xml");const r=t.documentElement.getAttribute("viewBox"),[n,i,a,l]=r?.split(" ")||[],o=t.documentElement.getAttribute("width");!o&&t.documentElement.setAttribute("width",a+"px");const u=t.documentElement.getAttribute("height");if((!u||u.indexOf("%")>=0)&&t.documentElement.setAttribute("height",l+"px"),o&&o.indexOf("%")>=0&&u&&u.indexOf("%")===-1){const d=parseFloat(u)/parseFloat(l);t.documentElement.setAttribute("width",d*parseFloat(a)+"px")}if(u&&u.indexOf("%")>=0&&o&&o.indexOf("%")===-1){const d=parseFloat(o)/parseFloat(a);t.documentElement.setAttribute("height",d*parseFloat(l)+"px")}return o==="100%"&&u==="100%"&&(t.documentElement.setAttribute("width",a+"px"),t.documentElement.setAttribute("height",l+"px")),new XMLSerializer().serializeToString(t)}const Vk=(e,t)=>{if(!e||!t)return!1;if(t==="currentColor"&&e==="black")return!0;const r=sr.Util.colorToRGBA(e),n=sr.Util.colorToRGBA(t);return r&&n?r.r===n.r&&r.g===n.g&&r.b===n.b&&r.a===n.a:void 0};function Pm(e,t){var r=new DOMParser().parseFromString(e,"image/svg+xml");const n=qk(r),i=Array.from(t.keys()),a=zk(r);return n.forEach(l=>{const{fill:o,stroke:u}=W8(l,a);[{prop:"fill",color:o},{prop:"stroke",color:u}].forEach(({prop:d,color:f})=>{const v=i.find(g=>Vk(g,f));if(v){const g=t.get(v);if(v0(g)){const{rotation:c,stops:y}=n8(g),x=y.map(S=>({offset:100*S.offset+"%","stop-color":S.color})),E="color"+Math.round(1e8*Math.random());(function(S,b,w,_){var A=S.namespaceURI,M=document.createElementNS(A,"linearGradient");const O=sr.Util.degToRad(w+90),L=(Math.cos(O)+1)/2,R=(Math.sin(O)+1)/2,T=(Math.cos(O+Math.PI)+1)/2,k=(Math.sin(O+Math.PI)+1)/2;M.setAttribute("x1",100*L+"%"),M.setAttribute("y1",100*R+"%"),M.setAttribute("x2",100*T+"%"),M.setAttribute("y2",100*k+"%"),M.setAttribute("gradientUnits","userSpaceOnUse"),M.setAttribute("id",b);for(var C=0;C<_.length;C++){var q=_[C],G=document.createElementNS(A,"stop");for(var J in q)q.hasOwnProperty(J)&&G.setAttribute(J,q[J]);M.appendChild(G)}(S.querySelector("defs")||S.insertBefore(document.createElementNS(A,"defs"),S.firstChild)).appendChild(M)})(r.children[0],E,c,x),l.style[d]=null,l.setAttribute(d,`url('#${E}')`)}else l.style[d]=t.get(v)}})}),$f(new XMLSerializer().serializeToString(r))}const km=(e,t,r)=>{let n=t,i=r,a=1;for(;n>0&&i>0;){e.width=n,e.height=i;const l=e.getContext("2d");if(!l)return;if(l.fillStyle="rgba(0,0,0,0.1)",l.fillRect(0,0,1,1),l.getImageData(0,0,1,1).data[3]!==0)return void l.clearRect(0,0,e.width,e.height);if(a*=.9,n=Math.floor(t*a),i=Math.floor(r*a),n=Math.max(n,1),i=Math.max(i,1),n<=1&&i<=1)return e.width=1,void(e.height=1)}},jv=(e,t=100,r=!1,n)=>{const i=ce.useRef(n??e),[,a]=ce.useReducer(u=>u+1,0),l=ce.useCallback(u=>{i.current!==u&&(i.current=u,a())},[i]),o=ce.useRef(null);return e===r&&(o.current&&(clearTimeout(o.current),o.current=null),i.current=r),ce.useEffect(()=>(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{l(e),o.current=null},t),()=>{o.current&&clearTimeout(o.current)}),[e,t,r]),[i.current,l]};function Nf(){return document.createElement("canvas")}const Y8=e=>e.indexOf("data:image/svg+xml")>=0||e.indexOf(".svg")>=0,Fb=e=>{const[t,r]=ce.useState(e);return ce.useEffect(()=>{(async()=>{const n=await async function(i){if(!Y8(i))return i;const a=await Ap(i),l=Am(a);return $f(l)}(e);n!==t&&r(n)})()},[e]),t};function jb(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}const Gk={boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2},$k={boundBoxFunc:(e,t)=>t.width<5||t.height<5?e:t,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2},Db=(e,t,r)=>Math.max(t,Math.min(r,e)),Wk=(e,t,r,n,i=0,a=!1,l=!0)=>{const o=Math.floor(Db(e.a.width*n,1,1e4)),u=Math.floor(Db(e.a.height*n,1,1e4)),d=Math.min(i*n,o/2,u/2),f=Math.max(e.a.width/r.width,e.a.height/r.height)*n,v=e.page._exportingOrRendering&&gi.imageDownScalingEnabled&&f<1&&!a,g=r.x===0&&r.y===0&&r.width===t?.width&&r.height===t?.height,c=ce.useMemo(()=>{if(t&&t.width&&t.height)return g&&d===0&&!v?void 0:Nf()},[t,d,v,g]);return ce.useLayoutEffect(()=>{if(!c||!t)return;km(c,o,u);const y=c.getContext("2d");if(!y)return;d&&(y.beginPath(),y.moveTo(d,0),y.lineTo(o-d,0),y.arc(o-d,d,d,3*Math.PI/2,0,!1),y.lineTo(o,u-d),y.arc(o-d,u-d,d,0,Math.PI/2,!1),y.lineTo(d,u),y.arc(d,u-d,d,Math.PI/2,Math.PI,!1),y.lineTo(0,d),y.arc(d,d,d,Math.PI,3*Math.PI/2,!1),y.clip());const x=v?function(S,b){var w,_;const A=Nf();A.width=S.width,A.height=S.height;const M=Math.max(1,Math.floor(A.width*b)),O=Math.max(1,Math.floor(A.height*b));(w=A.getContext("2d"))===null||w===void 0||w.drawImage(S,0,0,A.width,A.height);const L=function(R,T,k,C,q,G,J){for(var ae=new ImageData(T,k),H=new Int32Array(R.data.buffer),V=R.width,Y=new Int32Array(ae.data.buffer),U=ae.width,D=T/G,j=k/J,z=Math.round(1/D),Z=Math.round(1/j),re=z*Z,W=0;W<ae.height;W++)for(var Q=0;Q<U;Q++){for(var se=0+Math.round(Q/D)+(0+Math.round(W/j))*V,ue=0,le=0,ye=0,Re=0,Me=0;Me<Z;Me++)for(var Pe=0;Pe<z;Pe++){var de=H[se+Pe+Me*V];ue+=de<<24>>>24,le+=de<<16>>>24,ye+=de<<8>>>24,Re+=de>>>24}ue=Math.round(ue/re),le=Math.round(le/re),ye=Math.round(ye/re),Re=Math.round(Re/re),Y[Q+W*U]=Re<<24|ye<<16|le<<8|ue}return ae}(A.getContext("2d").getImageData(0,0,A.width,A.height),M,O,0,0,A.width,A.height);return A.width=M,A.height=O,(_=A.getContext("2d"))===null||_===void 0||_.putImageData(L,0,0),A}(t,f):t,E=v?{x:Math.floor(r.x*f),y:Math.floor(r.y*f),width:Math.floor(r.width*f),height:Math.floor(r.height*f)}:r;y.drawImage(x,E.x,E.y,E.width,E.height,0,0,c.width,c.height)},[c,e.a.width,e.a.height,r.x,r.y,r.width,r.height,i,n,a,e.page._exportingOrRendering,v]),ce.useEffect(()=>()=>{c&&c.nodeName==="CANVAS"&&sr.Util.releaseCanvas(c)},[c]),c||t},Yk=Nf(),Xk=Yn(({element:e})=>{const t=Math.min(30,e.a.width/4,e.a.height/4),r=ce.useRef(null);return ce.useEffect(()=>{const n=r.current;if(!n)return;const i=new sr.Animation(a=>{n.rotate((a?.timeDiff||0)/2)},n.getLayer());return i.start(),()=>{i.stop()}}),ce.createElement(vn,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},ce.createElement(En,{width:e.a.width,height:e.a.height,fill:"rgba(124, 173, 212, 0.8)"}),ce.createElement(mm,{ref:r,x:e.a.width/2,y:e.a.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),Kk=Yn(({element:e})=>{const t=Math.max(10,Math.min(30,e.a.width/25));return ce.createElement(vn,{x:e.x,y:e.y,rotation:e.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},ce.createElement(En,{width:e.a.width,height:e.a.height,fill:"rgba(223, 102, 102, 0.8)"}),ce.createElement(Au,{text:"Can not load the image...",fontSize:t,width:e.a.width,height:e.a.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let Dg=ym;const Jd=(e,t="",r="")=>{const n=ce.useRef(),i=()=>{var a;(a=n.current)===null||a===void 0||a.call(n),n.current=void 0};ce.useEffect(()=>i,[]),ce.useLayoutEffect(()=>{const a=t.slice(0,200),l=`image with id ${r} url: ${a}`;e!=="loading"||n.current||(n.current=Rh(l)),e!=="loading"&&i(),e==="failed"&&Sp(l)},[e])},Bb=Yn(({element:e,store:t})=>{var r;const[n,i]=ce.useState(!1),a=ce.useRef(null),l=ce.useRef(null),o=t.selectedShapes.indexOf(e)>=0&&e.selectable,[u,d]=(Te=>{const[Ae,be]=ce.useReducer(Ce=>Ce+1,0),_e=ce.useRef("loading"),xe=ce.useRef(Te.src),Le=ce.useRef(Te.src);Le.current!==Te.src&&(Le.current=Te.src,_e.current="loading");const pe=ce.useMemo(()=>Y8(Te.src)||Te.type==="svg",[Te.src,Te.type]);return ce.useEffect(()=>{if(!pe||!Te.src)return;let Ce=!1;return(async()=>{_e.current="loading",be();const je=await Ap(Te.src),He=Am(je);let st;st=Te.colorsReplace?Pm(He,Te.colorsReplace||new Map):$f(He),Ce||(xe.current=st,_e.current="loaded",be())})(),()=>{Ce=!0}},[Te.src,JSON.stringify(Te.colorsReplace)]),pe?[xe.current,_e.current]:[Te.src,"loaded"]})(e),[f,v]=Dg(u,"anonymous"),g=e.type!=="svg"||d==="loaded"?v:"loading";Jd(g,e.src,e.id);const c=e.page._exportingOrRendering?1:Math.max(1,t.scale),y=t._elementsPixelRatio*c,x=(({image:Te,status:Ae,type:be})=>{const _e=ce.useRef();return ce.useEffect(()=>{_e.current=Te||_e.current},[Te]),Ae!=="failed"||Ae!=="failed"&&be==="svg"?_e.current:void 0})({image:f,status:v,type:e.type}),E=((Te,Ae,be)=>{const _e=ce.useMemo(()=>{var xe,Le;const{flipX:pe,flipY:Ce}=Te,je=Te.type==="svg"||Te.src.indexOf("data:image/svg+xml")>=0||Te.src.indexOf(".svg")>=0,He=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,st=(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||He)&&je||Te.maskSrc;if(!pe&&!Ce&&!st)return Ae;if(!Ae||!Ae.width||!Ae.height)return null;const pt=Nf();let ct=1;Te.type==="svg"&&(ct=Math.max(Te.a.width/Ae.width*be,Te.a.height/Ae.height*be)),km(pt,Math.max(Ae.width*ct,1),Math.max(Ae.height*ct,1));let bt=pe?-pt.width:0,ht=Ce?-pt.height:0;return(xe=pt.getContext("2d"))===null||xe===void 0||xe.scale(pe?-1:1,Ce?-1:1),(Le=pt.getContext("2d"))===null||Le===void 0||Le.drawImage(Ae,bt,ht,pt.width,pt.height),pt},[Te.maskSrc,Te.flipX,Te.flipY,Ae,Te.a.width,Te.a.height,be]);return ce.useEffect(()=>()=>{_e&&_e.nodeName==="CANVAS"&&sr.Util.releaseCanvas(_e)},[_e]),_e})(e,f||x,y),S=((Te,Ae)=>{const be=Fb(Te.maskSrc||""),[_e,xe]=Dg(be,"anonymous");return Jd(be?xe:"loaded",be||"",Te.id),ce.useMemo(()=>{if(!_e||!Ae||!Ae.width||!Ae.height)return Ae;const Le=Nf();Le.width=Math.max(Ae.width,1),Le.height=Math.max(Ae.height,1);const pe=Le.getContext("2d");if(!pe)return Ae;pe.drawImage(Ae,0,0),pe.globalCompositeOperation="source-in";const Ce=function(je,He){const st=He.width/He.height;let pt,ct;return st>=je.width/je.height?(pt=je.width,ct=je.width/st):(pt=je.height*st,ct=je.height),{x:(je.width-pt)/2,y:(je.height-ct)/2,width:pt,height:ct}}(_e,Te);return pe.drawImage(_e,Ce.x,Ce.y,Ce.width,Ce.height,0,0,Ae.width,Ae.height),Le},[Ae,_e,Te.a.width,Te.a.height])})(e,E)||Yk;let{cropX:b,cropY:w,cropWidth:_,cropHeight:A}=e.a;v!=="loaded"&&(b=w=0,_=A=1);const M=S.width*_,O=S.height*A,L=e.a.width/e.a.height;let R,T;const k=M/O,C=e.stretchEnabled;C?(R=M,T=O):L>=k?(R=M,T=M/L):(R=O*L,T=O);const q={x:S.width*b,y:S.height*w,width:R,height:T},G=(r=e.cornerRadius)!==null&&r!==void 0?r:0,J=e.page._exportingOrRendering?1:Math.min(2,t.scale),ae=t._elementsPixelRatio*J;let H=((Te,Ae,be,_e)=>{const xe=Fb(Te.clipSrc||""),[Le,pe]=Dg(xe,"anonymous"),Ce=Te.clipSrc?pe:"loaded";Jd(Ce,Te.clipSrc,Te.id);const je=ce.useMemo(()=>{if(Ae&&Le)return Nf()},[Ae,Le]);return ce.useLayoutEffect(()=>{var He;if(!Le||!Ae||!Ae.width||!Ae.height||!Le||!Le.width||!Le.height||!je)return;const st=Nf(),pt=Math.max(Te.a.width/Le.width*be,Te.a.height/Le.height*be);st.width=Math.max(Le.width*pt,1),st.height=Math.max(Le.height*pt,1),(He=st.getContext("2d"))===null||He===void 0||He.drawImage(Le,0,0,st.width,st.height),je.width=Math.max(Ae.width,1),je.height=Math.max(Ae.height,1);const ct=je.getContext("2d");ct&&(ct.save(),ct.drawImage(st,0,0,Ae.width,Ae.height),sr.Util.releaseCanvas(st),ct.globalCompositeOperation="source-in",ct.drawImage(Ae,0,0,je.width,je.height),ct.restore())},[je,Ae,Le,Te.a.width,Te.a.height,be,..._e]),Te.clipSrc&&Le?je:Ae})(e,Wk(e,S,q,ae,G,n||e._cropModeEnabled||e.type==="svg",!0),ae,[q,G,ae]);const V=Math.max(e.a.width/R,e.a.height/T);ce.useEffect(()=>{var Te;if(!e._cropModeEnabled)return;const Ae=(Te=a.current)===null||Te===void 0?void 0:Te.getStage();function be(xe){e._cropModeEnabled&&xe.target!==l.current&&e.toggleCropMode(!1)}function _e(xe){e._cropModeEnabled&&xe.target.parentNode!==Ae.content&&e.toggleCropMode(!1)}return document.body.addEventListener("click",_e),Ae?.on("click",be),Ae?.on("tap",be),()=>{document.body.removeEventListener("click",_e),document.body.removeEventListener("touchstart",_e),Ae?.off("click",be),Ae?.off("click",be)}},[e._cropModeEnabled]),ce.useLayoutEffect(()=>{if(!n&&!e._cropModeEnabled)return _s(a.current,e),Ou(()=>{_s(a.current,e)},{delay:100})},[H,e.page._exportingOrRendering,n,_,A,e._cropModeEnabled]),ce.useLayoutEffect(()=>{var Te;n||e._cropModeEnabled?(Te=a.current)===null||Te===void 0||Te.clearCache():_s(a.current,e)},[n,e.a.width,e.a.height,e._cropModeEnabled]),ce.useEffect(()=>{_s(a.current,e)},[e.shadowEnabled,e.shadowBlur,e.cornerRadius,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]);const Y=ce.useRef(null),U=ce.useRef(null),D=ce.useRef(null);ce.useLayoutEffect(()=>{e._cropModeEnabled&&(U.current.nodes([Y.current]),D.current.nodes([l.current]))},[e._cropModeEnabled]);var j=ce.useRef(null),z=ce.useRef(0),Z=ce.useRef(!1);const re=Te=>{var Ae;((Ae=Te.evt.touches)===null||Ae===void 0?void 0:Ae.length)>2&&Te.target.stopDrag(),Math.round(Te.target.x())>0&&(Te.target.x(0),Te.target.scaleX(1)),Math.round(Te.target.y())>0&&(Te.target.y(0),Te.target.scaleY(1));const be=Te.target.width()*Te.target.scaleX(),_e=Te.target.height()*Te.target.scaleY(),xe=Math.min(1,R/be),Le=Math.min(1,T/_e),pe=1-xe,Ce=Math.min(pe,Math.max(0,Math.round(-Te.target.x())/be)),je=1-Le,He=Math.min(je,Math.max(0,Math.round(-Te.target.y())/_e));Te.target.setAttrs({x:-Ce*S.width,y:-He*S.height,scaleX:1,scaleY:1}),e.set({cropX:Ce,cropY:He,cropWidth:xe,cropHeight:Le})},W=()=>{e.type!=="svg"&&e.contentEditable&&(e.stretchEnabled||setTimeout(()=>{e.toggleCropMode(!0)}))},Q=e.type==="svg"&&x,se=v==="loading"&&!Q,[ue]=jv(se,100,!1,!1),le=v==="failed",ye=!ue&&!le,Re=ce.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Me=ye?e.a.opacity:0;xp(a,Me);const Pe=e.selectable||t.role==="admin",de=lf();return ce.createElement(ce.Fragment,null,ue&&ce.createElement(Xk,{element:e}),le&&ce.createElement(Kk,{element:e}),ce.createElement(bu,{ref:a,name:"element",id:e.id,image:H,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:Me,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:q,listening:Pe,draggable:de?e.draggable&&o:e.draggable,preventDefault:!de||o,hideInExport:!e.showInExport,onDragMove:Te=>{e.set({x:Te.target.x(),y:Te.target.y()})},onDragEnd:Te=>{e.set({x:Te.target.x(),y:Te.target.y()})},onDblClick:W,onDblTap:W,onTransformStart:()=>{i(!0),Re.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:Te=>{var Ae;const be=Te.currentTarget,_e=Math.abs(be.scaleX()-1)<1e-7?1:be.scaleX(),xe=Math.abs(be.scaleY()-1)<1e-7?1:be.scaleY();be.scaleX(1),be.scaleY(1);const Le=(Ae=Te.target.getStage())===null||Ae===void 0?void 0:Ae.findOne("Transformer"),pe=1-R/S.width,Ce=Math.min(pe,Math.max(0,e.cropX)),je=1-T/S.height,He=Math.min(je,Math.max(0,e.cropY)),st=Le.getActiveAnchor(),pt=!(st.indexOf("middle")>=0||st.indexOf("center")>=0),ct=!pt&&_e<1&&Re.current.cropHeight>T/S.height;let bt=pt?e.cropWidth:e.cropWidth*_e;ct&&(bt=e.cropWidth);const ht=!pt&&xe<1&&Re.current.cropWidth>R/S.width;let vt=pt?e.cropHeight:e.cropHeight*xe;ht&&(vt=e.cropHeight),C&&(bt=e.cropWidth,vt=e.cropHeight),e.set({cropX:Ce,cropY:He,x:be.x(),y:be.y(),width:be.width()*_e,height:be.height()*xe,rotation:Te.target.rotation(),cropWidth:Math.min(bt,1-Ce),cropHeight:Math.min(vt,1-He)})},onTransformEnd:Te=>{const Ae=Te.currentTarget;e.set({width:Ae.width(),height:Ae.height(),x:Ae.x(),y:Ae.y(),rotation:Te.target.rotation(),cropWidth:R/S.width,cropHeight:T/S.height}),i(!1)}}),ce.createElement(En,{x:e.x,y:e.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:Me,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,G-e.borderSize),hideInExport:!e.showInExport}),e._cropModeEnabled&&ce.createElement(bm,{selector:".page-abs-container",enabled:!0},ce.createElement(En,{x:-window.innerWidth/t.scale,y:-window.innerWidth/t.scale,width:window.innerWidth/t.scale*3,height:window.innerWidth/t.scale*3,fill:"rgba(0,0,0,0.3)"}),ce.createElement(bu,{listening:!1,image:H,x:e.x,y:e.y,width:e.a.width,height:e.a.height,rotation:e.rotation,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur}),ce.createElement(vn,{x:e.x,y:e.y,rotation:e.rotation,scaleX:V,scaleY:V},ce.createElement(bu,{image:S,ref:l,opacity:.4,draggable:!0,x:-e.cropX*S.width,y:-e.cropY*S.height,onDragMove:re,onTransform:re,onTouchMove:Te=>{Te.evt.preventDefault();const Ae=Te.target.getStage().getPointersPositions();var be=Ae[0],_e=Ae[1];const xe=Te.target;if(be&&!_e&&!xe.isDragging()&&Z.current&&(xe.startDrag(),Z.current=!1),be&&_e){sr.hitOnDragEnabled=!0,xe.isDragging()&&(Z.current=!0,xe.stopDrag());const ht=Te.target.getAbsoluteTransform().copy();ht.invert();var Le={x:be.x,y:be.y},pe={x:_e.x,y:_e.y};if(!j.current)return void(j.current=jb(Le,pe));var Ce=jb(Le,pe),je=function(Pt,$t){return Math.sqrt(Math.pow($t.x-Pt.x,2)+Math.pow($t.y-Pt.y,2))}(Le,pe);z.current||(z.current=je);const vt=xe.position();var He={x:Ce.x-vt.x,y:Ce.y-vt.y},st=je/z.current;xe.scaleX(st),xe.scaleY(st);const wr=ht.point(Ce),cr=ht.point(j.current);var pt=wr.x-cr.x,ct=wr.y-cr.y,bt={x:Math.min(0,Ce.x-He.x*st+pt),y:Math.min(0,Ce.y-He.y*st+ct)};xe.position(bt),z.current=je,j.current=Ce,re(Te)}},onTouchEnd:Te=>{z.current=0,j.current=null,sr.hitOnDragEnabled=!1}}),ce.createElement(lp,Object.assign({ref:D},$k)),ce.createElement(En,{width:R,height:T,ref:Y,listening:!1,onTransform:Te=>{if(e.cropX<Math.abs(Te.target.x()/S.width)&&Te.target.x()<0&&e.cropX>0){const je=(e.cropWidth+e.cropX)*S.width;Te.target.scaleX(1),Te.target.width(je)}if(e.cropY<Math.abs(Te.target.y()/S.height)&&Te.target.y()<0&&e.cropY>0){const je=(e.cropHeight+e.cropY)*S.height;Te.target.scaleY(1),Te.target.height(je)}Te.target.x()<-e.cropX*S.width-1e-9&&(Te.target.x(-e.cropX*S.width),Te.target.scaleX(1)),Te.target.y()<-e.cropY*S.height-1e-9&&(Te.target.y(-e.cropY*S.height),Te.target.scaleY(1));const Ae=Math.min(1,Math.max(0,e.cropX+Te.target.x()/S.width)),be=Math.min(1,Math.max(0,Te.target.y()/S.height+e.cropY)),_e=Te.target.width()*Te.target.scaleX(),xe=Te.target.height()*Te.target.scaleY(),Le=Math.min(1-Ae,_e/S.width),pe=Math.min(1-be,xe/S.height),Ce=Te.target.getAbsolutePosition(Te.target.getParent().getParent());Te.target.scale({x:1,y:1}),Te.target.position({x:0,y:0}),e.set({x:Ce.x,y:Ce.y,cropX:Ae,cropY:be,cropWidth:Le,cropHeight:pe,width:Math.min(_e*V,S.width*(1-Ae)*V),height:Math.min(xe*V,S.height*(1-be)*V)})}}),ce.createElement(lp,Object.assign({ref:U},Gk,{visible:e.resizable})))))});var A1={exports:{}};/*!
101
- * Quill Editor v1.3.7
102
- * https://quilljs.com/
103
- * Copyright (c) 2014, Jason Chen
104
- * Copyright (c) 2013, salesforce.com
105
- */var Zk=A1.exports,zb;function Qk(){return zb||(zb=1,function(e,t){(function(n,i){e.exports=i()})(typeof self<"u"?self:Zk,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var l=n[a]={i:a,l:!1,exports:{}};return r[a].call(l.exports,l,l.exports,i),l.l=!0,l.exports}return i.m=r,i.c=n,i.d=function(a,l,o){i.o(a,l)||Object.defineProperty(a,l,{configurable:!1,enumerable:!0,get:o})},i.n=function(a){var l=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(l,"a",l),l},i.o=function(a,l){return Object.prototype.hasOwnProperty.call(a,l)},i.p="",i(i.s=109)}([function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(17),l=i(18),o=i(19),u=i(45),d=i(46),f=i(47),v=i(48),g=i(49),c=i(12),y=i(32),x=i(33),E=i(31),S=i(1),b={Scope:S.Scope,create:S.create,find:S.find,query:S.query,register:S.register,Container:a.default,Format:l.default,Leaf:o.default,Embed:v.default,Scroll:u.default,Block:f.default,Inline:d.default,Text:g.default,Attributor:{Attribute:c.default,Class:y.default,Style:x.default,Store:E.default}};n.default=b},function(r,n,i){var a=this&&this.__extends||function(){var E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,b){S.__proto__=b}||function(S,b){for(var w in b)b.hasOwnProperty(w)&&(S[w]=b[w])};return function(S,b){E(S,b);function w(){this.constructor=S}S.prototype=b===null?Object.create(b):(w.prototype=b.prototype,new w)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=function(E){a(S,E);function S(b){var w=this;return b="[Parchment] "+b,w=E.call(this,b)||this,w.message=b,w.name=w.constructor.name,w}return S}(Error);n.ParchmentError=l;var o={},u={},d={},f={};n.DATA_KEY="__blot";var v;(function(E){E[E.TYPE=3]="TYPE",E[E.LEVEL=12]="LEVEL",E[E.ATTRIBUTE=13]="ATTRIBUTE",E[E.BLOT=14]="BLOT",E[E.INLINE=7]="INLINE",E[E.BLOCK=11]="BLOCK",E[E.BLOCK_BLOT=10]="BLOCK_BLOT",E[E.INLINE_BLOT=6]="INLINE_BLOT",E[E.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",E[E.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",E[E.ANY=15]="ANY"})(v=n.Scope||(n.Scope={}));function g(E,S){var b=y(E);if(b==null)throw new l("Unable to create "+E+" blot");var w=b,_=E instanceof Node||E.nodeType===Node.TEXT_NODE?E:w.create(S);return new w(_,S)}n.create=g;function c(E,S){return S===void 0&&(S=!1),E==null?null:E[n.DATA_KEY]!=null?E[n.DATA_KEY].blot:S?c(E.parentNode,S):null}n.find=c;function y(E,S){S===void 0&&(S=v.ANY);var b;if(typeof E=="string")b=f[E]||o[E];else if(E instanceof Text||E.nodeType===Node.TEXT_NODE)b=f.text;else if(typeof E=="number")E&v.LEVEL&v.BLOCK?b=f.block:E&v.LEVEL&v.INLINE&&(b=f.inline);else if(E instanceof HTMLElement){var w=(E.getAttribute("class")||"").split(/\s+/);for(var _ in w)if(b=u[w[_]],b)break;b=b||d[E.tagName]}return b==null?null:S&v.LEVEL&b.scope&&S&v.TYPE&b.scope?b:null}n.query=y;function x(){for(var E=[],S=0;S<arguments.length;S++)E[S]=arguments[S];if(E.length>1)return E.map(function(_){return x(_)});var b=E[0];if(typeof b.blotName!="string"&&typeof b.attrName!="string")throw new l("Invalid definition");if(b.blotName==="abstract")throw new l("Cannot register abstract class");if(f[b.blotName||b.attrName]=b,typeof b.keyName=="string")o[b.keyName]=b;else if(b.className!=null&&(u[b.className]=b),b.tagName!=null){Array.isArray(b.tagName)?b.tagName=b.tagName.map(function(_){return _.toUpperCase()}):b.tagName=b.tagName.toUpperCase();var w=Array.isArray(b.tagName)?b.tagName:[b.tagName];w.forEach(function(_){(d[_]==null||b.className==null)&&(d[_]=b)})}return b}n.register=x},function(r,n,i){var a=i(51),l=i(11),o=i(3),u=i(20),d="\0",f=function(v){Array.isArray(v)?this.ops=v:v!=null&&Array.isArray(v.ops)?this.ops=v.ops:this.ops=[]};f.prototype.insert=function(v,g){var c={};return v.length===0?this:(c.insert=v,g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(c.attributes=g),this.push(c))},f.prototype.delete=function(v){return v<=0?this:this.push({delete:v})},f.prototype.retain=function(v,g){if(v<=0)return this;var c={retain:v};return g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(c.attributes=g),this.push(c)},f.prototype.push=function(v){var g=this.ops.length,c=this.ops[g-1];if(v=o(!0,{},v),typeof c=="object"){if(typeof v.delete=="number"&&typeof c.delete=="number")return this.ops[g-1]={delete:c.delete+v.delete},this;if(typeof c.delete=="number"&&v.insert!=null&&(g-=1,c=this.ops[g-1],typeof c!="object"))return this.ops.unshift(v),this;if(l(v.attributes,c.attributes)){if(typeof v.insert=="string"&&typeof c.insert=="string")return this.ops[g-1]={insert:c.insert+v.insert},typeof v.attributes=="object"&&(this.ops[g-1].attributes=v.attributes),this;if(typeof v.retain=="number"&&typeof c.retain=="number")return this.ops[g-1]={retain:c.retain+v.retain},typeof v.attributes=="object"&&(this.ops[g-1].attributes=v.attributes),this}}return g===this.ops.length?this.ops.push(v):this.ops.splice(g,0,v),this},f.prototype.chop=function(){var v=this.ops[this.ops.length-1];return v&&v.retain&&!v.attributes&&this.ops.pop(),this},f.prototype.filter=function(v){return this.ops.filter(v)},f.prototype.forEach=function(v){this.ops.forEach(v)},f.prototype.map=function(v){return this.ops.map(v)},f.prototype.partition=function(v){var g=[],c=[];return this.forEach(function(y){var x=v(y)?g:c;x.push(y)}),[g,c]},f.prototype.reduce=function(v,g){return this.ops.reduce(v,g)},f.prototype.changeLength=function(){return this.reduce(function(v,g){return g.insert?v+u.length(g):g.delete?v-g.delete:v},0)},f.prototype.length=function(){return this.reduce(function(v,g){return v+u.length(g)},0)},f.prototype.slice=function(v,g){v=v||0,typeof g!="number"&&(g=1/0);for(var c=[],y=u.iterator(this.ops),x=0;x<g&&y.hasNext();){var E;x<v?E=y.next(v-x):(E=y.next(g-x),c.push(E)),x+=u.length(E)}return new f(c)},f.prototype.compose=function(v){var g=u.iterator(this.ops),c=u.iterator(v.ops),y=[],x=c.peek();if(x!=null&&typeof x.retain=="number"&&x.attributes==null){for(var E=x.retain;g.peekType()==="insert"&&g.peekLength()<=E;)E-=g.peekLength(),y.push(g.next());x.retain-E>0&&c.next(x.retain-E)}for(var S=new f(y);g.hasNext()||c.hasNext();)if(c.peekType()==="insert")S.push(c.next());else if(g.peekType()==="delete")S.push(g.next());else{var b=Math.min(g.peekLength(),c.peekLength()),w=g.next(b),_=c.next(b);if(typeof _.retain=="number"){var A={};typeof w.retain=="number"?A.retain=b:A.insert=w.insert;var M=u.attributes.compose(w.attributes,_.attributes,typeof w.retain=="number");if(M&&(A.attributes=M),S.push(A),!c.hasNext()&&l(S.ops[S.ops.length-1],A)){var O=new f(g.rest());return S.concat(O).chop()}}else typeof _.delete=="number"&&typeof w.retain=="number"&&S.push(_)}return S.chop()},f.prototype.concat=function(v){var g=new f(this.ops.slice());return v.ops.length>0&&(g.push(v.ops[0]),g.ops=g.ops.concat(v.ops.slice(1))),g},f.prototype.diff=function(v,g){if(this.ops===v.ops)return new f;var c=[this,v].map(function(b){return b.map(function(w){if(w.insert!=null)return typeof w.insert=="string"?w.insert:d;var _=b===v?"on":"with";throw new Error("diff() called "+_+" non-document")}).join("")}),y=new f,x=a(c[0],c[1],g),E=u.iterator(this.ops),S=u.iterator(v.ops);return x.forEach(function(b){for(var w=b[1].length;w>0;){var _=0;switch(b[0]){case a.INSERT:_=Math.min(S.peekLength(),w),y.push(S.next(_));break;case a.DELETE:_=Math.min(w,E.peekLength()),E.next(_),y.delete(_);break;case a.EQUAL:_=Math.min(E.peekLength(),S.peekLength(),w);var A=E.next(_),M=S.next(_);l(A.insert,M.insert)?y.retain(_,u.attributes.diff(A.attributes,M.attributes)):y.push(M).delete(_);break}w-=_}}),y.chop()},f.prototype.eachLine=function(v,g){g=g||`
106
- `;for(var c=u.iterator(this.ops),y=new f,x=0;c.hasNext();){if(c.peekType()!=="insert")return;var E=c.peek(),S=u.length(E)-c.peekLength(),b=typeof E.insert=="string"?E.insert.indexOf(g,S)-S:-1;if(b<0)y.push(c.next());else if(b>0)y.push(c.next(b));else{if(v(y,c.next(1).attributes||{},x)===!1)return;x+=1,y=new f}}y.length()>0&&v(y,{},x)},f.prototype.transform=function(v,g){if(g=!!g,typeof v=="number")return this.transformPosition(v,g);for(var c=u.iterator(this.ops),y=u.iterator(v.ops),x=new f;c.hasNext()||y.hasNext();)if(c.peekType()==="insert"&&(g||y.peekType()!=="insert"))x.retain(u.length(c.next()));else if(y.peekType()==="insert")x.push(y.next());else{var E=Math.min(c.peekLength(),y.peekLength()),S=c.next(E),b=y.next(E);if(S.delete)continue;b.delete?x.push(b):x.retain(E,u.attributes.transform(S.attributes,b.attributes,g))}return x.chop()},f.prototype.transformPosition=function(v,g){g=!!g;for(var c=u.iterator(this.ops),y=0;c.hasNext()&&y<=v;){var x=c.peekLength(),E=c.peekType();if(c.next(),E==="delete"){v-=Math.min(x,v-y);continue}else E==="insert"&&(y<v||!g)&&(v+=x);y+=x}return v},r.exports=f},function(r,n){var i=Object.prototype.hasOwnProperty,a=Object.prototype.toString,l=Object.defineProperty,o=Object.getOwnPropertyDescriptor,u=function(c){return typeof Array.isArray=="function"?Array.isArray(c):a.call(c)==="[object Array]"},d=function(c){if(!c||a.call(c)!=="[object Object]")return!1;var y=i.call(c,"constructor"),x=c.constructor&&c.constructor.prototype&&i.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!y&&!x)return!1;var E;for(E in c);return typeof E>"u"||i.call(c,E)},f=function(c,y){l&&y.name==="__proto__"?l(c,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):c[y.name]=y.newValue},v=function(c,y){if(y==="__proto__")if(i.call(c,y)){if(o)return o(c,y).value}else return;return c[y]};r.exports=function g(){var c,y,x,E,S,b,w=arguments[0],_=1,A=arguments.length,M=!1;for(typeof w=="boolean"&&(M=w,w=arguments[1]||{},_=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});_<A;++_)if(c=arguments[_],c!=null)for(y in c)x=v(w,y),E=v(c,y),w!==E&&(M&&E&&(d(E)||(S=u(E)))?(S?(S=!1,b=x&&u(x)?x:[]):b=x&&d(x)?x:{},f(w,{name:y,newValue:g(M,b,E)})):typeof E<"u"&&f(w,{name:y,newValue:E}));return w}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var a=function(){function k(C,q){for(var G=0;G<q.length;G++){var J=q[G];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(C,J.key,J)}}return function(C,q,G){return q&&k(C.prototype,q),G&&k(C,G),C}}(),l=function k(C,q,G){C===null&&(C=Function.prototype);var J=Object.getOwnPropertyDescriptor(C,q);if(J===void 0){var ae=Object.getPrototypeOf(C);return ae===null?void 0:k(ae,q,G)}else{if("value"in J)return J.value;var H=J.get;return H===void 0?void 0:H.call(G)}},o=i(3),u=w(o),d=i(2),f=w(d),v=i(0),g=w(v),c=i(16),y=w(c),x=i(6),E=w(x),S=i(7),b=w(S);function w(k){return k&&k.__esModule?k:{default:k}}function _(k,C){if(!(k instanceof C))throw new TypeError("Cannot call a class as a function")}function A(k,C){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:k}function M(k,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);k.prototype=Object.create(C&&C.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(k,C):k.__proto__=C)}var O=1,L=function(k){M(C,k);function C(){return _(this,C),A(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}return a(C,[{key:"attach",value:function(){l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"attach",this).call(this),this.attributes=new g.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new f.default().insert(this.value(),(0,u.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(G,J){var ae=g.default.query(G,g.default.Scope.BLOCK_ATTRIBUTE);ae!=null&&this.attributes.attribute(ae,J)}},{key:"formatAt",value:function(G,J,ae,H){this.format(ae,H)}},{key:"insertAt",value:function(G,J,ae){if(typeof J=="string"&&J.endsWith(`
107
- `)){var H=g.default.create(R.blotName);this.parent.insertBefore(H,G===0?this:this.next),H.insertAt(0,J.slice(0,-1))}else l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,G,J,ae)}}]),C}(g.default.Embed);L.scope=g.default.Scope.BLOCK_BLOT;var R=function(k){M(C,k);function C(q){_(this,C);var G=A(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,q));return G.cache={},G}return a(C,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(g.default.Leaf).reduce(function(G,J){return J.length()===0?G:G.insert(J.value(),T(J))},new f.default).insert(`
108
- `,T(this))),this.cache.delta}},{key:"deleteAt",value:function(G,J){l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"deleteAt",this).call(this,G,J),this.cache={}}},{key:"formatAt",value:function(G,J,ae,H){J<=0||(g.default.query(ae,g.default.Scope.BLOCK)?G+J===this.length()&&this.format(ae,H):l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"formatAt",this).call(this,G,Math.min(J,this.length()-G-1),ae,H),this.cache={})}},{key:"insertAt",value:function(G,J,ae){if(ae!=null)return l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,G,J,ae);if(J.length!==0){var H=J.split(`
109
- `),V=H.shift();V.length>0&&(G<this.length()-1||this.children.tail==null?l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertAt",this).call(this,Math.min(G,this.length()-1),V):this.children.tail.insertAt(this.children.tail.length(),V),this.cache={});var Y=this;H.reduce(function(U,D){return Y=Y.split(U,!0),Y.insertAt(0,D),D.length},G+V.length)}}},{key:"insertBefore",value:function(G,J){var ae=this.children.head;l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"insertBefore",this).call(this,G,J),ae instanceof y.default&&ae.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"length",this).call(this)+O),this.cache.length}},{key:"moveChildren",value:function(G,J){l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"moveChildren",this).call(this,G,J),this.cache={}}},{key:"optimize",value:function(G){l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"optimize",this).call(this,G),this.cache={}}},{key:"path",value:function(G){return l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"path",this).call(this,G,!0)}},{key:"removeChild",value:function(G){l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"removeChild",this).call(this,G),this.cache={}}},{key:"split",value:function(G){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(J&&(G===0||G>=this.length()-O)){var ae=this.clone();return G===0?(this.parent.insertBefore(ae,this),this):(this.parent.insertBefore(ae,this.next),ae)}else{var H=l(C.prototype.__proto__||Object.getPrototypeOf(C.prototype),"split",this).call(this,G,J);return this.cache={},H}}}]),C}(g.default.Block);R.blotName="block",R.tagName="P",R.defaultChild="break",R.allowedChildren=[E.default,g.default.Embed,b.default];function T(k){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return k==null||(typeof k.formats=="function"&&(C=(0,u.default)(C,k.formats())),k.parent==null||k.parent.blotName=="scroll"||k.parent.statics.scope!==k.statics.scope)?C:T(k.parent,C)}n.bubbleFormats=T,n.BlockEmbed=L,n.default=R},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(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y},l=function(){function Y(U,D){var j=[],z=!0,Z=!1,re=void 0;try{for(var W=U[Symbol.iterator](),Q;!(z=(Q=W.next()).done)&&(j.push(Q.value),!(D&&j.length===D));z=!0);}catch(se){Z=!0,re=se}finally{try{!z&&W.return&&W.return()}finally{if(Z)throw re}}return j}return function(U,D){if(Array.isArray(U))return U;if(Symbol.iterator in Object(U))return Y(U,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function Y(U,D){for(var j=0;j<D.length;j++){var z=D[j];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(U,z.key,z)}}return function(U,D,j){return D&&Y(U.prototype,D),j&&Y(U,j),U}}();i(50);var u=i(2),d=T(u),f=i(14),v=T(f),g=i(8),c=T(g),y=i(9),x=T(y),E=i(0),S=T(E),b=i(15),w=T(b),_=i(3),A=T(_),M=i(10),O=T(M),L=i(34),R=T(L);function T(Y){return Y&&Y.__esModule?Y:{default:Y}}function k(Y,U,D){return U in Y?Object.defineProperty(Y,U,{value:D,enumerable:!0,configurable:!0,writable:!0}):Y[U]=D,Y}function C(Y,U){if(!(Y instanceof U))throw new TypeError("Cannot call a class as a function")}var q=(0,O.default)("quill"),G=function(){o(Y,null,[{key:"debug",value:function(D){D===!0&&(D="log"),O.default.level(D)}},{key:"find",value:function(D){return D.__quill||S.default.find(D)}},{key:"import",value:function(D){return this.imports[D]==null&&q.error("Cannot import "+D+". Are you sure it was registered?"),this.imports[D]}},{key:"register",value:function(D,j){var z=this,Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof D!="string"){var re=D.attrName||D.blotName;typeof re=="string"?this.register("formats/"+re,D,j):Object.keys(D).forEach(function(W){z.register(W,D[W],j)})}else this.imports[D]!=null&&!Z&&q.warn("Overwriting "+D+" with",j),this.imports[D]=j,(D.startsWith("blots/")||D.startsWith("formats/"))&&j.blotName!=="abstract"?S.default.register(j):D.startsWith("modules")&&typeof j.register=="function"&&j.register()}}]);function Y(U){var D=this,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(C(this,Y),this.options=J(U,j),this.container=this.options.container,this.container==null)return q.error("Invalid Quill container",U);this.options.debug&&Y.debug(this.options.debug);var z=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 c.default,this.scroll=S.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new v.default(this.scroll),this.selection=new w.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(c.default.events.EDITOR_CHANGE,function(re){re===c.default.events.TEXT_CHANGE&&D.root.classList.toggle("ql-blank",D.editor.isBlank())}),this.emitter.on(c.default.events.SCROLL_UPDATE,function(re,W){var Q=D.selection.lastRange,se=Q&&Q.length===0?Q.index:void 0;ae.call(D,function(){return D.editor.update(null,W,se)},re)});var Z=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+z+"<p><br></p></div>");this.setContents(Z),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return o(Y,[{key:"addContainer",value:function(D){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof D=="string"){var z=D;D=document.createElement("div"),D.classList.add(z)}return this.container.insertBefore(D,j),D}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(D,j,z){var Z=this,re=H(D,j,z),W=l(re,4);return D=W[0],j=W[1],z=W[3],ae.call(this,function(){return Z.editor.deleteText(D,j)},z,D,-1*j)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(D),this.container.classList.toggle("ql-disabled",!D)}},{key:"focus",value:function(){var D=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=D,this.scrollIntoView()}},{key:"format",value:function(D,j){var z=this,Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:c.default.sources.API;return ae.call(this,function(){var re=z.getSelection(!0),W=new d.default;if(re==null)return W;if(S.default.query(D,S.default.Scope.BLOCK))W=z.editor.formatLine(re.index,re.length,k({},D,j));else{if(re.length===0)return z.selection.format(D,j),W;W=z.editor.formatText(re.index,re.length,k({},D,j))}return z.setSelection(re,c.default.sources.SILENT),W},Z)}},{key:"formatLine",value:function(D,j,z,Z,re){var W=this,Q=void 0,se=H(D,j,z,Z,re),ue=l(se,4);return D=ue[0],j=ue[1],Q=ue[2],re=ue[3],ae.call(this,function(){return W.editor.formatLine(D,j,Q)},re,D,0)}},{key:"formatText",value:function(D,j,z,Z,re){var W=this,Q=void 0,se=H(D,j,z,Z,re),ue=l(se,4);return D=ue[0],j=ue[1],Q=ue[2],re=ue[3],ae.call(this,function(){return W.editor.formatText(D,j,Q)},re,D,0)}},{key:"getBounds",value:function(D){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,z=void 0;typeof D=="number"?z=this.selection.getBounds(D,j):z=this.selection.getBounds(D.index,D.length);var Z=this.container.getBoundingClientRect();return{bottom:z.bottom-Z.top,height:z.height,left:z.left-Z.left,right:z.right-Z.left,top:z.top-Z.top,width:z.width}}},{key:"getContents",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-D,z=H(D,j),Z=l(z,2);return D=Z[0],j=Z[1],this.editor.getContents(D,j)}},{key:"getFormat",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof D=="number"?this.editor.getFormat(D,j):this.editor.getFormat(D.index,D.length)}},{key:"getIndex",value:function(D){return D.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(D){return this.scroll.leaf(D)}},{key:"getLine",value:function(D){return this.scroll.line(D)}},{key:"getLines",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof D!="number"?this.scroll.lines(D.index,D.length):this.scroll.lines(D,j)}},{key:"getModule",value:function(D){return this.theme.modules[D]}},{key:"getSelection",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return D&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-D,z=H(D,j),Z=l(z,2);return D=Z[0],j=Z[1],this.editor.getText(D,j)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(D,j,z){var Z=this,re=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Y.sources.API;return ae.call(this,function(){return Z.editor.insertEmbed(D,j,z)},re,D)}},{key:"insertText",value:function(D,j,z,Z,re){var W=this,Q=void 0,se=H(D,0,z,Z,re),ue=l(se,4);return D=ue[0],Q=ue[2],re=ue[3],ae.call(this,function(){return W.editor.insertText(D,j,Q)},re,D,j.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(D,j,z){this.clipboard.dangerouslyPasteHTML(D,j,z)}},{key:"removeFormat",value:function(D,j,z){var Z=this,re=H(D,j,z),W=l(re,4);return D=W[0],j=W[1],z=W[3],ae.call(this,function(){return Z.editor.removeFormat(D,j)},z,D)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(D){var j=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c.default.sources.API;return ae.call(this,function(){D=new d.default(D);var Z=j.getLength(),re=j.editor.deleteText(0,Z),W=j.editor.applyDelta(D),Q=W.ops[W.ops.length-1];Q!=null&&typeof Q.insert=="string"&&Q.insert[Q.insert.length-1]===`
110
- `&&(j.editor.deleteText(j.getLength()-1,1),W.delete(1));var se=re.compose(W);return se},z)}},{key:"setSelection",value:function(D,j,z){if(D==null)this.selection.setRange(null,j||Y.sources.API);else{var Z=H(D,j,z),re=l(Z,4);D=re[0],j=re[1],z=re[3],this.selection.setRange(new b.Range(D,j),z),z!==c.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(D){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c.default.sources.API,z=new d.default().insert(D);return this.setContents(z,j)}},{key:"update",value:function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:c.default.sources.USER,j=this.scroll.update(D);return this.selection.update(D),j}},{key:"updateContents",value:function(D){var j=this,z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c.default.sources.API;return ae.call(this,function(){return D=new d.default(D),j.editor.applyDelta(D,z)},z,!0)}}]),Y}();G.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},G.events=c.default.events,G.sources=c.default.sources,G.version="1.3.7",G.imports={delta:d.default,parchment:S.default,"core/module":x.default,"core/theme":R.default};function J(Y,U){if(U=(0,A.default)(!0,{container:Y,modules:{clipboard:!0,keyboard:!0,history:!0}},U),!U.theme||U.theme===G.DEFAULTS.theme)U.theme=R.default;else if(U.theme=G.import("themes/"+U.theme),U.theme==null)throw new Error("Invalid theme "+U.theme+". Did you register it?");var D=(0,A.default)(!0,{},U.theme.DEFAULTS);[D,U].forEach(function(Z){Z.modules=Z.modules||{},Object.keys(Z.modules).forEach(function(re){Z.modules[re]===!0&&(Z.modules[re]={})})});var j=Object.keys(D.modules).concat(Object.keys(U.modules)),z=j.reduce(function(Z,re){var W=G.import("modules/"+re);return W==null?q.error("Cannot load "+re+" module. Are you sure you registered it?"):Z[re]=W.DEFAULTS||{},Z},{});return U.modules!=null&&U.modules.toolbar&&U.modules.toolbar.constructor!==Object&&(U.modules.toolbar={container:U.modules.toolbar}),U=(0,A.default)(!0,{},G.DEFAULTS,{modules:z},D,U),["bounds","container","scrollingContainer"].forEach(function(Z){typeof U[Z]=="string"&&(U[Z]=document.querySelector(U[Z]))}),U.modules=Object.keys(U.modules).reduce(function(Z,re){return U.modules[re]&&(Z[re]=U.modules[re]),Z},{}),U}function ae(Y,U,D,j){if(this.options.strict&&!this.isEnabled()&&U===c.default.sources.USER)return new d.default;var z=D==null?null:this.getSelection(),Z=this.editor.delta,re=Y();if(z!=null&&(D===!0&&(D=z.index),j==null?z=V(z,re,U):j!==0&&(z=V(z,D,j,U)),this.setSelection(z,c.default.sources.SILENT)),re.length()>0){var W,Q=[c.default.events.TEXT_CHANGE,re,Z,U];if((W=this.emitter).emit.apply(W,[c.default.events.EDITOR_CHANGE].concat(Q)),U!==c.default.sources.SILENT){var se;(se=this.emitter).emit.apply(se,Q)}}return re}function H(Y,U,D,j,z){var Z={};return typeof Y.index=="number"&&typeof Y.length=="number"?typeof U!="number"?(z=j,j=D,D=U,U=Y.length,Y=Y.index):(U=Y.length,Y=Y.index):typeof U!="number"&&(z=j,j=D,D=U,U=0),(typeof D>"u"?"undefined":a(D))==="object"?(Z=D,z=j):typeof D=="string"&&(j!=null?Z[D]=j:z=D),z=z||c.default.sources.API,[Y,U,Z,z]}function V(Y,U,D,j){if(Y==null)return null;var z=void 0,Z=void 0;if(U instanceof d.default){var re=[Y.index,Y.index+Y.length].map(function(ue){return U.transformPosition(ue,j!==c.default.sources.USER)}),W=l(re,2);z=W[0],Z=W[1]}else{var Q=[Y.index,Y.index+Y.length].map(function(ue){return ue<U||ue===U&&j===c.default.sources.USER?ue:D>=0?ue+D:Math.max(U,ue+D)}),se=l(Q,2);z=se[0],Z=se[1]}return new b.Range(z,Z-z)}n.expandConfig=J,n.overload=H,n.default=G},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(S,b){for(var w=0;w<b.length;w++){var _=b[w];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(S,_.key,_)}}return function(S,b,w){return b&&E(S.prototype,b),w&&E(S,w),S}}(),l=function E(S,b,w){S===null&&(S=Function.prototype);var _=Object.getOwnPropertyDescriptor(S,b);if(_===void 0){var A=Object.getPrototypeOf(S);return A===null?void 0:E(A,b,w)}else{if("value"in _)return _.value;var M=_.get;return M===void 0?void 0:M.call(w)}},o=i(7),u=v(o),d=i(0),f=v(d);function v(E){return E&&E.__esModule?E:{default:E}}function g(E,S){if(!(E instanceof S))throw new TypeError("Cannot call a class as a function")}function c(E,S){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:E}function y(E,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);E.prototype=Object.create(S&&S.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(E,S):E.__proto__=S)}var x=function(E){y(S,E);function S(){return g(this,S),c(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,[{key:"formatAt",value:function(w,_,A,M){if(S.compare(this.statics.blotName,A)<0&&f.default.query(A,f.default.Scope.BLOT)){var O=this.isolate(w,_);M&&O.wrap(A,M)}else l(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"formatAt",this).call(this,w,_,A,M)}},{key:"optimize",value:function(w){if(l(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"optimize",this).call(this,w),this.parent instanceof S&&S.compare(this.statics.blotName,this.parent.statics.blotName)>0){var _=this.parent.isolate(this.offset(),this.length());this.moveChildren(_),_.wrap(this)}}}],[{key:"compare",value:function(w,_){var A=S.order.indexOf(w),M=S.order.indexOf(_);return A>=0||M>=0?A-M:w===_?0:w<_?-1:1}}]),S}(f.default.Inline);x.allowedChildren=[x,f.default.Embed,u.default],x.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),l=o(a);function o(g){return g&&g.__esModule?g:{default:g}}function u(g,c){if(!(g instanceof c))throw new TypeError("Cannot call a class as a function")}function d(g,c){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:g}function f(g,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);g.prototype=Object.create(c&&c.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(g,c):g.__proto__=c)}var v=function(g){f(c,g);function c(){return u(this,c),d(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}return c}(l.default.Text);n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function b(w,_){for(var A=0;A<_.length;A++){var M=_[A];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(w,M.key,M)}}return function(w,_,A){return _&&b(w.prototype,_),A&&b(w,A),w}}(),l=function b(w,_,A){w===null&&(w=Function.prototype);var M=Object.getOwnPropertyDescriptor(w,_);if(M===void 0){var O=Object.getPrototypeOf(w);return O===null?void 0:b(O,_,A)}else{if("value"in M)return M.value;var L=M.get;return L===void 0?void 0:L.call(A)}},o=i(54),u=v(o),d=i(10),f=v(d);function v(b){return b&&b.__esModule?b:{default:b}}function g(b,w){if(!(b instanceof w))throw new TypeError("Cannot call a class as a function")}function c(b,w){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:b}function y(b,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);b.prototype=Object.create(w&&w.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(b,w):b.__proto__=w)}var x=(0,f.default)("quill:events"),E=["selectionchange","mousedown","mouseup","click"];E.forEach(function(b){document.addEventListener(b,function(){for(var w=arguments.length,_=Array(w),A=0;A<w;A++)_[A]=arguments[A];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(M){if(M.__quill&&M.__quill.emitter){var O;(O=M.__quill.emitter).handleDOM.apply(O,_)}})})});var S=function(b){y(w,b);function w(){g(this,w);var _=c(this,(w.__proto__||Object.getPrototypeOf(w)).call(this));return _.listeners={},_.on("error",x.error),_}return a(w,[{key:"emit",value:function(){x.log.apply(x,arguments),l(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(A){for(var M=arguments.length,O=Array(M>1?M-1:0),L=1;L<M;L++)O[L-1]=arguments[L];(this.listeners[A.type]||[]).forEach(function(R){var T=R.node,k=R.handler;(A.target===T||T.contains(A.target))&&k.apply(void 0,[A].concat(O))})}},{key:"listenDOM",value:function(A,M,O){this.listeners[A]||(this.listeners[A]=[]),this.listeners[A].push({node:M,handler:O})}}]),w}(u.default);S.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"},S.sources={API:"api",SILENT:"silent",USER:"user"},n.default=S},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});function a(o,u){if(!(o instanceof u))throw new TypeError("Cannot call a class as a function")}var l=function o(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,o),this.quill=u,this.options=d};l.DEFAULTS={},n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=["error","warn","log","info"],l="warn";function o(d){if(a.indexOf(d)<=a.indexOf(l)){for(var f,v=arguments.length,g=Array(v>1?v-1:0),c=1;c<v;c++)g[c-1]=arguments[c];(f=console)[d].apply(f,g)}}function u(d){return a.reduce(function(f,v){return f[v]=o.bind(console,v,d),f},{})}o.level=u.level=function(d){l=d},n.default=u},function(r,n,i){var a=Array.prototype.slice,l=i(52),o=i(53),u=r.exports=function(g,c,y){return y||(y={}),g===c?!0:g instanceof Date&&c instanceof Date?g.getTime()===c.getTime():!g||!c||typeof g!="object"&&typeof c!="object"?y.strict?g===c:g==c:v(g,c,y)};function d(g){return g==null}function f(g){return!(!g||typeof g!="object"||typeof g.length!="number"||typeof g.copy!="function"||typeof g.slice!="function"||g.length>0&&typeof g[0]!="number")}function v(g,c,y){var x,E;if(d(g)||d(c)||g.prototype!==c.prototype)return!1;if(o(g))return o(c)?(g=a.call(g),c=a.call(c),u(g,c,y)):!1;if(f(g)){if(!f(c)||g.length!==c.length)return!1;for(x=0;x<g.length;x++)if(g[x]!==c[x])return!1;return!0}try{var S=l(g),b=l(c)}catch{return!1}if(S.length!=b.length)return!1;for(S.sort(),b.sort(),x=S.length-1;x>=0;x--)if(S[x]!=b[x])return!1;for(x=S.length-1;x>=0;x--)if(E=S[x],!u(g[E],c[E],y))return!1;return typeof g==typeof c}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),l=function(){function o(u,d,f){f===void 0&&(f={}),this.attrName=u,this.keyName=d;var v=a.Scope.TYPE&a.Scope.ATTRIBUTE;f.scope!=null?this.scope=f.scope&a.Scope.LEVEL|v:this.scope=a.Scope.ATTRIBUTE,f.whitelist!=null&&(this.whitelist=f.whitelist)}return o.keys=function(u){return[].map.call(u.attributes,function(d){return d.name})},o.prototype.add=function(u,d){return this.canAdd(u,d)?(u.setAttribute(this.keyName,d),!0):!1},o.prototype.canAdd=function(u,d){var f=a.query(u,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return f==null?!1:this.whitelist==null?!0:typeof d=="string"?this.whitelist.indexOf(d.replace(/["']/g,""))>-1:this.whitelist.indexOf(d)>-1},o.prototype.remove=function(u){u.removeAttribute(this.keyName)},o.prototype.value=function(u){var d=u.getAttribute(this.keyName);return this.canAdd(u,d)&&d?d:""},o}();n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var a=function(){function L(R,T){var k=[],C=!0,q=!1,G=void 0;try{for(var J=R[Symbol.iterator](),ae;!(C=(ae=J.next()).done)&&(k.push(ae.value),!(T&&k.length===T));C=!0);}catch(H){q=!0,G=H}finally{try{!C&&J.return&&J.return()}finally{if(q)throw G}}return k}return function(R,T){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return L(R,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function L(R,T){for(var k=0;k<T.length;k++){var C=T[k];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(R,C.key,C)}}return function(R,T,k){return T&&L(R.prototype,T),k&&L(R,k),R}}(),o=function L(R,T,k){R===null&&(R=Function.prototype);var C=Object.getOwnPropertyDescriptor(R,T);if(C===void 0){var q=Object.getPrototypeOf(R);return q===null?void 0:L(q,T,k)}else{if("value"in C)return C.value;var G=C.get;return G===void 0?void 0:G.call(k)}},u=i(2),d=b(u),f=i(0),v=b(f),g=i(4),c=b(g),y=i(6),x=b(y),E=i(7),S=b(E);function b(L){return L&&L.__esModule?L:{default:L}}function w(L,R){if(!(L instanceof R))throw new TypeError("Cannot call a class as a function")}function _(L,R){if(!L)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:L}function A(L,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);L.prototype=Object.create(R&&R.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(L,R):L.__proto__=R)}var M=function(L){A(R,L);function R(){return w(this,R),_(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return R}(x.default);M.blotName="code",M.tagName="CODE";var O=function(L){A(R,L);function R(){return w(this,R),_(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return l(R,[{key:"delta",value:function(){var k=this,C=this.domNode.textContent;return C.endsWith(`
111
- `)&&(C=C.slice(0,-1)),C.split(`
112
- `).reduce(function(q,G){return q.insert(G).insert(`
113
- `,k.formats())},new d.default)}},{key:"format",value:function(k,C){if(!(k===this.statics.blotName&&C)){var q=this.descendant(S.default,this.length()-1),G=a(q,1),J=G[0];J?.deleteAt(J.length()-1,1),o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"format",this).call(this,k,C)}}},{key:"formatAt",value:function(k,C,q,G){if(C!==0&&!(v.default.query(q,v.default.Scope.BLOCK)==null||q===this.statics.blotName&&G===this.statics.formats(this.domNode))){var J=this.newlineIndex(k);if(!(J<0||J>=k+C)){var ae=this.newlineIndex(k,!0)+1,H=J-ae+1,V=this.isolate(ae,H),Y=V.next;V.format(q,G),Y instanceof R&&Y.formatAt(0,k-ae+C-H,q,G)}}}},{key:"insertAt",value:function(k,C,q){if(q==null){var G=this.descendant(S.default,k),J=a(G,2),ae=J[0],H=J[1];ae.insertAt(H,C)}}},{key:"length",value:function(){var k=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
114
- `)?k:k+1}},{key:"newlineIndex",value:function(k){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(C)return this.domNode.textContent.slice(0,k).lastIndexOf(`
115
- `);var q=this.domNode.textContent.slice(k).indexOf(`
116
- `);return q>-1?k+q:-1}},{key:"optimize",value:function(k){this.domNode.textContent.endsWith(`
117
- `)||this.appendChild(v.default.create("text",`
118
- `)),o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"optimize",this).call(this,k);var C=this.next;C!=null&&C.prev===this&&C.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===C.statics.formats(C.domNode)&&(C.optimize(k),C.moveChildren(this),C.remove())}},{key:"replace",value:function(k){o(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"replace",this).call(this,k),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(C){var q=v.default.find(C);q==null?C.parentNode.removeChild(C):q instanceof v.default.Embed?q.remove():q.unwrap()})}}],[{key:"create",value:function(k){var C=o(R.__proto__||Object.getPrototypeOf(R),"create",this).call(this,k);return C.setAttribute("spellcheck",!1),C}},{key:"formats",value:function(){return!0}}]),R}(c.default);O.blotName="code-block",O.tagName="PRE",O.TAB=" ",n.Code=M,n.default=O},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Y){return typeof Y}:function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y},l=function(){function Y(U,D){var j=[],z=!0,Z=!1,re=void 0;try{for(var W=U[Symbol.iterator](),Q;!(z=(Q=W.next()).done)&&(j.push(Q.value),!(D&&j.length===D));z=!0);}catch(se){Z=!0,re=se}finally{try{!z&&W.return&&W.return()}finally{if(Z)throw re}}return j}return function(U,D){if(Array.isArray(U))return U;if(Symbol.iterator in Object(U))return Y(U,D);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function Y(U,D){for(var j=0;j<D.length;j++){var z=D[j];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(U,z.key,z)}}return function(U,D,j){return D&&Y(U.prototype,D),j&&Y(U,j),U}}(),u=i(2),d=C(u),f=i(20),v=C(f),g=i(0),c=C(g),y=i(13),x=C(y),E=i(24),S=C(E),b=i(4),w=C(b),_=i(16),A=C(_),M=i(21),O=C(M),L=i(11),R=C(L),T=i(3),k=C(T);function C(Y){return Y&&Y.__esModule?Y:{default:Y}}function q(Y,U,D){return U in Y?Object.defineProperty(Y,U,{value:D,enumerable:!0,configurable:!0,writable:!0}):Y[U]=D,Y}function G(Y,U){if(!(Y instanceof U))throw new TypeError("Cannot call a class as a function")}var J=/^[ -~]*$/,ae=function(){function Y(U){G(this,Y),this.scroll=U,this.delta=this.getDelta()}return o(Y,[{key:"applyDelta",value:function(D){var j=this,z=!1;this.scroll.update();var Z=this.scroll.length();return this.scroll.batchStart(),D=V(D),D.reduce(function(re,W){var Q=W.retain||W.delete||W.insert.length||1,se=W.attributes||{};if(W.insert!=null){if(typeof W.insert=="string"){var ue=W.insert;ue.endsWith(`
119
- `)&&z&&(z=!1,ue=ue.slice(0,-1)),re>=Z&&!ue.endsWith(`
120
- `)&&(z=!0),j.scroll.insertAt(re,ue);var le=j.scroll.line(re),ye=l(le,2),Re=ye[0],Me=ye[1],Pe=(0,k.default)({},(0,b.bubbleFormats)(Re));if(Re instanceof w.default){var de=Re.descendant(c.default.Leaf,Me),Te=l(de,1),Ae=Te[0];Pe=(0,k.default)(Pe,(0,b.bubbleFormats)(Ae))}se=v.default.attributes.diff(Pe,se)||{}}else if(a(W.insert)==="object"){var be=Object.keys(W.insert)[0];if(be==null)return re;j.scroll.insertAt(re,be,W.insert[be])}Z+=Q}return Object.keys(se).forEach(function(_e){j.scroll.formatAt(re,Q,_e,se[_e])}),re+Q},0),D.reduce(function(re,W){return typeof W.delete=="number"?(j.scroll.deleteAt(re,W.delete),re):re+(W.retain||W.insert.length||1)},0),this.scroll.batchEnd(),this.update(D)}},{key:"deleteText",value:function(D,j){return this.scroll.deleteAt(D,j),this.update(new d.default().retain(D).delete(j))}},{key:"formatLine",value:function(D,j){var z=this,Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(Z).forEach(function(re){if(!(z.scroll.whitelist!=null&&!z.scroll.whitelist[re])){var W=z.scroll.lines(D,Math.max(j,1)),Q=j;W.forEach(function(se){var ue=se.length();if(!(se instanceof x.default))se.format(re,Z[re]);else{var le=D-se.offset(z.scroll),ye=se.newlineIndex(le+Q)-le+1;se.formatAt(le,ye,re,Z[re])}Q-=ue})}}),this.scroll.optimize(),this.update(new d.default().retain(D).retain(j,(0,O.default)(Z)))}},{key:"formatText",value:function(D,j){var z=this,Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(Z).forEach(function(re){z.scroll.formatAt(D,j,re,Z[re])}),this.update(new d.default().retain(D).retain(j,(0,O.default)(Z)))}},{key:"getContents",value:function(D,j){return this.delta.slice(D,D+j)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(D,j){return D.concat(j.delta())},new d.default)}},{key:"getFormat",value:function(D){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,z=[],Z=[];j===0?this.scroll.path(D).forEach(function(W){var Q=l(W,1),se=Q[0];se instanceof w.default?z.push(se):se instanceof c.default.Leaf&&Z.push(se)}):(z=this.scroll.lines(D,j),Z=this.scroll.descendants(c.default.Leaf,D,j));var re=[z,Z].map(function(W){if(W.length===0)return{};for(var Q=(0,b.bubbleFormats)(W.shift());Object.keys(Q).length>0;){var se=W.shift();if(se==null)return Q;Q=H((0,b.bubbleFormats)(se),Q)}return Q});return k.default.apply(k.default,re)}},{key:"getText",value:function(D,j){return this.getContents(D,j).filter(function(z){return typeof z.insert=="string"}).map(function(z){return z.insert}).join("")}},{key:"insertEmbed",value:function(D,j,z){return this.scroll.insertAt(D,j,z),this.update(new d.default().retain(D).insert(q({},j,z)))}},{key:"insertText",value:function(D,j){var z=this,Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return j=j.replace(/\r\n/g,`
121
- `).replace(/\r/g,`
122
- `),this.scroll.insertAt(D,j),Object.keys(Z).forEach(function(re){z.scroll.formatAt(D,j.length,re,Z[re])}),this.update(new d.default().retain(D).insert(j,(0,O.default)(Z)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var D=this.scroll.children.head;return D.statics.blotName!==w.default.blotName||D.children.length>1?!1:D.children.head instanceof A.default}},{key:"removeFormat",value:function(D,j){var z=this.getText(D,j),Z=this.scroll.line(D+j),re=l(Z,2),W=re[0],Q=re[1],se=0,ue=new d.default;W!=null&&(W instanceof x.default?se=W.newlineIndex(Q)-Q+1:se=W.length()-Q,ue=W.delta().slice(Q,Q+se-1).insert(`
123
- `));var le=this.getContents(D,j+se),ye=le.diff(new d.default().insert(z).concat(ue)),Re=new d.default().retain(D).concat(ye);return this.applyDelta(Re)}},{key:"update",value:function(D){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,Z=this.delta;if(j.length===1&&j[0].type==="characterData"&&j[0].target.data.match(J)&&c.default.find(j[0].target)){var re=c.default.find(j[0].target),W=(0,b.bubbleFormats)(re),Q=re.offset(this.scroll),se=j[0].oldValue.replace(S.default.CONTENTS,""),ue=new d.default().insert(se),le=new d.default().insert(re.value()),ye=new d.default().retain(Q).concat(ue.diff(le,z));D=ye.reduce(function(Re,Me){return Me.insert?Re.insert(Me.insert,W):Re.push(Me)},new d.default),this.delta=Z.compose(D)}else this.delta=this.getDelta(),(!D||!(0,R.default)(Z.compose(D),this.delta))&&(D=Z.diff(this.delta,z));return D}}]),Y}();function H(Y,U){return Object.keys(U).reduce(function(D,j){return Y[j]==null||(U[j]===Y[j]?D[j]=U[j]:Array.isArray(U[j])?U[j].indexOf(Y[j])<0&&(D[j]=U[j].concat([Y[j]])):D[j]=[U[j],Y[j]]),D},{})}function V(Y){return Y.reduce(function(U,D){if(D.insert===1){var j=(0,O.default)(D.attributes);return delete j.image,U.insert({image:D.attributes.image},j)}if(D.attributes!=null&&(D.attributes.list===!0||D.attributes.bullet===!0)&&(D=(0,O.default)(D),D.attributes.list?D.attributes.list="ordered":(D.attributes.list="bullet",delete D.attributes.bullet)),typeof D.insert=="string"){var z=D.insert.replace(/\r\n/g,`
124
- `).replace(/\r/g,`
125
- `);return U.insert(z,D.attributes)}return U.push(D)},new d.default)}n.default=ae},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=function(){function L(R,T){var k=[],C=!0,q=!1,G=void 0;try{for(var J=R[Symbol.iterator](),ae;!(C=(ae=J.next()).done)&&(k.push(ae.value),!(T&&k.length===T));C=!0);}catch(H){q=!0,G=H}finally{try{!C&&J.return&&J.return()}finally{if(q)throw G}}return k}return function(R,T){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return L(R,T);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function L(R,T){for(var k=0;k<T.length;k++){var C=T[k];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(R,C.key,C)}}return function(R,T,k){return T&&L(R.prototype,T),k&&L(R,k),R}}(),o=i(0),u=S(o),d=i(21),f=S(d),v=i(11),g=S(v),c=i(8),y=S(c),x=i(10),E=S(x);function S(L){return L&&L.__esModule?L:{default:L}}function b(L){if(Array.isArray(L)){for(var R=0,T=Array(L.length);R<L.length;R++)T[R]=L[R];return T}else return Array.from(L)}function w(L,R){if(!(L instanceof R))throw new TypeError("Cannot call a class as a function")}var _=(0,E.default)("quill:selection"),A=function L(R){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;w(this,L),this.index=R,this.length=T},M=function(){function L(R,T){var k=this;w(this,L),this.emitter=T,this.scroll=R,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=u.default.create("cursor",this),this.lastRange=this.savedRange=new A(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){k.mouseDown||setTimeout(k.update.bind(k,y.default.sources.USER),1)}),this.emitter.on(y.default.events.EDITOR_CHANGE,function(C,q){C===y.default.events.TEXT_CHANGE&&q.length()>0&&k.update(y.default.sources.SILENT)}),this.emitter.on(y.default.events.SCROLL_BEFORE_UPDATE,function(){if(k.hasFocus()){var C=k.getNativeRange();C!=null&&C.start.node!==k.cursor.textNode&&k.emitter.once(y.default.events.SCROLL_UPDATE,function(){try{k.setNativeRange(C.start.node,C.start.offset,C.end.node,C.end.offset)}catch{}})}}),this.emitter.on(y.default.events.SCROLL_OPTIMIZE,function(C,q){if(q.range){var G=q.range,J=G.startNode,ae=G.startOffset,H=G.endNode,V=G.endOffset;k.setNativeRange(J,ae,H,V)}}),this.update(y.default.sources.SILENT)}return l(L,[{key:"handleComposition",value:function(){var T=this;this.root.addEventListener("compositionstart",function(){T.composing=!0}),this.root.addEventListener("compositionend",function(){if(T.composing=!1,T.cursor.parent){var k=T.cursor.restore();if(!k)return;setTimeout(function(){T.setNativeRange(k.startNode,k.startOffset,k.endNode,k.endOffset)},1)}})}},{key:"handleDragging",value:function(){var T=this;this.emitter.listenDOM("mousedown",document.body,function(){T.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){T.mouseDown=!1,T.update(y.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(T,k){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[T])){this.scroll.update();var C=this.getNativeRange();if(!(C==null||!C.native.collapsed||u.default.query(T,u.default.Scope.BLOCK))){if(C.start.node!==this.cursor.textNode){var q=u.default.find(C.start.node,!1);if(q==null)return;if(q instanceof u.default.Leaf){var G=q.split(C.start.offset);q.parent.insertBefore(this.cursor,G)}else q.insertBefore(this.cursor,C.start.node);this.cursor.attach()}this.cursor.format(T,k),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(T){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=this.scroll.length();T=Math.min(T,C-1),k=Math.min(T+k,C-1)-T;var q=void 0,G=this.scroll.leaf(T),J=a(G,2),ae=J[0],H=J[1];if(ae==null)return null;var V=ae.position(H,!0),Y=a(V,2);q=Y[0],H=Y[1];var U=document.createRange();if(k>0){U.setStart(q,H);var D=this.scroll.leaf(T+k),j=a(D,2);if(ae=j[0],H=j[1],ae==null)return null;var z=ae.position(H,!0),Z=a(z,2);return q=Z[0],H=Z[1],U.setEnd(q,H),U.getBoundingClientRect()}else{var re="left",W=void 0;return q instanceof Text?(H<q.data.length?(U.setStart(q,H),U.setEnd(q,H+1)):(U.setStart(q,H-1),U.setEnd(q,H),re="right"),W=U.getBoundingClientRect()):(W=ae.domNode.getBoundingClientRect(),H>0&&(re="right")),{bottom:W.top+W.height,height:W.height,left:W[re],right:W[re],top:W.top,width:0}}}},{key:"getNativeRange",value:function(){var T=document.getSelection();if(T==null||T.rangeCount<=0)return null;var k=T.getRangeAt(0);if(k==null)return null;var C=this.normalizeNative(k);return _.info("getNativeRange",C),C}},{key:"getRange",value:function(){var T=this.getNativeRange();if(T==null)return[null,null];var k=this.normalizedToRange(T);return[k,T]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(T){var k=this,C=[[T.start.node,T.start.offset]];T.native.collapsed||C.push([T.end.node,T.end.offset]);var q=C.map(function(ae){var H=a(ae,2),V=H[0],Y=H[1],U=u.default.find(V,!0),D=U.offset(k.scroll);return Y===0?D:U instanceof u.default.Container?D+U.length():D+U.index(V,Y)}),G=Math.min(Math.max.apply(Math,b(q)),this.scroll.length()-1),J=Math.min.apply(Math,[G].concat(b(q)));return new A(J,G-J)}},{key:"normalizeNative",value:function(T){if(!O(this.root,T.startContainer)||!T.collapsed&&!O(this.root,T.endContainer))return null;var k={start:{node:T.startContainer,offset:T.startOffset},end:{node:T.endContainer,offset:T.endOffset},native:T};return[k.start,k.end].forEach(function(C){for(var q=C.node,G=C.offset;!(q instanceof Text)&&q.childNodes.length>0;)if(q.childNodes.length>G)q=q.childNodes[G],G=0;else if(q.childNodes.length===G)q=q.lastChild,G=q instanceof Text?q.data.length:q.childNodes.length+1;else break;C.node=q,C.offset=G}),k}},{key:"rangeToNative",value:function(T){var k=this,C=T.collapsed?[T.index]:[T.index,T.index+T.length],q=[],G=this.scroll.length();return C.forEach(function(J,ae){J=Math.min(G-1,J);var H=void 0,V=k.scroll.leaf(J),Y=a(V,2),U=Y[0],D=Y[1],j=U.position(D,ae!==0),z=a(j,2);H=z[0],D=z[1],q.push(H,D)}),q.length<2&&(q=q.concat(q)),q}},{key:"scrollIntoView",value:function(T){var k=this.lastRange;if(k!=null){var C=this.getBounds(k.index,k.length);if(C!=null){var q=this.scroll.length()-1,G=this.scroll.line(Math.min(k.index,q)),J=a(G,1),ae=J[0],H=ae;if(k.length>0){var V=this.scroll.line(Math.min(k.index+k.length,q)),Y=a(V,1);H=Y[0]}if(!(ae==null||H==null)){var U=T.getBoundingClientRect();C.top<U.top?T.scrollTop-=U.top-C.top:C.bottom>U.bottom&&(T.scrollTop+=C.bottom-U.bottom)}}}}},{key:"setNativeRange",value:function(T,k){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:T,q=arguments.length>3&&arguments[3]!==void 0?arguments[3]:k,G=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(_.info("setNativeRange",T,k,C,q),!(T!=null&&(this.root.parentNode==null||T.parentNode==null||C.parentNode==null))){var J=document.getSelection();if(J!=null)if(T!=null){this.hasFocus()||this.root.focus();var ae=(this.getNativeRange()||{}).native;if(ae==null||G||T!==ae.startContainer||k!==ae.startOffset||C!==ae.endContainer||q!==ae.endOffset){T.tagName=="BR"&&(k=[].indexOf.call(T.parentNode.childNodes,T),T=T.parentNode),C.tagName=="BR"&&(q=[].indexOf.call(C.parentNode.childNodes,C),C=C.parentNode);var H=document.createRange();H.setStart(T,k),H.setEnd(C,q),J.removeAllRanges(),J.addRange(H)}}else J.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(T){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.default.sources.API;if(typeof k=="string"&&(C=k,k=!1),_.info("setRange",T),T!=null){var q=this.rangeToNative(T);this.setNativeRange.apply(this,b(q).concat([k]))}else this.setNativeRange(null);this.update(C)}},{key:"update",value:function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y.default.sources.USER,k=this.lastRange,C=this.getRange(),q=a(C,2),G=q[0],J=q[1];if(this.lastRange=G,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,g.default)(k,this.lastRange)){var ae;!this.composing&&J!=null&&J.native.collapsed&&J.start.node!==this.cursor.textNode&&this.cursor.restore();var H=[y.default.events.SELECTION_CHANGE,(0,f.default)(this.lastRange),(0,f.default)(k),T];if((ae=this.emitter).emit.apply(ae,[y.default.events.EDITOR_CHANGE].concat(H)),T!==y.default.sources.SILENT){var V;(V=this.emitter).emit.apply(V,H)}}}}]),L}();function O(L,R){try{R.parentNode}catch{return!1}return R instanceof Text&&(R=R.parentNode),L.contains(R)}n.Range=A,n.default=M},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(x,E){for(var S=0;S<E.length;S++){var b=E[S];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(x,b.key,b)}}return function(x,E,S){return E&&y(x.prototype,E),S&&y(x,S),x}}(),l=function y(x,E,S){x===null&&(x=Function.prototype);var b=Object.getOwnPropertyDescriptor(x,E);if(b===void 0){var w=Object.getPrototypeOf(x);return w===null?void 0:y(w,E,S)}else{if("value"in b)return b.value;var _=b.get;return _===void 0?void 0:_.call(S)}},o=i(0),u=d(o);function d(y){return y&&y.__esModule?y:{default:y}}function f(y,x){if(!(y instanceof x))throw new TypeError("Cannot call a class as a function")}function v(y,x){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:y}function g(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);y.prototype=Object.create(x&&x.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(y,x):y.__proto__=x)}var c=function(y){g(x,y);function x(){return f(this,x),v(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"insertInto",value:function(S,b){S.children.length===0?l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"insertInto",this).call(this,S,b):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),x}(u.default.Embed);c.blotName="break",c.tagName="BR",n.default=c},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,c){g.__proto__=c}||function(g,c){for(var y in c)c.hasOwnProperty(y)&&(g[y]=c[y])};return function(g,c){v(g,c);function y(){this.constructor=g}g.prototype=c===null?Object.create(c):(y.prototype=c.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=i(44),o=i(30),u=i(1),d=function(v){a(g,v);function g(c){var y=v.call(this,c)||this;return y.build(),y}return g.prototype.appendChild=function(c){this.insertBefore(c)},g.prototype.attach=function(){v.prototype.attach.call(this),this.children.forEach(function(c){c.attach()})},g.prototype.build=function(){var c=this;this.children=new l.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(y){try{var x=f(y);c.insertBefore(x,c.children.head||void 0)}catch(E){if(E instanceof u.ParchmentError)return;throw E}})},g.prototype.deleteAt=function(c,y){if(c===0&&y===this.length())return this.remove();this.children.forEachAt(c,y,function(x,E,S){x.deleteAt(E,S)})},g.prototype.descendant=function(c,y){var x=this.children.find(y),E=x[0],S=x[1];return c.blotName==null&&c(E)||c.blotName!=null&&E instanceof c?[E,S]:E instanceof g?E.descendant(c,S):[null,-1]},g.prototype.descendants=function(c,y,x){y===void 0&&(y=0),x===void 0&&(x=Number.MAX_VALUE);var E=[],S=x;return this.children.forEachAt(y,x,function(b,w,_){(c.blotName==null&&c(b)||c.blotName!=null&&b instanceof c)&&E.push(b),b instanceof g&&(E=E.concat(b.descendants(c,w,S))),S-=_}),E},g.prototype.detach=function(){this.children.forEach(function(c){c.detach()}),v.prototype.detach.call(this)},g.prototype.formatAt=function(c,y,x,E){this.children.forEachAt(c,y,function(S,b,w){S.formatAt(b,w,x,E)})},g.prototype.insertAt=function(c,y,x){var E=this.children.find(c),S=E[0],b=E[1];if(S)S.insertAt(b,y,x);else{var w=x==null?u.create("text",y):u.create(y,x);this.appendChild(w)}},g.prototype.insertBefore=function(c,y){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(x){return c instanceof x}))throw new u.ParchmentError("Cannot insert "+c.statics.blotName+" into "+this.statics.blotName);c.insertInto(this,y)},g.prototype.length=function(){return this.children.reduce(function(c,y){return c+y.length()},0)},g.prototype.moveChildren=function(c,y){this.children.forEach(function(x){c.insertBefore(x,y)})},g.prototype.optimize=function(c){if(v.prototype.optimize.call(this,c),this.children.length===0)if(this.statics.defaultChild!=null){var y=u.create(this.statics.defaultChild);this.appendChild(y),y.optimize(c)}else this.remove()},g.prototype.path=function(c,y){y===void 0&&(y=!1);var x=this.children.find(c,y),E=x[0],S=x[1],b=[[this,c]];return E instanceof g?b.concat(E.path(S,y)):(E!=null&&b.push([E,S]),b)},g.prototype.removeChild=function(c){this.children.remove(c)},g.prototype.replace=function(c){c instanceof g&&c.moveChildren(this),v.prototype.replace.call(this,c)},g.prototype.split=function(c,y){if(y===void 0&&(y=!1),!y){if(c===0)return this;if(c===this.length())return this.next}var x=this.clone();return this.parent.insertBefore(x,this.next),this.children.forEachAt(c,this.length(),function(E,S,b){E=E.split(S,y),x.appendChild(E)}),x},g.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},g.prototype.update=function(c,y){var x=this,E=[],S=[];c.forEach(function(b){b.target===x.domNode&&b.type==="childList"&&(E.push.apply(E,b.addedNodes),S.push.apply(S,b.removedNodes))}),S.forEach(function(b){if(!(b.parentNode!=null&&b.tagName!=="IFRAME"&&document.body.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var w=u.find(b);w!=null&&(w.domNode.parentNode==null||w.domNode.parentNode===x.domNode)&&w.detach()}}),E.filter(function(b){return b.parentNode==x.domNode}).sort(function(b,w){return b===w?0:b.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(b){var w=null;b.nextSibling!=null&&(w=u.find(b.nextSibling));var _=f(b);(_.next!=w||_.next==null)&&(_.parent!=null&&_.parent.removeChild(x),x.insertBefore(_,w||void 0))})},g}(o.default);function f(v){var g=u.find(v);if(g==null)try{g=u.create(v)}catch{g=u.create(u.Scope.INLINE),[].slice.call(v.childNodes).forEach(function(y){g.domNode.appendChild(y)}),v.parentNode&&v.parentNode.replaceChild(g.domNode,v),g.attach()}return g}n.default=d},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,c){g.__proto__=c}||function(g,c){for(var y in c)c.hasOwnProperty(y)&&(g[y]=c[y])};return function(g,c){v(g,c);function y(){this.constructor=g}g.prototype=c===null?Object.create(c):(y.prototype=c.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=i(12),o=i(31),u=i(17),d=i(1),f=function(v){a(g,v);function g(c){var y=v.call(this,c)||this;return y.attributes=new o.default(y.domNode),y}return g.formats=function(c){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return c.tagName.toLowerCase()},g.prototype.format=function(c,y){var x=d.query(c);x instanceof l.default?this.attributes.attribute(x,y):y&&x!=null&&(c!==this.statics.blotName||this.formats()[c]!==y)&&this.replaceWith(c,y)},g.prototype.formats=function(){var c=this.attributes.values(),y=this.statics.formats(this.domNode);return y!=null&&(c[this.statics.blotName]=y),c},g.prototype.replaceWith=function(c,y){var x=v.prototype.replaceWith.call(this,c,y);return this.attributes.copy(x),x},g.prototype.update=function(c,y){var x=this;v.prototype.update.call(this,c,y),c.some(function(E){return E.target===x.domNode&&E.type==="attributes"})&&this.attributes.build()},g.prototype.wrap=function(c,y){var x=v.prototype.wrap.call(this,c,y);return x instanceof g&&x.statics.scope===this.statics.scope&&this.attributes.move(x),x},g}(u.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var g in v)v.hasOwnProperty(g)&&(f[g]=v[g])};return function(f,v){d(f,v);function g(){this.constructor=f}f.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=i(30),o=i(1),u=function(d){a(f,d);function f(){return d!==null&&d.apply(this,arguments)||this}return f.value=function(v){return!0},f.prototype.index=function(v,g){return this.domNode===v||this.domNode.compareDocumentPosition(v)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(g,1):-1},f.prototype.position=function(v,g){var c=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return v>0&&(c+=1),[this.parent.domNode,c]},f.prototype.value=function(){var v;return v={},v[this.statics.blotName]=this.statics.value(this.domNode)||!0,v},f.scope=o.Scope.INLINE_BLOT,f}(l.default);n.default=u},function(r,n,i){var a=i(11),l=i(3),o={attributes:{compose:function(d,f,v){typeof d!="object"&&(d={}),typeof f!="object"&&(f={});var g=l(!0,{},f);v||(g=Object.keys(g).reduce(function(y,x){return g[x]!=null&&(y[x]=g[x]),y},{}));for(var c in d)d[c]!==void 0&&f[c]===void 0&&(g[c]=d[c]);return Object.keys(g).length>0?g:void 0},diff:function(d,f){typeof d!="object"&&(d={}),typeof f!="object"&&(f={});var v=Object.keys(d).concat(Object.keys(f)).reduce(function(g,c){return a(d[c],f[c])||(g[c]=f[c]===void 0?null:f[c]),g},{});return Object.keys(v).length>0?v:void 0},transform:function(d,f,v){if(typeof d!="object")return f;if(typeof f=="object"){if(!v)return f;var g=Object.keys(f).reduce(function(c,y){return d[y]===void 0&&(c[y]=f[y]),c},{});return Object.keys(g).length>0?g:void 0}}},iterator:function(d){return new u(d)},length:function(d){return typeof d.delete=="number"?d.delete:typeof d.retain=="number"?d.retain:typeof d.insert=="string"?d.insert.length:1}};function u(d){this.ops=d,this.index=0,this.offset=0}u.prototype.hasNext=function(){return this.peekLength()<1/0},u.prototype.next=function(d){d||(d=1/0);var f=this.ops[this.index];if(f){var v=this.offset,g=o.length(f);if(d>=g-v?(d=g-v,this.index+=1,this.offset=0):this.offset+=d,typeof f.delete=="number")return{delete:d};var c={};return f.attributes&&(c.attributes=f.attributes),typeof f.retain=="number"?c.retain=d:typeof f.insert=="string"?c.insert=f.insert.substr(v,d):c.insert=f.insert,c}else return{retain:1/0}},u.prototype.peek=function(){return this.ops[this.index]},u.prototype.peekLength=function(){return this.ops[this.index]?o.length(this.ops[this.index])-this.offset:1/0},u.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},u.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var d=this.offset,f=this.index,v=this.next(),g=this.ops.slice(this.index);return this.offset=d,this.index=f,[v].concat(g)}else return[]},r.exports=o},function(r,n){var i=function(){function a(x,E){return E!=null&&x instanceof E}var l;try{l=Map}catch{l=function(){}}var o;try{o=Set}catch{o=function(){}}var u;try{u=Promise}catch{u=function(){}}function d(x,E,S,b,w){typeof E=="object"&&(S=E.depth,b=E.prototype,w=E.includeNonEnumerable,E=E.circular);var _=[],A=[],M=typeof Buffer<"u";typeof E>"u"&&(E=!0),typeof S>"u"&&(S=1/0);function O(L,R){if(L===null)return null;if(R===0)return L;var T,k;if(typeof L!="object")return L;if(a(L,l))T=new l;else if(a(L,o))T=new o;else if(a(L,u))T=new u(function(U,D){L.then(function(j){U(O(j,R-1))},function(j){D(O(j,R-1))})});else if(d.__isArray(L))T=[];else if(d.__isRegExp(L))T=new RegExp(L.source,y(L)),L.lastIndex&&(T.lastIndex=L.lastIndex);else if(d.__isDate(L))T=new Date(L.getTime());else{if(M&&Buffer.isBuffer(L))return Buffer.allocUnsafe?T=Buffer.allocUnsafe(L.length):T=new Buffer(L.length),L.copy(T),T;a(L,Error)?T=Object.create(L):typeof b>"u"?(k=Object.getPrototypeOf(L),T=Object.create(k)):(T=Object.create(b),k=b)}if(E){var C=_.indexOf(L);if(C!=-1)return A[C];_.push(L),A.push(T)}a(L,l)&&L.forEach(function(U,D){var j=O(D,R-1),z=O(U,R-1);T.set(j,z)}),a(L,o)&&L.forEach(function(U){var D=O(U,R-1);T.add(D)});for(var q in L){var G;k&&(G=Object.getOwnPropertyDescriptor(k,q)),!(G&&G.set==null)&&(T[q]=O(L[q],R-1))}if(Object.getOwnPropertySymbols)for(var J=Object.getOwnPropertySymbols(L),q=0;q<J.length;q++){var ae=J[q],H=Object.getOwnPropertyDescriptor(L,ae);H&&!H.enumerable&&!w||(T[ae]=O(L[ae],R-1),H.enumerable||Object.defineProperty(T,ae,{enumerable:!1}))}if(w)for(var V=Object.getOwnPropertyNames(L),q=0;q<V.length;q++){var Y=V[q],H=Object.getOwnPropertyDescriptor(L,Y);H&&H.enumerable||(T[Y]=O(L[Y],R-1),Object.defineProperty(T,Y,{enumerable:!1}))}return T}return O(x,S)}d.clonePrototype=function(E){if(E===null)return null;var S=function(){};return S.prototype=E,new S};function f(x){return Object.prototype.toString.call(x)}d.__objToStr=f;function v(x){return typeof x=="object"&&f(x)==="[object Date]"}d.__isDate=v;function g(x){return typeof x=="object"&&f(x)==="[object Array]"}d.__isArray=g;function c(x){return typeof x=="object"&&f(x)==="[object RegExp]"}d.__isRegExp=c;function y(x){var E="";return x.global&&(E+="g"),x.ignoreCase&&(E+="i"),x.multiline&&(E+="m"),E}return d.__getRegExpFlags=y,d}();typeof r=="object"&&r.exports&&(r.exports=i)},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function T(k,C){var q=[],G=!0,J=!1,ae=void 0;try{for(var H=k[Symbol.iterator](),V;!(G=(V=H.next()).done)&&(q.push(V.value),!(C&&q.length===C));G=!0);}catch(Y){J=!0,ae=Y}finally{try{!G&&H.return&&H.return()}finally{if(J)throw ae}}return q}return function(k,C){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return T(k,C);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function T(k,C){for(var q=0;q<C.length;q++){var G=C[q];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(k,G.key,G)}}return function(k,C,q){return C&&T(k.prototype,C),q&&T(k,q),k}}(),o=function T(k,C,q){k===null&&(k=Function.prototype);var G=Object.getOwnPropertyDescriptor(k,C);if(G===void 0){var J=Object.getPrototypeOf(k);return J===null?void 0:T(J,C,q)}else{if("value"in G)return G.value;var ae=G.get;return ae===void 0?void 0:ae.call(q)}},u=i(0),d=_(u),f=i(8),v=_(f),g=i(4),c=_(g),y=i(16),x=_(y),E=i(13),S=_(E),b=i(25),w=_(b);function _(T){return T&&T.__esModule?T:{default:T}}function A(T,k){if(!(T instanceof k))throw new TypeError("Cannot call a class as a function")}function M(T,k){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:T}function O(T,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);T.prototype=Object.create(k&&k.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(T,k):T.__proto__=k)}function L(T){return T instanceof c.default||T instanceof g.BlockEmbed}var R=function(T){O(k,T);function k(C,q){A(this,k);var G=M(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,C));return G.emitter=q.emitter,Array.isArray(q.whitelist)&&(G.whitelist=q.whitelist.reduce(function(J,ae){return J[ae]=!0,J},{})),G.domNode.addEventListener("DOMNodeInserted",function(){}),G.optimize(),G.enable(),G}return l(k,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(q,G){var J=this.line(q),ae=a(J,2),H=ae[0],V=ae[1],Y=this.line(q+G),U=a(Y,1),D=U[0];if(o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"deleteAt",this).call(this,q,G),D!=null&&H!==D&&V>0){if(H instanceof g.BlockEmbed||D instanceof g.BlockEmbed){this.optimize();return}if(H instanceof S.default){var j=H.newlineIndex(H.length(),!0);if(j>-1&&(H=H.split(j+1),H===D)){this.optimize();return}}else if(D instanceof S.default){var z=D.newlineIndex(0);z>-1&&D.split(z+1)}var Z=D.children.head instanceof x.default?null:D.children.head;H.moveChildren(D,Z),H.remove()}this.optimize()}},{key:"enable",value:function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",q)}},{key:"formatAt",value:function(q,G,J,ae){this.whitelist!=null&&!this.whitelist[J]||(o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"formatAt",this).call(this,q,G,J,ae),this.optimize())}},{key:"insertAt",value:function(q,G,J){if(!(J!=null&&this.whitelist!=null&&!this.whitelist[G])){if(q>=this.length())if(J==null||d.default.query(G,d.default.Scope.BLOCK)==null){var ae=d.default.create(this.statics.defaultChild);this.appendChild(ae),J==null&&G.endsWith(`
126
- `)&&(G=G.slice(0,-1)),ae.insertAt(0,G,J)}else{var H=d.default.create(G,J);this.appendChild(H)}else o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertAt",this).call(this,q,G,J);this.optimize()}}},{key:"insertBefore",value:function(q,G){if(q.statics.scope===d.default.Scope.INLINE_BLOT){var J=d.default.create(this.statics.defaultChild);J.appendChild(q),q=J}o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"insertBefore",this).call(this,q,G)}},{key:"leaf",value:function(q){return this.path(q).pop()||[null,-1]}},{key:"line",value:function(q){return q===this.length()?this.line(q-1):this.descendant(L,q)}},{key:"lines",value:function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,J=function ae(H,V,Y){var U=[],D=Y;return H.children.forEachAt(V,Y,function(j,z,Z){L(j)?U.push(j):j instanceof d.default.Container&&(U=U.concat(ae(j,z,D))),D-=Z}),U};return J(this,q,G)}},{key:"optimize",value:function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"optimize",this).call(this,q,G),q.length>0&&this.emitter.emit(v.default.events.SCROLL_OPTIMIZE,q,G))}},{key:"path",value:function(q){return o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"path",this).call(this,q).slice(1)}},{key:"update",value:function(q){if(this.batch!==!0){var G=v.default.sources.USER;typeof q=="string"&&(G=q),Array.isArray(q)||(q=this.observer.takeRecords()),q.length>0&&this.emitter.emit(v.default.events.SCROLL_BEFORE_UPDATE,G,q),o(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"update",this).call(this,q.concat([])),q.length>0&&this.emitter.emit(v.default.events.SCROLL_UPDATE,G,q)}}}]),k}(d.default.Scroll);R.blotName="scroll",R.className="ql-editor",R.tagName="DIV",R.defaultChild="block",R.allowedChildren=[c.default,g.BlockEmbed,w.default],n.default=R},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(W){return typeof W}:function(W){return W&&typeof Symbol=="function"&&W.constructor===Symbol&&W!==Symbol.prototype?"symbol":typeof W},l=function(){function W(Q,se){var ue=[],le=!0,ye=!1,Re=void 0;try{for(var Me=Q[Symbol.iterator](),Pe;!(le=(Pe=Me.next()).done)&&(ue.push(Pe.value),!(se&&ue.length===se));le=!0);}catch(de){ye=!0,Re=de}finally{try{!le&&Me.return&&Me.return()}finally{if(ye)throw Re}}return ue}return function(Q,se){if(Array.isArray(Q))return Q;if(Symbol.iterator in Object(Q))return W(Q,se);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function W(Q,se){for(var ue=0;ue<se.length;ue++){var le=se[ue];le.enumerable=le.enumerable||!1,le.configurable=!0,"value"in le&&(le.writable=!0),Object.defineProperty(Q,le.key,le)}}return function(Q,se,ue){return se&&W(Q.prototype,se),ue&&W(Q,ue),Q}}(),u=i(21),d=T(u),f=i(11),v=T(f),g=i(3),c=T(g),y=i(2),x=T(y),E=i(20),S=T(E),b=i(0),w=T(b),_=i(5),A=T(_),M=i(10),O=T(M),L=i(9),R=T(L);function T(W){return W&&W.__esModule?W:{default:W}}function k(W,Q,se){return Q in W?Object.defineProperty(W,Q,{value:se,enumerable:!0,configurable:!0,writable:!0}):W[Q]=se,W}function C(W,Q){if(!(W instanceof Q))throw new TypeError("Cannot call a class as a function")}function q(W,Q){if(!W)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Q&&(typeof Q=="object"||typeof Q=="function")?Q:W}function G(W,Q){if(typeof Q!="function"&&Q!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Q);W.prototype=Object.create(Q&&Q.prototype,{constructor:{value:W,enumerable:!1,writable:!0,configurable:!0}}),Q&&(Object.setPrototypeOf?Object.setPrototypeOf(W,Q):W.__proto__=Q)}var J=(0,O.default)("quill:keyboard"),ae=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",H=function(W){G(Q,W),o(Q,null,[{key:"match",value:function(ue,le){return le=re(le),["altKey","ctrlKey","metaKey","shiftKey"].some(function(ye){return!!le[ye]!==ue[ye]&&le[ye]!==null})?!1:le.key===(ue.which||ue.keyCode)}}]);function Q(se,ue){C(this,Q);var le=q(this,(Q.__proto__||Object.getPrototypeOf(Q)).call(this,se,ue));return le.bindings={},Object.keys(le.options.bindings).forEach(function(ye){ye==="list autofill"&&se.scroll.whitelist!=null&&!se.scroll.whitelist.list||le.options.bindings[ye]&&le.addBinding(le.options.bindings[ye])}),le.addBinding({key:Q.keys.ENTER,shiftKey:null},j),le.addBinding({key:Q.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(le.addBinding({key:Q.keys.BACKSPACE},{collapsed:!0},Y),le.addBinding({key:Q.keys.DELETE},{collapsed:!0},U)):(le.addBinding({key:Q.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},Y),le.addBinding({key:Q.keys.DELETE},{collapsed:!0,suffix:/^.?$/},U)),le.addBinding({key:Q.keys.BACKSPACE},{collapsed:!1},D),le.addBinding({key:Q.keys.DELETE},{collapsed:!1},D),le.addBinding({key:Q.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},Y),le.listen(),le}return o(Q,[{key:"addBinding",value:function(ue){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ye=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Re=re(ue);if(Re==null||Re.key==null)return J.warn("Attempted to add invalid keyboard binding",Re);typeof le=="function"&&(le={handler:le}),typeof ye=="function"&&(ye={handler:ye}),Re=(0,c.default)(Re,le,ye),this.bindings[Re.key]=this.bindings[Re.key]||[],this.bindings[Re.key].push(Re)}},{key:"listen",value:function(){var ue=this;this.quill.root.addEventListener("keydown",function(le){if(!le.defaultPrevented){var ye=le.which||le.keyCode,Re=(ue.bindings[ye]||[]).filter(function(ht){return Q.match(le,ht)});if(Re.length!==0){var Me=ue.quill.getSelection();if(!(Me==null||!ue.quill.hasFocus())){var Pe=ue.quill.getLine(Me.index),de=l(Pe,2),Te=de[0],Ae=de[1],be=ue.quill.getLeaf(Me.index),_e=l(be,2),xe=_e[0],Le=_e[1],pe=Me.length===0?[xe,Le]:ue.quill.getLeaf(Me.index+Me.length),Ce=l(pe,2),je=Ce[0],He=Ce[1],st=xe instanceof w.default.Text?xe.value().slice(0,Le):"",pt=je instanceof w.default.Text?je.value().slice(He):"",ct={collapsed:Me.length===0,empty:Me.length===0&&Te.length()<=1,format:ue.quill.getFormat(Me),offset:Ae,prefix:st,suffix:pt},bt=Re.some(function(ht){if(ht.collapsed!=null&&ht.collapsed!==ct.collapsed||ht.empty!=null&&ht.empty!==ct.empty||ht.offset!=null&&ht.offset!==ct.offset)return!1;if(Array.isArray(ht.format)){if(ht.format.every(function(vt){return ct.format[vt]==null}))return!1}else if(a(ht.format)==="object"&&!Object.keys(ht.format).every(function(vt){return ht.format[vt]===!0?ct.format[vt]!=null:ht.format[vt]===!1?ct.format[vt]==null:(0,v.default)(ht.format[vt],ct.format[vt])}))return!1;return ht.prefix!=null&&!ht.prefix.test(ct.prefix)||ht.suffix!=null&&!ht.suffix.test(ct.suffix)?!1:ht.handler.call(ue,Me,ct)!==!0});bt&&le.preventDefault()}}}})}}]),Q}(R.default);H.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},H.DEFAULTS={bindings:{bold:Z("bold"),italic:Z("italic"),underline:Z("underline"),indent:{key:H.keys.TAB,format:["blockquote","indent","list"],handler:function(Q,se){if(se.collapsed&&se.offset!==0)return!0;this.quill.format("indent","+1",A.default.sources.USER)}},outdent:{key:H.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(Q,se){if(se.collapsed&&se.offset!==0)return!0;this.quill.format("indent","-1",A.default.sources.USER)}},"outdent backspace":{key:H.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(Q,se){se.format.indent!=null?this.quill.format("indent","-1",A.default.sources.USER):se.format.list!=null&&this.quill.format("list",!1,A.default.sources.USER)}},"indent code-block":z(!0),"outdent code-block":z(!1),"remove tab":{key:H.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(Q){this.quill.deleteText(Q.index-1,1,A.default.sources.USER)}},tab:{key:H.keys.TAB,handler:function(Q){this.quill.history.cutoff();var se=new x.default().retain(Q.index).delete(Q.length).insert(" ");this.quill.updateContents(se,A.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(Q.index+1,A.default.sources.SILENT)}},"list empty enter":{key:H.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(Q,se){this.quill.format("list",!1,A.default.sources.USER),se.format.indent&&this.quill.format("indent",!1,A.default.sources.USER)}},"checklist enter":{key:H.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(Q){var se=this.quill.getLine(Q.index),ue=l(se,2),le=ue[0],ye=ue[1],Re=(0,c.default)({},le.formats(),{list:"checked"}),Me=new x.default().retain(Q.index).insert(`
127
- `,Re).retain(le.length()-ye-1).retain(1,{list:"unchecked"});this.quill.updateContents(Me,A.default.sources.USER),this.quill.setSelection(Q.index+1,A.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:H.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(Q,se){var ue=this.quill.getLine(Q.index),le=l(ue,2),ye=le[0],Re=le[1],Me=new x.default().retain(Q.index).insert(`
128
- `,se.format).retain(ye.length()-Re-1).retain(1,{header:null});this.quill.updateContents(Me,A.default.sources.USER),this.quill.setSelection(Q.index+1,A.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(Q,se){var ue=se.prefix.length,le=this.quill.getLine(Q.index),ye=l(le,2),Re=ye[0],Me=ye[1];if(Me>ue)return!0;var Pe=void 0;switch(se.prefix.trim()){case"[]":case"[ ]":Pe="unchecked";break;case"[x]":Pe="checked";break;case"-":case"*":Pe="bullet";break;default:Pe="ordered"}this.quill.insertText(Q.index," ",A.default.sources.USER),this.quill.history.cutoff();var de=new x.default().retain(Q.index-Me).delete(ue+1).retain(Re.length()-2-Me).retain(1,{list:Pe});this.quill.updateContents(de,A.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(Q.index-ue,A.default.sources.SILENT)}},"code exit":{key:H.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(Q){var se=this.quill.getLine(Q.index),ue=l(se,2),le=ue[0],ye=ue[1],Re=new x.default().retain(Q.index+le.length()-ye-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(Re,A.default.sources.USER)}},"embed left":V(H.keys.LEFT,!1),"embed left shift":V(H.keys.LEFT,!0),"embed right":V(H.keys.RIGHT,!1),"embed right shift":V(H.keys.RIGHT,!0)}};function V(W,Q){var se,ue=W===H.keys.LEFT?"prefix":"suffix";return se={key:W,shiftKey:Q,altKey:null},k(se,ue,/^$/),k(se,"handler",function(ye){var Re=ye.index;W===H.keys.RIGHT&&(Re+=ye.length+1);var Me=this.quill.getLeaf(Re),Pe=l(Me,1),de=Pe[0];return de instanceof w.default.Embed?(W===H.keys.LEFT?Q?this.quill.setSelection(ye.index-1,ye.length+1,A.default.sources.USER):this.quill.setSelection(ye.index-1,A.default.sources.USER):Q?this.quill.setSelection(ye.index,ye.length+1,A.default.sources.USER):this.quill.setSelection(ye.index+ye.length+1,A.default.sources.USER),!1):!0}),se}function Y(W,Q){if(!(W.index===0||this.quill.getLength()<=1)){var se=this.quill.getLine(W.index),ue=l(se,1),le=ue[0],ye={};if(Q.offset===0){var Re=this.quill.getLine(W.index-1),Me=l(Re,1),Pe=Me[0];if(Pe!=null&&Pe.length()>1){var de=le.formats(),Te=this.quill.getFormat(W.index-1,1);ye=S.default.attributes.diff(de,Te)||{}}}var Ae=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(Q.prefix)?2:1;this.quill.deleteText(W.index-Ae,Ae,A.default.sources.USER),Object.keys(ye).length>0&&this.quill.formatLine(W.index-Ae,Ae,ye,A.default.sources.USER),this.quill.focus()}}function U(W,Q){var se=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(Q.suffix)?2:1;if(!(W.index>=this.quill.getLength()-se)){var ue={},le=0,ye=this.quill.getLine(W.index),Re=l(ye,1),Me=Re[0];if(Q.offset>=Me.length()-1){var Pe=this.quill.getLine(W.index+1),de=l(Pe,1),Te=de[0];if(Te){var Ae=Me.formats(),be=this.quill.getFormat(W.index,1);ue=S.default.attributes.diff(Ae,be)||{},le=Te.length()}}this.quill.deleteText(W.index,se,A.default.sources.USER),Object.keys(ue).length>0&&this.quill.formatLine(W.index+le-1,se,ue,A.default.sources.USER)}}function D(W){var Q=this.quill.getLines(W),se={};if(Q.length>1){var ue=Q[0].formats(),le=Q[Q.length-1].formats();se=S.default.attributes.diff(le,ue)||{}}this.quill.deleteText(W,A.default.sources.USER),Object.keys(se).length>0&&this.quill.formatLine(W.index,1,se,A.default.sources.USER),this.quill.setSelection(W.index,A.default.sources.SILENT),this.quill.focus()}function j(W,Q){var se=this;W.length>0&&this.quill.scroll.deleteAt(W.index,W.length);var ue=Object.keys(Q.format).reduce(function(le,ye){return w.default.query(ye,w.default.Scope.BLOCK)&&!Array.isArray(Q.format[ye])&&(le[ye]=Q.format[ye]),le},{});this.quill.insertText(W.index,`
129
- `,ue,A.default.sources.USER),this.quill.setSelection(W.index+1,A.default.sources.SILENT),this.quill.focus(),Object.keys(Q.format).forEach(function(le){ue[le]==null&&(Array.isArray(Q.format[le])||le!=="link"&&se.quill.format(le,Q.format[le],A.default.sources.USER))})}function z(W){return{key:H.keys.TAB,shiftKey:!W,format:{"code-block":!0},handler:function(se){var ue=w.default.query("code-block"),le=se.index,ye=se.length,Re=this.quill.scroll.descendant(ue,le),Me=l(Re,2),Pe=Me[0],de=Me[1];if(Pe!=null){var Te=this.quill.getIndex(Pe),Ae=Pe.newlineIndex(de,!0)+1,be=Pe.newlineIndex(Te+de+ye),_e=Pe.domNode.textContent.slice(Ae,be).split(`
130
- `);de=0,_e.forEach(function(xe,Le){W?(Pe.insertAt(Ae+de,ue.TAB),de+=ue.TAB.length,Le===0?le+=ue.TAB.length:ye+=ue.TAB.length):xe.startsWith(ue.TAB)&&(Pe.deleteAt(Ae+de,ue.TAB.length),de-=ue.TAB.length,Le===0?le-=ue.TAB.length:ye-=ue.TAB.length),de+=xe.length+1}),this.quill.update(A.default.sources.USER),this.quill.setSelection(le,ye,A.default.sources.SILENT)}}}}function Z(W){return{key:W[0].toUpperCase(),shortKey:!0,handler:function(se,ue){this.quill.format(W,!ue.format[W],A.default.sources.USER)}}}function re(W){if(typeof W=="string"||typeof W=="number")return re({key:W});if((typeof W>"u"?"undefined":a(W))==="object"&&(W=(0,d.default)(W,!1)),typeof W.key=="string")if(H.keys[W.key.toUpperCase()]!=null)W.key=H.keys[W.key.toUpperCase()];else if(W.key.length===1)W.key=W.key.toUpperCase().charCodeAt(0);else return null;return W.shortKey&&(W[ae]=W.shortKey,delete W.shortKey),W}n.default=H,n.SHORTKEY=ae},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,w){var _=[],A=!0,M=!1,O=void 0;try{for(var L=b[Symbol.iterator](),R;!(A=(R=L.next()).done)&&(_.push(R.value),!(w&&_.length===w));A=!0);}catch(T){M=!0,O=T}finally{try{!A&&L.return&&L.return()}finally{if(M)throw O}}return _}return function(b,w){if(Array.isArray(b))return b;if(Symbol.iterator in Object(b))return S(b,w);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function S(b,w,_){b===null&&(b=Function.prototype);var A=Object.getOwnPropertyDescriptor(b,w);if(A===void 0){var M=Object.getPrototypeOf(b);return M===null?void 0:S(M,w,_)}else{if("value"in A)return A.value;var O=A.get;return O===void 0?void 0:O.call(_)}},o=function(){function S(b,w){for(var _=0;_<w.length;_++){var A=w[_];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(b,A.key,A)}}return function(b,w,_){return w&&S(b.prototype,w),_&&S(b,_),b}}(),u=i(0),d=g(u),f=i(7),v=g(f);function g(S){return S&&S.__esModule?S:{default:S}}function c(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function y(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function x(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var E=function(S){x(b,S),o(b,null,[{key:"value",value:function(){}}]);function b(w,_){c(this,b);var A=y(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,w));return A.selection=_,A.textNode=document.createTextNode(b.CONTENTS),A.domNode.appendChild(A.textNode),A._length=0,A}return o(b,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(_,A){if(this._length!==0)return l(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,_,A);for(var M=this,O=0;M!=null&&M.statics.scope!==d.default.Scope.BLOCK_BLOT;)O+=M.offset(M.parent),M=M.parent;M!=null&&(this._length=b.CONTENTS.length,M.optimize(),M.formatAt(O,b.CONTENTS.length,_,A),this._length=0)}},{key:"index",value:function(_,A){return _===this.textNode?0:l(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"index",this).call(this,_,A)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){l(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var _=this.textNode,A=this.selection.getNativeRange(),M=void 0,O=void 0,L=void 0;if(A!=null&&A.start.node===_&&A.end.node===_){var R=[_,A.start.offset,A.end.offset];M=R[0],O=R[1],L=R[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==b.CONTENTS){var T=this.textNode.data.split(b.CONTENTS).join("");this.next instanceof v.default?(M=this.next.domNode,this.next.insertAt(0,T),this.textNode.data=b.CONTENTS):(this.textNode.data=T,this.parent.insertBefore(d.default.create(this.textNode),this),this.textNode=document.createTextNode(b.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),O!=null){var k=[O,L].map(function(q){return Math.max(0,Math.min(M.data.length,q-1))}),C=a(k,2);return O=C[0],L=C[1],{startNode:M,startOffset:O,endNode:M,endOffset:L}}}}},{key:"update",value:function(_,A){var M=this;if(_.some(function(L){return L.type==="characterData"&&L.target===M.textNode})){var O=this.restore();O&&(A.range=O)}}},{key:"value",value:function(){return""}}]),b}(d.default.Embed);E.blotName="cursor",E.className="ql-cursor",E.tagName="span",E.CONTENTS="\uFEFF",n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),l=d(a),o=i(4),u=d(o);function d(y){return y&&y.__esModule?y:{default:y}}function f(y,x){if(!(y instanceof x))throw new TypeError("Cannot call a class as a function")}function v(y,x){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:y}function g(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);y.prototype=Object.create(x&&x.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(y,x):y.__proto__=x)}var c=function(y){g(x,y);function x(){return f(this,x),v(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return x}(l.default.Container);c.allowedChildren=[u.default,o.BlockEmbed,c],n.default=c},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=function(){function E(S,b){for(var w=0;w<b.length;w++){var _=b[w];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(S,_.key,_)}}return function(S,b,w){return b&&E(S.prototype,b),w&&E(S,w),S}}(),l=function E(S,b,w){S===null&&(S=Function.prototype);var _=Object.getOwnPropertyDescriptor(S,b);if(_===void 0){var A=Object.getPrototypeOf(S);return A===null?void 0:E(A,b,w)}else{if("value"in _)return _.value;var M=_.get;return M===void 0?void 0:M.call(w)}},o=i(0),u=d(o);function d(E){return E&&E.__esModule?E:{default:E}}function f(E,S){if(!(E instanceof S))throw new TypeError("Cannot call a class as a function")}function v(E,S){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:E}function g(E,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);E.prototype=Object.create(S&&S.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(E,S):E.__proto__=S)}var c=function(E){g(S,E);function S(){return f(this,S),v(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,[{key:"value",value:function(w){var _=l(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"value",this).call(this,w);return _.startsWith("rgb(")?(_=_.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+_.split(",").map(function(A){return("00"+parseInt(A).toString(16)).slice(-2)}).join("")):_}}]),S}(u.default.Attributor.Style),y=new u.default.Attributor.Class("color","ql-color",{scope:u.default.Scope.INLINE}),x=new c("color","color",{scope:u.default.Scope.INLINE});n.ColorAttributor=c,n.ColorClass=y,n.ColorStyle=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=function(){function x(E,S){for(var b=0;b<S.length;b++){var w=S[b];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(E,w.key,w)}}return function(E,S,b){return S&&x(E.prototype,S),b&&x(E,b),E}}(),l=function x(E,S,b){E===null&&(E=Function.prototype);var w=Object.getOwnPropertyDescriptor(E,S);if(w===void 0){var _=Object.getPrototypeOf(E);return _===null?void 0:x(_,S,b)}else{if("value"in w)return w.value;var A=w.get;return A===void 0?void 0:A.call(b)}},o=i(6),u=d(o);function d(x){return x&&x.__esModule?x:{default:x}}function f(x,E){if(!(x instanceof E))throw new TypeError("Cannot call a class as a function")}function v(x,E){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:x}function g(x,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);x.prototype=Object.create(E&&E.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(x,E):x.__proto__=E)}var c=function(x){g(E,x);function E(){return f(this,E),v(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,[{key:"format",value:function(b,w){if(b!==this.statics.blotName||!w)return l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"format",this).call(this,b,w);w=this.constructor.sanitize(w),this.domNode.setAttribute("href",w)}}],[{key:"create",value:function(b){var w=l(E.__proto__||Object.getPrototypeOf(E),"create",this).call(this,b);return b=this.sanitize(b),w.setAttribute("href",b),w.setAttribute("rel","noopener noreferrer"),w.setAttribute("target","_blank"),w}},{key:"formats",value:function(b){return b.getAttribute("href")}},{key:"sanitize",value:function(b){return y(b,this.PROTOCOL_WHITELIST)?b:this.SANITIZED_URL}}]),E}(u.default);c.blotName="link",c.tagName="A",c.SANITIZED_URL="about:blank",c.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function y(x,E){var S=document.createElement("a");S.href=x;var b=S.href.slice(0,S.href.indexOf(":"));return E.indexOf(b)>-1}n.default=c,n.sanitize=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=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},l=function(){function E(S,b){for(var w=0;w<b.length;w++){var _=b[w];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(S,_.key,_)}}return function(S,b,w){return b&&E(S.prototype,b),w&&E(S,w),S}}(),o=i(23),u=v(o),d=i(107),f=v(d);function v(E){return E&&E.__esModule?E:{default:E}}function g(E,S){if(!(E instanceof S))throw new TypeError("Cannot call a class as a function")}var c=0;function y(E,S){E.setAttribute(S,E.getAttribute(S)!=="true")}var x=function(){function E(S){var b=this;g(this,E),this.select=S,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(){b.togglePicker()}),this.label.addEventListener("keydown",function(w){switch(w.keyCode){case u.default.keys.ENTER:b.togglePicker();break;case u.default.keys.ESCAPE:b.escape(),w.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return l(E,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),y(this.label,"aria-expanded"),y(this.options,"aria-hidden")}},{key:"buildItem",value:function(b){var w=this,_=document.createElement("span");return _.tabIndex="0",_.setAttribute("role","button"),_.classList.add("ql-picker-item"),b.hasAttribute("value")&&_.setAttribute("data-value",b.getAttribute("value")),b.textContent&&_.setAttribute("data-label",b.textContent),_.addEventListener("click",function(){w.selectItem(_,!0)}),_.addEventListener("keydown",function(A){switch(A.keyCode){case u.default.keys.ENTER:w.selectItem(_,!0),A.preventDefault();break;case u.default.keys.ESCAPE:w.escape(),A.preventDefault();break}}),_}},{key:"buildLabel",value:function(){var b=document.createElement("span");return b.classList.add("ql-picker-label"),b.innerHTML=f.default,b.tabIndex="0",b.setAttribute("role","button"),b.setAttribute("aria-expanded","false"),this.container.appendChild(b),b}},{key:"buildOptions",value:function(){var b=this,w=document.createElement("span");w.classList.add("ql-picker-options"),w.setAttribute("aria-hidden","true"),w.tabIndex="-1",w.id="ql-picker-options-"+c,c+=1,this.label.setAttribute("aria-controls",w.id),this.options=w,[].slice.call(this.select.options).forEach(function(_){var A=b.buildItem(_);w.appendChild(A),_.selected===!0&&b.selectItem(A)}),this.container.appendChild(w)}},{key:"buildPicker",value:function(){var b=this;[].slice.call(this.select.attributes).forEach(function(w){b.container.setAttribute(w.name,w.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var b=this;this.close(),setTimeout(function(){return b.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(b){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_=this.container.querySelector(".ql-selected");if(b!==_&&(_?.classList.remove("ql-selected"),b!=null&&(b.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(b.parentNode.children,b),b.hasAttribute("data-value")?this.label.setAttribute("data-value",b.getAttribute("data-value")):this.label.removeAttribute("data-value"),b.hasAttribute("data-label")?this.label.setAttribute("data-label",b.getAttribute("data-label")):this.label.removeAttribute("data-label"),w))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":a(Event))==="object"){var A=document.createEvent("Event");A.initEvent("change",!0,!0),this.select.dispatchEvent(A)}this.close()}}},{key:"update",value:function(){var b=void 0;if(this.select.selectedIndex>-1){var w=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];b=this.select.options[this.select.selectedIndex],this.selectItem(w)}else this.selectItem(null);var _=b!=null&&b!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",_)}}]),E}();n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),l=J(a),o=i(5),u=J(o),d=i(4),f=J(d),v=i(16),g=J(v),c=i(25),y=J(c),x=i(24),E=J(x),S=i(35),b=J(S),w=i(6),_=J(w),A=i(22),M=J(A),O=i(7),L=J(O),R=i(55),T=J(R),k=i(42),C=J(k),q=i(23),G=J(q);function J(ae){return ae&&ae.__esModule?ae:{default:ae}}u.default.register({"blots/block":f.default,"blots/block/embed":d.BlockEmbed,"blots/break":g.default,"blots/container":y.default,"blots/cursor":E.default,"blots/embed":b.default,"blots/inline":_.default,"blots/scroll":M.default,"blots/text":L.default,"modules/clipboard":T.default,"modules/history":C.default,"modules/keyboard":G.default}),l.default.register(f.default,g.default,E.default,_.default,M.default,L.default),n.default=u.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(1),l=function(){function o(u){this.domNode=u,this.domNode[a.DATA_KEY]={blot:this}}return Object.defineProperty(o.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),o.create=function(u){if(this.tagName==null)throw new a.ParchmentError("Blot definition missing tagName");var d;return Array.isArray(this.tagName)?(typeof u=="string"&&(u=u.toUpperCase(),parseInt(u).toString()===u&&(u=parseInt(u))),typeof u=="number"?d=document.createElement(this.tagName[u-1]):this.tagName.indexOf(u)>-1?d=document.createElement(u):d=document.createElement(this.tagName[0])):d=document.createElement(this.tagName),this.className&&d.classList.add(this.className),d},o.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},o.prototype.clone=function(){var u=this.domNode.cloneNode(!1);return a.create(u)},o.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[a.DATA_KEY]},o.prototype.deleteAt=function(u,d){var f=this.isolate(u,d);f.remove()},o.prototype.formatAt=function(u,d,f,v){var g=this.isolate(u,d);if(a.query(f,a.Scope.BLOT)!=null&&v)g.wrap(f,v);else if(a.query(f,a.Scope.ATTRIBUTE)!=null){var c=a.create(this.statics.scope);g.wrap(c),c.format(f,v)}},o.prototype.insertAt=function(u,d,f){var v=f==null?a.create("text",d):a.create(d,f),g=this.split(u);this.parent.insertBefore(v,g)},o.prototype.insertInto=function(u,d){d===void 0&&(d=null),this.parent!=null&&this.parent.children.remove(this);var f=null;u.children.insertBefore(this,d),d!=null&&(f=d.domNode),(this.domNode.parentNode!=u.domNode||this.domNode.nextSibling!=f)&&u.domNode.insertBefore(this.domNode,f),this.parent=u,this.attach()},o.prototype.isolate=function(u,d){var f=this.split(u);return f.split(d),f},o.prototype.length=function(){return 1},o.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)},o.prototype.optimize=function(u){this.domNode[a.DATA_KEY]!=null&&delete this.domNode[a.DATA_KEY].mutations},o.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},o.prototype.replace=function(u){u.parent!=null&&(u.parent.insertBefore(this,u.next),u.remove())},o.prototype.replaceWith=function(u,d){var f=typeof u=="string"?a.create(u,d):u;return f.replace(this),f},o.prototype.split=function(u,d){return u===0?this:this.next},o.prototype.update=function(u,d){},o.prototype.wrap=function(u,d){var f=typeof u=="string"?a.create(u,d):u;return this.parent!=null&&this.parent.insertBefore(f,this.next),f.appendChild(this),f},o.blotName="abstract",o}();n.default=l},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(12),l=i(32),o=i(33),u=i(1),d=function(){function f(v){this.attributes={},this.domNode=v,this.build()}return f.prototype.attribute=function(v,g){g?v.add(this.domNode,g)&&(v.value(this.domNode)!=null?this.attributes[v.attrName]=v:delete this.attributes[v.attrName]):(v.remove(this.domNode),delete this.attributes[v.attrName])},f.prototype.build=function(){var v=this;this.attributes={};var g=a.default.keys(this.domNode),c=l.default.keys(this.domNode),y=o.default.keys(this.domNode);g.concat(c).concat(y).forEach(function(x){var E=u.query(x,u.Scope.ATTRIBUTE);E instanceof a.default&&(v.attributes[E.attrName]=E)})},f.prototype.copy=function(v){var g=this;Object.keys(this.attributes).forEach(function(c){var y=g.attributes[c].value(g.domNode);v.format(c,y)})},f.prototype.move=function(v){var g=this;this.copy(v),Object.keys(this.attributes).forEach(function(c){g.attributes[c].remove(g.domNode)}),this.attributes={}},f.prototype.values=function(){var v=this;return Object.keys(this.attributes).reduce(function(g,c){return g[c]=v.attributes[c].value(v.domNode),g},{})},f}();n.default=d},function(r,n,i){var a=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var g in v)v.hasOwnProperty(g)&&(f[g]=v[g])};return function(f,v){d(f,v);function g(){this.constructor=f}f.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=i(12);function o(d,f){var v=d.getAttribute("class")||"";return v.split(/\s+/).filter(function(g){return g.indexOf(f+"-")===0})}var u=function(d){a(f,d);function f(){return d!==null&&d.apply(this,arguments)||this}return f.keys=function(v){return(v.getAttribute("class")||"").split(/\s+/).map(function(g){return g.split("-").slice(0,-1).join("-")})},f.prototype.add=function(v,g){return this.canAdd(v,g)?(this.remove(v),v.classList.add(this.keyName+"-"+g),!0):!1},f.prototype.remove=function(v){var g=o(v,this.keyName);g.forEach(function(c){v.classList.remove(c)}),v.classList.length===0&&v.removeAttribute("class")},f.prototype.value=function(v){var g=o(v,this.keyName)[0]||"",c=g.slice(this.keyName.length+1);return this.canAdd(v,c)?c:""},f}(l.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var g in v)v.hasOwnProperty(g)&&(f[g]=v[g])};return function(f,v){d(f,v);function g(){this.constructor=f}f.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=i(12);function o(d){var f=d.split("-"),v=f.slice(1).map(function(g){return g[0].toUpperCase()+g.slice(1)}).join("");return f[0]+v}var u=function(d){a(f,d);function f(){return d!==null&&d.apply(this,arguments)||this}return f.keys=function(v){return(v.getAttribute("style")||"").split(";").map(function(g){var c=g.split(":");return c[0].trim()})},f.prototype.add=function(v,g){return this.canAdd(v,g)?(v.style[o(this.keyName)]=g,!0):!1},f.prototype.remove=function(v){v.style[o(this.keyName)]="",v.getAttribute("style")||v.removeAttribute("style")},f.prototype.value=function(v){var g=v.style[o(this.keyName)];return this.canAdd(v,g)?g:""},f}(l.default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(d,f){for(var v=0;v<f.length;v++){var g=f[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(d,g.key,g)}}return function(d,f,v){return f&&u(d.prototype,f),v&&u(d,v),d}}();function l(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")}var o=function(){function u(d,f){l(this,u),this.quill=d,this.options=f,this.modules={}}return a(u,[{key:"init",value:function(){var f=this;Object.keys(this.options.modules).forEach(function(v){f.modules[v]==null&&f.addModule(v)})}},{key:"addModule",value:function(f){var v=this.quill.constructor.import("modules/"+f);return this.modules[f]=new v(this.quill,this.options.modules[f]||{}),this.modules[f]}}]),u}();o.DEFAULTS={modules:{}},o.themes={default:o},n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function S(b,w){for(var _=0;_<w.length;_++){var A=w[_];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(b,A.key,A)}}return function(b,w,_){return w&&S(b.prototype,w),_&&S(b,_),b}}(),l=function S(b,w,_){b===null&&(b=Function.prototype);var A=Object.getOwnPropertyDescriptor(b,w);if(A===void 0){var M=Object.getPrototypeOf(b);return M===null?void 0:S(M,w,_)}else{if("value"in A)return A.value;var O=A.get;return O===void 0?void 0:O.call(_)}},o=i(0),u=v(o),d=i(7),f=v(d);function v(S){return S&&S.__esModule?S:{default:S}}function g(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function c(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function y(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var x="\uFEFF",E=function(S){y(b,S);function b(w){g(this,b);var _=c(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,w));return _.contentNode=document.createElement("span"),_.contentNode.setAttribute("contenteditable",!1),[].slice.call(_.domNode.childNodes).forEach(function(A){_.contentNode.appendChild(A)}),_.leftGuard=document.createTextNode(x),_.rightGuard=document.createTextNode(x),_.domNode.appendChild(_.leftGuard),_.domNode.appendChild(_.contentNode),_.domNode.appendChild(_.rightGuard),_}return a(b,[{key:"index",value:function(_,A){return _===this.leftGuard?0:_===this.rightGuard?1:l(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"index",this).call(this,_,A)}},{key:"restore",value:function(_){var A=void 0,M=void 0,O=_.data.split(x).join("");if(_===this.leftGuard)if(this.prev instanceof f.default){var L=this.prev.length();this.prev.insertAt(L,O),A={startNode:this.prev.domNode,startOffset:L+O.length}}else M=document.createTextNode(O),this.parent.insertBefore(u.default.create(M),this),A={startNode:M,startOffset:O.length};else _===this.rightGuard&&(this.next instanceof f.default?(this.next.insertAt(0,O),A={startNode:this.next.domNode,startOffset:O.length}):(M=document.createTextNode(O),this.parent.insertBefore(u.default.create(M),this.next),A={startNode:M,startOffset:O.length}));return _.data=x,A}},{key:"update",value:function(_,A){var M=this;_.forEach(function(O){if(O.type==="characterData"&&(O.target===M.leftGuard||O.target===M.rightGuard)){var L=M.restore(O.target);L&&(A.range=L)}})}}]),b}(u.default.Embed);n.default=E},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var a=i(0),l=o(a);function o(g){return g&&g.__esModule?g:{default:g}}var u={scope:l.default.Scope.BLOCK,whitelist:["right","center","justify"]},d=new l.default.Attributor.Attribute("align","align",u),f=new l.default.Attributor.Class("align","ql-align",u),v=new l.default.Attributor.Style("align","text-align",u);n.AlignAttribute=d,n.AlignClass=f,n.AlignStyle=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var a=i(0),l=u(a),o=i(26);function u(v){return v&&v.__esModule?v:{default:v}}var d=new l.default.Attributor.Class("background","ql-bg",{scope:l.default.Scope.INLINE}),f=new o.ColorAttributor("background","background-color",{scope:l.default.Scope.INLINE});n.BackgroundClass=d,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),l=o(a);function o(g){return g&&g.__esModule?g:{default:g}}var u={scope:l.default.Scope.BLOCK,whitelist:["rtl"]},d=new l.default.Attributor.Attribute("direction","dir",u),f=new l.default.Attributor.Class("direction","ql-direction",u),v=new l.default.Attributor.Style("direction","direction",u);n.DirectionAttribute=d,n.DirectionClass=f,n.DirectionStyle=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=function(){function S(b,w){for(var _=0;_<w.length;_++){var A=w[_];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(b,A.key,A)}}return function(b,w,_){return w&&S(b.prototype,w),_&&S(b,_),b}}(),l=function S(b,w,_){b===null&&(b=Function.prototype);var A=Object.getOwnPropertyDescriptor(b,w);if(A===void 0){var M=Object.getPrototypeOf(b);return M===null?void 0:S(M,w,_)}else{if("value"in A)return A.value;var O=A.get;return O===void 0?void 0:O.call(_)}},o=i(0),u=d(o);function d(S){return S&&S.__esModule?S:{default:S}}function f(S,b){if(!(S instanceof b))throw new TypeError("Cannot call a class as a function")}function v(S,b){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:S}function g(S,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);S.prototype=Object.create(b&&b.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(S,b):S.__proto__=b)}var c={scope:u.default.Scope.INLINE,whitelist:["serif","monospace"]},y=new u.default.Attributor.Class("font","ql-font",c),x=function(S){g(b,S);function b(){return f(this,b),v(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"value",value:function(_){return l(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,_).replace(/["']/g,"")}}]),b}(u.default.Attributor.Style),E=new x("font","font-family",c);n.FontStyle=E,n.FontClass=y},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var a=i(0),l=o(a);function o(f){return f&&f.__esModule?f:{default:f}}var u=new l.default.Attributor.Class("size","ql-size",{scope:l.default.Scope.INLINE,whitelist:["small","large","huge"]}),d=new l.default.Attributor.Style("size","font-size",{scope:l.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=u,n.SizeStyle=d},function(r,n,i){r.exports={align:{"":i(76),center:i(77),right:i(78),justify:i(79)},background:i(80),blockquote:i(81),bold:i(82),clean:i(83),code:i(58),"code-block":i(58),color:i(84),direction:{"":i(85),rtl:i(86)},float:{center:i(87),full:i(88),left:i(89),right:i(90)},formula:i(91),header:{1:i(92),2:i(93)},italic:i(94),image:i(95),indent:{"+1":i(96),"-1":i(97)},link:i(98),list:{ordered:i(99),bullet:i(100),check:i(101)},script:{sub:i(102),super:i(103)},strike:i(104),underline:i(105),video:i(106)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var a=function(){function w(_,A){for(var M=0;M<A.length;M++){var O=A[M];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(_,O.key,O)}}return function(_,A,M){return A&&w(_.prototype,A),M&&w(_,M),_}}(),l=i(0),o=g(l),u=i(5),d=g(u),f=i(9),v=g(f);function g(w){return w&&w.__esModule?w:{default:w}}function c(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}function y(w,_){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:w}function x(w,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);w.prototype=Object.create(_&&_.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(w,_):w.__proto__=_)}var E=function(w){x(_,w);function _(A,M){c(this,_);var O=y(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,A,M));return O.lastRecorded=0,O.ignoreChange=!1,O.clear(),O.quill.on(d.default.events.EDITOR_CHANGE,function(L,R,T,k){L!==d.default.events.TEXT_CHANGE||O.ignoreChange||(!O.options.userOnly||k===d.default.sources.USER?O.record(R,T):O.transform(R))}),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(_,[{key:"change",value:function(M,O){if(this.stack[M].length!==0){var L=this.stack[M].pop();this.stack[O].push(L),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(L[M],d.default.sources.USER),this.ignoreChange=!1;var R=b(L[M]);this.quill.setSelection(R)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(M,O){if(M.ops.length!==0){this.stack.redo=[];var L=this.quill.getContents().diff(O),R=Date.now();if(this.lastRecorded+this.options.delay>R&&this.stack.undo.length>0){var T=this.stack.undo.pop();L=L.compose(T.undo),M=T.redo.compose(M)}else this.lastRecorded=R;this.stack.undo.push({redo:M,undo:L}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(M){this.stack.undo.forEach(function(O){O.undo=M.transform(O.undo,!0),O.redo=M.transform(O.redo,!0)}),this.stack.redo.forEach(function(O){O.undo=M.transform(O.undo,!0),O.redo=M.transform(O.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),_}(v.default);E.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function S(w){var _=w.ops[w.ops.length-1];return _==null?!1:_.insert!=null?typeof _.insert=="string"&&_.insert.endsWith(`
131
- `):_.attributes!=null?Object.keys(_.attributes).some(function(A){return o.default.query(A,o.default.Scope.BLOCK)!=null}):!1}function b(w){var _=w.reduce(function(M,O){return M+=O.delete||0,M},0),A=w.length()-_;return S(w)&&(A-=1),A}n.default=E,n.getLastChangeIndex=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=function(){function j(z,Z){for(var re=0;re<Z.length;re++){var W=Z[re];W.enumerable=W.enumerable||!1,W.configurable=!0,"value"in W&&(W.writable=!0),Object.defineProperty(z,W.key,W)}}return function(z,Z,re){return Z&&j(z.prototype,Z),re&&j(z,re),z}}(),l=function j(z,Z,re){z===null&&(z=Function.prototype);var W=Object.getOwnPropertyDescriptor(z,Z);if(W===void 0){var Q=Object.getPrototypeOf(z);return Q===null?void 0:j(Q,Z,re)}else{if("value"in W)return W.value;var se=W.get;return se===void 0?void 0:se.call(re)}},o=i(3),u=R(o),d=i(2),f=R(d),v=i(8),g=R(v),c=i(23),y=R(c),x=i(34),E=R(x),S=i(59),b=R(S),w=i(60),_=R(w),A=i(28),M=R(A),O=i(61),L=R(O);function R(j){return j&&j.__esModule?j:{default:j}}function T(j,z){if(!(j instanceof z))throw new TypeError("Cannot call a class as a function")}function k(j,z){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return z&&(typeof z=="object"||typeof z=="function")?z:j}function C(j,z){if(typeof z!="function"&&z!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof z);j.prototype=Object.create(z&&z.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),z&&(Object.setPrototypeOf?Object.setPrototypeOf(j,z):j.__proto__=z)}var q=[!1,"center","right","justify"],G=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],J=[!1,"serif","monospace"],ae=["1","2","3",!1],H=["small",!1,"large","huge"],V=function(j){C(z,j);function z(Z,re){T(this,z);var W=k(this,(z.__proto__||Object.getPrototypeOf(z)).call(this,Z,re)),Q=function se(ue){if(!document.body.contains(Z.root))return document.body.removeEventListener("click",se);W.tooltip!=null&&!W.tooltip.root.contains(ue.target)&&document.activeElement!==W.tooltip.textbox&&!W.quill.hasFocus()&&W.tooltip.hide(),W.pickers!=null&&W.pickers.forEach(function(le){le.container.contains(ue.target)||le.close()})};return Z.emitter.listenDOM("click",document.body,Q),W}return a(z,[{key:"addModule",value:function(re){var W=l(z.prototype.__proto__||Object.getPrototypeOf(z.prototype),"addModule",this).call(this,re);return re==="toolbar"&&this.extendToolbar(W),W}},{key:"buildButtons",value:function(re,W){re.forEach(function(Q){var se=Q.getAttribute("class")||"";se.split(/\s+/).forEach(function(ue){if(ue.startsWith("ql-")&&(ue=ue.slice(3),W[ue]!=null))if(ue==="direction")Q.innerHTML=W[ue][""]+W[ue].rtl;else if(typeof W[ue]=="string")Q.innerHTML=W[ue];else{var le=Q.value||"";le!=null&&W[ue][le]&&(Q.innerHTML=W[ue][le])}})})}},{key:"buildPickers",value:function(re,W){var Q=this;this.pickers=re.map(function(ue){if(ue.classList.contains("ql-align"))return ue.querySelector("option")==null&&D(ue,q),new _.default(ue,W.align);if(ue.classList.contains("ql-background")||ue.classList.contains("ql-color")){var le=ue.classList.contains("ql-background")?"background":"color";return ue.querySelector("option")==null&&D(ue,G,le==="background"?"#ffffff":"#000000"),new b.default(ue,W[le])}else return ue.querySelector("option")==null&&(ue.classList.contains("ql-font")?D(ue,J):ue.classList.contains("ql-header")?D(ue,ae):ue.classList.contains("ql-size")&&D(ue,H)),new M.default(ue)});var se=function(){Q.pickers.forEach(function(le){le.update()})};this.quill.on(g.default.events.EDITOR_CHANGE,se)}}]),z}(E.default);V.DEFAULTS=(0,u.default)(!0,{},E.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var z=this,Z=this.container.querySelector("input.ql-image[type=file]");Z==null&&(Z=document.createElement("input"),Z.setAttribute("type","file"),Z.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),Z.classList.add("ql-image"),Z.addEventListener("change",function(){if(Z.files!=null&&Z.files[0]!=null){var re=new FileReader;re.onload=function(W){var Q=z.quill.getSelection(!0);z.quill.updateContents(new f.default().retain(Q.index).delete(Q.length).insert({image:W.target.result}),g.default.sources.USER),z.quill.setSelection(Q.index+1,g.default.sources.SILENT),Z.value=""},re.readAsDataURL(Z.files[0])}}),this.container.appendChild(Z)),Z.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var Y=function(j){C(z,j);function z(Z,re){T(this,z);var W=k(this,(z.__proto__||Object.getPrototypeOf(z)).call(this,Z,re));return W.textbox=W.root.querySelector('input[type="text"]'),W.listen(),W}return a(z,[{key:"listen",value:function(){var re=this;this.textbox.addEventListener("keydown",function(W){y.default.match(W,"enter")?(re.save(),W.preventDefault()):y.default.match(W,"escape")&&(re.cancel(),W.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),W!=null?this.textbox.value=W:re!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+re)||""),this.root.setAttribute("data-mode",re)}},{key:"restoreFocus",value:function(){var re=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=re}},{key:"save",value:function(){var re=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var W=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",re,g.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",re,g.default.sources.USER)),this.quill.root.scrollTop=W;break}case"video":re=U(re);case"formula":{if(!re)break;var Q=this.quill.getSelection(!0);if(Q!=null){var se=Q.index+Q.length;this.quill.insertEmbed(se,this.root.getAttribute("data-mode"),re,g.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(se+1," ",g.default.sources.USER),this.quill.setSelection(se+2,g.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),z}(L.default);function U(j){var z=j.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||j.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return z?(z[1]||"https")+"://www.youtube.com/embed/"+z[2]+"?showinfo=0":(z=j.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(z[1]||"https")+"://player.vimeo.com/video/"+z[2]+"/":j}function D(j,z){var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;z.forEach(function(re){var W=document.createElement("option");re===Z?W.setAttribute("selected","selected"):W.setAttribute("value",re),j.appendChild(W)})}n.BaseTooltip=Y,n.default=V},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function l(){this.head=this.tail=null,this.length=0}return l.prototype.append=function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];this.insertBefore(o[0],null),o.length>1&&this.append.apply(this,o.slice(1))},l.prototype.contains=function(o){for(var u,d=this.iterator();u=d();)if(u===o)return!0;return!1},l.prototype.insertBefore=function(o,u){o&&(o.next=u,u!=null?(o.prev=u.prev,u.prev!=null&&(u.prev.next=o),u.prev=o,u===this.head&&(this.head=o)):this.tail!=null?(this.tail.next=o,o.prev=this.tail,this.tail=o):(o.prev=null,this.head=this.tail=o),this.length+=1)},l.prototype.offset=function(o){for(var u=0,d=this.head;d!=null;){if(d===o)return u;u+=d.length(),d=d.next}return-1},l.prototype.remove=function(o){this.contains(o)&&(o.prev!=null&&(o.prev.next=o.next),o.next!=null&&(o.next.prev=o.prev),o===this.head&&(this.head=o.next),o===this.tail&&(this.tail=o.prev),this.length-=1)},l.prototype.iterator=function(o){return o===void 0&&(o=this.head),function(){var u=o;return o!=null&&(o=o.next),u}},l.prototype.find=function(o,u){u===void 0&&(u=!1);for(var d,f=this.iterator();d=f();){var v=d.length();if(o<v||u&&o===v&&(d.next==null||d.next.length()!==0))return[d,o];o-=v}return[null,0]},l.prototype.forEach=function(o){for(var u,d=this.iterator();u=d();)o(u)},l.prototype.forEachAt=function(o,u,d){if(!(u<=0))for(var f=this.find(o),v=f[0],g=f[1],c,y=o-g,x=this.iterator(v);(c=x())&&y<o+u;){var E=c.length();o>y?d(c,o-y,Math.min(u,y+E-o)):d(c,0,Math.min(E,o+u-y)),y+=E}},l.prototype.map=function(o){return this.reduce(function(u,d){return u.push(o(d)),u},[])},l.prototype.reduce=function(o,u){for(var d,f=this.iterator();d=f();)u=o(u,d);return u},l}();n.default=a},function(r,n,i){var a=this&&this.__extends||function(){var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,c){g.__proto__=c}||function(g,c){for(var y in c)c.hasOwnProperty(y)&&(g[y]=c[y])};return function(g,c){v(g,c);function y(){this.constructor=g}g.prototype=c===null?Object.create(c):(y.prototype=c.prototype,new y)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=i(17),o=i(1),u={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},d=100,f=function(v){a(g,v);function g(c){var y=v.call(this,c)||this;return y.scroll=y,y.observer=new MutationObserver(function(x){y.update(x)}),y.observer.observe(y.domNode,u),y.attach(),y}return g.prototype.detach=function(){v.prototype.detach.call(this),this.observer.disconnect()},g.prototype.deleteAt=function(c,y){this.update(),c===0&&y===this.length()?this.children.forEach(function(x){x.remove()}):v.prototype.deleteAt.call(this,c,y)},g.prototype.formatAt=function(c,y,x,E){this.update(),v.prototype.formatAt.call(this,c,y,x,E)},g.prototype.insertAt=function(c,y,x){this.update(),v.prototype.insertAt.call(this,c,y,x)},g.prototype.optimize=function(c,y){var x=this;c===void 0&&(c=[]),y===void 0&&(y={}),v.prototype.optimize.call(this,y);for(var E=[].slice.call(this.observer.takeRecords());E.length>0;)c.push(E.pop());for(var S=function(A,M){M===void 0&&(M=!0),!(A==null||A===x)&&A.domNode.parentNode!=null&&(A.domNode[o.DATA_KEY].mutations==null&&(A.domNode[o.DATA_KEY].mutations=[]),M&&S(A.parent))},b=function(A){A.domNode[o.DATA_KEY]==null||A.domNode[o.DATA_KEY].mutations==null||(A instanceof l.default&&A.children.forEach(b),A.optimize(y))},w=c,_=0;w.length>0;_+=1){if(_>=d)throw new Error("[Parchment] Maximum optimize iterations reached");for(w.forEach(function(A){var M=o.find(A.target,!0);M!=null&&(M.domNode===A.target&&(A.type==="childList"?(S(o.find(A.previousSibling,!1)),[].forEach.call(A.addedNodes,function(O){var L=o.find(O,!1);S(L,!1),L instanceof l.default&&L.children.forEach(function(R){S(R,!1)})})):A.type==="attributes"&&S(M.prev)),S(M))}),this.children.forEach(b),w=[].slice.call(this.observer.takeRecords()),E=w.slice();E.length>0;)c.push(E.pop())}},g.prototype.update=function(c,y){var x=this;y===void 0&&(y={}),c=c||this.observer.takeRecords(),c.map(function(E){var S=o.find(E.target,!0);return S==null?null:S.domNode[o.DATA_KEY].mutations==null?(S.domNode[o.DATA_KEY].mutations=[E],S):(S.domNode[o.DATA_KEY].mutations.push(E),null)}).forEach(function(E){E==null||E===x||E.domNode[o.DATA_KEY]==null||E.update(E.domNode[o.DATA_KEY].mutations||[],y)}),this.domNode[o.DATA_KEY].mutations!=null&&v.prototype.update.call(this,this.domNode[o.DATA_KEY].mutations,y),this.optimize(c,y)},g.blotName="scroll",g.defaultChild="block",g.scope=o.Scope.BLOCK_BLOT,g.tagName="DIV",g}(l.default);n.default=f},function(r,n,i){var a=this&&this.__extends||function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,g){v.__proto__=g}||function(v,g){for(var c in g)g.hasOwnProperty(c)&&(v[c]=g[c])};return function(v,g){f(v,g);function c(){this.constructor=v}v.prototype=g===null?Object.create(g):(c.prototype=g.prototype,new c)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=i(18),o=i(1);function u(f,v){if(Object.keys(f).length!==Object.keys(v).length)return!1;for(var g in f)if(f[g]!==v[g])return!1;return!0}var d=function(f){a(v,f);function v(){return f!==null&&f.apply(this,arguments)||this}return v.formats=function(g){if(g.tagName!==v.tagName)return f.formats.call(this,g)},v.prototype.format=function(g,c){var y=this;g===this.statics.blotName&&!c?(this.children.forEach(function(x){x instanceof l.default||(x=x.wrap(v.blotName,!0)),y.attributes.copy(x)}),this.unwrap()):f.prototype.format.call(this,g,c)},v.prototype.formatAt=function(g,c,y,x){if(this.formats()[y]!=null||o.query(y,o.Scope.ATTRIBUTE)){var E=this.isolate(g,c);E.format(y,x)}else f.prototype.formatAt.call(this,g,c,y,x)},v.prototype.optimize=function(g){f.prototype.optimize.call(this,g);var c=this.formats();if(Object.keys(c).length===0)return this.unwrap();var y=this.next;y instanceof v&&y.prev===this&&u(c,y.formats())&&(y.moveChildren(this),y.remove())},v.blotName="inline",v.scope=o.Scope.INLINE_BLOT,v.tagName="SPAN",v}(l.default);n.default=d},function(r,n,i){var a=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var g in v)v.hasOwnProperty(g)&&(f[g]=v[g])};return function(f,v){d(f,v);function g(){this.constructor=f}f.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=i(18),o=i(1),u=function(d){a(f,d);function f(){return d!==null&&d.apply(this,arguments)||this}return f.formats=function(v){var g=o.query(f.blotName).tagName;if(v.tagName!==g)return d.formats.call(this,v)},f.prototype.format=function(v,g){o.query(v,o.Scope.BLOCK)!=null&&(v===this.statics.blotName&&!g?this.replaceWith(f.blotName):d.prototype.format.call(this,v,g))},f.prototype.formatAt=function(v,g,c,y){o.query(c,o.Scope.BLOCK)!=null?this.format(c,y):d.prototype.formatAt.call(this,v,g,c,y)},f.prototype.insertAt=function(v,g,c){if(c==null||o.query(g,o.Scope.INLINE)!=null)d.prototype.insertAt.call(this,v,g,c);else{var y=this.split(v),x=o.create(g,c);y.parent.insertBefore(x,y)}},f.prototype.update=function(v,g){navigator.userAgent.match(/Trident/)?this.build():d.prototype.update.call(this,v,g)},f.blotName="block",f.scope=o.Scope.BLOCK_BLOT,f.tagName="P",f}(l.default);n.default=u},function(r,n,i){var a=this&&this.__extends||function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var v in f)f.hasOwnProperty(v)&&(d[v]=f[v])};return function(d,f){u(d,f);function v(){this.constructor=d}d.prototype=f===null?Object.create(f):(v.prototype=f.prototype,new v)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=i(19),o=function(u){a(d,u);function d(){return u!==null&&u.apply(this,arguments)||this}return d.formats=function(f){},d.prototype.format=function(f,v){u.prototype.formatAt.call(this,0,this.length(),f,v)},d.prototype.formatAt=function(f,v,g,c){f===0&&v===this.length()?this.format(g,c):u.prototype.formatAt.call(this,f,v,g,c)},d.prototype.formats=function(){return this.statics.formats(this.domNode)},d}(l.default);n.default=o},function(r,n,i){var a=this&&this.__extends||function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var g in v)v.hasOwnProperty(g)&&(f[g]=v[g])};return function(f,v){d(f,v);function g(){this.constructor=f}f.prototype=v===null?Object.create(v):(g.prototype=v.prototype,new g)}}();Object.defineProperty(n,"__esModule",{value:!0});var l=i(19),o=i(1),u=function(d){a(f,d);function f(v){var g=d.call(this,v)||this;return g.text=g.statics.value(g.domNode),g}return f.create=function(v){return document.createTextNode(v)},f.value=function(v){var g=v.data;return g.normalize&&(g=g.normalize()),g},f.prototype.deleteAt=function(v,g){this.domNode.data=this.text=this.text.slice(0,v)+this.text.slice(v+g)},f.prototype.index=function(v,g){return this.domNode===v?g:-1},f.prototype.insertAt=function(v,g,c){c==null?(this.text=this.text.slice(0,v)+g+this.text.slice(v),this.domNode.data=this.text):d.prototype.insertAt.call(this,v,g,c)},f.prototype.length=function(){return this.text.length},f.prototype.optimize=function(v){d.prototype.optimize.call(this,v),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof f&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},f.prototype.position=function(v,g){return[this.domNode,v]},f.prototype.split=function(v,g){if(g===void 0&&(g=!1),!g){if(v===0)return this;if(v===this.length())return this.next}var c=o.create(this.domNode.splitText(v));return this.parent.insertBefore(c,this.next),this.text=this.statics.value(this.domNode),c},f.prototype.update=function(v,g){var c=this;v.some(function(y){return y.type==="characterData"&&y.target===c.domNode})&&(this.text=this.statics.value(this.domNode))},f.prototype.value=function(){return this.text},f.blotName="text",f.scope=o.Scope.INLINE_BLOT,f}(l.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 l=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(o,u){return arguments.length>1&&!this.contains(o)==!u?u:l.call(this,o)}}String.prototype.startsWith||(String.prototype.startsWith=function(o,u){return u=u||0,this.substr(u,o.length)===o}),String.prototype.endsWith||(String.prototype.endsWith=function(o,u){var d=this.toString();(typeof u!="number"||!isFinite(u)||Math.floor(u)!==u||u>d.length)&&(u=d.length),u-=o.length;var f=d.indexOf(o,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 d=Object(this),f=d.length>>>0,v=arguments[1],g,c=0;c<f;c++)if(g=d[c],u.call(v,g,c,d))return g}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})},function(r,n){var i=-1,a=1,l=0;function o(_,A,M){if(_==A)return _?[[l,_]]:[];(M<0||_.length<M)&&(M=null);var O=v(_,A),L=_.substring(0,O);_=_.substring(O),A=A.substring(O),O=g(_,A);var R=_.substring(_.length-O);_=_.substring(0,_.length-O),A=A.substring(0,A.length-O);var T=u(_,A);return L&&T.unshift([l,L]),R&&T.push([l,R]),y(T),M!=null&&(T=S(T,M)),T=b(T),T}function u(_,A){var M;if(!_)return[[a,A]];if(!A)return[[i,_]];var O=_.length>A.length?_:A,L=_.length>A.length?A:_,R=O.indexOf(L);if(R!=-1)return M=[[a,O.substring(0,R)],[l,L],[a,O.substring(R+L.length)]],_.length>A.length&&(M[0][0]=M[2][0]=i),M;if(L.length==1)return[[i,_],[a,A]];var T=c(_,A);if(T){var k=T[0],C=T[1],q=T[2],G=T[3],J=T[4],ae=o(k,q),H=o(C,G);return ae.concat([[l,J]],H)}return d(_,A)}function d(_,A){for(var M=_.length,O=A.length,L=Math.ceil((M+O)/2),R=L,T=2*L,k=new Array(T),C=new Array(T),q=0;q<T;q++)k[q]=-1,C[q]=-1;k[R+1]=0,C[R+1]=0;for(var G=M-O,J=G%2!=0,ae=0,H=0,V=0,Y=0,U=0;U<L;U++){for(var D=-U+ae;D<=U-H;D+=2){var j=R+D,z;D==-U||D!=U&&k[j-1]<k[j+1]?z=k[j+1]:z=k[j-1]+1;for(var Z=z-D;z<M&&Z<O&&_.charAt(z)==A.charAt(Z);)z++,Z++;if(k[j]=z,z>M)H+=2;else if(Z>O)ae+=2;else if(J){var re=R+G-D;if(re>=0&&re<T&&C[re]!=-1){var W=M-C[re];if(z>=W)return f(_,A,z,Z)}}}for(var Q=-U+V;Q<=U-Y;Q+=2){var re=R+Q,W;Q==-U||Q!=U&&C[re-1]<C[re+1]?W=C[re+1]:W=C[re-1]+1;for(var se=W-Q;W<M&&se<O&&_.charAt(M-W-1)==A.charAt(O-se-1);)W++,se++;if(C[re]=W,W>M)Y+=2;else if(se>O)V+=2;else if(!J){var j=R+G-Q;if(j>=0&&j<T&&k[j]!=-1){var z=k[j],Z=R+z-j;if(W=M-W,z>=W)return f(_,A,z,Z)}}}}return[[i,_],[a,A]]}function f(_,A,M,O){var L=_.substring(0,M),R=A.substring(0,O),T=_.substring(M),k=A.substring(O),C=o(L,R),q=o(T,k);return C.concat(q)}function v(_,A){if(!_||!A||_.charAt(0)!=A.charAt(0))return 0;for(var M=0,O=Math.min(_.length,A.length),L=O,R=0;M<L;)_.substring(R,L)==A.substring(R,L)?(M=L,R=M):O=L,L=Math.floor((O-M)/2+M);return L}function g(_,A){if(!_||!A||_.charAt(_.length-1)!=A.charAt(A.length-1))return 0;for(var M=0,O=Math.min(_.length,A.length),L=O,R=0;M<L;)_.substring(_.length-L,_.length-R)==A.substring(A.length-L,A.length-R)?(M=L,R=M):O=L,L=Math.floor((O-M)/2+M);return L}function c(_,A){var M=_.length>A.length?_:A,O=_.length>A.length?A:_;if(M.length<4||O.length*2<M.length)return null;function L(H,V,Y){for(var U=H.substring(Y,Y+Math.floor(H.length/4)),D=-1,j="",z,Z,re,W;(D=V.indexOf(U,D+1))!=-1;){var Q=v(H.substring(Y),V.substring(D)),se=g(H.substring(0,Y),V.substring(0,D));j.length<se+Q&&(j=V.substring(D-se,D)+V.substring(D,D+Q),z=H.substring(0,Y-se),Z=H.substring(Y+Q),re=V.substring(0,D-se),W=V.substring(D+Q))}return j.length*2>=H.length?[z,Z,re,W,j]:null}var R=L(M,O,Math.ceil(M.length/4)),T=L(M,O,Math.ceil(M.length/2)),k;if(!R&&!T)return null;T?R?k=R[4].length>T[4].length?R:T:k=T:k=R;var C,q,G,J;_.length>A.length?(C=k[0],q=k[1],G=k[2],J=k[3]):(G=k[0],J=k[1],C=k[2],q=k[3]);var ae=k[4];return[C,q,G,J,ae]}function y(_){_.push([l,""]);for(var A=0,M=0,O=0,L="",R="",T;A<_.length;)switch(_[A][0]){case a:O++,R+=_[A][1],A++;break;case i:M++,L+=_[A][1],A++;break;case l:M+O>1?(M!==0&&O!==0&&(T=v(R,L),T!==0&&(A-M-O>0&&_[A-M-O-1][0]==l?_[A-M-O-1][1]+=R.substring(0,T):(_.splice(0,0,[l,R.substring(0,T)]),A++),R=R.substring(T),L=L.substring(T)),T=g(R,L),T!==0&&(_[A][1]=R.substring(R.length-T)+_[A][1],R=R.substring(0,R.length-T),L=L.substring(0,L.length-T))),M===0?_.splice(A-O,M+O,[a,R]):O===0?_.splice(A-M,M+O,[i,L]):_.splice(A-M-O,M+O,[i,L],[a,R]),A=A-M-O+(M?1:0)+(O?1:0)+1):A!==0&&_[A-1][0]==l?(_[A-1][1]+=_[A][1],_.splice(A,1)):A++,O=0,M=0,L="",R="";break}_[_.length-1][1]===""&&_.pop();var k=!1;for(A=1;A<_.length-1;)_[A-1][0]==l&&_[A+1][0]==l&&(_[A][1].substring(_[A][1].length-_[A-1][1].length)==_[A-1][1]?(_[A][1]=_[A-1][1]+_[A][1].substring(0,_[A][1].length-_[A-1][1].length),_[A+1][1]=_[A-1][1]+_[A+1][1],_.splice(A-1,1),k=!0):_[A][1].substring(0,_[A+1][1].length)==_[A+1][1]&&(_[A-1][1]+=_[A+1][1],_[A][1]=_[A][1].substring(_[A+1][1].length)+_[A+1][1],_.splice(A+1,1),k=!0)),A++;k&&y(_)}var x=o;x.INSERT=a,x.DELETE=i,x.EQUAL=l,r.exports=x;function E(_,A){if(A===0)return[l,_];for(var M=0,O=0;O<_.length;O++){var L=_[O];if(L[0]===i||L[0]===l){var R=M+L[1].length;if(A===R)return[O+1,_];if(A<R){_=_.slice();var T=A-M,k=[L[0],L[1].slice(0,T)],C=[L[0],L[1].slice(T)];return _.splice(O,1,k,C),[O+1,_]}else M=R}}throw new Error("cursor_pos is out of bounds!")}function S(_,A){var M=E(_,A),O=M[1],L=M[0],R=O[L],T=O[L+1];if(R==null)return _;if(R[0]!==l)return _;if(T!=null&&R[1]+T[1]===T[1]+R[1])return O.splice(L,2,T,R),w(O,L,2);if(T!=null&&T[1].indexOf(R[1])===0){O.splice(L,2,[T[0],R[1]],[0,R[1]]);var k=T[1].slice(R[1].length);return k.length>0&&O.splice(L+2,0,[T[0],k]),w(O,L,3)}else return _}function b(_){for(var A=!1,M=function(T){return T.charCodeAt(0)>=56320&&T.charCodeAt(0)<=57343},O=function(T){return T.charCodeAt(T.length-1)>=55296&&T.charCodeAt(T.length-1)<=56319},L=2;L<_.length;L+=1)_[L-2][0]===l&&O(_[L-2][1])&&_[L-1][0]===i&&M(_[L-1][1])&&_[L][0]===a&&M(_[L][1])&&(A=!0,_[L-1][1]=_[L-2][1].slice(-1)+_[L-1][1],_[L][1]=_[L-2][1].slice(-1)+_[L][1],_[L-2][1]=_[L-2][1].slice(0,-1));if(!A)return _;for(var R=[],L=0;L<_.length;L+=1)_[L][1].length>0&&R.push(_[L]);return R}function w(_,A,M){for(var O=A+M-1;O>=0&&O>=A-1;O--)if(O+1<_.length){var L=_[O],R=_[O+1];L[0]===R[1]&&_.splice(O,2,[L[0],L[1]+R[1]])}return _}},function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:i,n.shim=i;function i(a){var l=[];for(var o in a)l.push(o);return l}},function(r,n){var i=function(){return Object.prototype.toString.call(arguments)}()=="[object Arguments]";n=r.exports=i?a:l,n.supported=a;function a(o){return Object.prototype.toString.call(o)=="[object Arguments]"}n.unsupported=l;function l(o){return o&&typeof o=="object"&&typeof o.length=="number"&&Object.prototype.hasOwnProperty.call(o,"callee")&&!Object.prototype.propertyIsEnumerable.call(o,"callee")||!1}},function(r,n){var i=Object.prototype.hasOwnProperty,a="~";function l(){}Object.create&&(l.prototype=Object.create(null),new l().__proto__||(a=!1));function o(d,f,v){this.fn=d,this.context=f,this.once=v||!1}function u(){this._events=new l,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],v,g;if(this._eventsCount===0)return f;for(g in v=this._events)i.call(v,g)&&f.push(a?g.slice(1):g);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(v)):f},u.prototype.listeners=function(f,v){var g=a?a+f:f,c=this._events[g];if(v)return!!c;if(!c)return[];if(c.fn)return[c.fn];for(var y=0,x=c.length,E=new Array(x);y<x;y++)E[y]=c[y].fn;return E},u.prototype.emit=function(f,v,g,c,y,x){var E=a?a+f:f;if(!this._events[E])return!1;var S=this._events[E],b=arguments.length,w,_;if(S.fn){switch(S.once&&this.removeListener(f,S.fn,void 0,!0),b){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,v),!0;case 3:return S.fn.call(S.context,v,g),!0;case 4:return S.fn.call(S.context,v,g,c),!0;case 5:return S.fn.call(S.context,v,g,c,y),!0;case 6:return S.fn.call(S.context,v,g,c,y,x),!0}for(_=1,w=new Array(b-1);_<b;_++)w[_-1]=arguments[_];S.fn.apply(S.context,w)}else{var A=S.length,M;for(_=0;_<A;_++)switch(S[_].once&&this.removeListener(f,S[_].fn,void 0,!0),b){case 1:S[_].fn.call(S[_].context);break;case 2:S[_].fn.call(S[_].context,v);break;case 3:S[_].fn.call(S[_].context,v,g);break;case 4:S[_].fn.call(S[_].context,v,g,c);break;default:if(!w)for(M=1,w=new Array(b-1);M<b;M++)w[M-1]=arguments[M];S[_].fn.apply(S[_].context,w)}}return!0},u.prototype.on=function(f,v,g){var c=new o(v,g||this),y=a?a+f:f;return this._events[y]?this._events[y].fn?this._events[y]=[this._events[y],c]:this._events[y].push(c):(this._events[y]=c,this._eventsCount++),this},u.prototype.once=function(f,v,g){var c=new o(v,g||this,!0),y=a?a+f:f;return this._events[y]?this._events[y].fn?this._events[y]=[this._events[y],c]:this._events[y].push(c):(this._events[y]=c,this._eventsCount++),this},u.prototype.removeListener=function(f,v,g,c){var y=a?a+f:f;if(!this._events[y])return this;if(!v)return--this._eventsCount===0?this._events=new l:delete this._events[y],this;var x=this._events[y];if(x.fn)x.fn===v&&(!c||x.once)&&(!g||x.context===g)&&(--this._eventsCount===0?this._events=new l:delete this._events[y]);else{for(var E=0,S=[],b=x.length;E<b;E++)(x[E].fn!==v||c&&!x[E].once||g&&x[E].context!==g)&&S.push(x[E]);S.length?this._events[y]=S.length===1?S[0]:S:--this._eventsCount===0?this._events=new l:delete this._events[y]}return this},u.prototype.removeAllListeners=function(f){var v;return f?(v=a?a+f:f,this._events[v]&&(--this._eventsCount===0?this._events=new l:delete this._events[v])):(this._events=new l,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(be){return typeof be}:function(be){return be&&typeof Symbol=="function"&&be.constructor===Symbol&&be!==Symbol.prototype?"symbol":typeof be},l=function(){function be(_e,xe){var Le=[],pe=!0,Ce=!1,je=void 0;try{for(var He=_e[Symbol.iterator](),st;!(pe=(st=He.next()).done)&&(Le.push(st.value),!(xe&&Le.length===xe));pe=!0);}catch(pt){Ce=!0,je=pt}finally{try{!pe&&He.return&&He.return()}finally{if(Ce)throw je}}return Le}return function(_e,xe){if(Array.isArray(_e))return _e;if(Symbol.iterator in Object(_e))return be(_e,xe);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function be(_e,xe){for(var Le=0;Le<xe.length;Le++){var pe=xe[Le];pe.enumerable=pe.enumerable||!1,pe.configurable=!0,"value"in pe&&(pe.writable=!0),Object.defineProperty(_e,pe.key,pe)}}return function(_e,xe,Le){return xe&&be(_e.prototype,xe),Le&&be(_e,Le),_e}}(),u=i(3),d=C(u),f=i(2),v=C(f),g=i(0),c=C(g),y=i(5),x=C(y),E=i(10),S=C(E),b=i(9),w=C(b),_=i(36),A=i(37),M=i(13),O=C(M),L=i(26),R=i(38),T=i(39),k=i(40);function C(be){return be&&be.__esModule?be:{default:be}}function q(be,_e,xe){return _e in be?Object.defineProperty(be,_e,{value:xe,enumerable:!0,configurable:!0,writable:!0}):be[_e]=xe,be}function G(be,_e){if(!(be instanceof _e))throw new TypeError("Cannot call a class as a function")}function J(be,_e){if(!be)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _e&&(typeof _e=="object"||typeof _e=="function")?_e:be}function ae(be,_e){if(typeof _e!="function"&&_e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _e);be.prototype=Object.create(_e&&_e.prototype,{constructor:{value:be,enumerable:!1,writable:!0,configurable:!0}}),_e&&(Object.setPrototypeOf?Object.setPrototypeOf(be,_e):be.__proto__=_e)}var H=(0,S.default)("quill:clipboard"),V="__ql-matcher",Y=[[Node.TEXT_NODE,Ae],[Node.TEXT_NODE,Pe],["br",ye],[Node.ELEMENT_NODE,Pe],[Node.ELEMENT_NODE,le],[Node.ELEMENT_NODE,de],[Node.ELEMENT_NODE,ue],[Node.ELEMENT_NODE,Te],["li",Me],["b",se.bind(se,"bold")],["i",se.bind(se,"italic")],["style",Re]],U=[_.AlignAttribute,R.DirectionAttribute].reduce(function(be,_e){return be[_e.keyName]=_e,be},{}),D=[_.AlignStyle,A.BackgroundStyle,L.ColorStyle,R.DirectionStyle,T.FontStyle,k.SizeStyle].reduce(function(be,_e){return be[_e.keyName]=_e,be},{}),j=function(be){ae(_e,be);function _e(xe,Le){G(this,_e);var pe=J(this,(_e.__proto__||Object.getPrototypeOf(_e)).call(this,xe,Le));return pe.quill.root.addEventListener("paste",pe.onPaste.bind(pe)),pe.container=pe.quill.addContainer("ql-clipboard"),pe.container.setAttribute("contenteditable",!0),pe.container.setAttribute("tabindex",-1),pe.matchers=[],Y.concat(pe.options.matchers).forEach(function(Ce){var je=l(Ce,2),He=je[0],st=je[1];!Le.matchVisual&&st===de||pe.addMatcher(He,st)}),pe}return o(_e,[{key:"addMatcher",value:function(Le,pe){this.matchers.push([Le,pe])}},{key:"convert",value:function(Le){if(typeof Le=="string")return this.container.innerHTML=Le.replace(/\>\r?\n +\</g,"><"),this.convert();var pe=this.quill.getFormat(this.quill.selection.savedRange.index);if(pe[O.default.blotName]){var Ce=this.container.innerText;return this.container.innerHTML="",new v.default().insert(Ce,q({},O.default.blotName,pe[O.default.blotName]))}var je=this.prepareMatching(),He=l(je,2),st=He[0],pt=He[1],ct=Q(this.container,st,pt);return re(ct,`
132
- `)&&ct.ops[ct.ops.length-1].attributes==null&&(ct=ct.compose(new v.default().retain(ct.length()-1).delete(1))),H.log("convert",this.container.innerHTML,ct),this.container.innerHTML="",ct}},{key:"dangerouslyPasteHTML",value:function(Le,pe){var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:x.default.sources.API;if(typeof Le=="string")this.quill.setContents(this.convert(Le),pe),this.quill.setSelection(0,x.default.sources.SILENT);else{var je=this.convert(pe);this.quill.updateContents(new v.default().retain(Le).concat(je),Ce),this.quill.setSelection(Le+je.length(),x.default.sources.SILENT)}}},{key:"onPaste",value:function(Le){var pe=this;if(!(Le.defaultPrevented||!this.quill.isEnabled())){var Ce=this.quill.getSelection(),je=new v.default().retain(Ce.index),He=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(x.default.sources.SILENT),setTimeout(function(){je=je.concat(pe.convert()).delete(Ce.length),pe.quill.updateContents(je,x.default.sources.USER),pe.quill.setSelection(je.length()-Ce.length,x.default.sources.SILENT),pe.quill.scrollingContainer.scrollTop=He,pe.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var Le=this,pe=[],Ce=[];return this.matchers.forEach(function(je){var He=l(je,2),st=He[0],pt=He[1];switch(st){case Node.TEXT_NODE:Ce.push(pt);break;case Node.ELEMENT_NODE:pe.push(pt);break;default:[].forEach.call(Le.container.querySelectorAll(st),function(ct){ct[V]=ct[V]||[],ct[V].push(pt)});break}}),[pe,Ce]}}]),_e}(w.default);j.DEFAULTS={matchers:[],matchVisual:!0};function z(be,_e,xe){return(typeof _e>"u"?"undefined":a(_e))==="object"?Object.keys(_e).reduce(function(Le,pe){return z(Le,pe,_e[pe])},be):be.reduce(function(Le,pe){return pe.attributes&&pe.attributes[_e]?Le.push(pe):Le.insert(pe.insert,(0,d.default)({},q({},_e,xe),pe.attributes))},new v.default)}function Z(be){if(be.nodeType!==Node.ELEMENT_NODE)return{};var _e="__ql-computed-style";return be[_e]||(be[_e]=window.getComputedStyle(be))}function re(be,_e){for(var xe="",Le=be.ops.length-1;Le>=0&&xe.length<_e.length;--Le){var pe=be.ops[Le];if(typeof pe.insert!="string")break;xe=pe.insert+xe}return xe.slice(-1*_e.length)===_e}function W(be){if(be.childNodes.length===0)return!1;var _e=Z(be);return["block","list-item"].indexOf(_e.display)>-1}function Q(be,_e,xe){return be.nodeType===be.TEXT_NODE?xe.reduce(function(Le,pe){return pe(be,Le)},new v.default):be.nodeType===be.ELEMENT_NODE?[].reduce.call(be.childNodes||[],function(Le,pe){var Ce=Q(pe,_e,xe);return pe.nodeType===be.ELEMENT_NODE&&(Ce=_e.reduce(function(je,He){return He(pe,je)},Ce),Ce=(pe[V]||[]).reduce(function(je,He){return He(pe,je)},Ce)),Le.concat(Ce)},new v.default):new v.default}function se(be,_e,xe){return z(xe,be,!0)}function ue(be,_e){var xe=c.default.Attributor.Attribute.keys(be),Le=c.default.Attributor.Class.keys(be),pe=c.default.Attributor.Style.keys(be),Ce={};return xe.concat(Le).concat(pe).forEach(function(je){var He=c.default.query(je,c.default.Scope.ATTRIBUTE);He!=null&&(Ce[He.attrName]=He.value(be),Ce[He.attrName])||(He=U[je],He!=null&&(He.attrName===je||He.keyName===je)&&(Ce[He.attrName]=He.value(be)||void 0),He=D[je],He!=null&&(He.attrName===je||He.keyName===je)&&(He=D[je],Ce[He.attrName]=He.value(be)||void 0))}),Object.keys(Ce).length>0&&(_e=z(_e,Ce)),_e}function le(be,_e){var xe=c.default.query(be);if(xe==null)return _e;if(xe.prototype instanceof c.default.Embed){var Le={},pe=xe.value(be);pe!=null&&(Le[xe.blotName]=pe,_e=new v.default().insert(Le,xe.formats(be)))}else typeof xe.formats=="function"&&(_e=z(_e,xe.blotName,xe.formats(be)));return _e}function ye(be,_e){return re(_e,`
133
- `)||_e.insert(`
134
- `),_e}function Re(){return new v.default}function Me(be,_e){var xe=c.default.query(be);if(xe==null||xe.blotName!=="list-item"||!re(_e,`
135
- `))return _e;for(var Le=-1,pe=be.parentNode;!pe.classList.contains("ql-clipboard");)(c.default.query(pe)||{}).blotName==="list"&&(Le+=1),pe=pe.parentNode;return Le<=0?_e:_e.compose(new v.default().retain(_e.length()-1).retain(1,{indent:Le}))}function Pe(be,_e){return re(_e,`
136
- `)||(W(be)||_e.length()>0&&be.nextSibling&&W(be.nextSibling))&&_e.insert(`
137
- `),_e}function de(be,_e){if(W(be)&&be.nextElementSibling!=null&&!re(_e,`
138
-
139
- `)){var xe=be.offsetHeight+parseFloat(Z(be).marginTop)+parseFloat(Z(be).marginBottom);be.nextElementSibling.offsetTop>be.offsetTop+xe*1.5&&_e.insert(`
140
- `)}return _e}function Te(be,_e){var xe={},Le=be.style||{};return Le.fontStyle&&Z(be).fontStyle==="italic"&&(xe.italic=!0),Le.fontWeight&&(Z(be).fontWeight.startsWith("bold")||parseInt(Z(be).fontWeight)>=700)&&(xe.bold=!0),Object.keys(xe).length>0&&(_e=z(_e,xe)),parseFloat(Le.textIndent||0)>0&&(_e=new v.default().insert(" ").concat(_e)),_e}function Ae(be,_e){var xe=be.data;if(be.parentNode.tagName==="O:P")return _e.insert(xe.trim());if(xe.trim().length===0&&be.parentNode.classList.contains("ql-clipboard"))return _e;if(!Z(be.parentNode).whiteSpace.startsWith("pre")){var Le=function(Ce,je){return je=je.replace(/[^\u00a0]/g,""),je.length<1&&Ce?" ":je};xe=xe.replace(/\r\n/g," ").replace(/\n/g," "),xe=xe.replace(/\s\s+/g,Le.bind(Le,!0)),(be.previousSibling==null&&W(be.parentNode)||be.previousSibling!=null&&W(be.previousSibling))&&(xe=xe.replace(/^\s+/,Le.bind(Le,!1))),(be.nextSibling==null&&W(be.parentNode)||be.nextSibling!=null&&W(be.nextSibling))&&(xe=xe.replace(/\s+$/,Le.bind(Le,!1)))}return _e.insert(xe)}n.default=j,n.matchAttributor=ue,n.matchBlot=le,n.matchNewline=Pe,n.matchSpacing=de,n.matchText=Ae},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(x,E){for(var S=0;S<E.length;S++){var b=E[S];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(x,b.key,b)}}return function(x,E,S){return E&&y(x.prototype,E),S&&y(x,S),x}}(),l=function y(x,E,S){x===null&&(x=Function.prototype);var b=Object.getOwnPropertyDescriptor(x,E);if(b===void 0){var w=Object.getPrototypeOf(x);return w===null?void 0:y(w,E,S)}else{if("value"in b)return b.value;var _=b.get;return _===void 0?void 0:_.call(S)}},o=i(6),u=d(o);function d(y){return y&&y.__esModule?y:{default:y}}function f(y,x){if(!(y instanceof x))throw new TypeError("Cannot call a class as a function")}function v(y,x){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:y}function g(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);y.prototype=Object.create(x&&x.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(y,x):y.__proto__=x)}var c=function(y){g(x,y);function x(){return f(this,x),v(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"optimize",value:function(S){l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"optimize",this).call(this,S),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return l(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),x}(u.default);c.blotName="bold",c.tagName=["STRONG","B"],n.default=c},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var a=function(){function k(C,q){var G=[],J=!0,ae=!1,H=void 0;try{for(var V=C[Symbol.iterator](),Y;!(J=(Y=V.next()).done)&&(G.push(Y.value),!(q&&G.length===q));J=!0);}catch(U){ae=!0,H=U}finally{try{!J&&V.return&&V.return()}finally{if(ae)throw H}}return G}return function(C,q){if(Array.isArray(C))return C;if(Symbol.iterator in Object(C))return k(C,q);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function k(C,q){for(var G=0;G<q.length;G++){var J=q[G];J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J&&(J.writable=!0),Object.defineProperty(C,J.key,J)}}return function(C,q,G){return q&&k(C.prototype,q),G&&k(C,G),C}}(),o=i(2),u=S(o),d=i(0),f=S(d),v=i(5),g=S(v),c=i(10),y=S(c),x=i(9),E=S(x);function S(k){return k&&k.__esModule?k:{default:k}}function b(k,C,q){return C in k?Object.defineProperty(k,C,{value:q,enumerable:!0,configurable:!0,writable:!0}):k[C]=q,k}function w(k,C){if(!(k instanceof C))throw new TypeError("Cannot call a class as a function")}function _(k,C){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C&&(typeof C=="object"||typeof C=="function")?C:k}function A(k,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof C);k.prototype=Object.create(C&&C.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),C&&(Object.setPrototypeOf?Object.setPrototypeOf(k,C):k.__proto__=C)}var M=(0,y.default)("quill:toolbar"),O=function(k){A(C,k);function C(q,G){w(this,C);var J=_(this,(C.__proto__||Object.getPrototypeOf(C)).call(this,q,G));if(Array.isArray(J.options.container)){var ae=document.createElement("div");R(ae,J.options.container),q.container.parentNode.insertBefore(ae,q.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 H;return H=M.error("Container required for toolbar",J.options),_(J,H)}return J.container.classList.add("ql-toolbar"),J.controls=[],J.handlers={},Object.keys(J.options.handlers).forEach(function(V){J.addHandler(V,J.options.handlers[V])}),[].forEach.call(J.container.querySelectorAll("button, select"),function(V){J.attach(V)}),J.quill.on(g.default.events.EDITOR_CHANGE,function(V,Y){V===g.default.events.SELECTION_CHANGE&&J.update(Y)}),J.quill.on(g.default.events.SCROLL_OPTIMIZE,function(){var V=J.quill.selection.getRange(),Y=a(V,1),U=Y[0];J.update(U)}),J}return l(C,[{key:"addHandler",value:function(G,J){this.handlers[G]=J}},{key:"attach",value:function(G){var J=this,ae=[].find.call(G.classList,function(V){return V.indexOf("ql-")===0});if(ae){if(ae=ae.slice(3),G.tagName==="BUTTON"&&G.setAttribute("type","button"),this.handlers[ae]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[ae]==null){M.warn("ignoring attaching to disabled format",ae,G);return}if(f.default.query(ae)==null){M.warn("ignoring attaching to nonexistent format",ae,G);return}}var H=G.tagName==="SELECT"?"change":"click";G.addEventListener(H,function(V){var Y=void 0;if(G.tagName==="SELECT"){if(G.selectedIndex<0)return;var U=G.options[G.selectedIndex];U.hasAttribute("selected")?Y=!1:Y=U.value||!1}else G.classList.contains("ql-active")?Y=!1:Y=G.value||!G.hasAttribute("value"),V.preventDefault();J.quill.focus();var D=J.quill.selection.getRange(),j=a(D,1),z=j[0];if(J.handlers[ae]!=null)J.handlers[ae].call(J,Y);else if(f.default.query(ae).prototype instanceof f.default.Embed){if(Y=prompt("Enter "+ae),!Y)return;J.quill.updateContents(new u.default().retain(z.index).delete(z.length).insert(b({},ae,Y)),g.default.sources.USER)}else J.quill.format(ae,Y,g.default.sources.USER);J.update(z)}),this.controls.push([ae,G])}}},{key:"update",value:function(G){var J=G==null?{}:this.quill.getFormat(G);this.controls.forEach(function(ae){var H=a(ae,2),V=H[0],Y=H[1];if(Y.tagName==="SELECT"){var U=void 0;if(G==null)U=null;else if(J[V]==null)U=Y.querySelector("option[selected]");else if(!Array.isArray(J[V])){var D=J[V];typeof D=="string"&&(D=D.replace(/\"/g,'\\"')),U=Y.querySelector('option[value="'+D+'"]')}U==null?(Y.value="",Y.selectedIndex=-1):U.selected=!0}else if(G==null)Y.classList.remove("ql-active");else if(Y.hasAttribute("value")){var j=J[V]===Y.getAttribute("value")||J[V]!=null&&J[V].toString()===Y.getAttribute("value")||J[V]==null&&!Y.getAttribute("value");Y.classList.toggle("ql-active",j)}else Y.classList.toggle("ql-active",J[V]!=null)})}}]),C}(E.default);O.DEFAULTS={};function L(k,C,q){var G=document.createElement("button");G.setAttribute("type","button"),G.classList.add("ql-"+C),q!=null&&(G.value=q),k.appendChild(G)}function R(k,C){Array.isArray(C[0])||(C=[C]),C.forEach(function(q){var G=document.createElement("span");G.classList.add("ql-formats"),q.forEach(function(J){if(typeof J=="string")L(G,J);else{var ae=Object.keys(J)[0],H=J[ae];Array.isArray(H)?T(G,ae,H):L(G,ae,H)}}),k.appendChild(G)})}function T(k,C,q){var G=document.createElement("select");G.classList.add("ql-"+C),q.forEach(function(J){var ae=document.createElement("option");J!==!1?ae.setAttribute("value",J):ae.setAttribute("selected","selected"),G.appendChild(ae)}),k.appendChild(G)}O.DEFAULTS={container:null,handlers:{clean:function(){var C=this,q=this.quill.getSelection();if(q!=null)if(q.length==0){var G=this.quill.getFormat();Object.keys(G).forEach(function(J){f.default.query(J,f.default.Scope.INLINE)!=null&&C.quill.format(J,!1)})}else this.quill.removeFormat(q,g.default.sources.USER)},direction:function(C){var q=this.quill.getFormat().align;C==="rtl"&&q==null?this.quill.format("align","right",g.default.sources.USER):!C&&q==="right"&&this.quill.format("align",!1,g.default.sources.USER),this.quill.format("direction",C,g.default.sources.USER)},indent:function(C){var q=this.quill.getSelection(),G=this.quill.getFormat(q),J=parseInt(G.indent||0);if(C==="+1"||C==="-1"){var ae=C==="+1"?1:-1;G.direction==="rtl"&&(ae*=-1),this.quill.format("indent",J+ae,g.default.sources.USER)}},link:function(C){C===!0&&(C=prompt("Enter link URL:")),this.quill.format("link",C,g.default.sources.USER)},list:function(C){var q=this.quill.getSelection(),G=this.quill.getFormat(q);C==="check"?G.list==="checked"||G.list==="unchecked"?this.quill.format("list",!1,g.default.sources.USER):this.quill.format("list","unchecked",g.default.sources.USER):this.quill.format("list",C,g.default.sources.USER)}}},n.default=O,n.addControls=R},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,E){for(var S=0;S<E.length;S++){var b=E[S];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(x,b.key,b)}}return function(x,E,S){return E&&y(x.prototype,E),S&&y(x,S),x}}(),l=function y(x,E,S){x===null&&(x=Function.prototype);var b=Object.getOwnPropertyDescriptor(x,E);if(b===void 0){var w=Object.getPrototypeOf(x);return w===null?void 0:y(w,E,S)}else{if("value"in b)return b.value;var _=b.get;return _===void 0?void 0:_.call(S)}},o=i(28),u=d(o);function d(y){return y&&y.__esModule?y:{default:y}}function f(y,x){if(!(y instanceof x))throw new TypeError("Cannot call a class as a function")}function v(y,x){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:y}function g(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);y.prototype=Object.create(x&&x.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(y,x):y.__proto__=x)}var c=function(y){g(x,y);function x(E,S){f(this,x);var b=v(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,E));return b.label.innerHTML=S,b.container.classList.add("ql-color-picker"),[].slice.call(b.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(w){w.classList.add("ql-primary")}),b}return a(x,[{key:"buildItem",value:function(S){var b=l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"buildItem",this).call(this,S);return b.style.backgroundColor=S.getAttribute("value")||"",b}},{key:"selectItem",value:function(S,b){l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"selectItem",this).call(this,S,b);var w=this.label.querySelector(".ql-color-label"),_=S&&S.getAttribute("data-value")||"";w&&(w.tagName==="line"?w.style.stroke=_:w.style.fill=_)}}]),x}(u.default);n.default=c},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(x,E){for(var S=0;S<E.length;S++){var b=E[S];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(x,b.key,b)}}return function(x,E,S){return E&&y(x.prototype,E),S&&y(x,S),x}}(),l=function y(x,E,S){x===null&&(x=Function.prototype);var b=Object.getOwnPropertyDescriptor(x,E);if(b===void 0){var w=Object.getPrototypeOf(x);return w===null?void 0:y(w,E,S)}else{if("value"in b)return b.value;var _=b.get;return _===void 0?void 0:_.call(S)}},o=i(28),u=d(o);function d(y){return y&&y.__esModule?y:{default:y}}function f(y,x){if(!(y instanceof x))throw new TypeError("Cannot call a class as a function")}function v(y,x){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:y}function g(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);y.prototype=Object.create(x&&x.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(y,x):y.__proto__=x)}var c=function(y){g(x,y);function x(E,S){f(this,x);var b=v(this,(x.__proto__||Object.getPrototypeOf(x)).call(this,E));return b.container.classList.add("ql-icon-picker"),[].forEach.call(b.container.querySelectorAll(".ql-picker-item"),function(w){w.innerHTML=S[w.getAttribute("data-value")||""]}),b.defaultItem=b.container.querySelector(".ql-selected"),b.selectItem(b.defaultItem),b}return a(x,[{key:"selectItem",value:function(S,b){l(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"selectItem",this).call(this,S,b),S=S||this.defaultItem,this.label.innerHTML=S.innerHTML}}]),x}(u.default);n.default=c},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function u(d,f){for(var v=0;v<f.length;v++){var g=f[v];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(d,g.key,g)}}return function(d,f,v){return f&&u(d.prototype,f),v&&u(d,v),d}}();function l(u,d){if(!(u instanceof d))throw new TypeError("Cannot call a class as a function")}var o=function(){function u(d,f){var v=this;l(this,u),this.quill=d,this.boundsContainer=f||document.body,this.root=d.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){v.root.style.marginTop=-1*v.quill.root.scrollTop+"px"}),this.hide()}return a(u,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(f){var v=f.left+f.width/2-this.root.offsetWidth/2,g=f.bottom+this.quill.root.scrollTop;this.root.style.left=v+"px",this.root.style.top=g+"px",this.root.classList.remove("ql-flip");var c=this.boundsContainer.getBoundingClientRect(),y=this.root.getBoundingClientRect(),x=0;if(y.right>c.right&&(x=c.right-y.right,this.root.style.left=v+x+"px"),y.left<c.left&&(x=c.left-y.left,this.root.style.left=v+x+"px"),y.bottom>c.bottom){var E=y.bottom-y.top,S=f.bottom-f.top+E;this.root.style.top=g-S+"px",this.root.classList.add("ql-flip")}return x}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),u}();n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function T(k,C){var q=[],G=!0,J=!1,ae=void 0;try{for(var H=k[Symbol.iterator](),V;!(G=(V=H.next()).done)&&(q.push(V.value),!(C&&q.length===C));G=!0);}catch(Y){J=!0,ae=Y}finally{try{!G&&H.return&&H.return()}finally{if(J)throw ae}}return q}return function(k,C){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return T(k,C);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function T(k,C,q){k===null&&(k=Function.prototype);var G=Object.getOwnPropertyDescriptor(k,C);if(G===void 0){var J=Object.getPrototypeOf(k);return J===null?void 0:T(J,C,q)}else{if("value"in G)return G.value;var ae=G.get;return ae===void 0?void 0:ae.call(q)}},o=function(){function T(k,C){for(var q=0;q<C.length;q++){var G=C[q];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(k,G.key,G)}}return function(k,C,q){return C&&T(k.prototype,C),q&&T(k,q),k}}(),u=i(3),d=w(u),f=i(8),v=w(f),g=i(43),c=w(g),y=i(27),x=w(y),E=i(15),S=i(41),b=w(S);function w(T){return T&&T.__esModule?T:{default:T}}function _(T,k){if(!(T instanceof k))throw new TypeError("Cannot call a class as a function")}function A(T,k){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:T}function M(T,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);T.prototype=Object.create(k&&k.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(T,k):T.__proto__=k)}var O=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],L=function(T){M(k,T);function k(C,q){_(this,k),q.modules.toolbar!=null&&q.modules.toolbar.container==null&&(q.modules.toolbar.container=O);var G=A(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,C,q));return G.quill.container.classList.add("ql-snow"),G}return o(k,[{key:"extendToolbar",value:function(q){q.container.classList.add("ql-snow"),this.buildButtons([].slice.call(q.container.querySelectorAll("button")),b.default),this.buildPickers([].slice.call(q.container.querySelectorAll("select")),b.default),this.tooltip=new R(this.quill,this.options.bounds),q.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(G,J){q.handlers.link.call(q,!J.format.link)})}}]),k}(c.default);L.DEFAULTS=(0,d.default)(!0,{},c.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(k){if(k){var C=this.quill.getSelection();if(C==null||C.length==0)return;var q=this.quill.getText(C);/^\S+@\S+\.\S+$/.test(q)&&q.indexOf("mailto:")!==0&&(q="mailto:"+q);var G=this.quill.theme.tooltip;G.edit("link",q)}else this.quill.format("link",!1)}}}}});var R=function(T){M(k,T);function k(C,q){_(this,k);var G=A(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,C,q));return G.preview=G.root.querySelector("a.ql-preview"),G}return o(k,[{key:"listen",value:function(){var q=this;l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(G){q.root.classList.contains("ql-editing")?q.save():q.edit("link",q.preview.textContent),G.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(G){if(q.linkRange!=null){var J=q.linkRange;q.restoreFocus(),q.quill.formatText(J,"link",!1,v.default.sources.USER),delete q.linkRange}G.preventDefault(),q.hide()}),this.quill.on(v.default.events.SELECTION_CHANGE,function(G,J,ae){if(G!=null){if(G.length===0&&ae===v.default.sources.USER){var H=q.quill.scroll.descendant(x.default,G.index),V=a(H,2),Y=V[0],U=V[1];if(Y!=null){q.linkRange=new E.Range(G.index-U,Y.length());var D=x.default.formats(Y.domNode);q.preview.textContent=D,q.preview.setAttribute("href",D),q.show(),q.position(q.quill.getBounds(q.linkRange));return}}else delete q.linkRange;q.hide()}})}},{key:"show",value:function(){l(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),k}(g.BaseTooltip);R.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=L},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(29),l=pe(a),o=i(36),u=i(38),d=i(64),f=i(65),v=pe(f),g=i(66),c=pe(g),y=i(67),x=pe(y),E=i(37),S=i(26),b=i(39),w=i(40),_=i(56),A=pe(_),M=i(68),O=pe(M),L=i(27),R=pe(L),T=i(69),k=pe(T),C=i(70),q=pe(C),G=i(71),J=pe(G),ae=i(72),H=pe(ae),V=i(73),Y=pe(V),U=i(13),D=pe(U),j=i(74),z=pe(j),Z=i(75),re=pe(Z),W=i(57),Q=pe(W),se=i(41),ue=pe(se),le=i(28),ye=pe(le),Re=i(59),Me=pe(Re),Pe=i(60),de=pe(Pe),Te=i(61),Ae=pe(Te),be=i(108),_e=pe(be),xe=i(62),Le=pe(xe);function pe(Ce){return Ce&&Ce.__esModule?Ce:{default:Ce}}l.default.register({"attributors/attribute/direction":u.DirectionAttribute,"attributors/class/align":o.AlignClass,"attributors/class/background":E.BackgroundClass,"attributors/class/color":S.ColorClass,"attributors/class/direction":u.DirectionClass,"attributors/class/font":b.FontClass,"attributors/class/size":w.SizeClass,"attributors/style/align":o.AlignStyle,"attributors/style/background":E.BackgroundStyle,"attributors/style/color":S.ColorStyle,"attributors/style/direction":u.DirectionStyle,"attributors/style/font":b.FontStyle,"attributors/style/size":w.SizeStyle},!0),l.default.register({"formats/align":o.AlignClass,"formats/direction":u.DirectionClass,"formats/indent":d.IndentClass,"formats/background":E.BackgroundStyle,"formats/color":S.ColorStyle,"formats/font":b.FontClass,"formats/size":w.SizeClass,"formats/blockquote":v.default,"formats/code-block":D.default,"formats/header":c.default,"formats/list":x.default,"formats/bold":A.default,"formats/code":U.Code,"formats/italic":O.default,"formats/link":R.default,"formats/script":k.default,"formats/strike":q.default,"formats/underline":J.default,"formats/image":H.default,"formats/video":Y.default,"formats/list/item":y.ListItem,"modules/formula":z.default,"modules/syntax":re.default,"modules/toolbar":Q.default,"themes/bubble":_e.default,"themes/snow":Le.default,"ui/icons":ue.default,"ui/picker":ye.default,"ui/icon-picker":de.default,"ui/color-picker":Me.default,"ui/tooltip":Ae.default},!0),n.default=l.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var a=function(){function x(E,S){for(var b=0;b<S.length;b++){var w=S[b];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(E,w.key,w)}}return function(E,S,b){return S&&x(E.prototype,S),b&&x(E,b),E}}(),l=function x(E,S,b){E===null&&(E=Function.prototype);var w=Object.getOwnPropertyDescriptor(E,S);if(w===void 0){var _=Object.getPrototypeOf(E);return _===null?void 0:x(_,S,b)}else{if("value"in w)return w.value;var A=w.get;return A===void 0?void 0:A.call(b)}},o=i(0),u=d(o);function d(x){return x&&x.__esModule?x:{default:x}}function f(x,E){if(!(x instanceof E))throw new TypeError("Cannot call a class as a function")}function v(x,E){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:x}function g(x,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);x.prototype=Object.create(E&&E.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(x,E):x.__proto__=E)}var c=function(x){g(E,x);function E(){return f(this,E),v(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}return a(E,[{key:"add",value:function(b,w){if(w==="+1"||w==="-1"){var _=this.value(b)||0;w=w==="+1"?_+1:_-1}return w===0?(this.remove(b),!0):l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"add",this).call(this,b,w)}},{key:"canAdd",value:function(b,w){return l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"canAdd",this).call(this,b,w)||l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"canAdd",this).call(this,b,parseInt(w))}},{key:"value",value:function(b){return parseInt(l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"value",this).call(this,b))||void 0}}]),E}(u.default.Attributor.Class),y=new c("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),l=o(a);function o(g){return g&&g.__esModule?g:{default:g}}function u(g,c){if(!(g instanceof c))throw new TypeError("Cannot call a class as a function")}function d(g,c){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:g}function f(g,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);g.prototype=Object.create(c&&c.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(g,c):g.__proto__=c)}var v=function(g){f(c,g);function c(){return u(this,c),d(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}return c}(l.default);v.blotName="blockquote",v.tagName="blockquote",n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function c(y,x){for(var E=0;E<x.length;E++){var S=x[E];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(y,S.key,S)}}return function(y,x,E){return x&&c(y.prototype,x),E&&c(y,E),y}}(),l=i(4),o=u(l);function u(c){return c&&c.__esModule?c:{default:c}}function d(c,y){if(!(c instanceof y))throw new TypeError("Cannot call a class as a function")}function f(c,y){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:c}function v(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(c,y):c.__proto__=y)}var g=function(c){v(y,c);function y(){return d(this,y),f(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,null,[{key:"formats",value:function(E){return this.tagName.indexOf(E.tagName)+1}}]),y}(o.default);g.blotName="header",g.tagName=["H1","H2","H3","H4","H5","H6"],n.default=g},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=function(){function _(A,M){for(var O=0;O<M.length;O++){var L=M[O];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(A,L.key,L)}}return function(A,M,O){return M&&_(A.prototype,M),O&&_(A,O),A}}(),l=function _(A,M,O){A===null&&(A=Function.prototype);var L=Object.getOwnPropertyDescriptor(A,M);if(L===void 0){var R=Object.getPrototypeOf(A);return R===null?void 0:_(R,M,O)}else{if("value"in L)return L.value;var T=L.get;return T===void 0?void 0:T.call(O)}},o=i(0),u=c(o),d=i(4),f=c(d),v=i(25),g=c(v);function c(_){return _&&_.__esModule?_:{default:_}}function y(_,A,M){return A in _?Object.defineProperty(_,A,{value:M,enumerable:!0,configurable:!0,writable:!0}):_[A]=M,_}function x(_,A){if(!(_ instanceof A))throw new TypeError("Cannot call a class as a function")}function E(_,A){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:_}function S(_,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);_.prototype=Object.create(A&&A.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(_,A):_.__proto__=A)}var b=function(_){S(A,_);function A(){return x(this,A),E(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}return a(A,[{key:"format",value:function(O,L){O===w.blotName&&!L?this.replaceWith(u.default.create(this.statics.scope)):l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"format",this).call(this,O,L)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(O,L){return this.parent.isolate(this.offset(this.parent),this.length()),O===this.parent.statics.blotName?(this.parent.replaceWith(O,L),this):(this.parent.unwrap(),l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"replaceWith",this).call(this,O,L))}}],[{key:"formats",value:function(O){return O.tagName===this.tagName?void 0:l(A.__proto__||Object.getPrototypeOf(A),"formats",this).call(this,O)}}]),A}(f.default);b.blotName="list-item",b.tagName="LI";var w=function(_){S(A,_),a(A,null,[{key:"create",value:function(O){var L=O==="ordered"?"OL":"UL",R=l(A.__proto__||Object.getPrototypeOf(A),"create",this).call(this,L);return(O==="checked"||O==="unchecked")&&R.setAttribute("data-checked",O==="checked"),R}},{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 A(M){x(this,A);var O=E(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,M)),L=function(T){if(T.target.parentNode===M){var k=O.statics.formats(M),C=u.default.find(T.target);k==="checked"?C.format("list","unchecked"):k==="unchecked"&&C.format("list","checked")}};return M.addEventListener("touchstart",L),M.addEventListener("mousedown",L),O}return a(A,[{key:"format",value:function(O,L){this.children.length>0&&this.children.tail.format(O,L)}},{key:"formats",value:function(){return y({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(O,L){if(O instanceof b)l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertBefore",this).call(this,O,L);else{var R=L==null?this.length():L.offset(this),T=this.split(R);T.parent.insertBefore(O,T)}}},{key:"optimize",value:function(O){l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,O);var L=this.next;L!=null&&L.prev===this&&L.statics.blotName===this.statics.blotName&&L.domNode.tagName===this.domNode.tagName&&L.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(L.moveChildren(this),L.remove())}},{key:"replace",value:function(O){if(O.statics.blotName!==this.statics.blotName){var L=u.default.create(this.statics.defaultChild);O.moveChildren(L),this.appendChild(L)}l(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"replace",this).call(this,O)}}]),A}(g.default);w.blotName="list",w.scope=u.default.Scope.BLOCK_BLOT,w.tagName=["OL","UL"],w.defaultChild="list-item",w.allowedChildren=[b],n.ListItem=b,n.default=w},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(56),l=o(a);function o(g){return g&&g.__esModule?g:{default:g}}function u(g,c){if(!(g instanceof c))throw new TypeError("Cannot call a class as a function")}function d(g,c){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:g}function f(g,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);g.prototype=Object.create(c&&c.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(g,c):g.__proto__=c)}var v=function(g){f(c,g);function c(){return u(this,c),d(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}return c}(l.default);v.blotName="italic",v.tagName=["EM","I"],n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function y(x,E){for(var S=0;S<E.length;S++){var b=E[S];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(x,b.key,b)}}return function(x,E,S){return E&&y(x.prototype,E),S&&y(x,S),x}}(),l=function y(x,E,S){x===null&&(x=Function.prototype);var b=Object.getOwnPropertyDescriptor(x,E);if(b===void 0){var w=Object.getPrototypeOf(x);return w===null?void 0:y(w,E,S)}else{if("value"in b)return b.value;var _=b.get;return _===void 0?void 0:_.call(S)}},o=i(6),u=d(o);function d(y){return y&&y.__esModule?y:{default:y}}function f(y,x){if(!(y instanceof x))throw new TypeError("Cannot call a class as a function")}function v(y,x){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:y}function g(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);y.prototype=Object.create(x&&x.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(y,x):y.__proto__=x)}var c=function(y){g(x,y);function x(){return f(this,x),v(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,null,[{key:"create",value:function(S){return S==="super"?document.createElement("sup"):S==="sub"?document.createElement("sub"):l(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,S)}},{key:"formats",value:function(S){if(S.tagName==="SUB")return"sub";if(S.tagName==="SUP")return"super"}}]),x}(u.default);c.blotName="script",c.tagName=["SUB","SUP"],n.default=c},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),l=o(a);function o(g){return g&&g.__esModule?g:{default:g}}function u(g,c){if(!(g instanceof c))throw new TypeError("Cannot call a class as a function")}function d(g,c){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:g}function f(g,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);g.prototype=Object.create(c&&c.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(g,c):g.__proto__=c)}var v=function(g){f(c,g);function c(){return u(this,c),d(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}return c}(l.default);v.blotName="strike",v.tagName="S",n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(6),l=o(a);function o(g){return g&&g.__esModule?g:{default:g}}function u(g,c){if(!(g instanceof c))throw new TypeError("Cannot call a class as a function")}function d(g,c){if(!g)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:g}function f(g,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);g.prototype=Object.create(c&&c.prototype,{constructor:{value:g,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(g,c):g.__proto__=c)}var v=function(g){f(c,g);function c(){return u(this,c),d(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}return c}(l.default);v.blotName="underline",v.tagName="U",n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(S,b){for(var w=0;w<b.length;w++){var _=b[w];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(S,_.key,_)}}return function(S,b,w){return b&&E(S.prototype,b),w&&E(S,w),S}}(),l=function E(S,b,w){S===null&&(S=Function.prototype);var _=Object.getOwnPropertyDescriptor(S,b);if(_===void 0){var A=Object.getPrototypeOf(S);return A===null?void 0:E(A,b,w)}else{if("value"in _)return _.value;var M=_.get;return M===void 0?void 0:M.call(w)}},o=i(0),u=f(o),d=i(27);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,S){if(!(E instanceof S))throw new TypeError("Cannot call a class as a function")}function g(E,S){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:E}function c(E,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);E.prototype=Object.create(S&&S.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(E,S):E.__proto__=S)}var y=["alt","height","width"],x=function(E){c(S,E);function S(){return v(this,S),g(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,[{key:"format",value:function(w,_){y.indexOf(w)>-1?_?this.domNode.setAttribute(w,_):this.domNode.removeAttribute(w):l(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"format",this).call(this,w,_)}}],[{key:"create",value:function(w){var _=l(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,w);return typeof w=="string"&&_.setAttribute("src",this.sanitize(w)),_}},{key:"formats",value:function(w){return y.reduce(function(_,A){return w.hasAttribute(A)&&(_[A]=w.getAttribute(A)),_},{})}},{key:"match",value:function(w){return/\.(jpe?g|gif|png)$/.test(w)||/^data:image\/.+;base64/.test(w)}},{key:"sanitize",value:function(w){return(0,d.sanitize)(w,["http","https","data"])?w:"//:0"}},{key:"value",value:function(w){return w.getAttribute("src")}}]),S}(u.default.Embed);x.blotName="image",x.tagName="IMG",n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function E(S,b){for(var w=0;w<b.length;w++){var _=b[w];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(S,_.key,_)}}return function(S,b,w){return b&&E(S.prototype,b),w&&E(S,w),S}}(),l=function E(S,b,w){S===null&&(S=Function.prototype);var _=Object.getOwnPropertyDescriptor(S,b);if(_===void 0){var A=Object.getPrototypeOf(S);return A===null?void 0:E(A,b,w)}else{if("value"in _)return _.value;var M=_.get;return M===void 0?void 0:M.call(w)}},o=i(4),u=i(27),d=f(u);function f(E){return E&&E.__esModule?E:{default:E}}function v(E,S){if(!(E instanceof S))throw new TypeError("Cannot call a class as a function")}function g(E,S){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:E}function c(E,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);E.prototype=Object.create(S&&S.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(E,S):E.__proto__=S)}var y=["height","width"],x=function(E){c(S,E);function S(){return v(this,S),g(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,[{key:"format",value:function(w,_){y.indexOf(w)>-1?_?this.domNode.setAttribute(w,_):this.domNode.removeAttribute(w):l(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"format",this).call(this,w,_)}}],[{key:"create",value:function(w){var _=l(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,w);return _.setAttribute("frameborder","0"),_.setAttribute("allowfullscreen",!0),_.setAttribute("src",this.sanitize(w)),_}},{key:"formats",value:function(w){return y.reduce(function(_,A){return w.hasAttribute(A)&&(_[A]=w.getAttribute(A)),_},{})}},{key:"sanitize",value:function(w){return d.default.sanitize(w)}},{key:"value",value:function(w){return w.getAttribute("src")}}]),S}(o.BlockEmbed);x.blotName="video",x.className="ql-video",x.tagName="IFRAME",n.default=x},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var a=function(){function w(_,A){for(var M=0;M<A.length;M++){var O=A[M];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(_,O.key,O)}}return function(_,A,M){return A&&w(_.prototype,A),M&&w(_,M),_}}(),l=function w(_,A,M){_===null&&(_=Function.prototype);var O=Object.getOwnPropertyDescriptor(_,A);if(O===void 0){var L=Object.getPrototypeOf(_);return L===null?void 0:w(L,A,M)}else{if("value"in O)return O.value;var R=O.get;return R===void 0?void 0:R.call(M)}},o=i(35),u=c(o),d=i(5),f=c(d),v=i(9),g=c(v);function c(w){return w&&w.__esModule?w:{default:w}}function y(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}function x(w,_){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:w}function E(w,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);w.prototype=Object.create(_&&_.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(w,_):w.__proto__=_)}var S=function(w){E(_,w);function _(){return y(this,_),x(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,null,[{key:"create",value:function(M){var O=l(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,M);return typeof M=="string"&&(window.katex.render(M,O,{throwOnError:!1,errorColor:"#f00"}),O.setAttribute("data-value",M)),O}},{key:"value",value:function(M){return M.getAttribute("data-value")}}]),_}(u.default);S.blotName="formula",S.className="ql-formula",S.tagName="SPAN";var b=function(w){E(_,w),a(_,null,[{key:"register",value:function(){f.default.register(S,!0)}}]);function _(){y(this,_);var A=x(this,(_.__proto__||Object.getPrototypeOf(_)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return A}return _}(g.default);n.FormulaBlot=S,n.default=b},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=function(){function M(O,L){for(var R=0;R<L.length;R++){var T=L[R];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(O,T.key,T)}}return function(O,L,R){return L&&M(O.prototype,L),R&&M(O,R),O}}(),l=function M(O,L,R){O===null&&(O=Function.prototype);var T=Object.getOwnPropertyDescriptor(O,L);if(T===void 0){var k=Object.getPrototypeOf(O);return k===null?void 0:M(k,L,R)}else{if("value"in T)return T.value;var C=T.get;return C===void 0?void 0:C.call(R)}},o=i(0),u=x(o),d=i(5),f=x(d),v=i(9),g=x(v),c=i(13),y=x(c);function x(M){return M&&M.__esModule?M:{default:M}}function E(M,O){if(!(M instanceof O))throw new TypeError("Cannot call a class as a function")}function S(M,O){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:M}function b(M,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);M.prototype=Object.create(O&&O.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(M,O):M.__proto__=O)}var w=function(M){b(O,M);function O(){return E(this,O),S(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return a(O,[{key:"replaceWith",value:function(R){this.domNode.textContent=this.domNode.textContent,this.attach(),l(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replaceWith",this).call(this,R)}},{key:"highlight",value:function(R){var T=this.domNode.textContent;this.cachedText!==T&&((T.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=R(T),this.domNode.normalize(),this.attach()),this.cachedText=T)}}]),O}(y.default);w.className="ql-syntax";var _=new u.default.Attributor.Class("token","hljs",{scope:u.default.Scope.INLINE}),A=function(M){b(O,M),a(O,null,[{key:"register",value:function(){f.default.register(_,!0),f.default.register(w,!0)}}]);function O(L,R){E(this,O);var T=S(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,L,R));if(typeof T.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var k=null;return T.quill.on(f.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(k),k=setTimeout(function(){T.highlight(),k=null},T.options.interval)}),T.highlight(),T}return a(O,[{key:"highlight",value:function(){var R=this;if(!this.quill.selection.composing){this.quill.update(f.default.sources.USER);var T=this.quill.getSelection();this.quill.scroll.descendants(w).forEach(function(k){k.highlight(R.options.highlight)}),this.quill.update(f.default.sources.SILENT),T!=null&&this.quill.setSelection(T,f.default.sources.SILENT)}}}]),O}(g.default);A.DEFAULTS={highlight:function(){return window.hljs==null?null:function(M){var O=window.hljs.highlightAuto(M);return O.value}}(),interval:1e3},n.CodeBlock=w,n.CodeToken=_,n.default=A},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'},function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'},function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'},function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var a=function O(L,R,T){L===null&&(L=Function.prototype);var k=Object.getOwnPropertyDescriptor(L,R);if(k===void 0){var C=Object.getPrototypeOf(L);return C===null?void 0:O(C,R,T)}else{if("value"in k)return k.value;var q=k.get;return q===void 0?void 0:q.call(T)}},l=function(){function O(L,R){for(var T=0;T<R.length;T++){var k=R[T];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(L,k.key,k)}}return function(L,R,T){return R&&O(L.prototype,R),T&&O(L,T),L}}(),o=i(3),u=E(o),d=i(8),f=E(d),v=i(43),g=E(v),c=i(15),y=i(41),x=E(y);function E(O){return O&&O.__esModule?O:{default:O}}function S(O,L){if(!(O instanceof L))throw new TypeError("Cannot call a class as a function")}function b(O,L){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return L&&(typeof L=="object"||typeof L=="function")?L:O}function w(O,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);O.prototype=Object.create(L&&L.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(O,L):O.__proto__=L)}var _=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],A=function(O){w(L,O);function L(R,T){S(this,L),T.modules.toolbar!=null&&T.modules.toolbar.container==null&&(T.modules.toolbar.container=_);var k=b(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,R,T));return k.quill.container.classList.add("ql-bubble"),k}return l(L,[{key:"extendToolbar",value:function(T){this.tooltip=new M(this.quill,this.options.bounds),this.tooltip.root.appendChild(T.container),this.buildButtons([].slice.call(T.container.querySelectorAll("button")),x.default),this.buildPickers([].slice.call(T.container.querySelectorAll("select")),x.default)}}]),L}(g.default);A.DEFAULTS=(0,u.default)(!0,{},g.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(L){L?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var M=function(O){w(L,O);function L(R,T){S(this,L);var k=b(this,(L.__proto__||Object.getPrototypeOf(L)).call(this,R,T));return k.quill.on(f.default.events.EDITOR_CHANGE,function(C,q,G,J){if(C===f.default.events.SELECTION_CHANGE)if(q!=null&&q.length>0&&J===f.default.sources.USER){k.show(),k.root.style.left="0px",k.root.style.width="",k.root.style.width=k.root.offsetWidth+"px";var ae=k.quill.getLines(q.index,q.length);if(ae.length===1)k.position(k.quill.getBounds(q));else{var H=ae[ae.length-1],V=k.quill.getIndex(H),Y=Math.min(H.length()-1,q.index+q.length-V),U=k.quill.getBounds(new c.Range(V,Y));k.position(U)}}else document.activeElement!==k.textbox&&k.quill.hasFocus()&&k.hide()}),k}return l(L,[{key:"listen",value:function(){var T=this;a(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){T.root.classList.remove("ql-editing")}),this.quill.on(f.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!T.root.classList.contains("ql-hidden")){var k=T.quill.getSelection();k!=null&&T.position(T.quill.getBounds(k))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(T){var k=a(L.prototype.__proto__||Object.getPrototypeOf(L.prototype),"position",this).call(this,T),C=this.root.querySelector(".ql-tooltip-arrow");if(C.style.marginLeft="",k===0)return k;C.style.marginLeft=-1*k-C.offsetWidth/2+"px"}}]),L}(v.BaseTooltip);M.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=M,n.default=A},function(r,n,i){r.exports=i(63)}]).default})}(A1)),A1.exports}var Jk=Qk();const X8=lc(Jk);var P1={exports:{}},Af={},Wd={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var eO=Wd.exports,Ub;function tO(){return Ub||(Ub=1,function(e,t){(function(r){var n=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,a=typeof Ch=="object"&&Ch;(a.global===a||a.window===a||a.self===a)&&(r=a);var l,o=2147483647,u=36,d=1,f=26,v=38,g=700,c=72,y=128,x="-",E=/^xn--/,S=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=u-d,A=Math.floor,M=String.fromCharCode,O;function L(U){throw new RangeError(w[U])}function R(U,D){for(var j=U.length,z=[];j--;)z[j]=D(U[j]);return z}function T(U,D){var j=U.split("@"),z="";j.length>1&&(z=j[0]+"@",U=j[1]),U=U.replace(b,".");var Z=U.split("."),re=R(Z,D).join(".");return z+re}function k(U){for(var D=[],j=0,z=U.length,Z,re;j<z;)Z=U.charCodeAt(j++),Z>=55296&&Z<=56319&&j<z?(re=U.charCodeAt(j++),(re&64512)==56320?D.push(((Z&1023)<<10)+(re&1023)+65536):(D.push(Z),j--)):D.push(Z);return D}function C(U){return R(U,function(D){var j="";return D>65535&&(D-=65536,j+=M(D>>>10&1023|55296),D=56320|D&1023),j+=M(D),j}).join("")}function q(U){return U-48<10?U-22:U-65<26?U-65:U-97<26?U-97:u}function G(U,D){return U+22+75*(U<26)-((D!=0)<<5)}function J(U,D,j){var z=0;for(U=j?A(U/g):U>>1,U+=A(U/D);U>_*f>>1;z+=u)U=A(U/_);return A(z+(_+1)*U/(U+v))}function ae(U){var D=[],j=U.length,z,Z=0,re=y,W=c,Q,se,ue,le,ye,Re,Me,Pe,de;for(Q=U.lastIndexOf(x),Q<0&&(Q=0),se=0;se<Q;++se)U.charCodeAt(se)>=128&&L("not-basic"),D.push(U.charCodeAt(se));for(ue=Q>0?Q+1:0;ue<j;){for(le=Z,ye=1,Re=u;ue>=j&&L("invalid-input"),Me=q(U.charCodeAt(ue++)),(Me>=u||Me>A((o-Z)/ye))&&L("overflow"),Z+=Me*ye,Pe=Re<=W?d:Re>=W+f?f:Re-W,!(Me<Pe);Re+=u)de=u-Pe,ye>A(o/de)&&L("overflow"),ye*=de;z=D.length+1,W=J(Z-le,z,le==0),A(Z/z)>o-re&&L("overflow"),re+=A(Z/z),Z%=z,D.splice(Z++,0,re)}return C(D)}function H(U){var D,j,z,Z,re,W,Q,se,ue,le,ye,Re=[],Me,Pe,de,Te;for(U=k(U),Me=U.length,D=y,j=0,re=c,W=0;W<Me;++W)ye=U[W],ye<128&&Re.push(M(ye));for(z=Z=Re.length,Z&&Re.push(x);z<Me;){for(Q=o,W=0;W<Me;++W)ye=U[W],ye>=D&&ye<Q&&(Q=ye);for(Pe=z+1,Q-D>A((o-j)/Pe)&&L("overflow"),j+=(Q-D)*Pe,D=Q,W=0;W<Me;++W)if(ye=U[W],ye<D&&++j>o&&L("overflow"),ye==D){for(se=j,ue=u;le=ue<=re?d:ue>=re+f?f:ue-re,!(se<le);ue+=u)Te=se-le,de=u-le,Re.push(M(G(le+Te%de,0))),se=A(Te/de);Re.push(M(G(se,0))),re=J(j,Pe,z==Z),j=0,++z}++j,++D}return Re.join("")}function V(U){return T(U,function(D){return E.test(D)?ae(D.slice(4).toLowerCase()):D})}function Y(U){return T(U,function(D){return S.test(D)?"xn--"+H(D):D})}if(l={version:"1.4.1",ucs2:{decode:k,encode:C},decode:ae,encode:H,toASCII:Y,toUnicode:V},n&&i)if(e.exports==n)i.exports=l;else for(O in l)l.hasOwnProperty(O)&&(n[O]=l[O]);else r.punycode=l})(eO)}(Wd,Wd.exports)),Wd.exports}var Bg,qb;function zh(){return qb||(qb=1,Bg=TypeError),Bg}const rO={},nO=Object.freeze(Object.defineProperty({__proto__:null,default:rO},Symbol.toStringTag,{value:"Module"})),iO=e9(nO);var zg,Hb;function _0(){if(Hb)return zg;Hb=1;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,n=e&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=i&&a&&typeof a.get=="function"?a.get:null,o=i&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,d=u?WeakMap.prototype.has:null,f=typeof WeakSet=="function"&&WeakSet.prototype,v=f?WeakSet.prototype.has:null,g=typeof WeakRef=="function"&&WeakRef.prototype,c=g?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,x=Object.prototype.toString,E=Function.prototype.toString,S=String.prototype.match,b=String.prototype.slice,w=String.prototype.replace,_=String.prototype.toUpperCase,A=String.prototype.toLowerCase,M=RegExp.prototype.test,O=Array.prototype.concat,L=Array.prototype.join,R=Array.prototype.slice,T=Math.floor,k=typeof BigInt=="function"?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,G=typeof Symbol=="function"&&typeof Symbol.iterator=="object",J=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===G||!0)?Symbol.toStringTag:null,ae=Object.prototype.propertyIsEnumerable,H=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function($e){return $e.__proto__}:null);function V($e,ze){if($e===1/0||$e===-1/0||$e!==$e||$e&&$e>-1e3&&$e<1e3||M.call(/e/,ze))return ze;var kt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof $e=="number"){var St=$e<0?-T(-$e):T($e);if(St!==$e){var er=String(St),jt=b.call(ze,er.length+1);return w.call(er,kt,"$&_")+"."+w.call(w.call(jt,/([0-9]{3})/g,"$&_"),/_$/,"")}}return w.call(ze,kt,"$&_")}var Y=iO,U=Y.custom,D=Pe(U)?U:null,j={__proto__:null,double:'"',single:"'"},z={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};zg=function $e(ze,kt,St,er){var jt=kt||{};if(Ae(jt,"quoteStyle")&&!Ae(j,jt.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ae(jt,"maxStringLength")&&(typeof jt.maxStringLength=="number"?jt.maxStringLength<0&&jt.maxStringLength!==1/0:jt.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var vr=Ae(jt,"customInspect")?jt.customInspect:!0;if(typeof vr!="boolean"&&vr!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ae(jt,"indent")&&jt.indent!==null&&jt.indent!==" "&&!(parseInt(jt.indent,10)===jt.indent&&jt.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ae(jt,"numericSeparator")&&typeof jt.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Xt=jt.numericSeparator;if(typeof ze>"u")return"undefined";if(ze===null)return"null";if(typeof ze=="boolean")return ze?"true":"false";if(typeof ze=="string")return pt(ze,jt);if(typeof ze=="number"){if(ze===0)return 1/0/ze>0?"0":"-0";var lr=String(ze);return Xt?V(ze,lr):lr}if(typeof ze=="bigint"){var Oi=String(ze)+"n";return Xt?V(ze,Oi):Oi}var Zn=typeof jt.depth>"u"?5:jt.depth;if(typeof St>"u"&&(St=0),St>=Zn&&Zn>0&&typeof ze=="object")return Q(ze)?"[Array]":"[Object]";var vi=cr(jt,St);if(typeof er>"u")er=[];else if(xe(er,ze)>=0)return"[Circular]";function mn(Ci,Xa,Ps){if(Xa&&(er=R.call(er),er.push(Xa)),Ps){var Ko={depth:jt.depth};return Ae(jt,"quoteStyle")&&(Ko.quoteStyle=jt.quoteStyle),$e(Ci,Ko,St+1,er)}return $e(Ci,jt,St+1,er)}if(typeof ze=="function"&&!ue(ze)){var Yt=_e(ze),sa=$t(ze,mn);return"[Function"+(Yt?": "+Yt:" (anonymous)")+"]"+(sa.length>0?" { "+L.call(sa,", ")+" }":"")}if(Pe(ze)){var Ra=G?w.call(String(ze),/^(Symbol\(.*\))_[^)]*$/,"$1"):q.call(ze);return typeof ze=="object"&&!G?bt(Ra):Ra}if(st(ze)){for(var Un="<"+A.call(String(ze.nodeName)),Ui=ze.attributes||[],Rr=0;Rr<Ui.length;Rr++)Un+=" "+Ui[Rr].name+"="+Z(re(Ui[Rr].value),"double",jt);return Un+=">",ze.childNodes&&ze.childNodes.length&&(Un+="..."),Un+="</"+A.call(String(ze.nodeName))+">",Un}if(Q(ze)){if(ze.length===0)return"[]";var yn=$t(ze,mn);return vi&&!wr(yn)?"["+Pt(yn,vi)+"]":"[ "+L.call(yn,", ")+" ]"}if(le(ze)){var An=$t(ze,mn);return!("cause"in Error.prototype)&&"cause"in ze&&!ae.call(ze,"cause")?"{ ["+String(ze)+"] "+L.call(O.call("[cause]: "+mn(ze.cause),An),", ")+" }":An.length===0?"["+String(ze)+"]":"{ ["+String(ze)+"] "+L.call(An,", ")+" }"}if(typeof ze=="object"&&vr){if(D&&typeof ze[D]=="function"&&Y)return Y(ze,{depth:Zn-St});if(vr!=="symbol"&&typeof ze.inspect=="function")return ze.inspect()}if(Le(ze)){var ba=[];return n&&n.call(ze,function(Ci,Xa){ba.push(mn(Xa,ze,!0)+" => "+mn(Ci,ze))}),vt("Map",r.call(ze),ba,vi)}if(je(ze)){var Mo=[];return o&&o.call(ze,function(Ci){Mo.push(mn(Ci,ze))}),vt("Set",l.call(ze),Mo,vi)}if(pe(ze))return ht("WeakMap");if(He(ze))return ht("WeakSet");if(Ce(ze))return ht("WeakRef");if(Re(ze))return bt(mn(Number(ze)));if(de(ze))return bt(mn(k.call(ze)));if(Me(ze))return bt(y.call(ze));if(ye(ze))return bt(mn(String(ze)));if(typeof window<"u"&&ze===window)return"{ [object Window] }";if(typeof globalThis<"u"&&ze===globalThis||typeof Ch<"u"&&ze===Ch)return"{ [object globalThis] }";if(!se(ze)&&!ue(ze)){var wa=$t(ze,mn),Ya=H?H(ze)===Object.prototype:ze instanceof Object||ze.constructor===Object,Qn=ze instanceof Object?"":"null prototype",_a=!Ya&&J&&Object(ze)===ze&&J in ze?b.call(be(ze),8,-1):Qn?"Object":"",xa=Ya||typeof ze.constructor!="function"?"":ze.constructor.name?ze.constructor.name+" ":"",Io=xa+(_a||Qn?"["+L.call(O.call([],_a||[],Qn||[]),": ")+"] ":"");return wa.length===0?Io+"{}":vi?Io+"{"+Pt(wa,vi)+"}":Io+"{ "+L.call(wa,", ")+" }"}return String(ze)};function Z($e,ze,kt){var St=kt.quoteStyle||ze,er=j[St];return er+$e+er}function re($e){return w.call(String($e),/"/g,"&quot;")}function W($e){return!J||!(typeof $e=="object"&&(J in $e||typeof $e[J]<"u"))}function Q($e){return be($e)==="[object Array]"&&W($e)}function se($e){return be($e)==="[object Date]"&&W($e)}function ue($e){return be($e)==="[object RegExp]"&&W($e)}function le($e){return be($e)==="[object Error]"&&W($e)}function ye($e){return be($e)==="[object String]"&&W($e)}function Re($e){return be($e)==="[object Number]"&&W($e)}function Me($e){return be($e)==="[object Boolean]"&&W($e)}function Pe($e){if(G)return $e&&typeof $e=="object"&&$e instanceof Symbol;if(typeof $e=="symbol")return!0;if(!$e||typeof $e!="object"||!q)return!1;try{return q.call($e),!0}catch{}return!1}function de($e){if(!$e||typeof $e!="object"||!k)return!1;try{return k.call($e),!0}catch{}return!1}var Te=Object.prototype.hasOwnProperty||function($e){return $e in this};function Ae($e,ze){return Te.call($e,ze)}function be($e){return x.call($e)}function _e($e){if($e.name)return $e.name;var ze=S.call(E.call($e),/^function\s*([\w$]+)/);return ze?ze[1]:null}function xe($e,ze){if($e.indexOf)return $e.indexOf(ze);for(var kt=0,St=$e.length;kt<St;kt++)if($e[kt]===ze)return kt;return-1}function Le($e){if(!r||!$e||typeof $e!="object")return!1;try{r.call($e);try{l.call($e)}catch{return!0}return $e instanceof Map}catch{}return!1}function pe($e){if(!d||!$e||typeof $e!="object")return!1;try{d.call($e,d);try{v.call($e,v)}catch{return!0}return $e instanceof WeakMap}catch{}return!1}function Ce($e){if(!c||!$e||typeof $e!="object")return!1;try{return c.call($e),!0}catch{}return!1}function je($e){if(!l||!$e||typeof $e!="object")return!1;try{l.call($e);try{r.call($e)}catch{return!0}return $e instanceof Set}catch{}return!1}function He($e){if(!v||!$e||typeof $e!="object")return!1;try{v.call($e,v);try{d.call($e,d)}catch{return!0}return $e instanceof WeakSet}catch{}return!1}function st($e){return!$e||typeof $e!="object"?!1:typeof HTMLElement<"u"&&$e instanceof HTMLElement?!0:typeof $e.nodeName=="string"&&typeof $e.getAttribute=="function"}function pt($e,ze){if($e.length>ze.maxStringLength){var kt=$e.length-ze.maxStringLength,St="... "+kt+" more character"+(kt>1?"s":"");return pt(b.call($e,0,ze.maxStringLength),ze)+St}var er=z[ze.quoteStyle||"single"];er.lastIndex=0;var jt=w.call(w.call($e,er,"\\$1"),/[\x00-\x1f]/g,ct);return Z(jt,"single",ze)}function ct($e){var ze=$e.charCodeAt(0),kt={8:"b",9:"t",10:"n",12:"f",13:"r"}[ze];return kt?"\\"+kt:"\\x"+(ze<16?"0":"")+_.call(ze.toString(16))}function bt($e){return"Object("+$e+")"}function ht($e){return $e+" { ? }"}function vt($e,ze,kt,St){var er=St?Pt(kt,St):L.call(kt,", ");return $e+" ("+ze+") {"+er+"}"}function wr($e){for(var ze=0;ze<$e.length;ze++)if(xe($e[ze],`
141
- `)>=0)return!1;return!0}function cr($e,ze){var kt;if($e.indent===" ")kt=" ";else if(typeof $e.indent=="number"&&$e.indent>0)kt=L.call(Array($e.indent+1)," ");else return null;return{base:kt,prev:L.call(Array(ze+1),kt)}}function Pt($e,ze){if($e.length===0)return"";var kt=`
142
- `+ze.prev+ze.base;return kt+L.call($e,","+kt)+`
143
- `+ze.prev}function $t($e,ze){var kt=Q($e),St=[];if(kt){St.length=$e.length;for(var er=0;er<$e.length;er++)St[er]=Ae($e,er)?ze($e[er],$e):""}var jt=typeof C=="function"?C($e):[],vr;if(G){vr={};for(var Xt=0;Xt<jt.length;Xt++)vr["$"+jt[Xt]]=jt[Xt]}for(var lr in $e)Ae($e,lr)&&(kt&&String(Number(lr))===lr&&lr<$e.length||G&&vr["$"+lr]instanceof Symbol||(M.call(/[^\w$]/,lr)?St.push(ze(lr,$e)+": "+ze($e[lr],$e)):St.push(lr+": "+ze($e[lr],$e))));if(typeof C=="function")for(var Oi=0;Oi<jt.length;Oi++)ae.call($e,jt[Oi])&&St.push("["+ze(jt[Oi])+"]: "+ze($e[jt[Oi]],$e));return St}return zg}var Ug,Vb;function aO(){if(Vb)return Ug;Vb=1;var e=_0(),t=zh(),r=function(o,u,d){for(var f=o,v;(v=f.next)!=null;f=v)if(v.key===u)return f.next=v.next,d||(v.next=o.next,o.next=v),v},n=function(o,u){if(o){var d=r(o,u);return d&&d.value}},i=function(o,u,d){var f=r(o,u);f?f.value=d:o.next={key:u,next:o.next,value:d}},a=function(o,u){return o?!!r(o,u):!1},l=function(o,u){if(o)return r(o,u,!0)};return Ug=function(){var u,d={assert:function(f){if(!d.has(f))throw new t("Side channel does not contain "+e(f))},delete:function(f){var v=u&&u.next,g=l(u,f);return g&&v&&v===g&&(u=void 0),!!g},get:function(f){return n(u,f)},has:function(f){return a(u,f)},set:function(f,v){u||(u={next:void 0}),i(u,f,v)}};return d},Ug}var qg,Gb;function K8(){return Gb||(Gb=1,qg=Object),qg}var Hg,$b;function oO(){return $b||($b=1,Hg=Error),Hg}var Vg,Wb;function sO(){return Wb||(Wb=1,Vg=EvalError),Vg}var Gg,Yb;function lO(){return Yb||(Yb=1,Gg=RangeError),Gg}var $g,Xb;function uO(){return Xb||(Xb=1,$g=ReferenceError),$g}var Wg,Kb;function cO(){return Kb||(Kb=1,Wg=SyntaxError),Wg}var Yg,Zb;function fO(){return Zb||(Zb=1,Yg=URIError),Yg}var Xg,Qb;function hO(){return Qb||(Qb=1,Xg=Math.abs),Xg}var Kg,Jb;function dO(){return Jb||(Jb=1,Kg=Math.floor),Kg}var Zg,e3;function pO(){return e3||(e3=1,Zg=Math.max),Zg}var Qg,t3;function gO(){return t3||(t3=1,Qg=Math.min),Qg}var Jg,r3;function vO(){return r3||(r3=1,Jg=Math.pow),Jg}var e2,n3;function mO(){return n3||(n3=1,e2=Math.round),e2}var t2,i3;function yO(){return i3||(i3=1,t2=Number.isNaN||function(t){return t!==t}),t2}var r2,a3;function bO(){if(a3)return r2;a3=1;var e=yO();return r2=function(r){return e(r)||r===0?r:r<0?-1:1},r2}var n2,o3;function wO(){return o3||(o3=1,n2=Object.getOwnPropertyDescriptor),n2}var i2,s3;function Z8(){if(s3)return i2;s3=1;var e=wO();if(e)try{e([],"length")}catch{e=null}return i2=e,i2}var a2,l3;function _O(){if(l3)return a2;l3=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return a2=e,a2}var o2,u3;function xO(){return u3||(u3=1,o2=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var a in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(t,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0}),o2}var s2,c3;function SO(){if(c3)return s2;c3=1;var e=typeof Symbol<"u"&&Symbol,t=xO();return s2=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},s2}var l2,f3;function Q8(){return f3||(f3=1,l2=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),l2}var u2,h3;function J8(){if(h3)return u2;h3=1;var e=K8();return u2=e.getPrototypeOf||null,u2}var c2,d3;function EO(){if(d3)return c2;d3=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(u,d){for(var f=[],v=0;v<u.length;v+=1)f[v]=u[v];for(var g=0;g<d.length;g+=1)f[g+u.length]=d[g];return f},a=function(u,d){for(var f=[],v=d,g=0;v<u.length;v+=1,g+=1)f[g]=u[v];return f},l=function(o,u){for(var d="",f=0;f<o.length;f+=1)d+=o[f],f+1<o.length&&(d+=u);return d};return c2=function(u){var d=this;if(typeof d!="function"||t.apply(d)!==n)throw new TypeError(e+d);for(var f=a(arguments,1),v,g=function(){if(this instanceof v){var S=d.apply(this,i(f,arguments));return Object(S)===S?S:this}return d.apply(u,i(f,arguments))},c=r(0,d.length-f.length),y=[],x=0;x<c;x++)y[x]="$"+x;if(v=Function("binder","return function ("+l(y,",")+"){ return binder.apply(this,arguments); }")(g),d.prototype){var E=function(){};E.prototype=d.prototype,v.prototype=new E,E.prototype=null}return v},c2}var f2,p3;function x0(){if(p3)return f2;p3=1;var e=EO();return f2=Function.prototype.bind||e,f2}var h2,g3;function Om(){return g3||(g3=1,h2=Function.prototype.call),h2}var d2,v3;function e_(){return v3||(v3=1,d2=Function.prototype.apply),d2}var p2,m3;function AO(){return m3||(m3=1,p2=typeof Reflect<"u"&&Reflect&&Reflect.apply),p2}var g2,y3;function PO(){if(y3)return g2;y3=1;var e=x0(),t=e_(),r=Om(),n=AO();return g2=n||e.call(r,t),g2}var v2,b3;function t_(){if(b3)return v2;b3=1;var e=x0(),t=zh(),r=Om(),n=PO();return v2=function(a){if(a.length<1||typeof a[0]!="function")throw new t("a function is required");return n(e,r,a)},v2}var m2,w3;function kO(){if(w3)return m2;w3=1;var e=t_(),t=Z8(),r;try{r=[].__proto__===Array.prototype}catch(l){if(!l||typeof l!="object"||!("code"in l)||l.code!=="ERR_PROTO_ACCESS")throw l}var n=!!r&&t&&t(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return m2=n&&typeof n.get=="function"?e([n.get]):typeof a=="function"?function(o){return a(o==null?o:i(o))}:!1,m2}var y2,_3;function OO(){if(_3)return y2;_3=1;var e=Q8(),t=J8(),r=kO();return y2=e?function(i){return e(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:r?function(i){return r(i)}:null,y2}var b2,x3;function CO(){if(x3)return b2;x3=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=x0();return b2=r.call(e,t),b2}var w2,S3;function Cm(){if(S3)return w2;S3=1;var e,t=K8(),r=oO(),n=sO(),i=lO(),a=uO(),l=cO(),o=zh(),u=fO(),d=hO(),f=dO(),v=pO(),g=gO(),c=vO(),y=mO(),x=bO(),E=Function,S=function(ue){try{return E('"use strict"; return ('+ue+").constructor;")()}catch{}},b=Z8(),w=_O(),_=function(){throw new o},A=b?function(){try{return arguments.callee,_}catch{try{return b(arguments,"callee").get}catch{return _}}}():_,M=SO()(),O=OO(),L=J8(),R=Q8(),T=e_(),k=Om(),C={},q=typeof Uint8Array>"u"||!O?e:O(Uint8Array),G={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":M&&O?O([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?e:Float16Array,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":E,"%GeneratorFunction%":C,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&O?O(O([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!O?e:O(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!O?e:O(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&O?O(""[Symbol.iterator]()):e,"%Symbol%":M?Symbol:e,"%SyntaxError%":l,"%ThrowTypeError%":A,"%TypedArray%":q,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":T,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":L,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":v,"%Math.min%":g,"%Math.pow%":c,"%Math.round%":y,"%Math.sign%":x,"%Reflect.getPrototypeOf%":R};if(O)try{null.error}catch(ue){var J=O(O(ue));G["%Error.prototype%"]=J}var ae=function ue(le){var ye;if(le==="%AsyncFunction%")ye=S("async function () {}");else if(le==="%GeneratorFunction%")ye=S("function* () {}");else if(le==="%AsyncGeneratorFunction%")ye=S("async function* () {}");else if(le==="%AsyncGenerator%"){var Re=ue("%AsyncGeneratorFunction%");Re&&(ye=Re.prototype)}else if(le==="%AsyncIteratorPrototype%"){var Me=ue("%AsyncGenerator%");Me&&O&&(ye=O(Me.prototype))}return G[le]=ye,ye},H={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},V=x0(),Y=CO(),U=V.call(k,Array.prototype.concat),D=V.call(T,Array.prototype.splice),j=V.call(k,String.prototype.replace),z=V.call(k,String.prototype.slice),Z=V.call(k,RegExp.prototype.exec),re=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,Q=function(le){var ye=z(le,0,1),Re=z(le,-1);if(ye==="%"&&Re!=="%")throw new l("invalid intrinsic syntax, expected closing `%`");if(Re==="%"&&ye!=="%")throw new l("invalid intrinsic syntax, expected opening `%`");var Me=[];return j(le,re,function(Pe,de,Te,Ae){Me[Me.length]=Te?j(Ae,W,"$1"):de||Pe}),Me},se=function(le,ye){var Re=le,Me;if(Y(H,Re)&&(Me=H[Re],Re="%"+Me[0]+"%"),Y(G,Re)){var Pe=G[Re];if(Pe===C&&(Pe=ae(Re)),typeof Pe>"u"&&!ye)throw new o("intrinsic "+le+" exists, but is not available. Please file an issue!");return{alias:Me,name:Re,value:Pe}}throw new l("intrinsic "+le+" does not exist!")};return w2=function(le,ye){if(typeof le!="string"||le.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ye!="boolean")throw new o('"allowMissing" argument must be a boolean');if(Z(/^%?[^%]*%?$/,le)===null)throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Re=Q(le),Me=Re.length>0?Re[0]:"",Pe=se("%"+Me+"%",ye),de=Pe.name,Te=Pe.value,Ae=!1,be=Pe.alias;be&&(Me=be[0],D(Re,U([0,1],be)));for(var _e=1,xe=!0;_e<Re.length;_e+=1){var Le=Re[_e],pe=z(Le,0,1),Ce=z(Le,-1);if((pe==='"'||pe==="'"||pe==="`"||Ce==='"'||Ce==="'"||Ce==="`")&&pe!==Ce)throw new l("property names with quotes must have matching quotes");if((Le==="constructor"||!xe)&&(Ae=!0),Me+="."+Le,de="%"+Me+"%",Y(G,de))Te=G[de];else if(Te!=null){if(!(Le in Te)){if(!ye)throw new o("base intrinsic for "+le+" exists, but the property is not available.");return}if(b&&_e+1>=Re.length){var je=b(Te,Le);xe=!!je,xe&&"get"in je&&!("originalValue"in je.get)?Te=je.get:Te=Te[Le]}else xe=Y(Te,Le),Te=Te[Le];xe&&!Ae&&(G[de]=Te)}}return Te},w2}var _2,E3;function r_(){if(E3)return _2;E3=1;var e=Cm(),t=t_(),r=t([e("%String.prototype.indexOf%")]);return _2=function(i,a){var l=e(i,!!a);return typeof l=="function"&&r(i,".prototype.")>-1?t([l]):l},_2}var x2,A3;function n_(){if(A3)return x2;A3=1;var e=Cm(),t=r_(),r=_0(),n=zh(),i=e("%Map%",!0),a=t("Map.prototype.get",!0),l=t("Map.prototype.set",!0),o=t("Map.prototype.has",!0),u=t("Map.prototype.delete",!0),d=t("Map.prototype.size",!0);return x2=!!i&&function(){var v,g={assert:function(c){if(!g.has(c))throw new n("Side channel does not contain "+r(c))},delete:function(c){if(v){var y=u(v,c);return d(v)===0&&(v=void 0),y}return!1},get:function(c){if(v)return a(v,c)},has:function(c){return v?o(v,c):!1},set:function(c,y){v||(v=new i),l(v,c,y)}};return g},x2}var S2,P3;function NO(){if(P3)return S2;P3=1;var e=Cm(),t=r_(),r=_0(),n=n_(),i=zh(),a=e("%WeakMap%",!0),l=t("WeakMap.prototype.get",!0),o=t("WeakMap.prototype.set",!0),u=t("WeakMap.prototype.has",!0),d=t("WeakMap.prototype.delete",!0);return S2=a?function(){var v,g,c={assert:function(y){if(!c.has(y))throw new i("Side channel does not contain "+r(y))},delete:function(y){if(a&&y&&(typeof y=="object"||typeof y=="function")){if(v)return d(v,y)}else if(n&&g)return g.delete(y);return!1},get:function(y){return a&&y&&(typeof y=="object"||typeof y=="function")&&v?l(v,y):g&&g.get(y)},has:function(y){return a&&y&&(typeof y=="object"||typeof y=="function")&&v?u(v,y):!!g&&g.has(y)},set:function(y,x){a&&y&&(typeof y=="object"||typeof y=="function")?(v||(v=new a),o(v,y,x)):n&&(g||(g=n()),g.set(y,x))}};return c}:n,S2}var E2,k3;function LO(){if(k3)return E2;k3=1;var e=zh(),t=_0(),r=aO(),n=n_(),i=NO(),a=i||n||r;return E2=function(){var o,u={assert:function(d){if(!u.has(d))throw new e("Side channel does not contain "+t(d))},delete:function(d){return!!o&&o.delete(d)},get:function(d){return o&&o.get(d)},has:function(d){return!!o&&o.has(d)},set:function(d,f){o||(o=a()),o.set(d,f)}};return u},E2}var A2,O3;function Nm(){if(O3)return A2;O3=1;var e=String.prototype.replace,t=/%20/g,r={RFC1738:"RFC1738",RFC3986:"RFC3986"};return A2={default:r.RFC3986,formatters:{RFC1738:function(n){return e.call(n,t,"+")},RFC3986:function(n){return String(n)}},RFC1738:r.RFC1738,RFC3986:r.RFC3986},A2}var P2,C3;function i_(){if(C3)return P2;C3=1;var e=Nm(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var E=[],S=0;S<256;++S)E.push("%"+((S<16?"0":"")+S.toString(16)).toUpperCase());return E}(),i=function(S){for(;S.length>1;){var b=S.pop(),w=b.obj[b.prop];if(r(w)){for(var _=[],A=0;A<w.length;++A)typeof w[A]<"u"&&_.push(w[A]);b.obj[b.prop]=_}}},a=function(S,b){for(var w=b&&b.plainObjects?{__proto__:null}:{},_=0;_<S.length;++_)typeof S[_]<"u"&&(w[_]=S[_]);return w},l=function E(S,b,w){if(!b)return S;if(typeof b!="object"&&typeof b!="function"){if(r(S))S.push(b);else if(S&&typeof S=="object")(w&&(w.plainObjects||w.allowPrototypes)||!t.call(Object.prototype,b))&&(S[b]=!0);else return[S,b];return S}if(!S||typeof S!="object")return[S].concat(b);var _=S;return r(S)&&!r(b)&&(_=a(S,w)),r(S)&&r(b)?(b.forEach(function(A,M){if(t.call(S,M)){var O=S[M];O&&typeof O=="object"&&A&&typeof A=="object"?S[M]=E(O,A,w):S.push(A)}else S[M]=A}),S):Object.keys(b).reduce(function(A,M){var O=b[M];return t.call(A,M)?A[M]=E(A[M],O,w):A[M]=O,A},_)},o=function(S,b){return Object.keys(b).reduce(function(w,_){return w[_]=b[_],w},S)},u=function(E,S,b){var w=E.replace(/\+/g," ");if(b==="iso-8859-1")return w.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(w)}catch{return w}},d=1024,f=function(S,b,w,_,A){if(S.length===0)return S;var M=S;if(typeof S=="symbol"?M=Symbol.prototype.toString.call(S):typeof S!="string"&&(M=String(S)),w==="iso-8859-1")return escape(M).replace(/%u[0-9a-f]{4}/gi,function(q){return"%26%23"+parseInt(q.slice(2),16)+"%3B"});for(var O="",L=0;L<M.length;L+=d){for(var R=M.length>=d?M.slice(L,L+d):M,T=[],k=0;k<R.length;++k){var C=R.charCodeAt(k);if(C===45||C===46||C===95||C===126||C>=48&&C<=57||C>=65&&C<=90||C>=97&&C<=122||A===e.RFC1738&&(C===40||C===41)){T[T.length]=R.charAt(k);continue}if(C<128){T[T.length]=n[C];continue}if(C<2048){T[T.length]=n[192|C>>6]+n[128|C&63];continue}if(C<55296||C>=57344){T[T.length]=n[224|C>>12]+n[128|C>>6&63]+n[128|C&63];continue}k+=1,C=65536+((C&1023)<<10|R.charCodeAt(k)&1023),T[T.length]=n[240|C>>18]+n[128|C>>12&63]+n[128|C>>6&63]+n[128|C&63]}O+=T.join("")}return O},v=function(S){for(var b=[{obj:{o:S},prop:"o"}],w=[],_=0;_<b.length;++_)for(var A=b[_],M=A.obj[A.prop],O=Object.keys(M),L=0;L<O.length;++L){var R=O[L],T=M[R];typeof T=="object"&&T!==null&&w.indexOf(T)===-1&&(b.push({obj:M,prop:R}),w.push(T))}return i(b),S},g=function(S){return Object.prototype.toString.call(S)==="[object RegExp]"},c=function(S){return!S||typeof S!="object"?!1:!!(S.constructor&&S.constructor.isBuffer&&S.constructor.isBuffer(S))},y=function(S,b){return[].concat(S,b)},x=function(S,b){if(r(S)){for(var w=[],_=0;_<S.length;_+=1)w.push(b(S[_]));return w}return b(S)};return P2={arrayToObject:a,assign:o,combine:y,compact:v,decode:u,encode:f,isBuffer:c,isRegExp:g,maybeMap:x,merge:l},P2}var k2,N3;function TO(){if(N3)return k2;N3=1;var e=LO(),t=i_(),r=Nm(),n=Object.prototype.hasOwnProperty,i={brackets:function(E){return E+"[]"},comma:"comma",indices:function(E,S){return E+"["+S+"]"},repeat:function(E){return E}},a=Array.isArray,l=Array.prototype.push,o=function(x,E){l.apply(x,a(E)?E:[E])},u=Date.prototype.toISOString,d=r.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:r.formatters[d],indices:!1,serializeDate:function(E){return u.call(E)},skipNulls:!1,strictNullHandling:!1},v=function(E){return typeof E=="string"||typeof E=="number"||typeof E=="boolean"||typeof E=="symbol"||typeof E=="bigint"},g={},c=function x(E,S,b,w,_,A,M,O,L,R,T,k,C,q,G,J,ae,H){for(var V=E,Y=H,U=0,D=!1;(Y=Y.get(g))!==void 0&&!D;){var j=Y.get(E);if(U+=1,typeof j<"u"){if(j===U)throw new RangeError("Cyclic object value");D=!0}typeof Y.get(g)>"u"&&(U=0)}if(typeof R=="function"?V=R(S,V):V instanceof Date?V=C(V):b==="comma"&&a(V)&&(V=t.maybeMap(V,function(de){return de instanceof Date?C(de):de})),V===null){if(A)return L&&!J?L(S,f.encoder,ae,"key",q):S;V=""}if(v(V)||t.isBuffer(V)){if(L){var z=J?S:L(S,f.encoder,ae,"key",q);return[G(z)+"="+G(L(V,f.encoder,ae,"value",q))]}return[G(S)+"="+G(String(V))]}var Z=[];if(typeof V>"u")return Z;var re;if(b==="comma"&&a(V))J&&L&&(V=t.maybeMap(V,L)),re=[{value:V.length>0?V.join(",")||null:void 0}];else if(a(R))re=R;else{var W=Object.keys(V);re=T?W.sort(T):W}var Q=O?String(S).replace(/\./g,"%2E"):String(S),se=w&&a(V)&&V.length===1?Q+"[]":Q;if(_&&a(V)&&V.length===0)return se+"[]";for(var ue=0;ue<re.length;++ue){var le=re[ue],ye=typeof le=="object"&&le&&typeof le.value<"u"?le.value:V[le];if(!(M&&ye===null)){var Re=k&&O?String(le).replace(/\./g,"%2E"):String(le),Me=a(V)?typeof b=="function"?b(se,Re):se:se+(k?"."+Re:"["+Re+"]");H.set(E,U);var Pe=e();Pe.set(g,H),o(Z,x(ye,Me,b,w,_,A,M,O,b==="comma"&&J&&a(V)?null:L,R,T,k,C,q,G,J,ae,Pe))}}return Z},y=function(E){if(!E)return f;if(typeof E.allowEmptyArrays<"u"&&typeof E.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof E.encodeDotInKeys<"u"&&typeof E.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(E.encoder!==null&&typeof E.encoder<"u"&&typeof E.encoder!="function")throw new TypeError("Encoder has to be a function.");var S=E.charset||f.charset;if(typeof E.charset<"u"&&E.charset!=="utf-8"&&E.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var b=r.default;if(typeof E.format<"u"){if(!n.call(r.formatters,E.format))throw new TypeError("Unknown format option provided.");b=E.format}var w=r.formatters[b],_=f.filter;(typeof E.filter=="function"||a(E.filter))&&(_=E.filter);var A;if(E.arrayFormat in i?A=E.arrayFormat:"indices"in E?A=E.indices?"indices":"repeat":A=f.arrayFormat,"commaRoundTrip"in E&&typeof E.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var M=typeof E.allowDots>"u"?E.encodeDotInKeys===!0?!0:f.allowDots:!!E.allowDots;return{addQueryPrefix:typeof E.addQueryPrefix=="boolean"?E.addQueryPrefix:f.addQueryPrefix,allowDots:M,allowEmptyArrays:typeof E.allowEmptyArrays=="boolean"?!!E.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:A,charset:S,charsetSentinel:typeof E.charsetSentinel=="boolean"?E.charsetSentinel:f.charsetSentinel,commaRoundTrip:!!E.commaRoundTrip,delimiter:typeof E.delimiter>"u"?f.delimiter:E.delimiter,encode:typeof E.encode=="boolean"?E.encode:f.encode,encodeDotInKeys:typeof E.encodeDotInKeys=="boolean"?E.encodeDotInKeys:f.encodeDotInKeys,encoder:typeof E.encoder=="function"?E.encoder:f.encoder,encodeValuesOnly:typeof E.encodeValuesOnly=="boolean"?E.encodeValuesOnly:f.encodeValuesOnly,filter:_,format:b,formatter:w,serializeDate:typeof E.serializeDate=="function"?E.serializeDate:f.serializeDate,skipNulls:typeof E.skipNulls=="boolean"?E.skipNulls:f.skipNulls,sort:typeof E.sort=="function"?E.sort:null,strictNullHandling:typeof E.strictNullHandling=="boolean"?E.strictNullHandling:f.strictNullHandling}};return k2=function(x,E){var S=x,b=y(E),w,_;typeof b.filter=="function"?(_=b.filter,S=_("",S)):a(b.filter)&&(_=b.filter,w=_);var A=[];if(typeof S!="object"||S===null)return"";var M=i[b.arrayFormat],O=M==="comma"&&b.commaRoundTrip;w||(w=Object.keys(S)),b.sort&&w.sort(b.sort);for(var L=e(),R=0;R<w.length;++R){var T=w[R],k=S[T];b.skipNulls&&k===null||o(A,c(k,T,M,O,b.allowEmptyArrays,b.strictNullHandling,b.skipNulls,b.encodeDotInKeys,b.encode?b.encoder:null,b.filter,b.sort,b.allowDots,b.serializeDate,b.format,b.formatter,b.encodeValuesOnly,b.charset,L))}var C=A.join(b.delimiter),q=b.addQueryPrefix===!0?"?":"";return b.charsetSentinel&&(b.charset==="iso-8859-1"?q+="utf8=%26%2310003%3B&":q+="utf8=%E2%9C%93&"),C.length>0?q+C:""},k2}var O2,L3;function RO(){if(L3)return O2;L3=1;var e=i_(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},i=function(g){return g.replace(/&#(\d+);/g,function(c,y){return String.fromCharCode(parseInt(y,10))})},a=function(g,c,y){if(g&&typeof g=="string"&&c.comma&&g.indexOf(",")>-1)return g.split(",");if(c.throwOnLimitExceeded&&y>=c.arrayLimit)throw new RangeError("Array limit exceeded. Only "+c.arrayLimit+" element"+(c.arrayLimit===1?"":"s")+" allowed in an array.");return g},l="utf8=%26%2310003%3B",o="utf8=%E2%9C%93",u=function(c,y){var x={__proto__:null},E=y.ignoreQueryPrefix?c.replace(/^\?/,""):c;E=E.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var S=y.parameterLimit===1/0?void 0:y.parameterLimit,b=E.split(y.delimiter,y.throwOnLimitExceeded?S+1:S);if(y.throwOnLimitExceeded&&b.length>S)throw new RangeError("Parameter limit exceeded. Only "+S+" parameter"+(S===1?"":"s")+" allowed.");var w=-1,_,A=y.charset;if(y.charsetSentinel)for(_=0;_<b.length;++_)b[_].indexOf("utf8=")===0&&(b[_]===o?A="utf-8":b[_]===l&&(A="iso-8859-1"),w=_,_=b.length);for(_=0;_<b.length;++_)if(_!==w){var M=b[_],O=M.indexOf("]="),L=O===-1?M.indexOf("="):O+1,R,T;L===-1?(R=y.decoder(M,n.decoder,A,"key"),T=y.strictNullHandling?null:""):(R=y.decoder(M.slice(0,L),n.decoder,A,"key"),T=e.maybeMap(a(M.slice(L+1),y,r(x[R])?x[R].length:0),function(C){return y.decoder(C,n.decoder,A,"value")})),T&&y.interpretNumericEntities&&A==="iso-8859-1"&&(T=i(String(T))),M.indexOf("[]=")>-1&&(T=r(T)?[T]:T);var k=t.call(x,R);k&&y.duplicates==="combine"?x[R]=e.combine(x[R],T):(!k||y.duplicates==="last")&&(x[R]=T)}return x},d=function(g,c,y,x){var E=0;if(g.length>0&&g[g.length-1]==="[]"){var S=g.slice(0,-1).join("");E=Array.isArray(c)&&c[S]?c[S].length:0}for(var b=x?c:a(c,y,E),w=g.length-1;w>=0;--w){var _,A=g[w];if(A==="[]"&&y.parseArrays)_=y.allowEmptyArrays&&(b===""||y.strictNullHandling&&b===null)?[]:e.combine([],b);else{_=y.plainObjects?{__proto__:null}:{};var M=A.charAt(0)==="["&&A.charAt(A.length-1)==="]"?A.slice(1,-1):A,O=y.decodeDotInKeys?M.replace(/%2E/g,"."):M,L=parseInt(O,10);!y.parseArrays&&O===""?_={0:b}:!isNaN(L)&&A!==O&&String(L)===O&&L>=0&&y.parseArrays&&L<=y.arrayLimit?(_=[],_[L]=b):O!=="__proto__"&&(_[O]=b)}b=_}return b},f=function(c,y,x,E){if(c){var S=x.allowDots?c.replace(/\.([^.[]+)/g,"[$1]"):c,b=/(\[[^[\]]*])/,w=/(\[[^[\]]*])/g,_=x.depth>0&&b.exec(S),A=_?S.slice(0,_.index):S,M=[];if(A){if(!x.plainObjects&&t.call(Object.prototype,A)&&!x.allowPrototypes)return;M.push(A)}for(var O=0;x.depth>0&&(_=w.exec(S))!==null&&O<x.depth;){if(O+=1,!x.plainObjects&&t.call(Object.prototype,_[1].slice(1,-1))&&!x.allowPrototypes)return;M.push(_[1])}if(_){if(x.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+x.depth+" and strictDepth is true");M.push("["+S.slice(_.index)+"]")}return d(M,y,x,E)}},v=function(c){if(!c)return n;if(typeof c.allowEmptyArrays<"u"&&typeof c.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof c.decodeDotInKeys<"u"&&typeof c.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(c.decoder!==null&&typeof c.decoder<"u"&&typeof c.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof c.charset<"u"&&c.charset!=="utf-8"&&c.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof c.throwOnLimitExceeded<"u"&&typeof c.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var y=typeof c.charset>"u"?n.charset:c.charset,x=typeof c.duplicates>"u"?n.duplicates:c.duplicates;if(x!=="combine"&&x!=="first"&&x!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var E=typeof c.allowDots>"u"?c.decodeDotInKeys===!0?!0:n.allowDots:!!c.allowDots;return{allowDots:E,allowEmptyArrays:typeof c.allowEmptyArrays=="boolean"?!!c.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof c.allowPrototypes=="boolean"?c.allowPrototypes:n.allowPrototypes,allowSparse:typeof c.allowSparse=="boolean"?c.allowSparse:n.allowSparse,arrayLimit:typeof c.arrayLimit=="number"?c.arrayLimit:n.arrayLimit,charset:y,charsetSentinel:typeof c.charsetSentinel=="boolean"?c.charsetSentinel:n.charsetSentinel,comma:typeof c.comma=="boolean"?c.comma:n.comma,decodeDotInKeys:typeof c.decodeDotInKeys=="boolean"?c.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof c.decoder=="function"?c.decoder:n.decoder,delimiter:typeof c.delimiter=="string"||e.isRegExp(c.delimiter)?c.delimiter:n.delimiter,depth:typeof c.depth=="number"||c.depth===!1?+c.depth:n.depth,duplicates:x,ignoreQueryPrefix:c.ignoreQueryPrefix===!0,interpretNumericEntities:typeof c.interpretNumericEntities=="boolean"?c.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof c.parameterLimit=="number"?c.parameterLimit:n.parameterLimit,parseArrays:c.parseArrays!==!1,plainObjects:typeof c.plainObjects=="boolean"?c.plainObjects:n.plainObjects,strictDepth:typeof c.strictDepth=="boolean"?!!c.strictDepth:n.strictDepth,strictNullHandling:typeof c.strictNullHandling=="boolean"?c.strictNullHandling:n.strictNullHandling,throwOnLimitExceeded:typeof c.throwOnLimitExceeded=="boolean"?c.throwOnLimitExceeded:!1}};return O2=function(g,c){var y=v(c);if(g===""||g===null||typeof g>"u")return y.plainObjects?{__proto__:null}:{};for(var x=typeof g=="string"?u(g,y):g,E=y.plainObjects?{__proto__:null}:{},S=Object.keys(x),b=0;b<S.length;++b){var w=S[b],_=f(w,x[w],y,typeof g=="string");E=e.merge(E,_,y)}return y.allowSparse===!0?E:e.compact(E)},O2}var C2,T3;function MO(){if(T3)return C2;T3=1;var e=TO(),t=RO(),r=Nm();return C2={formats:r,parse:t,stringify:e},C2}var R3;function a_(){if(R3)return Af;R3=1;var e=tO();function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,a=["<",">",'"',"`"," ","\r",`
144
- `," "],l=["{","}","|","\\","^","`"].concat(a),o=["'"].concat(l),u=["%","/","?",";","#"].concat(o),d=["/","?","#"],f=255,v=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,c={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},x={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},E=MO();function S(A,M,O){if(A&&typeof A=="object"&&A instanceof t)return A;var L=new t;return L.parse(A,M,O),L}t.prototype.parse=function(A,M,O){if(typeof A!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof A);var L=A.indexOf("?"),R=L!==-1&&L<A.indexOf("#")?"?":"#",T=A.split(R),k=/\\/g;T[0]=T[0].replace(k,"/"),A=T.join(R);var C=A;if(C=C.trim(),!O&&A.split("#").length===1){var q=i.exec(C);if(q)return this.path=C,this.href=C,this.pathname=q[1],q[2]?(this.search=q[2],M?this.query=E.parse(this.search.substr(1)):this.query=this.search.substr(1)):M&&(this.search="",this.query={}),this}var G=r.exec(C);if(G){G=G[0];var J=G.toLowerCase();this.protocol=J,C=C.substr(G.length)}if(O||G||C.match(/^\/\/[^@/]+@[^@/]+/)){var ae=C.substr(0,2)==="//";ae&&!(G&&y[G])&&(C=C.substr(2),this.slashes=!0)}if(!y[G]&&(ae||G&&!x[G])){for(var H=-1,V=0;V<d.length;V++){var Y=C.indexOf(d[V]);Y!==-1&&(H===-1||Y<H)&&(H=Y)}var U,D;H===-1?D=C.lastIndexOf("@"):D=C.lastIndexOf("@",H),D!==-1&&(U=C.slice(0,D),C=C.slice(D+1),this.auth=decodeURIComponent(U)),H=-1;for(var V=0;V<u.length;V++){var Y=C.indexOf(u[V]);Y!==-1&&(H===-1||Y<H)&&(H=Y)}H===-1&&(H=C.length),this.host=C.slice(0,H),C=C.slice(H),this.parseHost(),this.hostname=this.hostname||"";var j=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!j)for(var z=this.hostname.split(/\./),V=0,Z=z.length;V<Z;V++){var re=z[V];if(re&&!re.match(v)){for(var W="",Q=0,se=re.length;Q<se;Q++)re.charCodeAt(Q)>127?W+="x":W+=re[Q];if(!W.match(v)){var ue=z.slice(0,V),le=z.slice(V+1),ye=re.match(g);ye&&(ue.push(ye[1]),le.unshift(ye[2])),le.length&&(C="/"+le.join(".")+C),this.hostname=ue.join(".");break}}}this.hostname.length>f?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=e.toASCII(this.hostname));var Re=this.port?":"+this.port:"",Me=this.hostname||"";this.host=Me+Re,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),C[0]!=="/"&&(C="/"+C))}if(!c[J])for(var V=0,Z=o.length;V<Z;V++){var Pe=o[V];if(C.indexOf(Pe)!==-1){var de=encodeURIComponent(Pe);de===Pe&&(de=escape(Pe)),C=C.split(Pe).join(de)}}var Te=C.indexOf("#");Te!==-1&&(this.hash=C.substr(Te),C=C.slice(0,Te));var Ae=C.indexOf("?");if(Ae!==-1?(this.search=C.substr(Ae),this.query=C.substr(Ae+1),M&&(this.query=E.parse(this.query)),C=C.slice(0,Ae)):M&&(this.search="",this.query={}),C&&(this.pathname=C),x[J]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var Re=this.pathname||"",be=this.search||"";this.path=Re+be}return this.href=this.format(),this};function b(A){return typeof A=="string"&&(A=S(A)),A instanceof t?A.format():t.prototype.format.call(A)}t.prototype.format=function(){var A=this.auth||"";A&&(A=encodeURIComponent(A),A=A.replace(/%3A/i,":"),A+="@");var M=this.protocol||"",O=this.pathname||"",L=this.hash||"",R=!1,T="";this.host?R=A+this.host:this.hostname&&(R=A+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(R+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(T=E.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var k=this.search||T&&"?"+T||"";return M&&M.substr(-1)!==":"&&(M+=":"),this.slashes||(!M||x[M])&&R!==!1?(R="//"+(R||""),O&&O.charAt(0)!=="/"&&(O="/"+O)):R||(R=""),L&&L.charAt(0)!=="#"&&(L="#"+L),k&&k.charAt(0)!=="?"&&(k="?"+k),O=O.replace(/[?#]/g,function(C){return encodeURIComponent(C)}),k=k.replace("#","%23"),M+R+O+k+L};function w(A,M){return S(A,!1,!0).resolve(M)}t.prototype.resolve=function(A){return this.resolveObject(S(A,!1,!0)).format()};function _(A,M){return A?S(A,!1,!0).resolveObject(M):M}return t.prototype.resolveObject=function(A){if(typeof A=="string"){var M=new t;M.parse(A,!1,!0),A=M}for(var O=new t,L=Object.keys(this),R=0;R<L.length;R++){var T=L[R];O[T]=this[T]}if(O.hash=A.hash,A.href==="")return O.href=O.format(),O;if(A.slashes&&!A.protocol){for(var k=Object.keys(A),C=0;C<k.length;C++){var q=k[C];q!=="protocol"&&(O[q]=A[q])}return x[O.protocol]&&O.hostname&&!O.pathname&&(O.pathname="/",O.path=O.pathname),O.href=O.format(),O}if(A.protocol&&A.protocol!==O.protocol){if(!x[A.protocol]){for(var G=Object.keys(A),J=0;J<G.length;J++){var ae=G[J];O[ae]=A[ae]}return O.href=O.format(),O}if(O.protocol=A.protocol,!A.host&&!y[A.protocol]){for(var Z=(A.pathname||"").split("/");Z.length&&!(A.host=Z.shift()););A.host||(A.host=""),A.hostname||(A.hostname=""),Z[0]!==""&&Z.unshift(""),Z.length<2&&Z.unshift(""),O.pathname=Z.join("/")}else O.pathname=A.pathname;if(O.search=A.search,O.query=A.query,O.host=A.host||"",O.auth=A.auth,O.hostname=A.hostname||A.host,O.port=A.port,O.pathname||O.search){var H=O.pathname||"",V=O.search||"";O.path=H+V}return O.slashes=O.slashes||A.slashes,O.href=O.format(),O}var Y=O.pathname&&O.pathname.charAt(0)==="/",U=A.host||A.pathname&&A.pathname.charAt(0)==="/",D=U||Y||O.host&&A.pathname,j=D,z=O.pathname&&O.pathname.split("/")||[],Z=A.pathname&&A.pathname.split("/")||[],re=O.protocol&&!x[O.protocol];if(re&&(O.hostname="",O.port=null,O.host&&(z[0]===""?z[0]=O.host:z.unshift(O.host)),O.host="",A.protocol&&(A.hostname=null,A.port=null,A.host&&(Z[0]===""?Z[0]=A.host:Z.unshift(A.host)),A.host=null),D=D&&(Z[0]===""||z[0]==="")),U)O.host=A.host||A.host===""?A.host:O.host,O.hostname=A.hostname||A.hostname===""?A.hostname:O.hostname,O.search=A.search,O.query=A.query,z=Z;else if(Z.length)z||(z=[]),z.pop(),z=z.concat(Z),O.search=A.search,O.query=A.query;else if(A.search!=null){if(re){O.host=z.shift(),O.hostname=O.host;var W=O.host&&O.host.indexOf("@")>0?O.host.split("@"):!1;W&&(O.auth=W.shift(),O.hostname=W.shift(),O.host=O.hostname)}return O.search=A.search,O.query=A.query,(O.pathname!==null||O.search!==null)&&(O.path=(O.pathname?O.pathname:"")+(O.search?O.search:"")),O.href=O.format(),O}if(!z.length)return O.pathname=null,O.search?O.path="/"+O.search:O.path=null,O.href=O.format(),O;for(var Q=z.slice(-1)[0],se=(O.host||A.host||z.length>1)&&(Q==="."||Q==="..")||Q==="",ue=0,le=z.length;le>=0;le--)Q=z[le],Q==="."?z.splice(le,1):Q===".."?(z.splice(le,1),ue++):ue&&(z.splice(le,1),ue--);if(!D&&!j)for(;ue--;ue)z.unshift("..");D&&z[0]!==""&&(!z[0]||z[0].charAt(0)!=="/")&&z.unshift(""),se&&z.join("/").substr(-1)!=="/"&&z.push("");var ye=z[0]===""||z[0]&&z[0].charAt(0)==="/";if(re){O.hostname=ye?"":z.length?z.shift():"",O.host=O.hostname;var W=O.host&&O.host.indexOf("@")>0?O.host.split("@"):!1;W&&(O.auth=W.shift(),O.hostname=W.shift(),O.host=O.hostname)}return D=D||O.host&&z.length,D&&!ye&&z.unshift(""),z.length>0?O.pathname=z.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=A.auth||O.auth,O.slashes=O.slashes||A.slashes,O.href=O.format(),O},t.prototype.parseHost=function(){var A=this.host,M=n.exec(A);M&&(M=M[0],M!==":"&&(this.port=M.substr(1)),A=A.substr(0,A.length-M.length)),A&&(this.hostname=A)},Af.parse=S,Af.resolve=w,Af.resolveObject=_,Af.format=b,Af.Url=t,Af}var k1={exports:{}},IO=k1.exports,M3;function FO(){return M3||(M3=1,function(e){(function(t,r){e.exports?e.exports=r():t.xmlserializer=r()})(IO,function(){var t=function(c){return c.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")},r=function(c){return c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},n=function(c){return c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},i=function(c){var y=c.value;return" "+c.name+'="'+r(y)+'"'},a=function(c){var y=c.tagName;return c.namespaceURI==="http://www.w3.org/1999/xhtml"&&(y=y.toLowerCase()),y},l=function(c,y){var x=Array.prototype.map.call(c.attributes||c.attrs,function(E){return E.name}).indexOf("xmlns")>=0;return!x&&(y||c.namespaceURI!==c.parentNode.namespaceURI)?' xmlns="'+c.namespaceURI+'"':""},o=function(c){return Array.prototype.map.call(c.childNodes,function(y){return g(y)}).join("")},u=function(c,y){var x="<"+a(c);return x+=l(c,y),Array.prototype.forEach.call(c.attributes||c.attrs,function(E){x+=i(E)}),c.childNodes.length>0?(x+=">",x+=o(c),x+="</"+a(c)+">"):x+="/>",x},d=function(c){var y=c.nodeValue||c.value||"";return n(y)},f=function(c){return"<!--"+c.data.replace(/-/g,"&#45;")+"-->"},v=function(c){return"<![CDATA["+c.nodeValue+"]]>"},g=function(c,y){var x=y&&y.rootNode;if(c.nodeName==="#document"||c.nodeName==="#document-fragment")return o(c);if(c.tagName)return u(c,x);if(c.nodeName==="#text")return d(c);if(c.nodeName==="#comment")return f(c);if(c.nodeName==="#cdata-section")return v(c)};return{serializeToString:function(c){return t(g(c,{rootNode:!0}))}}})}(k1)),k1.exports}var N2={},I3;function jO(){if(I3)return N2;I3=1;var e=function(a){var l=new XMLSerializer;return Array.prototype.map.call(a.childNodes,function(o){return l.serializeToString(o)}).join("")},t=function(a){if(a.documentElement.tagName==="parsererror"&&a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml")return a.documentElement;if((a.documentElement.tagName==="xml"||a.documentElement.tagName==="html")&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0];if(a.documentElement.tagName==="html"&&a.documentElement.childNodes&&a.documentElement.childNodes.length>0&&a.documentElement.childNodes[0].nodeName==="body"&&a.documentElement.childNodes[0].childNodes&&a.documentElement.childNodes[0].childNodes.length&&a.documentElement.childNodes[0].childNodes[0].nodeName==="parsererror")return a.documentElement.childNodes[0].childNodes[0]},r=[new RegExp(`^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)
145
- ?</div>`),new RegExp(`^(.+)
146
- `)],n=function(a){var l=e(a),o,u;for(o=0;o<r.length;o++)if(u=r[o].exec(l),u)return u[1]},i=function(a){var l;if(a===null)throw new Error("Parse error");var o=t(a);if(o!==void 0)throw l=n(o)||"Parse error",new Error(l)};return N2.failOnParseError=function(a){return i(a),a},N2}var L2={},T2={},F3;function S0(){return F3||(F3=1,function(e){var t=a_();e.getDocumentBaseUrl=function(o){return o.baseURI!=="about:blank"?o.baseURI:null},e.clone=function(o){var u={},d;for(d in o)o.hasOwnProperty(d)&&(u[d]=o[d]);return u},e.cloneArray=function(o){return Array.prototype.slice.apply(o,[0])},e.joinUrl=function(o,u){return o?t.resolve(o,u):u},e.isDataUri=function(o){return/^data:/.test(o)},e.collectAndReportErrors=function(o){var u=[];return Promise.all(o.map(function(d){return d.catch(function(f){u.push(f)})})).then(function(){return u})};var r=null,n=function(o,u){return u===!1||u==="none"||u==="repeated"?((r===null||u!=="repeated")&&(r=Date.now()),o+"?_="+r):o};e.ajax=function(o,u){return new Promise(function(d,f){var v=new window.XMLHttpRequest,g=e.joinUrl(u.baseUrl,o),c,y=function(){f({msg:"Unable to load url",url:g})};c=n(g,u.cache),v.addEventListener("load",function(){v.status===200||v.status===0?d(v.response):y()},!1),v.addEventListener("error",y,!1);try{v.open("GET",c,!0),v.overrideMimeType(u.mimeType),v.send(null)}catch{y()}})},e.binaryAjax=function(o,u){var d=e.clone(u);return d.mimeType="text/plain; charset=x-user-defined",e.ajax(o,d).then(function(f){for(var v="",g=0;g<f.length;g++)v+=String.fromCharCode(f.charCodeAt(g)&255);return v})};var i=function(o){var u=function(d,f){return d.substring(0,f.length)===f};return u(o,"<?xml")||u(o,"<svg")?"image/svg+xml":"image/png"};e.getDataURIForImageURL=function(o,u){return e.binaryAjax(o,u).then(function(d){var f=btoa(d),v=i(d);return"data:"+v+";base64,"+f})};var a=[],l=function(o){return a.indexOf(o)<0&&a.push(o),a.indexOf(o)};e.memoize=function(o,u,d){if(typeof d!="object")throw new Error("cacheBucket is not an object");return function(){var f=Array.prototype.slice.call(arguments),v=u(f),g=l(o),c;return d[g]&&d[g][v]?d[g][v]:(c=o.apply(null,f),d[g]=d[g]||{},d[g][v]=c,c)}}}(T2)),T2}var R2={},j3;function DO(){if(j3)return R2;j3=1;var e=S0(),t=function(a,l){var o=null;a.hasAttribute("src")?o=a.getAttribute("src"):a.hasAttributeNS("http://www.w3.org/1999/xlink","href")?o=a.getAttributeNS("http://www.w3.org/1999/xlink","href"):a.hasAttribute("href")&&(o=a.getAttribute("href"));var u=e.getDocumentBaseUrl(a.ownerDocument),d=e.clone(l);return!d.baseUrl&&u&&(d.baseUrl=u),e.getDataURIForImageURL(o,d).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(l){var o=null;return l.hasAttribute("src")?o=l.getAttribute("src"):l.hasAttributeNS("http://www.w3.org/1999/xlink","href")?o=l.getAttributeNS("http://www.w3.org/1999/xlink","href"):l.hasAttribute("href")&&(o=l.getAttribute("href")),o!==null&&!e.isDataUri(o)})},n=function(a){return Array.prototype.filter.call(a,function(l){return l.type==="image"})},i=function(a){return Array.prototype.slice.call(a)};return R2.inline=function(a,l){var o=i(a.getElementsByTagName("img")),u=i(a.getElementsByTagName("image")),d=n(a.getElementsByTagName("input"));o=o.concat(u),o=o.concat(d);var f=r(o);return e.collectAndReportErrors(f.map(function(v){return t(v,l).then(function(g){v.attributes.src?v.attributes.src.value=g:v.attributes["xlink:href"]?v.attributes["xlink:href"].value=g:v.attributes.href&&(v.attributes.href.value=g)})}))},R2}var M2={},D3;function BO(){if(D3)return M2;D3=1;var e=S0(),t=function(a,l){var o=a.attributes.src.value,u=e.getDocumentBaseUrl(a.ownerDocument),d=e.clone(l);return!d.baseUrl&&u&&(d.baseUrl=u),e.ajax(o,d).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,l){a.attributes.removeNamedItem("src"),a.textContent=r(l)},i=function(a){var l=a.getElementsByTagName("script");return Array.prototype.filter.call(l,function(o){return!!o.attributes.src})};return M2.inline=function(a,l){var o=i(a);return e.collectAndReportErrors(o.map(function(u){return t(u,l).then(function(d){n(u,d)})}))},M2}var I2={},F2={},B3;function Lm(){return B3||(B3=1,function(e){e.unquoteString=function(t){var r=/^"(.*)"$/,n=/^'(.*)'$/;return r.test(t)?t.replace(r,"$1"):n.test(t)?t.replace(n,"$1"):t},e.rulesForCssText=function(t){var r=document.implementation.createHTMLDocument(""),n=document.createElement("style"),i;return n.textContent=t,r.body.appendChild(n),i=n.sheet.cssRules,Array.prototype.slice.call(i)},e.cssRulesToText=function(t){return t.reduce(function(r,n){return r+n.cssText},"")},e.exchangeRule=function(t,r,n){var i=t.indexOf(r);t[i]=e.rulesForCssText(n)[0]},e.changeFontFaceRuleSrc=function(t,r,n){var i="@font-face { font-family: "+r.style.getPropertyValue("font-family")+"; ";r.style.getPropertyValue("font-style")&&(i+="font-style: "+r.style.getPropertyValue("font-style")+"; "),r.style.getPropertyValue("font-weight")&&(i+="font-weight: "+r.style.getPropertyValue("font-weight")+"; "),r.style.getPropertyValue("unicode-range")&&(i+="unicode-range: "+r.style.getPropertyValue("unicode-range")+"; "),i+="src: "+n+"}",e.exchangeRule(t,r,i)}}(F2)),F2}var j2={},z3;function zO(){return z3||(z3=1,function(e){var t=Lm(),r=function(a){var l=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return a.replace(l,"$1")};e.extractCssUrl=function(a){var l=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/,o;if(!l.test(a))throw new Error("Invalid url");return o=l.exec(a)[1],t.unquoteString(r(o))};var n=function(a){var l=`\\s*(?:"[^"]*"|'[^']*'|[^\\(]+)\\s*`,o="(url\\("+l+"\\)|[^,\\s]+)",u="(?:\\s*"+o+")+",d="^\\s*("+u+")(?:\\s*,\\s*("+u+"))*\\s*$",f=new RegExp(u,"g"),v,g=[],c=function(y){var x=new RegExp(o,"g"),E=[],S;for(S=x.exec(y);S;)E.push(S[1]),S=x.exec(y);return E};if(a.match(new RegExp(d))){for(v=f.exec(a);v;)g.push(c(v[0])),v=f.exec(a);return g}return[]},i=function(a){var l,o;for(l=0;l<a.length;l++)try{return o=e.extractCssUrl(a[l]),{url:o,idx:l}}catch{}};e.parse=function(a){var l=n(a);return l.map(function(o){var u=i(o);return u?{preUrl:o.slice(0,u.idx),url:u.url,postUrl:o.slice(u.idx+1)}:{preUrl:o}})},e.serialize=function(a){var l=a.map(function(o){var u=[].concat(o.preUrl);return o.url&&u.push('url("'+o.url+'")'),o.postUrl&&(u=u.concat(o.postUrl)),u.join(" ")});return l.join(", ")}}(j2)),j2}function l1(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var D2={exports:{}},U3;function UO(){return U3||(U3=1,function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,a){function l(d,f){if(!i[d]){if(!n[d]){var v=typeof l1=="function"&&l1;if(!f&&v)return v(d,!0);if(o)return o(d,!0);var g=new Error("Cannot find module '"+d+"'");throw g.code="MODULE_NOT_FOUND",g}var c=i[d]={exports:{}};n[d][0].call(c.exports,function(y){var x=n[d][1][y];return l(x||y)},c,c.exports,r,n,i,a)}return i[d].exports}for(var o=typeof l1=="function"&&l1,u=0;u<a.length;u++)l(a[u]);return l}({1:[function(r,n,i){function a(u,d){function f(){this.constructor=u}f.prototype=d.prototype,u.prototype=new f}function l(u,d,f,v){this.message=u,this.expected=d,this.found=f,this.location=v,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,l)}a(l,Error),l.buildMessage=function(u,d){var f={literal:function(S){return'"'+g(S.text)+'"'},class:function(S){var b="",w;for(w=0;w<S.parts.length;w++)b+=S.parts[w]instanceof Array?c(S.parts[w][0])+"-"+c(S.parts[w][1]):c(S.parts[w]);return"["+(S.inverted?"^":"")+b+"]"},any:function(S){return"any character"},end:function(S){return"end of input"},other:function(S){return S.description}};function v(S){return S.charCodeAt(0).toString(16).toUpperCase()}function g(S){return S.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(b){return"\\x0"+v(b)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(b){return"\\x"+v(b)})}function c(S){return S.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(b){return"\\x0"+v(b)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(b){return"\\x"+v(b)})}function y(S){return f[S.type](S)}function x(S){var b=new Array(S.length),w,_;for(w=0;w<S.length;w++)b[w]=y(S[w]);if(b.sort(),b.length>0){for(w=1,_=1;w<b.length;w++)b[w-1]!==b[w]&&(b[_]=b[w],_++);b.length=_}switch(b.length){case 1:return b[0];case 2:return b[0]+" or "+b[1];default:return b.slice(0,-1).join(", ")+", or "+b[b.length-1]}}function E(S){return S?'"'+g(S)+'"':"end of input"}return"Expected "+x(u)+" but "+E(d)+" found."};function o(u,d){d=d!==void 0?d:{};var f={},v={start:Re},g=Re,c="",y=function(){return[]},x=",",E=re(",",!1),S=function(pe,Ce){return[pe].concat(Ce)},b=function(pe){return[pe]},w=function(pe,Ce){return{url:pe,format:Ce}},_=function(pe){return{url:pe}},A="url(",M=re("url(",!1),O=")",L=re(")",!1),R=function(pe){return pe},T="format(",k=re("format(",!1),C="local(",q=re("local(",!1),G=function(pe){return{local:pe}},J=/^[^)]/,ae=W([")"],!0,!1),H=function(pe){return Le.extractValue(pe.join(""))},V=/^[ \t\r\n\f]/,Y=W([" "," ","\r",`
147
- `,"\f"],!1,!1),U=0,D=[{line:1,column:1}],j=0,z=[],Z;if("startRule"in d){if(!(d.startRule in v))throw new Error(`Can't start parsing from rule "`+d.startRule+'".');g=v[d.startRule]}function re(pe,Ce){return{type:"literal",text:pe,ignoreCase:Ce}}function W(pe,Ce,je){return{type:"class",parts:pe,inverted:Ce,ignoreCase:je}}function Q(){return{type:"end"}}function se(pe){var Ce=D[pe],je;if(Ce)return Ce;for(je=pe-1;!D[je];)je--;for(Ce=D[je],Ce={line:Ce.line,column:Ce.column};je<pe;)u.charCodeAt(je)===10?(Ce.line++,Ce.column=1):Ce.column++,je++;return D[pe]=Ce,Ce}function ue(pe,Ce){var je=se(pe),He=se(Ce);return{start:{offset:pe,line:je.line,column:je.column},end:{offset:Ce,line:He.line,column:He.column}}}function le(pe){U<j||(U>j&&(j=U,z=[]),z.push(pe))}function ye(pe,Ce,je){return new l(l.buildMessage(pe,Ce),pe,Ce,je)}function Re(){var pe,Ce;return pe=Me(),pe===f&&(pe=U,Ce=c,Ce!==f&&(Ce=y()),pe=Ce),pe}function Me(){var pe,Ce,je,He,st,pt;if(pe=U,Ce=Pe(),Ce!==f){for(je=[],He=xe();He!==f;)je.push(He),He=xe();if(je!==f)if(u.charCodeAt(U)===44?(He=x,U++):(He=f,le(E)),He!==f){for(st=[],pt=xe();pt!==f;)st.push(pt),pt=xe();st!==f?(pt=Me(),pt!==f?(Ce=S(Ce,pt),pe=Ce):(U=pe,pe=f)):(U=pe,pe=f)}else U=pe,pe=f;else U=pe,pe=f}else U=pe,pe=f;return pe===f&&(pe=U,Ce=Pe(),Ce!==f&&(Ce=b(Ce)),pe=Ce),pe}function Pe(){var pe;return pe=de(),pe===f&&(pe=be()),pe}function de(){var pe,Ce,je,He;if(pe=U,Ce=Te(),Ce!==f){if(je=[],He=xe(),He!==f)for(;He!==f;)je.push(He),He=xe();else je=f;je!==f?(He=Ae(),He!==f?(Ce=w(Ce,He),pe=Ce):(U=pe,pe=f)):(U=pe,pe=f)}else U=pe,pe=f;return pe===f&&(pe=U,Ce=Te(),Ce!==f&&(Ce=_(Ce)),pe=Ce),pe}function Te(){var pe,Ce,je,He;return pe=U,u.substr(U,4)===A?(Ce=A,U+=4):(Ce=f,le(M)),Ce!==f?(je=_e(),je!==f?(u.charCodeAt(U)===41?(He=O,U++):(He=f,le(L)),He!==f?(Ce=R(je),pe=Ce):(U=pe,pe=f)):(U=pe,pe=f)):(U=pe,pe=f),pe}function Ae(){var pe,Ce,je,He;return pe=U,u.substr(U,7)===T?(Ce=T,U+=7):(Ce=f,le(k)),Ce!==f?(je=_e(),je!==f?(u.charCodeAt(U)===41?(He=O,U++):(He=f,le(L)),He!==f?(Ce=R(je),pe=Ce):(U=pe,pe=f)):(U=pe,pe=f)):(U=pe,pe=f),pe}function be(){var pe,Ce,je,He;return pe=U,u.substr(U,6)===C?(Ce=C,U+=6):(Ce=f,le(q)),Ce!==f?(je=_e(),je!==f?(u.charCodeAt(U)===41?(He=O,U++):(He=f,le(L)),He!==f?(Ce=G(je),pe=Ce):(U=pe,pe=f)):(U=pe,pe=f)):(U=pe,pe=f),pe}function _e(){var pe,Ce,je;if(pe=U,Ce=[],J.test(u.charAt(U))?(je=u.charAt(U),U++):(je=f,le(ae)),je!==f)for(;je!==f;)Ce.push(je),J.test(u.charAt(U))?(je=u.charAt(U),U++):(je=f,le(ae));else Ce=f;return Ce!==f&&(Ce=H(Ce)),pe=Ce,pe}function xe(){var pe;return V.test(u.charAt(U))?(pe=u.charAt(U),U++):(pe=f,le(Y)),pe}var Le=r("../util");if(Z=g(),Z!==f&&U===u.length)return Z;throw Z!==f&&U<u.length&&le(Q()),ye(z,j<u.length?u.charAt(j):null,j<u.length?ue(j,j+1):ue(j,j))}n.exports={SyntaxError:l,parse:o}},{"../util":3}],2:[function(r,n,i){var a=r("./grammar");i.SyntaxError=function(l,o){this.message=l,this.offset=o},i.parse=function(l){try{return a.parse(l)}catch(o){throw new i.SyntaxError(o.message,o.offset)}},i.serialize=function(l){return l.map(function(o){var u;return o.url?(u='url("'+o.url+'")',o.format&&(u+=' format("'+o.format+'")')):u='local("'+o.local+'")',u}).join(", ")}},{"./grammar":1}],3:[function(r,n,i){var a=function(o){var u=/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/;return o.replace(u,"$1")},l=function(o){var u=/^"(.*)"$/,d=/^'(.*)'$/;return u.test(o)?o.replace(u,"$1"):d.test(o)?o.replace(d,"$1"):o};i.extractValue=function(o){return l(a(o))}},{}]},{},[2])(2)})}(D2)),D2.exports}var q3;function qO(){return q3||(q3=1,function(e){var t=S0(),r=Lm(),n=zO(),i=UO(),a=function(b,w,_){b.style.setProperty(w,_,b.style.getPropertyPriority(w))},l=function(b){return b.filter(function(w){return w.type===window.CSSRule.STYLE_RULE&&(w.style.getPropertyValue("background-image")||w.style.getPropertyValue("background"))})},o=function(b){var w=[];return b.forEach(function(_){_.style.getPropertyValue("background-image")?w.push({property:"background-image",value:_.style.getPropertyValue("background-image"),rule:_}):_.style.getPropertyValue("background")&&w.push({property:"background",value:_.style.getPropertyValue("background"),rule:_})}),w},u=function(b){return b.filter(function(w){return w.type===window.CSSRule.FONT_FACE_RULE&&w.style.getPropertyValue("src")})},d=function(b){return b.filter(function(w){return w.type===window.CSSRule.IMPORT_RULE&&w.href})},f=function(b){var w=[];return b.forEach(function(_,A){_.url&&!t.isDataUri(_.url)&&w.push(A)}),w},v=function(b){var w=[];return b.forEach(function(_,A){_.url&&!t.isDataUri(_.url)&&w.push(A)}),w};e.adjustPathsOfCssResources=function(b,w){var _=l(w),A=o(_),M=!1;return A.forEach(function(O){var L=n.parse(O.value),R=f(L),T;R.length>0&&(R.forEach(function(k){var C=L[k].url,q=t.joinUrl(b,C);L[k].url=q}),T=n.serialize(L),a(O.rule,O.property,T),M=!0)}),u(w).forEach(function(O){var L=O.style.getPropertyValue("src"),R,T;try{R=i.parse(L)}catch{return}T=v(R),T.length>0&&(T.forEach(function(k){var C=R[k].url,q=t.joinUrl(b,C);R[k].url=q}),r.changeFontFaceRuleSrc(w,O,i.serialize(R)),M=!0)}),d(w).forEach(function(O){var L=O.href,R=t.joinUrl(b,L);r.exchangeRule(w,O,"@import url("+R+");"),M=!0}),M};var g=function(b,w,_){var A=b.indexOf(w);b.splice(A,1),_.forEach(function(M,O){b.splice(A+O,0,M)})},c=function(b,w,_,A){var M=w.href,O;return M=r.unquoteString(M),O=t.joinUrl(A.baseUrl,M),_.indexOf(O)>=0?(g(b,w,[]),Promise.resolve([])):(_.push(O),t.ajax(M,A).then(function(L){var R=r.rulesForCssText(L);return e.loadCSSImportsForRules(R,_,A).then(function(T){return e.adjustPathsOfCssResources(M,R),g(b,w,R),T.errors})},function(L){throw{resourceType:"stylesheet",url:L.url,msg:"Unable to load stylesheet "+L.url}}))};e.loadCSSImportsForRules=function(b,w,_){var A=d(b),M=[],O=!1;return Promise.all(A.map(function(L){return c(b,L,w,_).then(function(R){M=M.concat(R),O=!0},function(R){M.push(R)})})).then(function(){return{hasChanges:O,errors:M}})};var y=function(b,w){var _=n.parse(b),A=f(_),M=!1;return t.collectAndReportErrors(A.map(function(O){var L=_[O].url;return t.getDataURIForImageURL(L,w).then(function(R){_[O].url=R,M=!0},function(R){throw{resourceType:"backgroundImage",url:R.url,msg:"Unable to load background-image "+R.url}})})).then(function(O){return{backgroundValue:n.serialize(_),hasChanges:M,errors:O}})},x=function(b,w){var _=l(b),A=o(_),M=[],O=!1;return Promise.all(A.map(function(L){return y(L.value,w).then(function(R){R.hasChanges&&(a(L.rule,L.property,R.backgroundValue),O=!0),M=M.concat(R.errors)})})).then(function(){return{hasChanges:O,errors:M}})},E=function(b,w){var _=!1,A,M;try{A=i.parse(b)}catch{A=[]}return M=v(A),t.collectAndReportErrors(M.map(function(O){var L=A[O],R=L.format||"woff";return t.binaryAjax(L.url,w).then(function(T){var k=btoa(T);L.url="data:font/"+R+";base64,"+k,_=!0},function(T){throw{resourceType:"fontFace",url:T.url,msg:"Unable to load font-face "+T.url}})})).then(function(O){return{srcDeclarationValue:i.serialize(A),hasChanges:_,errors:O}})},S=function(b,w){var _=u(b),A=[],M=!1;return Promise.all(_.map(function(O){var L=O.style.getPropertyValue("src");return E(L,w).then(function(R){R.hasChanges&&(r.changeFontFaceRuleSrc(b,O,R.srcDeclarationValue),M=!0),A=A.concat(R.errors)})})).then(function(){return{hasChanges:M,errors:A}})};e.loadAndInlineCSSResourcesForRules=function(b,w){var _=!1,A=[];return Promise.all([x,S].map(function(M){return M(b,w).then(function(O){_=_||O.hasChanges,A=A.concat(O.errors)})})).then(function(){return{hasChanges:_,errors:A}})}}(I2)),I2}var H3;function HO(){return H3||(H3=1,function(e){var t=S0(),r=DO(),n=BO(),i=qO(),a=Lm(),l=function(E){return t.joinUrl(E,".")},o=function(E){var S=E.map(function(b,w){return w===E.length-1&&(b={baseUrl:l(b.baseUrl)}),JSON.stringify(b)});return S},u=function(E,S){return S.cache!==!1&&S.cache!=="none"&&S.cacheBucket?t.memoize(E,o,S.cacheBucket):E},d=function(E,S,b){var w=a.rulesForCssText(E);return i.loadCSSImportsForRules(w,S,b).then(function(_){return i.loadAndInlineCSSResourcesForRules(w,b).then(function(A){var M=_.errors.concat(A.errors),O=_.hasChanges||A.hasChanges;return O&&(E=a.cssRulesToText(w)),{hasChanges:O,content:E,errors:M}})})},f=function(E,S,b){var w=E.textContent,_=u(d,S);return _(w,b,S).then(function(A){return A.hasChanges&&(E.childNodes[0].nodeValue=A.content),t.cloneArray(A.errors)})},v=function(E){var S=E.getElementsByTagName("style");return Array.prototype.filter.call(S,function(b){return!b.attributes.type||b.attributes.type.value==="text/css"})};e.loadAndInlineStyles=function(E,S){var b=v(E),w=[],_=[],A;return A=t.clone(S),A.baseUrl=A.baseUrl||t.getDocumentBaseUrl(E),Promise.all(b.map(function(M){return f(M,A,_).then(function(O){w=w.concat(O)})})).then(function(){return w})};var g=function(E,S){var b=E.parentNode,w;S=S.trim(),S&&(w=E.ownerDocument.createElement("style"),w.type="text/css",w.appendChild(E.ownerDocument.createTextNode(S)),b.insertBefore(w,E)),b.removeChild(E)},c=function(E,S){return t.ajax(E,S).then(function(b){var w=a.rulesForCssText(b);return{content:b,cssRules:w}}).then(function(b){var w=i.adjustPathsOfCssResources(E,b.cssRules);return{content:b.content,cssRules:b.cssRules,hasChanges:w}}).then(function(b){return i.loadCSSImportsForRules(b.cssRules,[],S).then(function(w){return{content:b.content,cssRules:b.cssRules,hasChanges:b.hasChanges||w.hasChanges,errors:w.errors}})}).then(function(b){return i.loadAndInlineCSSResourcesForRules(b.cssRules,S).then(function(w){return{content:b.content,cssRules:b.cssRules,hasChanges:b.hasChanges||w.hasChanges,errors:b.errors.concat(w.errors)}})}).then(function(b){var w=b.content;return b.hasChanges&&(w=a.cssRulesToText(b.cssRules)),{content:w,errors:b.errors}})},y=function(E,S){var b=E.attributes.href.value,w=t.getDocumentBaseUrl(E.ownerDocument),_=t.clone(S);!_.baseUrl&&w&&(_.baseUrl=w);var A=u(c,S);return A(b,_).then(function(M){return{content:M.content,errors:t.cloneArray(M.errors)}})},x=function(E){var S=E.getElementsByTagName("link");return Array.prototype.filter.call(S,function(b){return b.attributes.rel&&b.attributes.rel.value==="stylesheet"&&(!b.attributes.type||b.attributes.type.value==="text/css")})};e.loadAndInlineCssLinks=function(E,S){var b=x(E),w=[];return Promise.all(b.map(function(_){return y(_,S).then(function(A){g(_,A.content+`
148
- `),w=w.concat(A.errors)},function(A){w.push({resourceType:"stylesheet",url:A.url,msg:"Unable to load stylesheet "+A.url})})})).then(function(){return w})},e.loadAndInlineImages=r.inline,e.loadAndInlineScript=n.inline,e.inlineReferences=function(E,S){var b=[],w=[e.loadAndInlineImages,e.loadAndInlineStyles,e.loadAndInlineCssLinks];return S.inlineScripts!==!1&&w.push(e.loadAndInlineScript),Promise.all(w.map(function(_){return _(E,S).then(function(A){b=b.concat(A)})})).then(function(){return b})}}(L2)),L2}/*! rasterizeHTML.js - v1.3.1 - 2022-01-16
149
- * http://www.github.com/cburgmer/rasterizeHTML.js
150
- * Copyright (c) 2022 Christoph Burgmer; Licensed MIT */var VO=P1.exports,V3;function GO(){return V3||(V3=1,function(e){(function(t,r){t===void 0&&window!==void 0&&(t=window),e.exports?e.exports=r(a_(),FO(),jO(),HO()):t.rasterizeHTML=r(t.url,t.xmlserializer,t.sanedomparsererror,t.inlineresources)})(VO,function(t,r,n,i){var a=function(y){var x={},E=[];x.joinUrl=function(w,_){return w?y.resolve(w,_):_},x.getConstantUniqueIdFor=function(w){return E.indexOf(w)<0&&E.push(w),E.indexOf(w)},x.clone=function(w){var _={},A;for(A in w)w.hasOwnProperty(A)&&(_[A]=w[A]);return _};var S=function(w){return typeof w=="object"&&w!==null},b=function(w){return S(w)&&Object.prototype.toString.apply(w).match(/\[object (Canvas|HTMLCanvasElement)\]/i)};return x.parseOptionalParameters=function(w){var _={canvas:null,options:{}};return w[0]==null||b(w[0])?(_.canvas=w[0]||null,_.options=x.clone(w[1])):_.options=x.clone(w[0]),_},x}(t),l=function(y){var x={},E=function(S,b,w){var _=S[b];return S[b]=function(){var A=Array.prototype.slice.call(arguments);return w.apply(this,[A,_])},_};return x.baseUrlRespectingXhr=function(S,b){var w=function(){var _=new S;return E(_,"open",function(A,M){var O=A.shift(),L=A.shift(),R=y.joinUrl(b,L);return M.apply(this,[O,R].concat(A))}),_};return w},x.finishNotifyingXhr=function(S){var b=0,w=0,_=!1,A,M=new Promise(function(L){A=function(){var R=b-w;R<=0&&_&&L({totalCount:b})}}),O=function(){var L=new S;return E(L,"send",function(R,T){return b+=1,T.apply(this,arguments)}),L.addEventListener("load",function(){w+=1,A()}),L};return O.waitForRequestsToFinish=function(){return _=!0,A(),M},O},x}(a),o=function(){var y={},x=function(O){return Array.prototype.slice.call(O)};y.addClassName=function(O,L){O.className+=" "+L},y.addClassNameRecursively=function(O,L){y.addClassName(O,L),O.parentNode!==O.ownerDocument&&y.addClassNameRecursively(O.parentNode,L)};var E=function(O,L){var R=O.parentStyleSheet,T=x(R.cssRules).indexOf(O);R.insertRule(L,T+1),R.deleteRule(T)},S=function(O,L){var R=O.cssText.replace(/^[^\{]+/,""),T=L+" "+R;E(O,T)},b=function(O){return x(O).reduce(function(L,R){return L+R.cssText},"")},w=function(O){O.textContent=b(O.sheet.cssRules)},_=function(O){var L=document.implementation.createHTMLDocument(""),R=document.createElement("style");R.textContent=O.textContent,L.body.appendChild(R),O.sheet=R.sheet},A=function(O){return"((?:^|[^.#:\\w])|(?=\\W))("+O.join("|")+")(?=\\W|$)"},M=function(O,L,R){var T=A(L);x(O.querySelectorAll("style")).forEach(function(k){typeof k.sheet>"u"&&_(k);var C=x(k.sheet.cssRules).filter(function(q){return q.selectorText&&new RegExp(T,"i").test(q.selectorText)});C.length&&(C.forEach(function(q){var G=q.selectorText.replace(new RegExp(T,"gi"),function(J,ae,H){return ae+R(H)});G!==q.selectorText&&S(q,G)}),w(k))})};return y.rewriteCssSelectorWith=function(O,L,R){M(O,[L],function(){return R})},y.lowercaseCssTypeSelectors=function(O,L){M(O,L,function(R){return R.toLowerCase()})},y.findHtmlOnlyNodeNames=function(O){var L=O.ownerDocument.createTreeWalker(O,NodeFilter.SHOW_ELEMENT),R={},T={},k;do k=L.currentNode.tagName.toLowerCase(),L.currentNode.namespaceURI==="http://www.w3.org/1999/xhtml"?R[k]=!0:T[k]=!0;while(L.nextNode());return Object.keys(R).filter(function(C){return!T[C]})},y}(),u=function(y){var x={},E=function(b){return Array.prototype.slice.call(b)},S={active:!0,hover:!0,focus:!1,target:!1};return x.fakeUserAction=function(b,w,_){var A=b.querySelector(w),M=":"+_,O="rasterizehtml"+_;A&&(S[_]?y.addClassNameRecursively(A,O):y.addClassName(A,O),y.rewriteCssSelectorWith(b,M,"."+O))},x.persistInputValues=function(b){var w=b.querySelectorAll("input"),_=b.querySelectorAll("textarea"),A=function(M){return M.type==="checkbox"||M.type==="radio"};E(w).filter(A).forEach(function(M){M.checked?M.setAttribute("checked",""):M.removeAttribute("checked")}),E(w).filter(function(M){return!A(M)}).forEach(function(M){M.setAttribute("value",M.value)}),E(_).forEach(function(M){M.textContent=M.value})},x.rewriteTagNameSelectorsToLowerCase=function(b){y.lowercaseCssTypeSelectors(b,y.findHtmlOnlyNodeNames(b))},x}(o),d=function(y,x,E,S){var b={},w=function(H,V,Y,U){var D=H.createElement(V);return D.style.visibility="hidden",D.style.width=Y+"px",D.style.height=U+"px",D.style.position="absolute",D.style.top=-1e4-U+"px",D.style.left=-1e4-Y+"px",H.getElementsByTagName("body")[0].appendChild(D),D},_=function(H){return H>0?new Promise(function(V){setTimeout(V,H)}):Promise.resolve()};b.executeJavascript=function(H,V){return new Promise(function(Y){var U=w(S.document,"iframe",V.width,V.height),D=H.outerHTML,j=[],z=V.executeJsTimeout||0,Z=function(){S.document.getElementsByTagName("body")[0].removeChild(U)},re=function(){var ue=U.contentDocument;Y({document:ue,errors:j,cleanUp:Z})},W=U.contentWindow.XMLHttpRequest,Q=x.finishNotifyingXhr(W),se=x.baseUrlRespectingXhr(Q,V.baseUrl);U.onload=function(){_(z).then(Q.waitForRequestsToFinish).then(re)},U.contentDocument.open(),U.contentWindow.XMLHttpRequest=se,U.contentWindow.onerror=function(ue){j.push({resourceType:"scriptExecution",msg:ue})},U.contentDocument.write("<!DOCTYPE html>"),U.contentDocument.write(D),U.contentDocument.close()})};var A=function(H,V,Y){var U=H.createElement("iframe");return U.style.width=V+"px",U.style.height=Y+"px",U.style.visibility="hidden",U.style.position="absolute",U.style.top=-1e4-Y+"px",U.style.left=-1e4-V+"px",U.style.borderWidth=0,U.sandbox="allow-same-origin",U.scrolling="no",U},M=function(H,V,Y){var U=Math.floor(H/Y),D=Math.floor(V/Y);return A(S.document,U,D)},O=function(H,V,Y,U){return{width:Math.max(H.width*U,V),height:Math.max(H.height*U,Y)}},L=function(H,V){var Y=H.querySelector(V);if(Y)return Y;if(H.ownerDocument.querySelector(V)===H)return H;throw{message:"Clipping selector not found"}},R=function(H,V,Y,U,D){var j=Math.max(H.scrollWidth,H.clientWidth),z=Math.max(H.scrollHeight,H.clientHeight),Z,re,W,Q,se,ue,le,ye;return V?(ue=L(H,V),le=ue.getBoundingClientRect(),Z=le.top,re=le.left,W=le.width,Q=le.height):(Z=0,re=0,W=j,Q=z),ye=O({width:W,height:Q},Y,U,D),se=S.getComputedStyle(H.ownerDocument.documentElement).fontSize,{left:re,top:Z,width:ye.width,height:ye.height,viewportWidth:j,viewportHeight:z,rootFontSize:se}},T=function(H,V){var Y=H.tagName;return V.querySelector(Y)},k=function(H){var V=H.tagName.toLowerCase();return V==="html"||V==="body"?H.outerHTML:'<body style="margin: 0;">'+H.outerHTML+"</body>"};b.calculateDocumentContentSize=function(H,V){return new Promise(function(Y,U){var D=V.zoom||1,j;j=M(V.width,V.height,D),S.document.getElementsByTagName("body")[0].appendChild(j),j.onload=function(){var z=j.contentDocument,Z;try{Z=R(T(H,z),V.clip,V.width,V.height,D),Y(Z)}catch(re){U(re)}finally{S.document.getElementsByTagName("body")[0].removeChild(j)}},j.contentDocument.open(),j.contentDocument.write("<!DOCTYPE html>"),j.contentDocument.write(k(H)),j.contentDocument.close()})},b.parseHtmlFragment=function(H){var V=S.document.implementation.createHTMLDocument("");V.documentElement.innerHTML=H;var Y=V.querySelector("body").firstChild;if(!Y)throw"Invalid source";return Y};var C=function(H,V){var Y=/<html((?:\s+[^>]*)?)>/im.exec(V),U=S.document.implementation.createHTMLDocument(""),D,j,z,Z;if(Y)for(D="<div"+Y[1]+"></div>",U.documentElement.innerHTML=D,z=U.querySelector("div"),j=0;j<z.attributes.length;j++)Z=z.attributes[j],H.documentElement.setAttribute(Z.name,Z.value)};b.parseHTML=function(H){var V=S.document.implementation.createHTMLDocument("");return V.documentElement.innerHTML=H,C(V,H),V};var q=function(H){try{return E.failOnParseError(H)}catch(V){throw{message:"Invalid source",originalError:V}}};b.validateXHTML=function(H){var V=new DOMParser,Y=V.parseFromString(H,"application/xml");q(Y)};var G=null,J=function(H,V){return V==="none"||V==="repeated"?((G===null||V!=="repeated")&&(G=Date.now()),H+"?_="+G):H},ae=function(H,V){return new Promise(function(Y,U){var D=new window.XMLHttpRequest,j=y.joinUrl(V.baseUrl,H),z=J(j,V.cache),Z=function(re){U({message:"Unable to load page",originalError:re})};D.addEventListener("load",function(){D.status===200||D.status===0?Y(D.responseXML):Z(D.statusText)},!1),D.addEventListener("error",function(re){Z(re)},!1);try{D.open("GET",z,!0),D.responseType="document",D.send(null)}catch(re){Z(re)}})};return b.loadDocument=function(H,V){return ae(H,V).then(function(Y){return q(Y)})},b}(a,l,n,window),f=function(y){var x={},E=function(T,k){return k?URL.createObjectURL(new Blob([T],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(T)},S=function(T){T instanceof Blob&&URL.revokeObjectURL(T)},b='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',w=function(T){return new Promise(function(k,C){var q=document.createElement("canvas"),G=new Image;G.onload=function(){var J=q.getContext("2d");try{J.drawImage(G,0,0),q.toDataURL("image/png"),k(!0)}catch{k(!1)}},G.onerror=C,G.src=T})},_=function(){var T=E(b,!0);return w(T).then(function(k){return S(T),k?!1:w(E(b,!1)).then(function(C){return C})},function(){return!1})},A=function(){if(y.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch{}return!1},M=function(){return new Promise(function(T,k){A()&&y.URL?_().then(function(C){T(!C)},function(){k()}):T(!1)})},O,L=function(){return O===void 0&&(O=M()),O},R=function(T){return L().then(function(k){return E(T,k)})};return x.renderSvg=function(T){return new Promise(function(k,C){var q,G,J=function(){G.onload=null,G.onerror=null},ae=function(){q&&S(q)};G=new Image,G.onload=function(){J(),ae(),k(G)},G.onerror=function(){ae(),C()},R(T).then(function(H){q=H,G.src=q},C)})},x}(window),v=function(y,x,E,S){var b={},w=function(T,k){var C=k||1,q={width:T.width,height:T.height,"font-size":T.rootFontSize};return C!==1&&(q.style="transform:scale("+C+"); transform-origin: 0 0;"),q},_=function(T){var k,C,q,G;k=Math.round(T.viewportWidth),C=Math.round(T.viewportHeight),q=-T.left,G=-T.top;var J={x:q,y:G,width:k,height:C};return J},A=function(T){var k=T.style||"";T.style=k+"float: left;"},M=function(T){T.externalResourcesRequired=!0},O=function(){return'<style scoped="">html::-webkit-scrollbar { display: none; }</style>'},L=function(T){var k=Object.keys(T);return k.length?" "+k.map(function(C){return C+'="'+T[C]+'"'}).join(" "):""},R=function(T,k,C){var q=S.serializeToString(T);x.validateXHTML(q);var G=_(k);return A(G),M(G),'<svg xmlns="http://www.w3.org/2000/svg"'+L(w(k,C))+">"+O()+"<foreignObject"+L(G)+">"+q+"</foreignObject></svg>"};return b.getSvgForDocument=function(T,k,C){return E.rewriteTagNameSelectorsToLowerCase(T),R(T,k,C)},b.drawDocumentAsSvg=function(T,k){return["hover","active","focus","target"].forEach(function(C){k[C]&&E.fakeUserAction(T,k[C],C)}),x.calculateDocumentContentSize(T,k).then(function(C){return b.getSvgForDocument(T,C,k.zoom)})},b}(a,d,u,r),g=function(y,x,E,S,b,w){var _={},A=function(T){return{message:"Error rendering page",originalError:T}},M=function(T){return b.renderSvg(T).then(function(k){return{image:k,svg:T}},function(k){throw A(k)})},O=function(T,k){try{k.getContext("2d").drawImage(T,0,0)}catch(C){throw A(C)}},L=function(T,k,C){return S.drawDocumentAsSvg(T,C).then(M).then(function(q){return k&&O(q.image,k),q})},R=function(T,k){return x.executeJavascript(T,k).then(function(C){var q=C.document;return E.persistInputValues(q),{document:q,errors:C.errors,cleanUp:C.cleanUp}})};return _.rasterize=function(T,k,C){var q;return q=y.clone(C),q.inlineScripts=C.executeJs===!0,w.inlineReferences(T,q).then(function(G){return C.executeJs?R(T,C).then(function(J){return{element:J.document.documentElement,errors:G.concat(J.errors),cleanUp:J.cleanUp}}):{element:T,errors:G,cleanUp:function(){}}}).then(function(G){return L(G.element,k,C).then(function(J){return G.cleanUp(),{image:J.image,svg:J.svg,errors:G.errors}})})},_}(a,d,u,v,f,i),c=function(y,x,E){var S={},b=function(O,L){var R=300,T=200,k=O?O.width:R,C=O?O.height:T,q=L.width!==void 0?L.width:k,G=L.height!==void 0?L.height:C;return{width:q,height:G}},w=function(O){var L=b(O.canvas,O.options),R;return R=y.clone(O.options),R.width=L.width,R.height=L.height,R};S.drawDocument=function(){var O=arguments[0],L=Array.prototype.slice.call(arguments,1),R=y.parseOptionalParameters(L),T=O.documentElement?O.documentElement:O;return E.rasterize(T,R.canvas,w(R))};var _=function(O,L,R){var T=x.parseHTML(O);return S.drawDocument(T,L,R)};S.drawHTML=function(){var O=arguments[0],L=Array.prototype.slice.call(arguments,1),R=y.parseOptionalParameters(L);return _(O,R.canvas,R.options)};var A=function(O,L,R){var T=document.implementation.createHTMLDocument("");T.replaceChild(O.documentElement,T.documentElement);var k=R?y.clone(R):{};return R.baseUrl||(k.baseUrl=L),{document:T,options:k}},M=function(O,L,R){return x.loadDocument(O,R).then(function(T){var k=A(T,O,R);return S.drawDocument(k.document,L,k.options)})};return S.drawURL=function(){var O=arguments[0],L=Array.prototype.slice.call(arguments,1),R=y.parseOptionalParameters(L);return M(O,R.canvas,R.options)},S}(a,d,g);return c})}(P1)),P1.exports}var $O=GO();function WO(e,t){if(!e.includes("@font-face"))return"";const r=new Set,n=new Set;t&&((t.match(/font-weight:\s*(\d+|bold|normal)/gi)||[]).forEach(d=>{const f=d.split(":")[1].trim();f==="bold"?r.add("700"):f==="normal"?r.add("400"):/^\d+$/.test(f)&&r.add(f)}),(t.match(/font-style:\s*(italic|normal)/gi)||[]).forEach(d=>{d.split(":")[1].trim().toLowerCase()==="italic"&&n.add("italic")}),/<(b|strong)\b/i.test(t)&&r.add("700"),/<(i|em)\b/i.test(t)&&n.add("italic"));const i=Pu(t);i&&i.trim()&&r.add("400"),r.size===0&&r.add("400");const a=r,l=n.has("italic"),o=Array.from(new Set(i)).map(d=>d.codePointAt(0)).filter(d=>d!==void 0),u=e.split(/}\s*/).map(d=>d&&d+"}").filter(d=>/@font-face/.test(d)&&(f=>{const v=(f.match(/font-weight:\s*(\d+)/)||[])[1];if(v&&!a.has(v)||/font-style:\s*italic/.test(f)&&!l)return!1;const g=f.match(/unicode-range:\s*([^;]+);/);if(!g)return!0;const c=g[1].split(",").map(y=>{const[x,E=x]=y.replace("U+","").split("-").map(S=>parseInt(S,16));return[x,E]});return o.some(y=>c.some(([x,E])=>y>=x&&y<=E))})(d)).join(`
151
- `);return u?`<style>${u}</style>`:""}const E0=`
152
- p {
153
- margin: 0;
154
- padding: 0;
155
- word-wrap: break-word; /* Required for Firefox */
156
- /* a text may have several spaces, we need to preserve them */
157
- white-space: pre-wrap;
158
- }
159
-
160
- /* Reset default list styles and setup counters */
161
- ul, ol {
162
- list-style: none; /* Remove default markers */
163
- padding-inline-start: 0; /* Reset padding */
164
- margin: 0;
165
- display: block; /* Use block instead of inline-block for better text wrapping */
166
- width: 100%;
167
- text-decoration: inherit;
168
- counter-reset: ol-counter; /* Initialize counter for ol */
169
- }
170
-
171
- li {
172
- position: relative; /* Needed for absolute positioning of ::before */
173
- padding-inline-start: 2.1em; /* Space for the marker (start side) */
174
- margin: 0; /* Reset default li margins */
175
- word-wrap: break-word; /* Required for Firefox text wrapping */
176
- white-space: pre-wrap; /* Preserve spaces and allow wrapping */
177
- }
178
-
179
- li::before {
180
- content: ''; /* Base content */
181
- position: absolute;
182
- /* Use logical properties for positioning */
183
- inset-inline-start: 0; /* Position marker at the start edge (left in LTR, right in RTL) */
184
- top: 0; /* Adjust vertical alignment */
185
- /* Prevent letter-spacing from affecting the marker */
186
- letter-spacing: normal;
187
- /* Define width to ensure consistent spacing and alignment */
188
- display: inline-block;
189
- width: 2em; /* Width for the marker container */
190
- /* Align multi-digit numbers to the end (right in LTR, left in RTL) */
191
- text-align: end;
192
- /* Space between marker and text (using logical property) */
193
- margin-inline-end: 0.8em; /* Pushes text away from marker (2.5em total = 1.7em width + 0.8em margin)*/
194
- /* Prevent marker style from inheriting list item styles */
195
- font-weight: normal;
196
- font-style: normal;
197
- }
198
-
199
- /* Style for bullet points */
200
- ul > li::before {
201
- content: '•'; /* Literal bullet character */
202
- /* Center the bullet within its allocated width */
203
- text-align: center; /* Override text-align: end for bullets */
204
- font-size: 1.2em;
205
- top: 0em; /* Re-adjust vertical alignment for bullet */
206
- /* Bullets don't need number alignment, width can be tighter */
207
- width: 2em;
208
- /* Adjust margin to maintain overall padding */
209
- margin-inline-end: 1.5em; /* 2.5em total padding = 1em width + 1.5em margin */
210
- }
211
-
212
- /* Style for numbers using counter */
213
- ol > li {
214
- counter-increment: ol-counter; /* Increment counter for each li in ol */
215
- }
216
-
217
- ol > li::before {
218
- content: counter(ol-counter) "."; /* Display counter value + dot */
219
- }
220
-
221
- .ql-indent-1 {
222
- margin-inline-start: 0.5em;
223
- }
224
- .ql-indent-2 {
225
- margin-inline-start: 1em;
226
- }
227
- .ql-indent-3 {
228
- margin-inline-start: 1.5em;
229
- }
230
- `,YO=`
231
- <style>
232
- html, body {
233
- padding: 0;
234
- margin: 0;
235
- }
236
- ${E0}
237
- </style>
238
- `;let qc;const o_=()=>(qc||(qc=document.createElement("div"),qc.id="polotno-hidden-do-not-touch",qc.style.overflow="hidden",qc.style.position="relative",document.body.appendChild(qc),qc.innerHTML=`<style>#polotno-hidden-do-not-touch {${E0}}</style>`),qc);navigator.userAgent.includes("Firefox");function XO({html:e}){const t=document.createElement("div");t.innerHTML=e,t.style.display="inline-block",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.zIndex="1000",t.style.whiteSpace="nowrap",t.style.visibility="hidden";const r=o_();r.appendChild(t);const n=t.textContent,i=t.childNodes[0];i.style.whiteSpace="nowrap";const a=n?.split(/\s+/)||[];let l=!1;for(let o=0;o<a.length;o++){const u=a[o];if(i&&(i.textContent=u,l=i.scrollWidth>t.clientWidth,l))break}return r.removeChild(t),l}function G3(e){const t=document.createElement("div");t.innerHTML=e,t.style.display="inline-block",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.zIndex="1000";const r=o_();r.appendChild(t);const n=t.getBoundingClientRect();return r.removeChild(t),{width:n.width,height:n.height}}const KO={},B2={},z2=new Map;async function $3({html:e,width:t,height:r,fontFamily:n,padding:i,font:a,pixelRatio:l}){let o="";if(n!=="Arial"&&!a){const y=zA();o=await async function(x,E){const S=`${x}|${E}`;if(z2.has(S))return z2.get(S);const b=`https://fonts.googleapis.com/css?family=${x}:${E}&display=swap`,w=await(await fetch(b)).text();return z2.set(S,w),w}(n,y)}if(a){const y=a.styles||(a.url?[{src:`url("${a.url}")`}]:(x=>{if(B2[x])return B2[x];const E=function(b){const w=[];for(let _=0;_<document.styleSheets.length;_++){const A=document.styleSheets[_];try{const M=A.cssRules;if(M)for(let O=0;O<M.length;O++){const L=M[O];L instanceof CSSFontFaceRule&&L.style.fontFamily.replace(/['"]/g,"")===b&&w.push(L)}}catch(M){console.warn(`Could not access stylesheet: ${A.href}`,M)}}return w}(x),S=E.filter(b=>b.style.fontFamily.replace(/['"]/g,"")===x).map(b=>({src:b.style.getPropertyValue("src"),fontStyle:b.style.getPropertyValue("font-style")||"normal",fontWeight:b.style.getPropertyValue("font-weight")||"normal"}));return B2[x]=S,S})(n));o="",y.forEach(x=>{o+=`
239
- @font-face {
240
- font-family: '${n}';
241
- src: ${x.src};
242
- font-style: ${x.fontStyle||"normal"};
243
- font-weight: ${x.fontWeight||"normal"};
244
- }
245
- `})}let u="";o&&(u=WO(o,e)),e+=u+YO;const d=t+2*i,f=r+2*i,v=document.createElement("canvas"),g=await $O.drawHTML(`<div style="padding: ${i}px;" dir="auto">${e}</div>`,v,{width:d,height:f,cacheBucket:KO});km(v,d*l,f*l);const c=v.getContext("2d");return c?.drawImage(g.image,0,0,d,f,0,0,v.width,v.height),v}let ZO={data:""},QO=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||ZO,JO=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,eC=/\/\*[^]*?\*\/|\s\s+|\n/g,$c=(e,t)=>{let r="",n="",i="";for(let a in e){let l=e[a];a[0]=="@"?a[1]=="i"?r=a+" "+l+";":n+=a[1]=="f"?$c(l,a):a+"{"+$c(l,a[1]=="k"?"":t)+"}":typeof l=="object"?n+=$c(l,t?t.replace(/([^,])+/g,o=>a.replace(/(^:.*)|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,o):o?o+" "+u:u)):a):l!=null&&(a=a.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=$c.p?$c.p(a,l):a+":"+l+";")}return r+(t&&i?t+"{"+i+"}":i)+n},zd={},s_=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+s_(e[r]);return t}return e},tC=(e,t,r,n,i)=>{let a=s_(e),l=zd[a]||(zd[a]=(o=>{let u=0,d=11;for(;u<o.length;)d=101*d+o.charCodeAt(u++)>>>0;return"go"+d})(a));if(!zd[l]){let o=a!==e?e:(u=>{let d,f=[{}];for(;d=JO.exec(u.replace(eC,""));)d[4]?f.shift():d[3]?f.unshift(f[0][d[3]]=f[0][d[3]]||{}):f[0][d[1]]=d[2];return f[0]})(e);zd[l]=$c(i?{["@keyframes "+l]:o}:o,r?"":"."+l)}return((o,u,d)=>{u.data.indexOf(o)==-1&&(u.data=d?o+u.data:u.data+o)})(zd[l],t,n),l};function Tm(e){let t=this||{},r=e.call?e(t.p):e;return tC(r.unshift?r.raw?((n,i,a)=>n.reduce((l,o,u)=>{let d=i[u];if(d&&d.call){let f=d(a),v=f&&f.props&&f.props.className||/^go/.test(f)&&f;d=v?"."+v:f&&typeof f=="object"?f.props?"":$c(f,""):f===!1?"":f}return l+o+(d??"")},""))(r,[].slice.call(arguments,1),t.p):r.reduce((n,i)=>Object.assign(n,i&&i.call?i(t.p):i),{}):r,QO(t.target),t.g,t.o,t.k)}let l_,Dv,Bv;Tm.bind({g:1});Tm.bind({k:1});function rC(e,t,r,n){$c.p=t,l_=e,Dv=r,Bv=n}function Uh(e,t){let r=this||{};return function(){let n=arguments;function i(a,l){let o=Object.assign({},a),u=o.className||i.className;r.p=Object.assign({theme:Dv&&Dv()},o),r.o=/ *go\d+/.test(u),o.className=Tm.apply(r,n)+(u?" "+u:""),t&&(o.ref=l);let d=e;return e[0]&&(d=o.as||e,delete o.as),Bv&&d[0]&&Bv(o),l_(d,o)}return t?t(i):i}}rC(ce.createElement);function W3(e){const t=(e||"").trim();if(t==="<p><br></p>"||t==="<p></p>")return"";if(t.startsWith("<p>")&&t.endsWith("</p>")){const r=t.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 e}const Pf=$r({enabled:!1,currentFormat:{},editor:$r.object({instance:null},{},{deep:!1})}),u_=Uh("div",ce.forwardRef)`
246
- .ql-editor {
247
- outline: none;
248
- }
249
- .ql-clipboard {
250
- pointer-events: none;
251
- }
252
- ${E0}
253
- strong {
254
- font-weight: 700;
255
- }
256
- .ql-direction-rtl {
257
- direction: rtl;
258
- }
259
- `;let nC=["bold","color","font","italic","size","strike","underline","indent","list","direction"];const Y3=(e,t)=>{var r=e.clipboard.convert("<div class='ql-editor' style='outline: none;'>"+t+"<p><br></p></div>");e.setContents(r),e.history.clear()},iC=({html:e,onBlur:t,onChange:r,element:n,clickCoords:i})=>{const a=ce.useRef(null);ce.useEffect(()=>{if(!a.current)return;const o=(u=a.current,new X8(u,{toolbar:!1,keyboard:!1,clipboard:{matchVisual:!1},formats:nC}));var u;return tc(()=>{Pf.editor.instance=o}),window.__polotnoQuill=o,o.on("text-change",()=>{o.getSelection()&&tc(()=>{Pf.currentFormat=o.getFormat(o.getSelection())}),setTimeout(()=>{var d;const f=((d=a.current)===null||d===void 0?void 0:d.childNodes[0]).innerHTML;r(W3(f))},10)}),Y3(o,e),i?sC(o,i):o.setSelection(0,0,"api"),o.on("selection-change",(d,f,v)=>{d&&tc(()=>{Pf.currentFormat=o.getFormat(o.getSelection())})}),a.current.childNodes[0].addEventListener("blur",d=>{var f;if(!((f=d.relatedTarget)===null||f===void 0)&&f.classList.contains("ql-clipboard"))return;(function(g){return!!g&&!!g.closest(".sketch-picker")})(d.relatedTarget)||t()}),()=>{tc(()=>{Pf.editor.instance=null,Pf.currentFormat={}}),delete window.__polotnoQuill}},[]),ce.useEffect(()=>w6(()=>n.text,()=>{var o;const u=Pf.editor.instance;if(!u)return;const d=u.getSelection();W3((o=a.current)===null||o===void 0?void 0:o.childNodes[0].innerHTML)===n.text||(Y3(u,e),d&&(u.setSelection(d.index,d.length),tc(()=>{Pf.currentFormat=u.getFormat(u.getSelection())})))},{fireImmediately:!0}),[]),ce.useEffect(()=>{window.addEventListener("blur",t);const o=u=>{var d;!((d=a.current)===null||d===void 0)&&d.contains(u.target)||t()};return window.addEventListener("touchstart",o),()=>{window.removeEventListener("blur",t),window.removeEventListener("touchstart",o)}},[]);const l={color:n.fill};return n.fill.indexOf("gradient")>=0&&(l.backgroundColor=n.fill,l.backgroundImage=n.fill,l.backgroundSize="100% 100%",l.backgroundRepeat="repeat",l.webkitBackgroundClip="text",l.MozBackgroundClip="text",l.WebkitTextFillColor="transparent",l.MozTextFillColor="transparent"),ce.createElement(u_,{ref:a,style:Object.assign(Object.assign({},l),{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}),dir:w0(Pu(n.text))})};function aC(e){return!function(t){const r=t.getContext("2d").getImageData(0,0,t.width,t.height).data;for(let n=0;n<r.length;n+=4)if(r[n+3]!==0)return!0;return!1}(e)}function X3(e,{fontFamily:t="",color:r="black"}={}){let n=`color: ${r||e.fill}`;return e.fill.indexOf("gradient")>=0&&(n=`
260
- background-color: ${r};
261
- background-image: ${e.fill};
262
- background-size: 100% 100%;
263
- background-repeat: repeat;
264
- -webkit-background-clip: text;
265
- -moz-background-clip: text;
266
- -webkit-text-fill-color: transparent;
267
- -moz-text-fill-color: transparent;
268
- `),`<div style="${["white-space: pre-wrap",`width: ${Math.round(e.width||100)}px`,n,`font-size: ${e.fontSize}px`,`font-family: '${t}'`,`text-align: ${e.align}`,`text-transform: ${e.textTransform}`,e.textDecoration?`text-decoration: ${e.textDecoration}; text-decoration-color: ${r||e.fill}; text-decoration-layer: over`:"",e.lineHeight?`line-height: ${e.lineHeight}`:"",e.letterSpacing?`letter-spacing: ${e.letterSpacing*e.fontSize}px`:"",e.fontStyle?`font-style: ${e.fontStyle}`:"",e.fontWeight?`font-weight: ${e.fontWeight}`:"",e.strokeWidth?`-webkit-text-stroke: ${e.strokeWidth}px ${e.stroke}`:"",e.strokeWidth?"paint-order: stroke fill":""].filter(Boolean).join("; ")}" contentEditable dir="${w0(Pu(e.text))}">${$A(e.text).replace(/\n/g,"</br>")}</div>`}const K3=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),oC=Yn(({element:e,store:t})=>{const r=ce.useRef(null),[n,i]=ce.useState(),[a,l]=ce.useState(!1),[o,u]=ce.useState(!1),d=ce.useRef(e.height),f=t.selectedShapes.indexOf(e)>=0&&e.selectable,v=e.fontSize/3,{textVerticalResizeEnabled:g}=gi,c=G8(e.fontFamily),[y]=H8(t,e.fontFamily),x=e._editModeEnabled;xp(r);const E=y?e.fontFamily:c!==e.fontFamily?c:"Arial",S=tf(e).fill,b=X3(e,{fontFamily:E,color:S}),{width:w,height:_}=function(V,Y,U){return ce.useMemo(()=>G3(V),[V,Y.width,U])}(b,e,y);ce.useEffect(()=>{if(!y)return;if(!e.height)return void t.history.ignore(()=>{e.set({height:_})});const{textOverflow:V}=gi;if(V!=="change-font-size"||a)V==="resize"&&(g&&e.height<_&&t.history.ignore(()=>{e.set({height:_})}),g||e.height===_||t.history.ignore(()=>{e.set({height:_})}));else{const Y=(U=>{let D=U.fontSize;for(let j=1;j<50;j++){const z=X3(Object.assign(Object.assign({},U.toJSON()),{fontSize:D}),{fontFamily:U.fontFamily}),{height:Z}=G3(z),re=U.height&&Z>U.height,W=XO({html:z});if(!(re||W&&!gi.textSplitAllowed))break;D-=.5}return D})(e);Y!==e.fontSize?t.history.ignore(()=>{e.set({fontSize:Y})}):e.height!==_&&(g&&e.height<_?t.history.ignore(()=>{e.set({height:_})}):g||t.history.ignore(()=>{e.set({height:_})}))}});const A=ce.useMemo(()=>{const V={lastArgs:null,lastResult:null};return async function(Y){return V.lastArgs&&V.lastResult&&(U=V.lastArgs,D=Y,JSON.stringify(U)===JSON.stringify(D))||(V.lastResult=await $3(Y),V.lastArgs=Object.assign({},Y)),V.lastResult;var U,D}},[]),M=ce.useRef(0),O=ce.useRef(null);ce.useEffect(()=>{a||x||(async()=>{M.current++;const V=M.current;let Y=Rh(`text ${e.id} ${V}`);O.current&&O.current(),O.current=Y,u(!0);let U=null;const D=K3?5:1;for(let j=0;j<D;j++){const z=j>0?A:$3;try{if(U=await z({skipCache:j>0,html:b,width:e.width||1,height:e.height||_||1,fontFamily:E,padding:v,pixelRatio:t._elementsPixelRatio,font:t.fonts.find(Z=>Z.fontFamily===E)||wm.find(Z=>Z.fontFamily===E)}),V!==M.current)return;if(K3&&aC(U)){await new Promise(Z=>setTimeout(Z,50*(j+1)));continue}break}catch(Z){console.error(Z),Sp(`Error rendering rich text with id ${e.id}`);break}}U?i(U):Y?(Y(),Y=null):console.error("Finish function is called twice!"),u(!1)})()},[b,a,_,x,E,e.height,t._elementsPixelRatio,y]);const[L,R]=jv(o,300),[T]=jv(a,300,!0),k=T||L;ce.useEffect(()=>{var V;if(!k)return Ou(()=>{const Y=r.current;_s(Y,e)});(V=r.current)===null||V===void 0||V.clearCache()},[n,k,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]),ce.useEffect(()=>{n&&!o&&O.current&&(O.current(),O.current=null)},[n,o]),ce.useEffect(()=>()=>{O.current&&O.current()},[]),ce.useEffect(()=>{f||Pu(e.text)!==""||!e.removable||e.placeholder||t.deleteElements([e.id])},[f]);let C=0;e.verticalAlign==="middle"&&(C=(e.height-_)/2),e.verticalAlign==="bottom"&&(C=e.height-_);const q=V8({fontLoaded:y,fontFamily:e.fontFamily,fontSize:e.fontSize,lineHeight:e.lineHeight}),G=lf(),J=ce.useRef(null),ae=ce.useRef(null),H=x&&e.strokeWidth>0;return ce.createElement(ce.Fragment,null,ce.createElement(En,{x:e.a.x,y:e.a.y,offsetX:e.backgroundPadding*(e.fontSize*q*.5),offsetY:e.backgroundPadding*(e.fontSize*q*.5),rotation:e.a.rotation,hideInExport:!e.showInExport,listening:!1,visible:e.backgroundEnabled,opacity:e.backgroundOpacity*e.a.opacity,fill:e.backgroundColor,width:e.a.width+e.backgroundPadding*(e.fontSize*q),height:e.a.height+e.backgroundPadding*(e.fontSize*q),cornerRadius:e.backgroundCornerRadius*(e.fontSize*q*.5)}),ce.createElement(En,{ref:r,name:"element",x:e.a.x,y:e.a.y,listening:e.selectable,rotation:e.a.rotation,width:e.a.width,height:e.a.height,visible:!k,draggable:G?e.draggable&&f:e.draggable,preventDefault:!G||f,opacity:x?0:e.a.opacity,hideInExport:!e.showInExport,onDragMove:V=>{e.set({x:V.target.x(),y:V.target.y()})},onDragEnd:V=>{e.set({x:V.target.x(),y:V.target.y()})},id:e.id,onDblClick:V=>{e.contentEditable&&(ae.current={x:V.evt.clientX,y:V.evt.clientY},e.toggleEditMode(!0))},onDblTap:V=>{var Y;if(e.contentEditable){const U=(Y=V.evt.changedTouches)===null||Y===void 0?void 0:Y[0];ae.current=U?{x:U.clientX,y:U.clientY}:null,e.toggleEditMode(!0)}},onTransformStart:V=>{l(!0),d.current=e.height},onTransform:V=>{var Y;const U=V.target,D=((Y=U.getStage())===null||Y===void 0?void 0:Y.findOne("Transformer")).getActiveAnchor(),j=D==="middle-left"||D==="middle-right",z=D==="top-center"||D==="bottom-center",Z=U.scaleX();if(j){const re=U.scaleX(),W=U.width()*re,Q=e.fontSize;let se=W;if(W<Q&&(se=Q,J.current&&U.position(J.current)),U.width(se),U.scaleX(1),gi.textVerticalResizeEnabled){const ue=Math.max(_,d.current);e.set({height:ue})}e.set({width:U.width(),x:U.x(),y:U.y()})}else if(z){let re=gi.textOverflow==="resize"?_:e.lineHeight*e.fontSize;const W=Math.max(re,V.target.height()*V.target.scaleY());U.scaleY(1),e.set({x:U.x(),y:U.y(),height:W,rotation:U.rotation()})}else U.scaleX(1),U.scaleY(1),e.set({fontSize:e.fontSize*Z,letterSpacing:e.letterSpacing,width:U.width()*Z,x:U.x(),y:U.y(),rotation:U.rotation(),height:U.height()*Z});J.current=V.target.position()},onTransformEnd:V=>{l(!1),u(!0);const Y=V.target.scaleX();V.target.scaleX(1),V.target.scaleY(1),e.set({fontSize:e.fontSize*Y,width:V.target.width()*Y,x:V.target.x(),y:V.target.y(),rotation:V.target.rotation(),shadowBlur:e.shadowBlur*Y,shadowOffsetX:e.shadowOffsetX*Y,shadowOffsetY:e.shadowOffsetY*Y,strokeWidth:e.strokeWidth*Y})}}),ce.createElement(bu,{ref:r,image:n,x:e.a.x,y:e.a.y,offsetX:v,offsetY:v-C,listening:!1,rotation:e.a.rotation,width:e.a.width+2*v,height:(e.a.width+2*v)*(n?.height/n?.width||1),visible:!k&&!x,opacity:e.a.opacity,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,hideInExport:!e.showInExport,editModeEnabled:e._editModeEnabled||a||k}),(k||H)&&ce.createElement(vn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,offsetY:-C},ce.createElement($1,{divProps:{style:{pointerEvents:"none"}}},ce.createElement(u_,{dangerouslySetInnerHTML:{__html:b},style:{pointerEvents:"none",opacity:e.a.opacity,textShadow:e.shadowEnabled?`${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${e.shadowColor}`:void 0}}))),x&&ce.createElement(vn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,offsetY:-C},ce.createElement($1,null,ce.createElement(iC,{html:b,element:e,onChange:V=>{const Y=q8({oldText:Pu(e.text),newText:Pu(V),element:e});e.set({text:V,fontSize:Y})},onBlur:V=>{e.toggleEditMode(!1),R(!0)},clickCoords:ae.current}))))});function sC(e,t){if(!e||!t)return;const{x:r,y:n}=t;try{let i=null;if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(r,n);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r,n);a&&(i=document.createRange(),i.setStart(a.offsetNode,a.offset))}if(i){const a=X8.find(i.startContainer,!0);if(a){const l=a.offset(e.scroll)+i.startOffset;return void e.setSelection(l,0,"api")}}}catch{}e.setSelection(0,0,"api")}function Rm(e){return e/180*Math.PI}function u1(e,t,r,n,i){const a=Math.sqrt(r*r+n*n);return i+=Math.atan2(n,r),{x:e+a*Math.cos(i),y:t+a*Math.sin(i)}}function A0(e){const{x:t,y:r,width:n,height:i}=e,a=Rm(e.rotation),l=u1(t,r,0,0,a),o=u1(t,r,n,0,a),u=u1(t,r,n,i,a),d=u1(t,r,0,i,a),f=Math.min(l.x,o.x,u.x,d.x),v=Math.min(l.y,o.y,u.y,d.y),g=Math.max(l.x,o.x,u.x,d.x),c=Math.max(l.y,o.y,u.y,d.y);return{x:f,y:v,width:g-f,height:c-v,minX:f,minY:v,maxX:g,maxY:c}}function P0(e){const t=e.map(l=>A0(l)),r=Math.min(...t.map(l=>l.minX)),n=Math.min(...t.map(l=>l.minY)),i=Math.max(...t.map(l=>l.maxX)),a=Math.max(...t.map(l=>l.maxY));return{x:r,y:n,width:i-r,height:a-n,minX:r,minY:n,maxX:i,maxY:a}}function lC(e){const t=Rm(e.rotation||0);return{x:e.x+e.width/2*Math.cos(t)+e.height/2*Math.sin(-t),y:e.y+e.height/2*Math.cos(t)+e.width/2*Math.sin(t)}}function uC(e,t,r){const n=Rm(t),i=r.x+(e.x-r.x)*Math.cos(n)-(e.y-r.y)*Math.sin(n),a=r.y+(e.x-r.x)*Math.sin(n)+(e.y-r.y)*Math.cos(n);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:i,y:a})}function cC(e,t){return uC(e,t,lC(e))}const Yo={stroke:"rgb(0, 161, 255)",strokeWidth:1,dash:[4,6]},fC=({stroke:e,strokeWidth:t,dash:r})=>{e!==void 0&&(Yo.stroke=e),t!==void 0&&(Yo.strokeWidth=t),r!==void 0&&(Yo.dash=r)};let Z3=({targetKonvaNodes:e,guideKonvaNode:t,distance:r,snapDirection:n})=>r<5;function zv(e,t){var r=[],n=[];e.vertical.forEach(d=>{t.vertical.forEach(f=>{var v=Math.abs(d.offset-f.guide);Z3({targetKonvaNodes:f.nodes,guideKonvaNode:d.node,distance:v,snapDirection:d.snap})&&r.push({lineGuide:d.offset,diff:v,snap:f.snap,offset:f.offset})})}),e.horizontal.forEach(d=>{t.horizontal.forEach(f=>{var v=Math.abs(d.offset-f.guide);Z3({targetKonvaNodes:f.nodes,guideKonvaNode:d.node,distance:v,snapDirection:d.snap})&&n.push({lineGuide:d.offset,diff:v,snap:f.snap,offset:f.offset})})});var i=[];const a=r.sort((d,f)=>d.diff-f.diff),l=n.sort((d,f)=>d.diff-f.diff);var o=a[0],u=l[0];return o&&a.filter(d=>Math.abs(d.diff-o.diff)<.1).forEach(d=>{i.push(Object.assign({orientation:"V"},d))}),u&&l.filter(d=>Math.abs(d.diff-u.diff)<.1).forEach(d=>{i.push(Object.assign({orientation:"H"},d))}),i}const c_=()=>{if(sr.DD._dragElements.size===0)return;const e=[...sr.DD._dragElements.entries()],t=e.find(([r,n])=>n.node instanceof sr.Transformer);t&&(e.splice(e.indexOf(t),1),e.unshift(t),sr.DD._dragElements.clear(),e.forEach(([r,n])=>{sr.DD._dragElements.set(r,n)}))};function hC(e,t,r){const n=ce.useRef(null);fC(r);const i=f=>f.hasName("element")||f.hasName("page-background")||!n.current&&f.hasName("elements-area");function a(f){var v;const g=(v=e.current)===null||v===void 0?void 0:v.getStage(),c=[],y=[];return g.find(i).forEach(x=>{if(!(f.indexOf(x)>=0)){var E=x.getClientRect({skipShadow:!0,skipStroke:!0});c.push({offset:E.x,node:x,snap:"start"},{offset:E.x+E.width,node:x,snap:"end"},{offset:E.x+E.width/2,node:x,snap:"center"}),y.push({offset:E.y,node:x,snap:"start"},{offset:E.y+E.height,node:x,snap:"end"},{offset:E.y+E.height/2,node:x,snap:"center"})}}),{vertical:c,horizontal:y}}function l(f){var v;const g=(v=e.current)===null||v===void 0?void 0:v.getLayer(),c=g?.children.find(y=>y.name()==="line-guides");f.forEach(y=>{if(y.orientation==="H"){var x=new sr.Line({x:-g.getStage().x(),y:-g.getStage().y(),points:[-6e3,y.lineGuide,6e3,y.lineGuide],stroke:Yo.stroke,strokeWidth:Yo.strokeWidth,name:"guid-line",dash:Yo.dash});c?.add(x),g.batchDraw()}else y.orientation==="V"&&(x=new sr.Line({x:-g.getStage().x(),y:-g.getStage().y(),points:[y.lineGuide,-6e3,y.lineGuide,6e3],stroke:Yo.stroke,strokeWidth:Yo.strokeWidth,name:"guid-line",dash:Yo.dash}),c?.add(x))})}const o=f=>{const v=f.target.getLayer().children.find(w=>w.name()==="line-guides");v?.destroyChildren();var g=a(f.target.nodes()),c=function(w){const _=w.__getNodeRect(),A=A0(Object.assign(Object.assign({},_),{rotation:sr.Util.radToDeg(_.rotation)})),M=w.getAbsolutePosition();return{vertical:[{guide:A.x,offset:M.x-A.x,snap:"start",nodes:w.nodes()},{guide:A.x+A.width/2,offset:M.x-A.x-A.width/2,snap:"center",nodes:w.nodes()},{guide:A.x+A.width,offset:M.x-A.x-A.width,snap:"end",nodes:w.nodes()}],horizontal:[{guide:A.y,offset:M.y-A.y,snap:"start",nodes:w.nodes()},{guide:A.y+A.height/2,offset:M.y-A.y-A.height/2,snap:"center",nodes:w.nodes()},{guide:A.y+A.height,offset:M.y-A.y-A.height,snap:"end",nodes:w.nodes()}]}}(f.target),y=zv(g,c);if(!y.length)return;l(y);const x=f.target.getAbsolutePosition(),E=(f.target.nodes().map(w=>w.getAbsolutePosition()),Object.assign({},x));y.forEach(w=>{switch(w.snap){case"start":case"center":case"end":switch(w.orientation){case"V":E.x=w.lineGuide+w.offset;break;case"H":E.y=w.lineGuide+w.offset}}});const S=E.x-x.x,b=E.y-x.y;f.evt.ctrlKey||f.evt.metaKey||f.target.nodes().forEach(w=>{const _=w.getAbsolutePosition();w.setAbsolutePosition({x:_.x+S,y:_.y+b})})},u=(f,v,g)=>{var c;const y=e.current,x=y.getLayer().children.find(L=>L.name()==="line-guides");if(x?.destroyChildren(),y.getActiveAnchor()==="rotater")return v;const E=y.getActiveAnchor(),S=dC[E],b=(c=y.findOne(`.${S}`))===null||c===void 0?void 0:c.getAbsolutePosition();if(!b)return v;const w={x:f.x-b.x,y:f.y-b.y},_=function(L,R){const T=J3(L,R)/J3(R,R);return{x:T*R.x,y:T*R.y}}({x:v.x-f.x,y:v.y-f.y},w),A={x:f.x+_.x,y:f.y+_.y};var M=zv(a(y.nodes()),{vertical:[{guide:A.x,offset:0,snap:"start",nodes:y.nodes()}],horizontal:[{guide:A.y,offset:0,snap:"start",nodes:y.nodes()}]});if(!M.length||(l(M),g.ctrlKey||g.metaKey))return v;const O=[];if(M.forEach(L=>{const R=function(T,k,C){if(C.orientation==="V"){const q=C.lineGuide;if(Math.abs(k.x-T.x)<1e-4)return null;const G=(k.y-T.y)/(k.x-T.x);return{x:q,y:G*q+(T.y-G*T.x)}}{const q=C.lineGuide;if(Math.abs(k.y-T.y)<1e-4)return null;const G=(k.y-T.y)/(k.x-T.x);return{x:(q-T.y)/G+T.x,y:q}}}(A,b,{orientation:L.orientation,lineGuide:L.lineGuide});R&&O.push(R)}),O.length>0){let L=O[0],R=Math.sqrt(Math.pow(A.x-L.x,2)+Math.pow(A.y-L.y,2));if(O.forEach(T=>{const k=Math.sqrt(Math.pow(A.x-T.x,2)+Math.pow(A.y-T.y,2));k<R&&(R=k,L=T)}),R<10)return L}return A},d=f=>{if(!f.target)return;const v=f.target.getLayer(),g=v.children.find(c=>c.name()==="line-guides");g?.destroyChildren(),v.batchDraw()};ce.useEffect(()=>{e.current&&(e.current.anchorDragBoundFunc(u),e.current.on("dragstart",f=>{setTimeout(()=>{c_()})}),e.current.on("dragmove",o),e.current.on("dragend",d),e.current.on("transformend",d),e.current.on("transform",f=>{var v,g;f.evt.ctrlKey||f.evt.metaKey?(v=e.current)===null||v===void 0||v.rotationSnapTolerance(0):(g=e.current)===null||g===void 0||g.rotationSnapTolerance(5)}))},[])}function Q3(e,t,r){const n=l=>l.hasName("element")||l.hasName("line-anchor")||l.hasName("page-background")||l.hasName("elements-area"),i=l=>{const o=l.target.getLayer().children.find(y=>y.name()==="line-guides");o?.destroyChildren();var u,d=zv(function(y){var x;const E=(x=e.current)===null||x===void 0?void 0:x.getStage();var S=[],b=[];return E.find(n).forEach(w=>{if(!(y.indexOf(w)>=0)){var _=w.getClientRect({skipShadow:!0,skipStroke:!0});w.hasName("line-anchor")&&(_={x:w.absolutePosition().x,y:w.absolutePosition().y,width:0,height:0}),S.push({offset:_.x,node:w,snap:"start"},{offset:_.x+_.width,node:w,snap:"end"},{offset:_.x+_.width/2,node:w,snap:"center"}),b.push({offset:_.y,node:w,snap:"start"},{offset:_.y+_.height,node:w,snap:"end"},{offset:_.y+_.height/2,node:w,snap:"center"})}}),{vertical:S,horizontal:b}}([l.target,...t.map(y=>y.current)]),{vertical:[{guide:(u=l.target).absolutePosition().x,offset:0,snap:"center",nodes:[u]}],horizontal:[{guide:u.absolutePosition().y,offset:0,snap:"center",nodes:[u]}]});if(!d.length)return;(function(y){var x;const E=(x=e.current)===null||x===void 0?void 0:x.getLayer(),S=E?.children.find(b=>b.name()==="line-guides");y.forEach(b=>{if(b.orientation==="H"){var w=new sr.Line({points:[-6e3,b.lineGuide,6e3,b.lineGuide],stroke:Yo.stroke,strokeWidth:Yo.strokeWidth,name:"guid-line",dash:Yo.dash});S?.add(w),E.batchDraw()}else b.orientation==="V"&&(w=new sr.Line({points:[b.lineGuide,-6e3,b.lineGuide,6e3],stroke:Yo.stroke,strokeWidth:Yo.strokeWidth,name:"guid-line",dash:Yo.dash}),S?.add(w))})})(d);const f=l.target.getAbsolutePosition(),v=Object.assign({},f);d.forEach(y=>{switch(y.snap){case"start":case"center":case"end":switch(y.orientation){case"V":v.x=y.lineGuide+y.offset;break;case"H":v.y=y.lineGuide+y.offset}}});const g=v.x-f.x,c=v.y-f.y;if(!l.evt.ctrlKey&&!l.evt.metaKey){const y=l.target.getAbsolutePosition();l.target.absolutePosition({x:y.x+g,y:y.y+c})}},a=l=>{if(!l.target)return;const o=l.target.getLayer(),u=o.children.find(d=>d.name()==="line-guides");u?.destroyChildren(),o.batchDraw()};ce.useEffect(()=>{e.current&&(e.current.on("dragmove",i),e.current.on("dragend",a))},r)}function J3(e,t){return e.x*t.x+e.y*t.y}const dC={"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 pC(e){const{x:t,y:r,width:n,height:i,rotation:a}=e.a,l=a*Math.PI/180,o={x:t+i/2*Math.cos(l+Math.PI/2),y:r+i/2*Math.sin(l+Math.PI/2)};return{middleLeft:o,middleRight:{x:o.x+n*Math.cos(l),y:o.y+n*Math.sin(l)}}}function e4(e,t,r){const n=Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),i=Math.atan2(t.y-e.y,t.x-e.x),a=180*i/Math.PI;return{x:e.x+Math.cos(i-Math.PI/2)*r/2,y:e.y+Math.sin(i-Math.PI/2)*r/2,width:n,height:r,rotation:a}}const t4=(e,t)=>({offsetX:5/e,offsetY:5/e,width:10/e,height:10/e,fill:"white",stroke:"rgb(0, 161, 255)",strokeWidth:2,strokeScaleEnabled:!1,draggable:!0,dragDistance:0,onMouseEnter:r=>{r.target.getStage().container().style.cursor="crosshair"},onMouseLeave:r=>{r.target.getStage().container().style.cursor=""},onDragStart:r=>{t.history.startTransaction()},onDragEnd:r=>{t.history.endTransaction()}}),r4=Yn(({element:e,type:t})=>{const r=tf(e,e.a.color,"fill"),n=tf(e,e.a.color,"stroke"),i=Object.assign(Object.assign(Object.assign({strokeWidth:e.height,lineCap:"round",lineJoin:"round"},n),r),{opacity:e.a.opacity,hideInExport:!e.showInExport});return ce.createElement(ce.Fragment,null,t==="arrow"&&ce.createElement(Yc,Object.assign({points:[3*e.height,2*-e.height,0,0,3*e.height,2*e.height]},i)),t==="triangle"&&ce.createElement(Yc,Object.assign({points:[3*e.height,2*-e.height,0,0,3*e.height,2*e.height],closed:!0},i)),t==="bar"&&ce.createElement(Yc,Object.assign({points:[0,2*-e.height,0,2*e.height],closed:!0},i)),t==="square"&&ce.createElement(Yc,Object.assign({points:[0,2*-e.height,4*e.height,2*-e.height,4*e.height,2*e.height,0,2*e.height],closed:!0},i)),t==="circle"&&ce.createElement(fA,Object.assign({x:2*e.height,y:0,radius:2*e.height},i)))}),gC=Yn(({element:e,store:t})=>{const r=ce.useRef(null),n=ce.useRef(null),i=ce.useRef(null),a=e.selectable||t.role==="admin",l=lf(),o=t.selectedElements.indexOf(e)>=0&&t.selectedElements.length===1,u=t.selectedShapes.indexOf(e)>=0&&e.selectable,{middleLeft:d,middleRight:f}=pC(e);Q3(n,[r],[o]),Q3(i,[r],[o]);const v=tf(e,e.a.color,"stroke");return ce.createElement(ce.Fragment,null,ce.createElement(Yc,Object.assign({ref:r,name:"element",id:e.id,x:e.a.x,y:e.a.y,points:[0,0,e.a.width,0],offsetY:-e.a.height/2,strokeWidth:e.a.height,hitStrokeWidth:Math.max(e.a.height,20),dash:e.dash.map(g=>g*e.a.height)},v,{rotation:e.a.rotation,opacity:e.animated("opacity"),shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,listening:a,draggable:l?e.draggable&&u:e.draggable,preventDefault:!l||u,hideInExport:!e.showInExport,onDragMove:g=>{e.set({x:g.target.x(),y:g.target.y()})},onDragEnd:g=>{e.set({x:g.target.x(),y:g.target.y()})},onTransform:g=>{const c=g.target.scaleX();g.target.scaleX(1),g.target.scaleY(1),e.set({height:e.height*c,width:e.width*c,x:g.target.x(),y:g.target.y(),rotation:g.target.rotation()})}})),ce.createElement(vn,{x:d.x,y:d.y,rotation:e.rotation,hideInExport:!e.showInExport},ce.createElement(r4,{element:e,type:e.startHead})),ce.createElement(vn,{x:f.x,y:f.y,rotation:e.rotation+180},ce.createElement(r4,{element:e,type:e.endHead})),o&&e.resizable&&ce.createElement(bm,{selector:".page-abs-container",enabled:!0},ce.createElement(vn,{visible:o},ce.createElement(En,Object.assign({x:d.x,y:d.y,ref:n,name:"line-anchor"},t4(t.scale,t),{onDragMove:g=>{const c=e4(g.target.position(),f,e.height);e.set({x:c.x,y:c.y,width:c.width,rotation:c.rotation})}})),ce.createElement(En,Object.assign({x:f.x,y:f.y,ref:i,name:"line-anchor"},t4(t.scale,t),{onDragMove:g=>{const c=e4(d,g.target.position(),e.height);e.set({x:c.x,y:c.y,width:c.width,rotation:c.rotation})}})))))});function dp(){return document.createElement("canvas")}const f_=new window.Image;f_.src=$f(`
269
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
270
- <path opacity="0.6" d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" fill="white"/>
271
- <path d="M4 5.49683V18.5032C4 20.05 5.68077 21.0113 7.01404 20.227L18.0694 13.7239C19.384 12.9506 19.384 11.0494 18.0694 10.2761L7.01404 3.77296C5.68077 2.98869 4 3.95 4 5.49683Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
272
- </svg>
273
- `);const h_=new window.Image;h_.src=$f(`
274
- <svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
275
- <path opacity="0.6" d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" fill="white"/>
276
- <path opacity="0.6" d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" fill="white"/>
277
- <path d="M14 19L14 5C14 3.89543 14.8954 3 16 3L17 3C18.1046 3 19 3.89543 19 5L19 19C19 20.1046 18.1046 21 17 21L16 21C14.8954 21 14 20.1046 14 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
278
- <path d="M10 19L10 5C10 3.89543 9.10457 3 8 3L7 3C5.89543 3 5 3.89543 5 5L5 19C5 20.1046 5.89543 21 7 21L8 21C9.10457 21 10 20.1046 10 19Z" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
279
- </svg>
280
- `);const d_=(e,t,r,n,i=0,a=!1)=>{const l=Math.floor(Math.max(e.width*n,1)),o=Math.floor(Math.max(e.height*n,1)),u=Math.min(i*n,l/2,o/2),d=Math.max(e.width/r.width,e.height/r.height)*n,f=e.page._exportingOrRendering&&gi.imageDownScalingEnabled&&d<1&&!a,v=r.x===0&&r.y===0&&r.width===t?.width&&r.height===t?.height,g=ce.useMemo(()=>{if(t&&t.width&&t.height)return v&&u===0&&!f?void 0:dp()},[t,u,f,v]),c=()=>{if(!g||!t)return;g.width=l,g.height=o;const y=g.getContext("2d");if(!y)return;u&&(y.beginPath(),y.moveTo(u,0),y.lineTo(l-u,0),y.arc(l-u,u,u,3*Math.PI/2,0,!1),y.lineTo(l,o-u),y.arc(l-u,o-u,u,0,Math.PI/2,!1),y.lineTo(u,o),y.arc(u,o-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 x=f?function(S,b){var w,_;const A=dp();A.width=S.width,A.height=S.height,(w=A.getContext("2d"))===null||w===void 0||w.drawImage(S,0,0,A.width,A.height);const M=function(O,L,R,T,k,C,q){for(var G=new ImageData(L,R),J=new Int32Array(O.data.buffer),ae=O.width,H=new Int32Array(G.data.buffer),V=G.width,Y=L/C,U=R/q,D=Math.round(1/Y),j=Math.round(1/U),z=D*j,Z=0;Z<G.height;Z++)for(var re=0;re<V;re++){for(var W=0+Math.round(re/Y)+(0+Math.round(Z/U))*ae,Q=0,se=0,ue=0,le=0,ye=0;ye<j;ye++)for(var Re=0;Re<D;Re++){var Me=J[W+Re+ye*ae];Q+=Me<<24>>>24,se+=Me<<16>>>24,ue+=Me<<8>>>24,le+=Me>>>24}Q=Math.round(Q/z),se=Math.round(se/z),ue=Math.round(ue/z),le=Math.round(le/z),H[re+Z*V]=le<<24|ue<<16|se<<8|Q}return G}(A.getContext("2d").getImageData(0,0,A.width,A.height),Math.floor(A.width*b),Math.floor(A.height*b),0,0,A.width,A.height);return A.width=Math.floor(A.width*b),A.height=Math.floor(A.height*b),(_=A.getContext("2d"))===null||_===void 0||_.putImageData(M,0,0),A}(t,d):t,E=f?{x:Math.floor(r.x*d),y:Math.floor(r.y*d),width:Math.floor(r.width*d),height:Math.floor(r.height*d)}:r;y.drawImage(x,E.x,E.y,E.width,E.height,0,0,g.width,g.height)};return ce.useLayoutEffect(()=>{c()},[g,e.width,e.height,r.x,r.y,r.width,r.height,i,n,a,e.page._exportingOrRendering,f]),ce.useEffect(()=>()=>{g&&g.nodeName==="CANVAS"&&sr.Util.releaseCanvas(g)},[g]),[g||t,c]},vC=dp(),mC=Yn(({element:e})=>{const t=Math.min(30,e.width/4,e.height/4),r=ce.useRef(null);return ce.useEffect(()=>{const n=r.current;if(!n)return;const i=new sr.Animation(a=>{n.rotate((a?.timeDiff||0)/2)},n.getLayer());return i.start(),()=>{i.stop()}}),ce.createElement(vn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},ce.createElement(En,{width:e.width,height:e.height,fill:"rgba(124, 173, 212, 0.8)"}),ce.createElement(mm,{ref:r,x:e.width/2,y:e.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),yC=Yn(({element:e})=>{const t=Math.max(10,Math.min(30,e.width/25));return ce.createElement(vn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},ce.createElement(En,{width:e.width,height:e.height,fill:"rgba(223, 102, 102, 0.8)"}),ce.createElement(Au,{text:"Can not load the video...",fontSize:t,width:e.width,height:e.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))});let bC=function(e,t,r){const n=ce.useRef("loading"),i=ce.useRef(null),[a,l]=ce.useState(0),o=ce.useRef(),u=ce.useRef(),d=ce.useRef();return o.current===e&&u.current===t&&d.current===r||(n.current="loading",i.current=void 0,o.current=e,u.current=t,d.current=r),ce.useLayoutEffect(function(){if(e){var f=document.createElement("video");return f.addEventListener("canplay",v),f.addEventListener("error",g),f.crossOrigin=t,f.src=e,f.load(),function(){f.removeEventListener("canplay",v),f.removeEventListener("error",g)}}function v(){n.current="loaded",i.current=f,i.current.currentTime=0,l(Math.random()),i.current.removeEventListener("canplay",v)}function g(c){var y;const x=f.readyState===4,E=f.buffered&&f.buffered.length>0&&f.buffered.end(f.buffered.length-1)/f.duration*100>=100;if(x&&E)return;const S=c.message||((y=f.error)===null||y===void 0?void 0:y.message)||"Unknown error",b=new Error("Video failed to load: "+S);console.error(b),n.current="failed",i.current=void 0,l(Math.random())}},[e,t,r]),[i.current,n.current]};function n4(e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA}const i4=(e,t,r)=>{const n=ce.useRef(),i=()=>{var a;(a=n.current)===null||a===void 0||a.call(n),n.current=void 0};ce.useEffect(()=>i,[]),ce.useLayoutEffect(()=>{const a=t.slice(0,200),l=`video with id ${r} url: ${a}`;e!=="loading"||n.current||(n.current=Rh(l)),e!=="loading"&&i(),e==="failed"&&Sp(l)},[e])},wC=Yn(({element:e,store:t})=>{var r;const[n,i]=ce.useState(!1),a=ce.useRef(null),l=ce.useRef(null),o=t.selectedShapes.indexOf(e)>=0&&e.selectable,[u,d]=ce.useState(!1),[f,v]=bC(e.src,"anonymous"),g=t.activePage===e.page;i4(v,e.src,e.id),f&&(f.width=f.videoWidth,f.height=f.videoHeight,f.playsInline=!0);const c=f||vC;ce.useEffect(()=>{f&&t.history.ignore(()=>{e.set({duration:1e3*f.duration})})},[f]),ce.useEffect(()=>{var le;if(!f)return;const ye=t.animatedElementsIds,Re=(!ye.length||ye.includes(e.id))&&t.isPlaying,Me=g&&(Re||u);if(!Me)return void f.pause();Me&&(f.currentTime=e.startTime*f.duration,f.play());const Pe=new sr.Animation(()=>{ae()},(le=a.current)===null||le===void 0?void 0:le.getLayer());Pe.start();const de=()=>{d(!1),f.currentTime=e.startTime*f.duration},Te=()=>{f.currentTime>=e.endTime*f.duration&&(f.pause(),f.currentTime=e.startTime*f.duration,d(!1))};return f.addEventListener("ended",de),f.addEventListener("timeupdate",Te),()=>{f.pause(),Pe.stop(),f.removeEventListener("ended",de),f.removeEventListener("timeupdate",Te)}},[f,u,t.isPlaying,g]),ce.useEffect(()=>{f&&(f.volume=e.volume)},[f,e.volume]);const y=ce.useRef();ce.useEffect(()=>{const le=Ou(()=>{var ye,Re;if(f){const Me=t.animatedElementsIds;if(Me.length&&!Me.includes(e.id))return;const Pe=e.startTime*f.duration*1e3,de=f.duration*(e.endTime-e.startTime)*1e3,Te=((t.currentTime||e.page.startTime)-e.page.startTime)%de+Pe;if(Math.abs(1e3*f.currentTime-Te)>500||!t.isPlaying){const Ae=Te/1e3;Ae!==f.currentTime&&(f.currentTime=Ae),!n4(f)&&!t.isPlaying&&!y.current&&(y.current=Rh(`video ${e.id}`))}ae(),(Re=(ye=a.current)===null||ye===void 0?void 0:ye.getLayer())===null||Re===void 0||Re.batchDraw()}});return()=>{le(),y.current&&(y.current(),y.current=null)}},[t,f]),ce.useEffect(()=>{if(!f)return;const le=()=>{var Re,Me;!n4(f)&&e.page._exportingOrRendering||y.current&&(ae(),(Me=(Re=a.current)===null||Re===void 0?void 0:Re.getLayer())===null||Me===void 0||Me.batchDraw(),y.current(),y.current=null)};let ye;return e.page._exportingOrRendering&&(ye=setInterval(le,20)),f.addEventListener("timeupdate",le),f.addEventListener("canplay",le),()=>{clearInterval(ye),f.removeEventListener("timeupdate",le),f.removeEventListener("canplay",le)}},[e.page._exportingOrRendering,f,e.id,Rh]);let{cropX:x,cropY:E,cropWidth:S,cropHeight:b}=e;v!=="loaded"&&(x=E=0,S=b=1);const w=c.width*S,_=c.height*b,A=e.width/e.height;let M,O;const L=w/_,R=e.type==="svg";R?(M=w,O=_):A>=L?(M=w,O=w/A):(M=_*A,O=_);const T={x:c.width*x,y:c.height*E,width:M,height:O},k=(r=e.cornerRadius)!==null&&r!==void 0?r:0,[C,q]=d_(e,c,T,t._elementsPixelRatio,k,n||e._cropModeEnabled||e.type==="svg");let[G,J]=((le,ye,Re,Me)=>{const Pe=(xe=>{const[Le,pe]=ce.useState(xe);return ce.useEffect(()=>{(async()=>{const Ce=await async function(je){if(!(je.indexOf("data:image/svg+xml")>=0||je.indexOf(".svg")>=0))return je;const He=await Ap(je),st=Am(He);return $f(st)}(xe);Ce!==Le&&pe(Ce)})()},[xe]),Le})(le.clipSrc||""),[de,Te]=ym(Pe,"anonymous"),Ae=le.clipSrc?Te:"loaded";i4(Ae,le.clipSrc,le.id);const be=ce.useMemo(()=>{if(ye&&de)return dp()},[ye,de]);function _e(){var xe;if(!de||!ye||!ye.width||!ye.height||!de||!de.width||!de.height||!be)return;const Le=dp(),pe=Math.max(le.width/de.width*Re,le.height/de.height*Re);Le.width=de.width*pe,Le.height=de.height*pe,(xe=Le.getContext("2d"))===null||xe===void 0||xe.drawImage(de,0,0,Le.width,Le.height),be.width=Math.max(ye.width,1),be.height=Math.max(ye.height,1);const Ce=be.getContext("2d");Ce&&(Ce.save(),Ce.drawImage(Le,0,0,ye.width,ye.height),sr.Util.releaseCanvas(Le),Ce.globalCompositeOperation="source-in",Ce.drawImage(ye,0,0,be.width,be.height),Ce.restore())}return ce.useLayoutEffect(()=>{_e()},[be,ye,de,le.width,le.height,Re,...Me]),[le.clipSrc&&de?be:ye,_e]})(e,C,t._elementsPixelRatio,[T,k,t._elementsPixelRatio]);function ae(){q(),J()}const H=Math.max(e.width/M,e.height/O);ce.useEffect(()=>{var le;if(!e._cropModeEnabled)return;const ye=(le=a.current)===null||le===void 0?void 0:le.getStage();function Re(Pe){e._cropModeEnabled&&Pe.target!==l.current&&e.toggleCropMode(!1)}function Me(Pe){e._cropModeEnabled&&Pe.target.parentNode!==ye.content&&e.toggleCropMode(!1)}return document.body.addEventListener("click",Me),ye?.on("click",Re),ye?.on("tap",Re),()=>{document.body.removeEventListener("click",Me),document.body.removeEventListener("touchstart",Me),ye?.off("click",Re),ye?.off("click",Re)}},[e._cropModeEnabled]),ce.useLayoutEffect(()=>{if(!n&&!e._cropModeEnabled)return _s(a.current,e),Ou(()=>{_s(a.current,e)},{delay:100})},[c,n,S,b,e._cropModeEnabled]),ce.useLayoutEffect(()=>{var le;n||e._cropModeEnabled?(le=a.current)===null||le===void 0||le.clearCache():_s(a.current,e)},[n,e.width,e.height,e._cropModeEnabled]),ce.useEffect(()=>{_s(a.current,e)},[e.shadowEnabled,e.shadowBlur,e.cornerRadius,e.shadowColor,e.shadowOffsetX,e.shadowOffsetY,e.shadowOpacity]);const V=ce.useRef(null),Y=ce.useRef(null),U=ce.useRef(null);ce.useLayoutEffect(()=>{e._cropModeEnabled&&(Y.current.nodes([V.current]),U.current.nodes([l.current]))},[e._cropModeEnabled]);const D=le=>{Math.round(le.target.x())>0&&(le.target.x(0),le.target.scaleX(1)),Math.round(le.target.y())>0&&(le.target.y(0),le.target.scaleY(1));const ye=le.target.width()*le.target.scaleX(),Re=le.target.height()*le.target.scaleY(),Me=Math.min(1,M/ye),Pe=Math.min(1,O/Re),de=1-Me,Te=Math.min(de,Math.max(0,Math.round(-le.target.x())/ye)),Ae=1-Pe,be=Math.min(Ae,Math.max(0,Math.round(-le.target.y())/Re));le.target.setAttrs({x:-Te*c.width,y:-be*c.height,scaleX:1,scaleY:1}),e.set({cropX:Te,cropY:be,cropWidth:Me,cropHeight:Pe})},j=()=>{e.type!=="svg"&&e.contentEditable&&setTimeout(()=>{e.toggleCropMode(!0)})},z=v==="loading",Z=v==="failed",re=!z&&!Z,W=ce.useRef({cropX:0,cropY:0,cropWidth:0,cropHeight:0}),Q=re?e.a.opacity:0;xp(a,Q);const se=e.selectable||t.role==="admin",ue=lf();return ce.createElement(ce.Fragment,null,z&&ce.createElement(mC,{element:e}),Z&&ce.createElement(yC,{element:e}),ce.createElement(bu,{ref:a,name:"element",id:e.id,image:G,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:Q,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:T,listening:se,draggable:ue?e.draggable&&o:e.draggable,preventDefault:!ue||o,hideInExport:!e.showInExport,onDragMove:le=>{e.set({x:le.target.x(),y:le.target.y()})},onDragEnd:le=>{e.set({x:le.target.x(),y:le.target.y()})},onDblClick:j,onDblTap:j,onTransformStart:()=>{i(!0),W.current={cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}},onTransform:le=>{var ye;const Re=le.currentTarget,Me=Math.abs(Re.scaleX()-1)<1e-7?1:Re.scaleX(),Pe=Math.abs(Re.scaleY()-1)<1e-7?1:Re.scaleY();Re.scaleX(1),Re.scaleY(1);const de=(ye=le.target.getStage())===null||ye===void 0?void 0:ye.findOne("Transformer"),Te=1-M/c.width,Ae=Math.min(Te,Math.max(0,e.cropX)),be=1-O/c.height,_e=Math.min(be,Math.max(0,e.cropY)),xe=de.getActiveAnchor(),Le=!(xe.indexOf("middle")>=0||xe.indexOf("center")>=0),pe=!Le&&Me<1&&W.current.cropHeight>O/c.height;let Ce=Le?e.cropWidth:e.cropWidth*Me;pe&&(Ce=e.cropWidth);const je=!Le&&Pe<1&&W.current.cropWidth>M/c.width;let He=Le?e.cropHeight:e.cropHeight*Pe;je&&(He=e.cropHeight),R&&(Ce=e.cropWidth,He=e.cropHeight),e.set({cropX:Ae,cropY:_e,x:Re.x(),y:Re.y(),width:Re.width()*Me,height:Re.height()*Pe,rotation:le.target.rotation(),cropWidth:Math.min(Ce,1-Ae),cropHeight:Math.min(He,1-_e)})},onTransformEnd:le=>{const ye=le.currentTarget;e.set({width:ye.width(),height:ye.height(),x:ye.x(),y:ye.y(),rotation:le.target.rotation(),cropWidth:M/c.width,cropHeight:O/c.height}),i(!1)}}),ce.createElement(En,{x:e.a.x,y:e.a.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:Q,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,k-e.borderSize),hideInExport:!e.showInExport}),!t.isPlaying&&ce.createElement(bu,{image:u?h_:f_,x:e.a.x,y:e.a.y,offsetX:-e.a.width/2+15/t.scale,offsetY:-e.a.height/2+15/t.scale,rotation:e.a.rotation,width:30/t.scale,height:30/t.scale,hideInExport:!0,onClick:()=>d(!u),onTap:()=>d(!u)}),e._cropModeEnabled&&ce.createElement(bm,{selector:".page-abs-container",enabled:!0},ce.createElement(En,{x:-window.innerWidth/t.scale,y:-window.innerWidth/t.scale,width:window.innerWidth/t.scale*3,height:window.innerWidth/t.scale*3,fill:"rgba(0,0,0,0.3)"}),ce.createElement(bu,{listening:!1,image:G,x:e.a.x,y:e.a.y,width:e.a.width,height:e.a.height,rotation:e.a.rotation,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur}),ce.createElement(vn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,scaleX:H,scaleY:H},ce.createElement(bu,{image:c,ref:l,opacity:.4,draggable:!0,x:-e.cropX*c.width,y:-e.cropY*c.height,onDragMove:D,onTransform:D}),ce.createElement(lp,{ref:U,anchorSize:20,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(le,ye)=>ye.width<5||ye.height<5?le:ye,rotateEnabled:!1,borderEnabled:!1,anchorCornerRadius:10,anchorStrokeWidth:2,borderStrokeWidth:2}),ce.createElement(En,{width:M,height:O,ref:V,listening:!1,onTransform:le=>{le.target.x()<-e.cropX*c.width-1e-9&&(le.target.x(-e.cropX*c.width),le.target.scaleX(1)),le.target.y()<-e.cropY*c.height-1e-9&&(le.target.y(-e.cropY*c.height),le.target.scaleY(1));const ye=Math.min(1,Math.max(0,e.cropX+le.target.x()/c.width)),Re=Math.min(1,Math.max(0,le.target.y()/c.height+e.cropY)),Me=le.target.width()*le.target.scaleX(),Pe=le.target.height()*le.target.scaleY(),de=Math.min(1-ye,Me/c.width),Te=Math.min(1-Re,Pe/c.height),Ae=le.target.getAbsolutePosition(le.target.getParent().getParent());le.target.scale({x:1,y:1}),le.target.position({x:0,y:0}),e.set({x:Ae.x,y:Ae.y,cropX:ye,cropY:Re,cropWidth:de,cropHeight:Te,width:Math.min(Me*H,c.width*(1-ye)*H),height:Math.min(Pe*H,c.height*(1-Re)*H)})}}),ce.createElement(lp,{ref:Y,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],boundBoxFunc:(le,ye)=>ye.width<5||ye.height<5?le:ye,keepRatio:!1,rotateEnabled:!1,anchorFill:"rgb(240, 240, 240)",anchorStrokeWidth:2,borderStrokeWidth:2,visible:e.resizable}))))}),Mm=({width:e,height:t,cornerRadius:r})=>{if(r>0){const n=Math.min(r,e/2,t/2);return`M 0 ${n} A ${n} ${n} 0 0 1 ${n} 0 L ${e-n} 0 A ${n} ${n} 0 0 1 ${e} ${n} L ${e} ${t-n} A ${n} ${n} 0 0 1 ${e-n} ${t} L ${n} ${t} A ${n} ${n} 0 0 1 0 ${t-n} Z`}return`M 0 0 L ${e} 0 L ${e} ${t} L 0 ${t} Z`},_C=({width:e,height:t})=>`M ${e/2} 0 L ${e} ${t} L 0 ${t} Z`,xC=({width:e,height:t})=>`M 0 0 L ${e} 0 L 0 ${t} Z`,SC=({width:e,height:t})=>`M ${e/2} ${t/2} m -${e/2}, 0 a ${e/2},${t/2} 0 1,0 ${e},0 a ${e/2},${t/2} 0 1,0 -${e},0`;function EC({width:e,height:t}){const r=e/2,n=t/2,i=e/2,a=t/2,l=i/2,o=a/2;let u="",d=Math.PI/5;for(let f=0;f<10;f++){const v=f%2==0?a:o,g=r+(f%2==0?i:l)*Math.sin(f*d),c=n-v*Math.cos(f*d);f===0?u=`M ${g} ${c}`:u+=` L ${g} ${c}`}return u+" Z"}function AC({width:e,height:t}){const r=e/2,n=t/2;return`M ${r} 0 L ${e} ${n} L ${r} ${t} L 0 ${n} Z`}function PC({width:e,height:t}){const r=e/2,n=t/2,i=e/2,a=t/2;let l="",o=2*Math.PI/5;for(let u=0;u<5;u++){const d=a,f=r+i*Math.sin(u*o),v=n-d*Math.cos(u*o);u===0?l=`M ${f} ${v}`:l+=` L ${f} ${v}`}return l+" Z"}function kC({width:e,height:t}){const r=e/2,n=t/2,i=e/2,a=t/2;let l="",o=2*Math.PI/6;for(let u=0;u<6;u++){const d=a,f=r+i*Math.sin(u*o),v=n-d*Math.cos(u*o);u===0?l=`M ${f} ${v}`:l+=` L ${f} ${v}`}return l+" Z"}function Nt({path:e,aspectRatio:t,width:r,height:n}){return{path:e,scaleX:r/t.width,scaleY:n/t.height}}function OC({width:e,height:t}){const r=.1*Math.min(e,t),n=.2*e,i=.2*t,a=.5*e;let l=`M ${r},0`;return l+=" H "+(e-r),l+=` A ${r},${r} 0 0 1 ${e},${r}`,l+=" V "+(t-r-i),l+=` A ${r},${r} 0 0 1 ${e-r},${t-i}`,l+=` H ${a+n/2}`,l+=` L ${a},${t}`,l+=` L ${a-n/2},${t-i}`,l+=` H ${r}`,l+=` A ${r},${r} 0 0 1 0,${t-r-i}`,l+=` V ${r}`,l+=` A ${r},${r} 0 0 1 ${r},0`,l+=" Z",l}function CC({width:e,height:t}){const r=.3*e,n=.3*t,i=e/2,a=t/2,l=i-r/2,o=i+r/2,u=a-n/2,d=a+n/2;let f=`M ${l},0 `;return f+=`H ${o} `,f+=`V ${u} `,f+=`H ${e} `,f+=`V ${d} `,f+=`H ${o} `,f+=`V ${t} `,f+=`H ${l} `,f+=`V ${d} `,f+="H 0 ",f+=`V ${u} `,f+=`H ${l} `,f+="V 0 ",f+="Z",f}const NC={rect:Mm,circle:SC,star:EC,triangle:_C,rightTriangle:xC,diamond:AC,pentagon:PC,hexagon:kC,speechBubble:OC,cross:CC,arc:({width:e,height:t})=>Nt({path:"M234 117C234 85.97 221.673 56.21 199.731 34.269C177.79 12.327 148.03 0 117 0C85.97 0 56.2103 12.327 34.2685 34.268C12.3268 56.21 0 85.97 0 117H117H234Z",aspectRatio:{width:234,height:117},width:e,height:t}),cloud:({width:e,height:t})=>Nt({path:"M216.41 57.006C216.961 54.084 217.249 51.069 217.249 47.986C217.249 21.4841 195.972 0 169.725 0C153.666 0 139.467 8.043 130.865 20.3575C122.606 13.3566 111.954 9.1402 100.327 9.1402C74.3322 9.1402 53.2123 30.2136 52.8094 56.364H52.8035C23.6407 56.364 0 80.235 0 109.682C0 139.129 23.6407 163 52.8035 163H208.197C237.359 163 261 139.129 261 109.682C261 83.056 241.672 60.99 216.41 57.006Z",aspectRatio:{width:261,height:163},width:e,height:t}),rightArrow:({width:e,height:t})=>{const r=.6*e;return`M 0 ${t/4} L ${r} ${t/4} L ${r} 0 L ${e} ${t/2} L ${r} ${t} L ${r} ${.75*t} L 0 ${.75*t} Z`},leftArrow:({width:e,height:t})=>{const r=.4*e;return`M ${e} ${t/4} L ${r} ${t/4} L ${r} 0 L 0 ${t/2} L ${r} ${t} L ${r} ${.75*t} L ${e} ${.75*t} Z`},downArrow:({width:e,height:t})=>{const r=.6*t;return`M ${e/4} 0 L ${e/4} ${r} L 0 ${r} L ${e/2} ${t} L ${e} ${r} L ${.75*e} ${r} L ${.75*e} 0 Z`},upArrow:({width:e,height:t})=>{const r=.4*t;return`M ${e/4} ${t} L ${e/4} ${r} L 0 ${r} L ${e/2} 0 L ${e} ${r} L ${.75*e} ${r} L ${.75*e} ${t} Z`},asterisk1:({width:e,height:t})=>Nt({path:"M45.5265 218.498C51.5466 222.87 58.5359 224.98 65.4742 224.98C75.916 224.98 86.221 220.2 92.853 211.217C92.872 211.198 92.89 211.178 92.907 211.157C92.923 211.136 92.939 211.115 92.954 211.094L92.977 211.061C92.993 211.039 93.008 211.017 93.023 210.996L116.491 178.725L139.959 210.996C139.982 211.031 140.006 211.058 140.029 211.088C140.04 211.102 140.05 211.116 140.061 211.132C151.115 226.188 172.355 229.505 187.473 218.515C202.608 207.526 205.992 186.278 195.074 171.104L195.05 171.066C195.03 171.034 195.014 171.01 194.989 170.985L171.572 138.696L209.512 126.346C227.334 120.545 237.129 101.305 231.33 83.476C225.532 65.648 206.315 55.8493 188.476 61.6334L150.537 73.933L150.52 34.0064C150.502 15.2594 135.248 0 116.508 0C97.768 0 82.514 15.2594 82.497 34.0234L82.463 73.916L44.5233 61.6163C44.5083 61.6163 44.49 61.613 44.4716 61.6078C44.4477 61.6014 44.4232 61.5918 44.4041 61.5823C26.5992 55.8664 7.45076 65.665 1.66886 83.46C-4.11314 101.254 5.61427 120.426 23.3511 126.278C23.3675 126.283 23.3822 126.289 23.3963 126.295L23.4588 126.319L23.4873 126.329L61.4098 138.679L37.9929 170.968C37.9844 170.985 37.9718 171.002 37.9591 171.019C37.9462 171.036 37.9336 171.053 37.9251 171.07C26.9903 186.244 30.3915 207.509 45.5265 218.498Z",aspectRatio:{width:233,height:225},width:e,height:t}),asterisk2:({width:e,height:t})=>Nt({path:"M46.0556 112L0 85.388L33.9456 26.6121L80.028 53.1781L80.054 0H147.946L147.972 53.1781L194.054 26.6121L228 85.388L181.944 112L228 138.612L194.054 197.388L147.972 170.822L147.946 224H80.054L80.028 170.822L33.9456 197.388L0 138.612L46.0556 112Z",aspectRatio:{width:228,height:224},width:e,height:t}),bookmark:({width:e,height:t})=>Nt({path:"M0 0H199V238L99.5 142.8L0 238V0Z",aspectRatio:{width:199,height:238},width:e,height:t}),butterfly:({width:e,height:t})=>Nt({path:"M94.5 100.713C91.935 150.916 50.703 190.909 0 191.493V0C50.703 0.5845 91.935 40.5767 94.5 90.78C97.031 41.2385 137.217 1.6407 187 0.0438004V191.45C137.217 189.853 97.031 150.255 94.5 100.713Z",aspectRatio:{width:187,height:192},width:e,height:t}),cylinder:({width:e,height:t})=>Nt({path:"M169 36.8497V218.15C169 238.502 131.168 255 84.5 255C37.832 255 0 238.502 0 218.15V36.8497C0 16.4982 37.832 0 84.5 0C131.168 0 169 16.4982 169 36.8497Z",aspectRatio:{width:169,height:255},width:e,height:t}),diamond2:({width:e,height:t})=>Nt({path:"M0 55.5L124 185L248 55.5L189.307 0H58.6933L0 55.5Z",aspectRatio:{width:248,height:185},width:e,height:t}),door:({width:e,height:t})=>Nt({path:"M140 69.697C140 31.2044 108.66 0 70 0C31.34 0 0 31.2044 0 69.697V207H140V69.697Z",aspectRatio:{width:140,height:207},width:e,height:t}),drop1:({width:e,height:t})=>Nt({path:"M167 150.687C167 196.328 129.407 234 83.139 234C37.593 234 0 196.328 0 150.687C0 100.7 51.329 36.9474 83.139 0C114.948 39.1207 167 98.526 167 150.687Z",aspectRatio:{width:167,height:234},width:e,height:t}),drop2:({width:e,height:t})=>Nt({path:"M73 239C53.64 239 35.071 231.315 21.3812 217.634C7.691 203.954 0 185.4 0 166.054C0 136.091 13.8696 113.633 30.768 86.27C43.912 64.9877 58.888 40.7377 70.597 7.6816C71.281 5.7496 72.989 0 72.989 0C72.989 0 72.993 0.0124998 73 0.0363998C73.007 0.0124998 73.011 0 73.011 0C73.011 0 74.719 5.7496 75.403 7.6816C87.112 40.7377 102.088 64.9877 115.232 86.27C132.13 113.633 146 136.091 146 166.054C146 185.4 138.309 203.954 124.619 217.634C111.025 231.218 92.225 239 73 239Z",aspectRatio:{width:146,height:239},width:e,height:t}),explosion:({width:e,height:t})=>Nt({path:"M165.802 184.465L118.997 260L125.343 182.079L34.9058 219.45L99.164 159.817L0 163.792L78.538 134.373L0 74.7401L86.471 89.052V0L118.997 89.052L165.802 10.3364L149.143 97.798L217.368 29.419L165.802 112.905L245.927 81.101L165.802 143.914H261L165.802 184.465Z",aspectRatio:{width:261,height:260},width:e,height:t}),flag:({width:e,height:t})=>Nt({path:"M0 142.161C0 142.161 51.9956 118.626 103 137.469C159.992 158.525 206 141.31 206 141.31V11.1373C206 11.1373 160 28.3218 103.016 7.28273C52 -11.553 0 12.0974 0 12.0974V142.161Z",aspectRatio:{width:206,height:148},width:e,height:t}),flower:({width:e,height:t})=>Nt({path:"M135.351 66.1893C196.683 -5.00591 256.536 100.304 164.908 117.361C256.536 135.16 195.944 239.728 135.351 168.532C166.386 257.526 45.9394 256.785 76.975 168.532C15.643 239.728 -44.2109 135.16 47.4173 117.361C-44.9498 100.304 15.643 -4.26431 76.975 66.1893C45.2005 -22.0631 166.386 -22.0631 135.351 66.1893ZM105.793 104.012C113.183 104.012 119.833 109.945 119.833 117.361C119.833 124.777 113.183 131.452 105.793 131.452C98.404 131.452 92.492 124.777 92.492 117.361C92.492 109.945 98.404 104.012 105.793 104.012Z",aspectRatio:{width:212,height:235},width:e,height:t}),frame:({width:e,height:t})=>Nt({path:"M0 0H240L200 88L240 176H0L40 88L0 0Z",aspectRatio:{width:240,height:176},width:e,height:t}),heart1:({width:e,height:t})=>Nt({path:"M215.886 56.157C215.886 24.729 191.112 0 160.584 0C135.933 0 115.08 16.983 107.937 39.93C100.788 16.986 79.935 0.591 55.284 0.591C24.75 0.591 0 24.615 0 56.055C0 71.919 6.321 83.127 16.494 95.121L107.988 189.447L199.377 95.121C209.559 83.127 215.886 72.009 215.886 56.157Z",aspectRatio:{width:216,height:190},width:e,height:t}),home:({width:e,height:t})=>Nt({path:"M0 62.143L95.5 0L191 62.143V195H0V62.143Z",aspectRatio:{width:191,height:195},width:e,height:t}),home2:({width:e,height:t})=>Nt({path:"M206 94.076L103 0L0 94.076H31.2377V189H175.607V94.076H206Z",aspectRatio:{width:206,height:189},width:e,height:t}),hourglass:({width:e,height:t})=>Nt({path:"M0.392782 0H187.607C193.014 43.3688 140.804 53.797 140.804 97.5C140.804 141.203 193.014 151.631 187.607 195H0.392782C-5.01452 151.631 47.196 141.203 47.196 97.5C47.196 53.797 -5.01452 43.3688 0.392782 0Z",aspectRatio:{width:188,height:195},width:e,height:t}),house:({width:e,height:t})=>Nt({path:"M0 92.367L95 0L190 92.367V223H0V92.367Z",aspectRatio:{width:190,height:223},width:e,height:t}),keyhole:({width:e,height:t})=>Nt({path:"M115 57.0494C115 25.5387 89.416 0 57.863 0C26.311 0 0.726898 25.5414 0.726898 57.0494C0.726898 78.652 12.759 97.451 30.505 107.136L0 219H114.845L84.448 107.524C102.608 97.962 115 78.959 115 57.0494Z",aspectRatio:{width:115,height:219},width:e,height:t}),kiss:({width:e,height:t})=>Nt({path:"M124.5 17.1468C80.036 -36.5162 0 52.9218 0 52.9218C0 52.9218 44.4643 120 124.5 120C204.536 120 249 52.9218 249 52.9218C249 52.9218 168.964 -36.5162 124.5 17.1468Z",aspectRatio:{width:249,height:120},width:e,height:t}),leaf:({width:e,height:t})=>Nt({path:"M204.414 0.0151567C204.414 0.0151567 206.837 93.9509 150.394 150.394C93.9507 206.837 0.0151569 204.413 0.0151569 204.413C0.0151569 204.413 -2.40835 110.478 54.0347 54.0349C110.478 -2.40834 204.414 0.0151567 204.414 0.0151567Z",aspectRatio:{width:205,height:205},width:e,height:t}),lightning1:({width:e,height:t})=>Nt({path:"M111.5 0L0 142H51.433L31.5 253L143 111H91.567L111.5 0Z",aspectRatio:{width:143,height:253},width:e,height:t}),lightning2:({width:e,height:t})=>Nt({path:"M126 0H43L0 120.531H36L6 227L110 80.354H73L126 0Z",aspectRatio:{width:126,height:227},width:e,height:t}),magnet:({width:e,height:t})=>Nt({path:"M88.402 0H0V67.669H88.402C105.271 67.669 118.957 81.308 118.957 98C118.957 114.689 105.271 128.331 88.402 128.331H0V196H88.402C142.747 196 187 152.072 187 98C187 43.9279 142.747 0 88.402 0Z",aspectRatio:{width:187,height:196},width:e,height:t}),mithosis:({width:e,height:t})=>Nt({path:"M150.996 136.45C137.141 128.926 117.559 128.7 103.532 135.896C93.843 140.867 82.875 143.67 71.2577 143.67C31.9033 143.67 0 111.508 0 71.835C0 32.161 31.9033 0 71.2577 0C83.467 0 94.959 3.0955 105.004 8.5504C118.859 16.0745 138.441 16.3 152.467 9.1038C162.157 4.1328 173.125 1.3303 184.742 1.3303C224.097 1.3303 256 33.492 256 73.165C256 112.839 224.097 145 184.742 145C172.533 145 161.041 141.905 150.996 136.45Z",aspectRatio:{width:256,height:145},width:e,height:t}),orangeRicky:({width:e,height:t})=>Nt({path:"M69 0H0V69V138V207H69H138V138H69V69V0Z",aspectRatio:{width:138,height:207},width:e,height:t}),party:({width:e,height:t})=>Nt({path:"M134.622 0L144.682 68.2539L174.415 5.9977L163.91 74.1846L210.671 23.4578L180.535 85.519L240.169 50.8289L193.079 101.25L260.29 85.679L200.43 119.98L269.245 124.911L201.934 140.044L266.237 165.04L197.456 159.661L251.535 202.5L187.396 177.086L226.445 233.962L172.646 190.771L193.197 256.631L154.518 199.501L154.743 268.492L134.622 202.5L114.501 268.492L114.727 199.501L76.0482 256.631L96.5985 190.771L42.7992 233.962L81.8489 177.086L17.7091 202.5L71.7885 159.661L3.0072 165.04L67.3112 140.044L0 124.911L68.8149 119.98L8.9545 85.679L76.1658 101.25L29.0753 50.8289L88.7105 85.519L58.5743 23.4578L105.335 74.1846L94.8305 5.9977L124.562 68.2539L134.622 0Z",aspectRatio:{width:270,height:269},width:e,height:t}),pillow:({width:e,height:t})=>Nt({path:"M176 0.00169945C157.812 16.9062 125.203 28.174 88.001 28.174C50.798 28.174 18.1881 16.9054 0 0V258.421C18.1882 241.516 50.798 230.248 88 230.248C125.202 230.248 157.812 241.516 176 258.421V0.00169945Z",aspectRatio:{width:176,height:259},width:e,height:t}),polygon:({width:e,height:t})=>Nt({path:"M110 0L219.119 63V189L110 252L0.880798 189V63L110 0Z",aspectRatio:{width:220,height:252},width:e,height:t}),rainbow:({width:e,height:t})=>Nt({path:"M186.907 141H282C282 63.128 218.872 0 141 0C63.1278 0 0 63.128 0 141H95.093C95.093 115.646 115.646 95.093 141 95.093C166.354 95.093 186.907 115.646 186.907 141Z",aspectRatio:{width:282,height:141},width:e,height:t}),rhodeIsland:({width:e,height:t})=>Nt({path:"M69 0H0V69V138H69V207H138V138V69H69V0Z",aspectRatio:{width:138,height:207},width:e,height:t}),shell:({width:e,height:t})=>Nt({path:"M109 0C169.199 0 218 48.743 218 108.87C185.392 108.87 158.958 135.273 158.958 167.842C158.958 179.736 158.958 191 158.958 191H59.042C59.042 191 59.042 179.736 59.042 167.842C59.042 135.273 32.6077 108.87 0 108.87C0 48.743 48.8007 0 109 0Z",aspectRatio:{width:218,height:191},width:e,height:t}),shield1:({width:e,height:t})=>Nt({path:"M203.184 30.7277C142.457 30.7277 102.853 0 102.853 0C102.853 0 63.249 30.7277 3.05098 30.7277C3.05098 30.7277 -3.81372 128.209 3.05098 162.115C9.38758 193.902 102.853 249 102.853 249C102.853 249 196.319 193.902 203.184 162.115C209.52 128.738 203.184 30.7277 203.184 30.7277Z",aspectRatio:{width:206,height:249},width:e,height:t}),shield2:({width:e,height:t})=>Nt({path:"M0 12.9585C64.624 -4.3195 136.376 -4.3195 201 12.9585C201 51.0564 201 89.154 201 127.252C201 184.396 100.498 240 100.498 240C100.498 240 0 184.406 0 127.252C0 89.154 0 51.0564 0 12.9585Z",aspectRatio:{width:201,height:240},width:e,height:t}),skewedRectangle:({width:e,height:t})=>Nt({path:"M85.9799 0H290L204.02 141H0L85.9799 0Z",aspectRatio:{width:290,height:141},width:e,height:t}),softFlower:({width:e,height:t})=>Nt({path:"M109 0C80.073 0 56.6234 23.4498 56.6234 52.3766C56.6234 54.722 54.722 56.6234 52.3766 56.6234C23.4498 56.6234 0 80.073 0 109C0 137.927 23.4498 161.377 52.3766 161.377C54.722 161.377 56.6234 163.278 56.6234 165.623C56.6234 194.55 80.073 218 109 218C137.927 218 161.377 194.55 161.377 165.623C161.377 163.278 163.278 161.377 165.623 161.377C194.55 161.377 218 137.927 218 109C218 80.073 194.55 56.6234 165.623 56.6234C163.278 56.6234 161.377 54.722 161.377 52.3766C161.377 23.4498 137.927 0 109 0Z",aspectRatio:{width:218,height:218},width:e,height:t}),softStar:({width:e,height:t})=>Nt({path:"M130.424 3.17662C130.927 -1.05888 137.073 -1.05888 137.576 3.17662L141.792 38.7086C147.236 84.59 183.41 120.764 229.291 126.208L264.823 130.424C269.059 130.927 269.059 137.073 264.823 137.576L229.291 141.792C183.41 147.236 147.236 183.41 141.792 229.291L137.576 264.823C137.073 269.059 130.927 269.059 130.424 264.823L126.208 229.291C120.764 183.41 84.59 147.236 38.7086 141.792L3.17662 137.576C-1.05888 137.073 -1.05888 130.927 3.17662 130.424L38.7086 126.208C84.59 120.764 120.764 84.59 126.208 38.7086L130.424 3.17662Z",aspectRatio:{width:268,height:268},width:e,height:t}),stairs1:({width:e,height:t})=>Nt({path:"M0 0H67.667V67.667H135.333V135.333H203V203H0V0Z",aspectRatio:{width:203,height:203},width:e,height:t}),stairs2:({width:e,height:t})=>Nt({path:"M50 0H0V200H200V150H150V100H100V50H50V0Z",aspectRatio:{width:200,height:200},width:e,height:t}),teewee:({width:e,height:t})=>Nt({path:"M69 0H138V69H207V138H138H69H0V69H69V0Z",aspectRatio:{width:207,height:138},width:e,height:t}),blob1:({width:e,height:t})=>Nt({path:"M172.979 19.611C191.285 33.0858 204.505 54.442 210.861 78.5949C217.471 103.002 217.471 130.46 205.776 151.816C194.335 173.427 171.454 189.444 147.047 196.054C122.639 202.919 96.7069 200.631 75.3506 190.715C54.2486 180.546 37.7229 163.003 23.4855 142.155C9.5022 121.307 -2.19289 97.4087 0.349524 74.7813C3.14617 52.1538 19.9261 30.7976 40.2654 17.8313C60.6046 4.61077 84.5033 -0.474048 108.148 0.0344341C131.538 0.542916 154.928 6.13621 172.979 19.611Z",aspectRatio:{width:216,height:200},width:e,height:t}),blob10:({width:e,height:t})=>Nt({path:"M188.684 8.95173C205.601 24.3309 200.988 63.0866 191.453 99.3816C182.225 135.677 168.076 169.511 146.238 175.355C124.399 181.507 94.871 159.668 66.5733 143.059C37.9679 126.449 10.5929 115.068 2.59569 95.0754C-5.4015 75.0824 5.97912 46.1694 24.4342 30.4826C42.8893 14.7958 68.4188 12.0276 100.715 6.79864C132.704 1.5697 171.767 -6.42749 188.684 8.95173Z",aspectRatio:{width:200,height:177},width:e,height:t}),blob11:({width:e,height:t})=>Nt({path:"M137.368 29.4923C148.97 46.7605 146.542 72.1231 148.161 99.1046C149.779 126.086 155.715 154.956 144.113 174.383C132.781 193.81 103.911 203.793 80.4369 198.666C56.963 193.27 38.6156 173.034 28.3626 153.607C17.8398 134.181 15.4115 115.833 9.47555 91.5498C3.53961 67.2664 -5.63411 37.3169 4.61887 20.0488C15.1417 2.51078 45.0911 -1.80626 72.8821 0.622074C100.673 2.78059 126.036 12.2241 137.368 29.4923Z",aspectRatio:{width:152,height:200},width:e,height:t}),blob12:({width:e,height:t})=>Nt({path:"M158.391 17.923C172.491 28.5703 180.261 48.1384 187.743 70.5842C194.937 93.3177 202.419 118.641 194.649 138.785C187.167 158.928 164.146 173.317 138.535 184.54C112.923 196.05 84.4347 204.108 58.8235 197.777C33.2123 191.446 10.191 170.439 2.99688 146.267C-4.48504 121.807 3.57241 94.181 10.4788 68.282C17.0974 42.0953 22.565 17.6352 37.8166 7.27563C53.0682 -3.37171 78.1038 0.081487 100.837 2.67138C123.859 5.26127 144.29 7.27563 158.391 17.923Z",aspectRatio:{width:198,height:200},width:e,height:t}),blob13:({width:e,height:t})=>Nt({path:"M149.668 1.37595C170.663 5.22017 193.728 17.3442 198.755 34.7911C204.078 52.2379 191.363 75.3032 178.943 93.9329C166.819 112.563 154.99 126.757 140.501 145.386C126.011 164.312 108.86 187.673 92.5957 186.194C76.3317 185.011 60.9549 159.285 45.8737 140.655C30.4968 122.321 15.7114 110.788 7.43151 95.1157C-0.848339 79.4432 -2.32688 59.0392 3.5873 41.5924C9.50148 23.8498 23.1041 8.76868 38.7767 3.44592C54.745 -1.87685 73.3746 2.55879 91.7086 2.26308C110.338 2.26308 128.968 -2.17256 149.668 1.37595Z",aspectRatio:{width:200,height:187},width:e,height:t}),blob14:({width:e,height:t})=>Nt({path:"M137.838 28.6426C150.711 40.5617 165.014 46.5213 178.363 58.2021C191.474 69.8828 203.87 87.0464 198.864 99.6807C193.858 112.315 171.689 120.42 157.862 135.676C144.275 151.171 139.269 173.579 126.873 182.161C114.477 190.505 94.9294 185.022 76.8123 178.109C58.4568 171.196 41.5316 163.091 28.1822 150.456C14.5943 137.822 4.58225 120.42 1.24488 101.826C-2.09248 83.2322 1.00651 62.9697 13.8792 52.4809C26.7519 41.992 49.1598 41.0385 65.6083 30.788C82.0567 20.5376 92.0688 0.990158 103.034 0.0366268C113.762 -0.916905 125.204 16.9618 137.838 28.6426Z",aspectRatio:{width:200,height:187},width:e,height:t}),blob15:({width:e,height:t})=>Nt({path:"M185.203 1.52939C197.679 7.62217 200 32.2835 200 51.7223C200 71.1612 197.389 85.3777 197.679 100.175C198.259 114.681 201.741 129.768 198.259 143.114C194.778 156.46 184.623 168.356 171.567 173.868C158.801 179.671 143.134 179.091 130.368 174.739C117.312 170.387 106.867 162.263 86.8482 160.812C66.539 159.362 36.9454 164.294 18.9572 155.3C0.968966 146.306 -5.41395 123.095 5.03083 105.977C15.4756 88.5692 42.4579 77.5442 55.5139 59.5559C68.2798 41.8578 67.1192 17.4867 76.9837 9.6531C86.5581 2.10965 107.158 11.3939 128.627 9.6531C150.097 8.20244 172.728 -4.27327 185.203 1.52939Z",aspectRatio:{width:200,height:179},width:e,height:t}),blob16:({width:e,height:t})=>Nt({path:"M158.441 55.3221C167.253 80.2399 160.264 105.462 147.501 134.938C134.738 164.717 116.81 199.055 97.0576 199.967C77.3057 201.182 55.7305 168.668 34.4592 133.722C13.1879 99.0802 -7.77953 62.3112 2.85612 36.4818C13.4918 10.6523 56.0344 -3.93369 90.0685 0.928322C123.799 6.09421 149.324 30.7081 158.441 55.3221Z",aspectRatio:{width:163,height:200},width:e,height:t}),blob17:({width:e,height:t})=>Nt({path:"M168.917 36.7587C178.871 53.2457 175.138 76.5764 172.961 106.129C170.472 135.37 169.85 170.832 150.563 187.63C131.276 204.739 93.3252 203.495 65.0173 187.63C36.7095 172.077 18.0449 142.213 7.77943 107.373C-2.79714 72.2213 -4.35252 32.7147 14.312 14.0502C32.9765 -4.3033 72.1721 -1.50361 103.591 4.7179C135.32 10.6283 158.962 20.2717 168.917 36.7587Z",aspectRatio:{width:176,height:200},width:e,height:t}),blob18:({width:e,height:t})=>Nt({path:"M178.188 21.1464C193.012 36.3069 196.381 62.9219 198.739 88.1893C200.76 113.12 201.771 136.366 190.316 149.168C178.862 162.307 155.279 164.665 135.065 167.697C115.188 170.73 99.0168 174.098 72.4018 177.131C46.1237 180.163 9.40176 182.521 1.65309 168.371C-6.09559 154.221 15.4659 123.564 23.5515 92.9059C31.6371 62.2481 26.2467 31.2534 38.3751 15.4192C50.1665 -0.0781831 79.8136 -1.08888 107.776 0.595609C136.076 1.9432 163.028 5.64909 178.188 21.1464Z",aspectRatio:{width:200,height:180},width:e,height:t}),blob19:({width:e,height:t})=>Nt({path:"M148.621 13.3857C171.945 24.3818 194.937 41.3756 192.938 60.702C190.605 80.3615 163.282 101.687 149.953 123.346C136.958 145.005 137.958 166.664 128.295 174.661C118.631 182.325 98.3054 175.994 73.6476 181.991C48.9899 187.989 20.0004 205.983 11.0036 197.986C1.67366 189.989 12.6697 156.001 12.3365 131.343C12.0033 106.685 0.340809 91.0243 0.00759636 75.0301C-0.325616 59.0359 10.3372 42.3753 25.3318 28.7135C39.9931 15.0518 58.9863 4.05578 80.3119 1.05687C101.638 -2.27526 124.962 2.38972 148.621 13.3857Z",aspectRatio:{width:194,height:200},width:e,height:t}),blob2:({width:e,height:t})=>Nt({path:"M140.464 18.6393C156.081 28.3718 169.887 39.9149 178.714 54.853C187.541 69.5649 191.389 87.6717 189.578 104.421C187.768 121.396 180.525 137.239 172.377 153.535C164.455 169.832 155.854 186.58 142.048 194.276C128.241 201.971 109.456 200.613 92.4804 197.671C75.2789 194.502 60.1144 189.749 45.1762 182.733C30.4644 175.716 16.2052 166.21 8.28346 153.083C0.361703 139.729 -1.44898 122.527 1.04072 106.91C3.30408 91.2931 9.64147 76.8076 15.9789 60.5114C22.0899 44.2153 28.201 26.1084 40.6495 14.7916C53.0979 3.24849 71.8838 -1.27823 89.7643 0.306124C107.871 1.66414 124.846 9.13322 140.464 18.6393Z",aspectRatio:{width:191,height:200},width:e,height:t}),blob20:({width:e,height:t})=>Nt({path:"M150.035 13.2464C157.376 24.9386 153.026 48.323 157.92 65.7254C163.087 83.1277 177.498 94.2761 182.392 108.415C187.287 122.555 182.392 139.957 173.147 156.272C163.63 172.587 149.763 187.814 132.089 195.155C114.414 202.225 93.2053 201.137 73.6276 194.611C54.3219 188.357 36.9196 176.937 25.7712 161.438C14.8947 145.667 10.5441 126.09 5.92163 105.696C1.57105 85.0311 -3.05145 63.5501 2.65869 45.0601C8.64075 26.5701 24.6835 11.0711 43.1735 4.54524C61.6635 -1.98064 82.6007 0.194657 102.722 1.01039C122.844 1.82613 142.421 1.55421 150.035 13.2464Z",aspectRatio:{width:185,height:200},width:e,height:t}),blob21:({width:e,height:t})=>Nt({path:"M152.611 0.184799C172.596 -0.723643 197.73 1.39606 199.85 13.8114C201.969 26.2268 181.075 48.9379 174.716 68.0151C168.357 87.0924 176.533 102.536 174.11 114.649C171.991 127.064 159.575 136.148 146.252 139.782C132.928 143.719 118.696 141.902 105.977 139.176C93.562 136.451 82.6606 132.212 63.2805 131.909C43.9004 131.606 16.0416 135.24 5.44306 125.853C-5.15543 116.465 1.50648 94.0572 10.2881 76.4939C18.7669 59.2335 29.6682 46.8182 38.7526 35.3112C48.1398 23.5015 56.3158 12.903 66.9143 8.36078C77.5128 4.12138 91.1394 6.24108 104.766 5.63546C118.696 4.72701 132.928 1.09324 152.611 0.184799Z",aspectRatio:{width:200,height:143},width:e,height:t}),blob22:({width:e,height:t})=>Nt({path:"M195.507 15.5715C206.818 33.1668 193.622 69.3001 190.166 101.663C186.71 134.34 193.308 163.561 181.996 178.014C170.685 192.153 141.464 191.525 114.443 189.326C87.1072 187.44 62.2852 183.67 40.6052 169.531C19.2395 155.077 1.6441 130.255 0.0730908 103.862C-1.18372 77.4694 13.898 49.5054 35.2638 31.91C56.6296 14.0004 84.5936 6.45958 116.328 2.37494C148.063 -1.70969 184.196 -2.3381 195.507 15.5715Z",aspectRatio:{width:200,height:191},width:e,height:t}),blob23:({width:e,height:t})=>Nt({path:"M135.742 9.14189C157.815 19.2326 179.258 38.4681 176.105 56.7576C172.951 74.7317 145.202 92.0751 127.858 109.734C110.83 127.077 104.523 145.052 87.4953 164.918C70.4672 184.468 42.7177 206.227 27.5816 198.343C12.4455 190.46 9.60747 153.566 6.45411 126.762C2.98542 100.274 -0.798607 84.1917 0.147399 67.1636C0.77807 50.4508 6.76944 32.4767 19.0675 20.8093C31.0503 9.14189 49.6551 3.78119 70.4672 1.2585C90.964 -1.26418 113.668 -0.633508 135.742 9.14189Z",aspectRatio:{width:177,height:200},width:e,height:t}),blob24:({width:e,height:t})=>Nt({path:"M165.663 24.3715C171.555 44.4059 158.003 76.2254 151.816 96.2598C145.923 116.294 147.691 124.544 148.28 135.445C148.575 146.346 147.396 159.309 140.62 170.8C133.549 181.996 120.88 191.424 104.381 196.432C87.8821 201.441 67.553 202.03 54.8841 192.602C41.9207 183.469 36.6174 164.023 25.1271 143.105C13.3421 122.187 -4.33535 99.7953 0.967891 85.0641C6.27113 70.6275 34.2604 63.8511 56.0626 48.5307C77.5702 33.5048 92.8907 9.93489 113.22 2.56928C133.843 -4.79633 159.77 4.04241 165.663 24.3715Z",aspectRatio:{width:168,height:200},width:e,height:t}),blob25:({width:e,height:t})=>Nt({path:"M180.115 1.256C192.651 2.1962 189.83 34.163 190.771 58.2947C191.711 82.4265 196.098 98.4099 198.606 117.214C201.113 136.018 201.426 157.642 189.204 165.791C177.294 173.626 153.163 167.671 135.299 163.91C117.749 159.836 106.466 157.956 85.7818 162.97C65.0974 168.298 35.3244 180.521 18.7143 174.253C1.79068 167.985 -1.97012 142.913 0.850478 120.975C3.67107 99.0367 13.0731 79.6059 18.4009 54.8473C23.7287 30.0888 24.9823 -0.310996 40.0254 0.00240332C54.7552 0.00240332 82.9612 31.029 111.167 31.029C139.373 31.029 167.579 0.315802 180.115 1.256Z",aspectRatio:{width:200,height:176},width:e,height:t}),blob26:({width:e,height:t})=>Nt({path:"M142.571 0.586925C159.976 3.39414 176.258 15.1844 184.96 30.9048C193.662 46.6253 194.224 66.8372 189.171 83.6805C183.837 100.805 172.327 114.56 163.064 129.157C153.8 143.755 146.501 158.914 134.43 173.231C122.359 187.828 105.516 201.303 89.5146 199.899C73.2327 198.776 58.0738 182.775 42.9148 169.862C28.0366 157.23 13.7198 147.685 6.42103 134.491C-0.877729 121.297 -1.15845 103.892 1.64876 88.4528C4.45598 72.7324 10.0704 58.6963 18.4921 47.4674C27.1944 36.2386 38.4233 27.8169 50.4943 22.2025C62.846 16.3073 75.7592 13.5001 91.1989 8.72785C106.919 4.23631 125.166 -1.93957 142.571 0.586925Z",aspectRatio:{width:193,height:200},width:e,height:t}),blob27:({width:e,height:t})=>Nt({path:"M112.602 54.9337C129.225 71.8646 155.391 78.9448 158.777 89.719C162.471 100.493 143.693 114.654 127.07 135.586C110.447 156.519 96.2866 184.224 71.0442 194.998C46.1096 205.465 10.4008 199.308 2.0893 178.375C-6.22223 157.443 12.5557 121.734 18.4045 92.1817C24.5612 62.6296 17.7889 38.9263 26.4082 21.9954C34.7197 5.06454 58.423 -5.40183 73.5069 2.9097C88.8986 10.9134 95.9788 38.0028 112.602 54.9337Z",aspectRatio:{width:160,height:200},width:e,height:t}),blob28:({width:e,height:t})=>Nt({path:"M125.281 68.5835C142.15 82.9923 165.344 90.021 181.862 108.998C198.028 127.624 207.516 158.902 192.405 166.634C177.293 174.716 137.581 159.605 112.629 156.442C87.326 152.928 77.1344 161.713 59.9142 165.579C43.0453 169.445 19.1478 168.391 11.7677 157.496C4.73907 146.25 14.2278 124.813 11.4163 94.2382C8.2534 63.6634 -6.85825 23.9514 3.68476 8.48836C14.2278 -7.32615 50.4254 1.10826 73.9715 16.2199C97.5175 31.683 108.412 54.1747 125.281 68.5835Z",aspectRatio:{width:200,height:169},width:e,height:t}),blob29:({width:e,height:t})=>Nt({path:"M162.987 10.2348C169.16 25.1809 154.864 58.6471 147.066 79.4417C139.268 100.236 138.293 108.359 134.719 114.532C131.47 120.706 125.297 124.93 119.448 143.45C113.6 161.97 107.426 194.461 98.004 199.335C88.5814 204.209 75.5849 181.14 55.7651 167.494C35.6203 153.522 8.65241 148.648 1.8292 135.327C-4.994 122.33 8.65241 100.561 20.0244 82.041C31.3964 63.5208 40.1691 48.2498 53.4906 35.5782C66.8122 22.9065 84.0326 13.159 106.452 6.33584C128.871 -0.812285 156.489 -4.71127 162.987 10.2348Z",aspectRatio:{width:165,height:200},width:e,height:t}),blob3:({width:e,height:t})=>Nt({path:"M158.095 64.2637C176.543 95.19 192.277 129.1 181.697 155.686C171.117 182.001 133.951 201.533 99.4982 199.905C64.7739 198.549 33.0338 176.032 15.4004 145.377C-2.23296 114.994 -5.75963 76.2002 10.2461 46.6303C26.2518 17.0605 61.5185 -3.557 89.732 0.512241C118.217 4.58149 139.377 33.0662 158.095 64.2637Z",aspectRatio:{width:186,height:200},width:e,height:t}),blob30:({width:e,height:t})=>Nt({path:"M146.076 34.4585C157.052 54.582 155.833 80.1936 164.675 100.622C173.212 121.355 191.201 136.905 189.372 149.711C187.542 162.212 165.285 171.969 146.99 175.018C129.001 178.372 114.671 174.713 103.39 175.018C92.1083 175.018 83.876 178.982 66.8015 186.299C49.7271 193.617 23.8105 204.288 14.3586 198.19C4.90665 191.787 11.6145 168.615 10.3949 147.882C8.87037 127.148 -0.581561 108.549 0.0282404 89.3407C0.638042 70.1319 11.6145 50.6182 28.384 32.934C44.8487 15.5546 67.4113 0.309578 89.974 0.00467694C112.537 -0.300224 135.099 14.335 146.076 34.4585Z",aspectRatio:{width:190,height:200},width:e,height:t}),blob31:({width:e,height:t})=>Nt({path:"M134.218 44.0392C153.568 36.4264 184.97 26.9105 195.755 33.2544C206.222 39.9156 195.755 62.1194 181.481 76.3933C166.89 90.35 148.175 96.0596 145.638 116.36C143.1 136.661 156.74 171.235 151.664 183.923C146.589 196.928 123.434 187.413 105.036 178.531C86.6388 169.967 73.3165 161.72 52.0643 158.548C30.812 155.058 1.62986 156.644 0.0438693 145.225C-1.22492 133.806 25.4197 109.382 29.2261 86.8609C32.7152 64.3398 13.6834 44.0392 11.7802 26.9105C9.877 9.46461 24.7853 -4.80928 42.5484 1.53467C59.9942 7.87863 79.9777 34.5232 93.6172 45.308C107.257 56.4099 114.869 51.3347 134.218 44.0392Z",aspectRatio:{width:200,height:191},width:e,height:t}),blob32:({width:e,height:t})=>Nt({path:"M200 100.339C200 149.831 145.763 197.966 95.5932 197.966C45.7627 197.966 0 149.831 0 100.339C0 50.8475 45.7627 0 95.5932 0C145.763 0 200 50.8475 200 100.339Z",aspectRatio:{width:200,height:198},width:e,height:t}),blob4:({width:e,height:t})=>Nt({path:"M183.427 38.712C198.21 63.2519 196.141 95.1833 189.341 126.523C182.836 157.863 171.305 188.908 150.609 197.482C130.208 205.76 100.642 192.16 69.8936 177.968C39.4405 164.072 7.80478 150.176 1.30024 128.593C-5.2043 107.01 13.718 77.7393 35.3012 51.7211C56.5888 25.9986 81.1287 3.23272 108.921 0.276112C137.009 -2.38484 168.349 14.4678 183.427 38.712Z",aspectRatio:{width:195,height:200},width:e,height:t}),blob5:({width:e,height:t})=>Nt({path:"M166.251 30.6913C183.816 48.5185 195.875 71.8512 199.021 98.8542C202.429 125.595 197.186 155.744 179.359 169.115C161.794 182.223 131.645 178.815 103.331 176.979C75.0171 175.144 48.8006 174.882 29.6625 161.512C10.7866 148.141 -0.748681 121.925 0.0378149 96.2326C0.824311 70.8025 14.1947 46.159 33.0706 28.3318C52.2087 10.5045 76.8522 -0.5064 100.971 0.0179307C125.091 0.804426 148.423 12.864 166.251 30.6913Z",aspectRatio:{width:200,height:179},width:e,height:t}),blob6:({width:e,height:t})=>Nt({path:"M149.146 50.5452C161.911 68.0278 171.901 81.9028 176.619 97.9979C181.336 114.37 180.781 133.241 173.011 149.891C165.519 166.541 151.366 180.693 133.051 189.851C114.736 199.008 92.2586 202.893 71.446 197.621C50.6334 192.348 30.9308 177.918 18.1658 158.216C5.12323 138.791 -0.981801 113.815 0.128204 87.7304C1.51571 61.6453 10.6733 34.1726 29.2658 17.5226C48.1359 1.14999 76.996 -4.40004 98.9186 3.6475C120.841 11.695 136.381 32.7851 149.146 50.5452Z",aspectRatio:{width:180,height:200},width:e,height:t}),blob7:({width:e,height:t})=>Nt({path:"M158.662 41.8295C178.593 57.8305 204.138 64.5677 213.402 79.7266C222.666 94.6047 215.367 118.466 203.015 135.028C190.383 151.871 172.698 161.977 156.416 168.434C140.134 174.89 124.975 177.697 104.483 185.277C83.9903 192.856 58.1642 205.208 44.9704 197.629C31.4959 190.33 31.2152 163.1 21.9514 138.116C12.9684 112.851 -4.71688 90.1132 1.17822 75.5158C7.35404 61.1991 36.8295 55.5847 58.7256 40.1452C80.9024 24.7056 95.4998 -0.278374 109.816 0.00234533C124.414 0.283064 138.45 25.8285 158.662 41.8295Z",aspectRatio:{width:218,height:200},width:e,height:t}),blob8:({width:e,height:t})=>Nt({path:"M153.53 11.0108C168.179 18.1858 181.931 29.5461 192.993 44.4939C203.755 59.4417 212.425 78.2759 210.631 96.5122C209.136 114.748 197.477 132.088 182.529 142.252C167.581 152.716 148.747 156.004 128.717 168.262C108.687 180.22 87.1622 201.147 69.8228 199.951C52.7823 198.456 39.6283 174.54 32.4533 153.015C25.2784 131.49 24.0826 112.357 16.6087 91.131C9.13477 70.2041 -4.31825 46.8855 1.36191 31.9377C7.04207 16.691 31.8554 9.51607 52.7823 5.33069C73.4103 0.846349 90.4507 -0.648433 106.594 0.248435C123.037 1.1453 138.882 4.13486 153.53 11.0108Z",aspectRatio:{width:211,height:200},width:e,height:t}),blob9:({width:e,height:t})=>Nt({path:"M140.289 20.2182C156.96 27.7956 176.661 32.0895 189.29 43.9608C201.667 55.5796 206.718 75.0283 202.424 91.6987C198.131 108.622 184.491 122.766 175.651 140.952C166.81 158.885 162.769 180.607 150.393 191.216C138.016 201.824 117.052 201.572 98.866 197.025C80.6802 192.479 65.2727 183.891 48.3497 175.808C31.4268 167.726 13.2409 160.148 5.1583 146.761C-2.67172 133.122 -0.398493 113.673 4.14797 96.7504C8.69444 80.08 15.5141 65.6828 23.3442 52.296C31.4268 38.6566 40.5197 25.775 52.6436 15.6717C65.0201 5.82101 80.6802 -1.50385 95.3299 0.264221C109.98 1.77971 123.619 12.6407 140.289 20.2182Z",aspectRatio:{width:204,height:200},width:e,height:t})};function p_(e){return NC[e]||Mm}function g_(e){const{subType:t}=e,r=p_(t);return r?function(n,i){const{width:a,height:l,fill:o,stroke:u,strokeWidth:d,dash:f}=n,v=(f||[]).map(E=>E*d);let g=i(n),c=1,y=1;typeof g!="string"&&(c=g.scaleX,y=g.scaleY,g=g.path);const x=`clip-${n.id||Math.random()}`;return`
281
- <svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${l}">
282
- <defs>
283
- <clipPath id="${x}">
284
- <path d="${g}" />
285
- </clipPath>
286
- </defs>
287
-
288
- <!-- Path for the fill -->
289
- <path d="${g}" fill="${o}" transform="scale(${c}, ${y})"/>
290
-
291
- <!-- Path for the stroke, clipped by the star path -->
292
- <path d="${g}" fill="none" stroke="${u}" stroke-width="${2*d}" clip-path="url(#${x})" transform="scale(${c}, ${y})" stroke-dasharray="${v.join(" ")}"/>
293
- </svg>
294
- `}(e,r):(console.error(`Polotno error: Can not convert ${e.subType} figure to svg.`),Mm(e))}const U2={},LC=Yn(({element:e,store:t})=>{const r=e.selectable||t.role==="admin",n=lf(),i=t.selectedShapes.indexOf(e)>=0&&e.selectable,a=Math.min(e.strokeWidth,e.width/2,e.height/2),l=Math.max(0,Math.min(e.width/2,e.height/2,e.cornerRadius)),o=tf(e,e.a.fill,"fill"),u=Object.assign(Object.assign({width:e.a.width,height:e.a.height},o),{cornerRadius:l,opacity:e.animated("opacity"),shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,preventDefault:!n||i,hideInExport:!e.showInExport}),d=tf(e,e.stroke,"stroke"),f=Object.assign(Object.assign({visible:a>0,x:a/2,y:a/2,width:e.a.width-a,height:e.a.height-a},d),{strokeWidth:a,cornerRadius:Math.max(0,l-a),dash:e.dash.map(y=>y*a),opacity:e.animated("opacity"),hideInExport:!e.showInExport,listening:!1}),v=(g=e.subType,U2[g]||(U2[g]=(c=p_(g),Yn(({element:y,fillProps:x,strokeProps:E})=>{let S=c({width:y.a.width,height:y.a.height,cornerRadius:y.cornerRadius}),b=1,w=1;typeof S!="string"&&(b=S.scaleX,w=S.scaleY,S=S.path);const _=ce.useRef(null);return ce.createElement(ce.Fragment,null,ce.createElement(En,{width:y.width,height:y.height,fill:"transparent"}),ce.createElement(Tv,Object.assign({},x,{ref:_,data:S,scaleX:b,scaleY:w})),ce.createElement(vn,{clipFunc:A=>{const M=_.current;if(M){var O=M.dataArray;A.beginPath();for(var L=0;L<O.length;L++){var R=O[L].command,T=O[L].points;switch(R){case"L":A.lineTo(T[0],T[1]);break;case"M":A.moveTo(T[0],T[1]);break;case"C":A.bezierCurveTo(T[0],T[1],T[2],T[3],T[4],T[5]);break;case"Q":A.quadraticCurveTo(T[0],T[1],T[2],T[3]);break;case"A":var k=T[0],C=T[1],q=T[2],G=T[3],J=T[4],ae=T[5],H=T[6],V=T[7],Y=q>G?q:G,U=q>G?1:q/G,D=q>G?G/q:1;A.translate(k,C),A.rotate(H),A.scale(U,D),A.arc(0,0,Y,J,J+ae,1-V),A.scale(1/U,1/D),A.rotate(-H),A.translate(-k,-C);break;case"z":A.closePath()}}}},scaleX:b,scaleY:w},ce.createElement(Tv,Object.assign({},E,{x:0,y:0,data:S,strokeWidth:2*E.strokeWidth,dash:E.dash.map(A=>A)}))))}))),U2[g]||vn);var g,c;return ce.createElement(ce.Fragment,null,ce.createElement(vn,{id:e.id,x:e.a.x,y:e.a.y,rotation:e.a.rotation,opacity:e.a.opacity,listening:r,draggable:n?e.draggable&&i:e.draggable,name:"element",onDragMove:y=>{e.set({x:y.target.x(),y:y.target.y()})},onDragEnd:y=>{e.set({x:y.target.x(),y:y.target.y()})},onTransform:y=>{const x=y.target.scale();y.target.scaleX(1),y.target.scaleY(1),e.set({width:e.width*x.x,height:e.height*x.y,x:y.target.x(),y:y.target.y(),rotation:y.target.rotation()})}},ce.createElement(v,{element:e,fillProps:u,strokeProps:f})))});var Xu={},q2={},Ku={},a4;function v_(){if(a4)return Ku;a4=1,Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.loop=Ku.conditional=Ku.parse=void 0;var e=function n(i,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:l;if(Array.isArray(a))a.forEach(function(d){return n(i,d,l,o)});else if(typeof a=="function")a(i,l,o,n);else{var u=Object.keys(a)[0];Array.isArray(a[u])?(o[u]={},n(i,a[u],l,o[u])):o[u]=a[u](i,l,o,n)}return l};Ku.parse=e;var t=function(i,a){return function(l,o,u,d){a(l,o,u)&&d(l,i,o,u)}};Ku.conditional=t;var r=function(i,a){return function(l,o,u,d){for(var f=[],v=l.pos;a(l,o,u);){var g={};if(d(l,i,o,g),l.pos===v)break;v=l.pos,f.push(g)}return f}};return Ku.loop=r,Ku}var ra={},o4;function m_(){if(o4)return ra;o4=1,Object.defineProperty(ra,"__esModule",{value:!0}),ra.readBits=ra.readArray=ra.readUnsigned=ra.readString=ra.peekBytes=ra.readBytes=ra.peekByte=ra.readByte=ra.buildStream=void 0;var e=function(v){return{data:v,pos:0}};ra.buildStream=e;var t=function(){return function(v){return v.data[v.pos++]}};ra.readByte=t;var r=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(g){return g.data[g.pos+v]}};ra.peekByte=r;var n=function(v){return function(g){return g.data.subarray(g.pos,g.pos+=v)}};ra.readBytes=n;var i=function(v){return function(g){return g.data.subarray(g.pos,g.pos+v)}};ra.peekBytes=i;var a=function(v){return function(g){return Array.from(n(v)(g)).map(function(c){return String.fromCharCode(c)}).join("")}};ra.readString=a;var l=function(v){return function(g){var c=n(2)(g);return v?(c[1]<<8)+c[0]:(c[0]<<8)+c[1]}};ra.readUnsigned=l;var o=function(v,g){return function(c,y,x){for(var E=typeof g=="function"?g(c,y,x):g,S=n(v),b=new Array(E),w=0;w<E;w++)b[w]=S(c);return b}};ra.readArray=o;var u=function(v,g,c){for(var y=0,x=0;x<c;x++)y+=v[g+x]&&Math.pow(2,c-x-1);return y},d=function(v){return function(g){for(var c=t()(g),y=new Array(8),x=0;x<8;x++)y[7-x]=!!(c&1<<x);return Object.keys(v).reduce(function(E,S){var b=v[S];return b.length?E[S]=u(y,b.index,b.length):E[S]=y[b.index],E},{})}};return ra.readBits=d,ra}var s4;function TC(){return s4||(s4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=v_(),r=m_(),n={blocks:function(g){for(var c=0,y=[],x=g.data.length,E=0,S=(0,r.readByte)()(g);S!==c&&S;S=(0,r.readByte)()(g)){if(g.pos+S>=x){var b=x-g.pos;y.push((0,r.readBytes)(b)(g)),E+=b;break}y.push((0,r.readBytes)(S)(g)),E+=S}for(var w=new Uint8Array(E),_=0,A=0;A<y.length;A++)w.set(y[A],_),_+=y[A].length;return w}},i=(0,t.conditional)({gce:[{codes:(0,r.readBytes)(2)},{byteSize:(0,r.readByte)()},{extras:(0,r.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,r.readUnsigned)(!0)},{transparentColorIndex:(0,r.readByte)()},{terminator:(0,r.readByte)()}]},function(v){var g=(0,r.peekBytes)(2)(v);return g[0]===33&&g[1]===249}),a=(0,t.conditional)({image:[{code:(0,r.readByte)()},{descriptor:[{left:(0,r.readUnsigned)(!0)},{top:(0,r.readUnsigned)(!0)},{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{lct:(0,r.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,t.conditional)({lct:(0,r.readArray)(3,function(v,g,c){return Math.pow(2,c.descriptor.lct.size+1)})},function(v,g,c){return c.descriptor.lct.exists}),{data:[{minCodeSize:(0,r.readByte)()},n]}]},function(v){return(0,r.peekByte)()(v)===44}),l=(0,t.conditional)({text:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{preData:function(g,c,y){return(0,r.readBytes)(y.text.blockSize)(g)}},n]},function(v){var g=(0,r.peekBytes)(2)(v);return g[0]===33&&g[1]===1}),o=(0,t.conditional)({application:[{codes:(0,r.readBytes)(2)},{blockSize:(0,r.readByte)()},{id:function(g,c,y){return(0,r.readString)(y.blockSize)(g)}},n]},function(v){var g=(0,r.peekBytes)(2)(v);return g[0]===33&&g[1]===255}),u=(0,t.conditional)({comment:[{codes:(0,r.readBytes)(2)},n]},function(v){var g=(0,r.peekBytes)(2)(v);return g[0]===33&&g[1]===254}),d=[{header:[{signature:(0,r.readString)(3)},{version:(0,r.readString)(3)}]},{lsd:[{width:(0,r.readUnsigned)(!0)},{height:(0,r.readUnsigned)(!0)},{gct:(0,r.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,r.readByte)()},{pixelAspectRatio:(0,r.readByte)()}]},(0,t.conditional)({gct:(0,r.readArray)(3,function(v,g){return Math.pow(2,g.lsd.gct.size+1)})},function(v,g){return g.lsd.gct.exists}),{frames:(0,t.loop)([i,o,u,a,l],function(v){var g=(0,r.peekByte)()(v);return g===33||g===44})}],f=d;e.default=f}(q2)),q2}var Ud={},l4;function RC(){if(l4)return Ud;l4=1,Object.defineProperty(Ud,"__esModule",{value:!0}),Ud.deinterlace=void 0;var e=function(r,n){for(var i=new Array(r.length),a=r.length/n,l=function(c,y){var x=r.slice(y*n,(y+1)*n);i.splice.apply(i,[c*n,n].concat(x))},o=[0,4,2,1],u=[8,8,4,2],d=0,f=0;f<4;f++)for(var v=o[f];v<a;v+=u[f])l(v,d),d++;return i};return Ud.deinterlace=e,Ud}var qd={},u4;function MC(){if(u4)return qd;u4=1,Object.defineProperty(qd,"__esModule",{value:!0}),qd.lzw=void 0;var e=function(r,n,i){var a=4096,l=-1,o=i,u,d,f,v,g,c,y,O,x,E,M,S,L,R,k,T,b=new Array(i),w=new Array(a),_=new Array(a),A=new Array(a+1);for(S=r,d=1<<S,g=d+1,u=d+2,y=l,v=S+1,f=(1<<v)-1,x=0;x<d;x++)w[x]=0,_[x]=x;var M,O,L,R,T,k;for(M=O=L=R=T=k=0,E=0;E<o;){if(R===0){if(O<v){M+=n[k]<<O,O+=8,k++;continue}if(x=M&f,M>>=v,O-=v,x>u||x==g)break;if(x==d){v=S+1,f=(1<<v)-1,u=d+2,y=l;continue}if(y==l){A[R++]=_[x],y=x,L=x;continue}for(c=x,x==u&&(A[R++]=L,x=y);x>d;)A[R++]=_[x],x=w[x];L=_[x]&255,A[R++]=L,u<a&&(w[u]=y,_[u]=L,u++,(u&f)===0&&u<a&&(v++,f+=u)),y=c}R--,b[T++]=A[R],E++}for(E=T;E<o;E++)b[E]=0;return b};return qd.lzw=e,qd}var c4;function IC(){if(c4)return Xu;c4=1,Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.decompressFrames=Xu.decompressFrame=Xu.parseGIF=void 0;var e=a(TC()),t=v_(),r=m_(),n=RC(),i=MC();function a(f){return f&&f.__esModule?f:{default:f}}var l=function(v){var g=new Uint8Array(v);return(0,t.parse)((0,r.buildStream)(g),e.default)};Xu.parseGIF=l;var o=function(v){for(var g=v.pixels.length,c=new Uint8ClampedArray(g*4),y=0;y<g;y++){var x=y*4,E=v.pixels[y],S=v.colorTable[E]||[0,0,0];c[x]=S[0],c[x+1]=S[1],c[x+2]=S[2],c[x+3]=E!==v.transparentIndex?255:0}return c},u=function(v,g,c){if(!v.image){console.warn("gif frame does not have associated image.");return}var y=v.image,x=y.descriptor.width*y.descriptor.height,E=(0,i.lzw)(y.data.minCodeSize,y.data.blocks,x);y.descriptor.lct.interlaced&&(E=(0,n.deinterlace)(E,y.descriptor.width));var S={pixels:E,dims:{top:v.image.descriptor.top,left:v.image.descriptor.left,width:v.image.descriptor.width,height:v.image.descriptor.height}};return y.descriptor.lct&&y.descriptor.lct.exists?S.colorTable=y.lct:S.colorTable=g,v.gce&&(S.delay=(v.gce.delay||10)*10,S.disposalType=v.gce.extras.disposal,v.gce.extras.transparentColorGiven&&(S.transparentIndex=v.gce.transparentColorIndex)),c&&(S.patch=o(S)),S};Xu.decompressFrame=u;var d=function(v,g){return v.frames.filter(function(c){return c.image}).map(function(c){return u(c,v.gct,g)})};return Xu.decompressFrames=d,Xu}var f4=IC();function H2(e,t,r){const n=t.getContext("2d"),i=r.getContext("2d");if(!n||!i)return;e.disposalType===2&&n.clearRect(0,0,t.width,t.height),r.width=e.width,r.height=e.height;const a=i.createImageData(e.width,e.height);a.data.set(e.patch),i.putImageData(a,0,0),n.drawImage(r,e.left,e.top)}const FC=Yn(({element:e})=>{const t=Math.min(30,e.width/4,e.height/4),r=ce.useRef(null);return ce.useEffect(()=>{const n=r.current;if(!n)return;const i=new sr.Animation(a=>{n.rotate((a?.timeDiff||0)/2)},n.getLayer());return i.start(),()=>{i.stop()}},[]),ce.createElement(vn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},ce.createElement(En,{width:e.width,height:e.height,fill:"rgba(124, 173, 212, 0.8)"}),ce.createElement(mm,{ref:r,x:e.width/2,y:e.height/2,fill:"white",outerRadius:Math.abs(t),innerRadius:Math.max(1,t-5),angle:270}))}),jC=Yn(({element:e})=>{const t=Math.max(10,Math.min(30,e.width/22));return ce.createElement(vn,{x:e.a.x,y:e.a.y,rotation:e.a.rotation,listening:!1,opacity:e.a.opacity,hideInExport:!e.showInExport},ce.createElement(En,{width:e.width,height:e.height,fill:"rgba(223, 102, 102, 0.8)"}),ce.createElement(Au,{text:"Cannot load the GIF...",fontSize:t,width:e.width,height:e.height,align:"center",fill:"white",verticalAlign:"middle",padding:5}))}),DC=Yn(({element:e,store:t})=>{var r;const[n,i]=ce.useState(!1),a=t.selectedShapes.indexOf(e)>=0&&e.selectable,l=ce.useRef(null),o=ce.useRef(),[u,d,f,v]=function(R){const[T,k]=ce.useState([]),[C,q]=ce.useState(0),[G,J]=ce.useState("loading"),[ae,H]=ce.useState({width:0,height:0});return ce.useEffect(()=>{(async()=>{try{const V=await fetch(R),Y=await V.arrayBuffer(),U=f4.parseGIF(Y),D=f4.decompressFrames(U,!0),j=U.lsd.width,z=U.lsd.height;H({width:j,height:z});const Z=D.map(W=>({patch:new Uint8ClampedArray(W.patch),delay:W.delay,width:W.dims.width,height:W.dims.height,left:W.dims.left,top:W.dims.top,disposalType:W.disposalType})),re=Z.reduce((W,Q)=>W+Q.delay,0);k(Z),q(re),J("loaded")}catch(V){console.error("Failed to load GIF:",V),J("failed")}})()},[R]),[T,C,ae,G]}(e.src);Jd(v,e.src,e.id),ce.useEffect(()=>(o.current=document.createElement("canvas"),()=>{o.current&&sr.Util.releaseCanvas(o.current)}),[]),ce.useEffect(()=>{if(v==="loaded"&&o.current&&(o.current.width=f.width,o.current.height=f.height,u.length>0)){const R=o.current.getContext("2d");if(R){R.clearRect(0,0,f.width,f.height);const T=document.createElement("canvas");H2(u[0],o.current,T)}}},[f,v,u]),ce.useEffect(()=>{if(!u.length||!o.current)return;const R=o.current;R.width=f.width,R.height=f.height;const T=document.createElement("canvas"),k=R.getContext("2d");k&&k.clearRect(0,0,R.width,R.height);let C=-1;H2(u[0],R,T),w(),C=0;const q=G=>{const J=(ae=>{const H=ae%d;let V=0;for(let Y=0;Y<u.length;Y++)if(V+=u[Y].delay,V>H)return Y;return 0})(G);J!==C&&(H2(u[J],R,T),w(),l.current.getLayer().draw(),C=J)};if(t.isPlaying||e.page._exportingOrRendering)return Ou(()=>{q(t.currentTime-e.page.startTime)});{const G=window.setInterval(()=>{q(t.currentTime||performance.now())},16);return()=>{clearInterval(G)}}},[t.isPlaying,u,d,e.page._exportingOrRendering]),ce.useEffect(()=>{d&&t.history.ignore(()=>{e.set({duration:d})})},[d]);let{cropX:g,cropY:c,cropWidth:y,cropHeight:x}=e;v!=="loaded"&&(g=c=0,y=x=1);const E={x:f.width*g,y:f.height*c,width:f.width*y,height:f.height*x},S=(r=e.cornerRadius)!==null&&r!==void 0?r:0,[b,w]=d_(e,o.current,E,t._elementsPixelRatio,S,n||e._cropModeEnabled);ce.useLayoutEffect(()=>{if(!n&&!e._cropModeEnabled&&l.current)return _s(l.current,e),Ou(()=>{_s(l.current,e)},{delay:100})},[o.current,n,y,x,e._cropModeEnabled,f.width,f.height]);const _=v==="loading",A=v==="failed",M=_||A?0:e.a.opacity;xp(l,M);const O=e.selectable||t.role==="admin",L=lf();return ce.createElement(ce.Fragment,null,_&&ce.createElement(FC,{element:e}),A&&ce.createElement(jC,{element:e}),ce.createElement(bu,{ref:l,name:"element",id:e.id,image:b,x:e.a.x,y:e.a.y,width:e.a.width||1,height:e.a.height||1,rotation:e.a.rotation,opacity:M,shadowEnabled:e.shadowEnabled,shadowBlur:e.shadowBlur,shadowOffsetX:e.shadowOffsetX,shadowOffsetY:e.shadowOffsetY,shadowColor:e.shadowColor,shadowOpacity:e.shadowOpacity,customCrop:E,listening:O,draggable:L?e.draggable&&a:e.draggable,preventDefault:!L||a,hideInExport:!e.showInExport,onDragMove:R=>{e.set({x:R.target.x(),y:R.target.y()})},onDragEnd:R=>{e.set({x:R.target.x(),y:R.target.y()})},onTransformStart:()=>i(!0),onTransform:R=>{const T=R.currentTarget,k=Math.abs(T.scaleX()-1)<1e-7?1:T.scaleX(),C=Math.abs(T.scaleY()-1)<1e-7?1:T.scaleY();T.scaleX(1),T.scaleY(1),e.set({x:T.x(),y:T.y(),width:T.width()*k,height:T.height()*C,rotation:T.rotation()})},onTransformEnd:()=>i(!1)}),ce.createElement(En,{x:e.a.x,y:e.a.y,width:Math.max(e.a.width-e.borderSize,0),height:Math.max(e.a.height-e.borderSize,0),opacity:M,offsetX:-e.borderSize/2,offsetY:-e.borderSize/2,stroke:e.borderColor,strokeWidth:e.borderSize,listening:!1,visible:!!e.borderSize,rotation:e.rotation,cornerRadius:Math.max(0,S-e.borderSize),hideInExport:!e.showInExport}))}),BC={stroke:"rgb(0, 161, 255)",strokeWidth:2},zC=Yn(({element:e})=>ce.createElement(En,Object.assign({name:"highlighter",x:e.a.x,y:e.a.y,rotation:e.a.rotation,width:e.a.width,height:e.a.height,listening:!1,strokeScaleEnabled:!1},BC)));let ul=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),"");const ep=function(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!=Object.keys(t).length)return!1;for(var r in e)if(!t.hasOwnProperty(r)||!ep(e[r],t[r]))return!1;return!0}return!1};Object.assign(Jt);const UC=Jt.model("UndoManager",{history:Jt.array(Jt.frozen()),undoIdx:-1,targetPath:""}).views(e=>({get canUndo(){return e.undoIdx>0},get canRedo(){return e.undoIdx<e.history.length-1}})).actions(e=>{let t,r,n=!1,i=null,a=0,l=0;const o=()=>l>0;function u(){const f=wu(t);return{pages:f.pages,width:f.width,height:f.height,custom:f.custom,audios:f.audios}}function d(f){const v=t.pages.map(x=>x.id),g=f.pages.map(x=>x.id),c=!ep(v,g),y=!ep(t.custom,f.custom);c?Fv(t.pages,f.pages):t.pages.forEach((x,E)=>{Fv(x,f.pages[E])}),y&&t.set({custom:f.custom}),t.setSize(f.width,f.height)}return{startTransaction(){l++},endTransaction(f){l--,f||this.requestAddState(u())},async ignore(f,v=!1,g=!1){g&&await new Promise(S=>setTimeout(S,10)),a&&e.addUndoState();let c=o();e.startTransaction();let y=l;try{await f()}catch(S){setTimeout(()=>{throw S})}const x=y!==l,E=!x;e.endTransaction(E),v||c||e.replaceState(),x||(clearTimeout(a),a=0)},async transaction(f){await e.ignore(f,!0),this.addUndoState()},requestAddState(f){i=f,a||o()||(n?n=!1:a=setTimeout(()=>{a=0,clearTimeout(a),o()||this.addUndoState()},100))},addUndoState(){if(n)return void(n=!1);const f=e.history[e.undoIdx];!ep(i,f)&&(clearTimeout(a),a=0,e.history.splice(e.undoIdx+1),e.history.push(i),e.undoIdx=e.history.length-1)},afterCreate(){if(t=JA(e,".."),!t)throw new Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");r=p8(t,()=>{this.requestAddState(u())}),e.history.length===0&&this.requestAddState(u())},clear(){clearTimeout(a),a=0,e.history.splice(0,e.history.length),e.undoIdx=-1,e.addUndoState(u())},beforeDestroy(){r()},undo(){a&&this.addUndoState(),e.canUndo?(e.undoIdx--,n=!0,d(e.history[e.undoIdx])):console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.")},redo(){a&&this.addUndoState(),e.canRedo?(e.undoIdx++,n=!0,d(e.history[e.undoIdx])):console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.")},replaceState(){e.history[e.undoIdx]=u()}}});async function c1(e,t){const r=await(await fetch(e)).blob(),n=document.createElement("a"),i=URL.createObjectURL(r);n.href=i,n.download=t,document.body.appendChild(n),n.click(),setTimeout(function(){document.body.removeChild(n),window.URL.revokeObjectURL(i)},0)}let V2=null;function qC(){var e;return!((e=window.jspdf)===null||e===void 0)&&e.jsPDF?Promise.resolve(window.jspdf.jsPDF):V2||(V2=new Promise(t=>{var r=document.createElement("script");r.onload=function(){t(window.jspdf.jsPDF)},r.src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/3.0.1/jspdf.umd.min.js",document.head.appendChild(r)}),V2)}function HC(){return window.GIF?Promise.resolve(window.GIF):new Promise(e=>{var t=document.createElement("script");t.onload=function(){e(window.GIF)},t.src="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js",document.head.appendChild(t)})}async function VC({width:e,height:t}){return new(await HC())({workers:4,width:e,height:t,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
295
- (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.pageSize;i++){rv+=ByteArray.charMap[this.pages[p][i]]}}return rv};ByteArray.prototype.writeByte=function(val){if(this.cursor>=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i<l;i++)this.writeByte(string.charCodeAt(i))};ByteArray.prototype.writeBytes=function(array,offset,length){for(var l=length||array.length,i=offset||0;i<l;i++)this.writeByte(array[i])};function GIFEncoder(width,height){this.width=~~width;this.height=~~height;this.transparent=null;this.transIndex=0;this.repeat=-1;this.delay=0;this.image=null;this.pixels=null;this.indexedPixels=null;this.colorDepth=null;this.colorTab=null;this.neuQuant=null;this.usedEntry=new Array;this.palSize=7;this.dispose=-1;this.firstFrame=true;this.sample=10;this.dither=false;this.globalPalette=false;this.out=new ByteArray}GIFEncoder.prototype.setDelay=function(milliseconds){this.delay=Math.round(milliseconds/10)};GIFEncoder.prototype.setFrameRate=function(fps){this.delay=Math.round(100/fps)};GIFEncoder.prototype.setDispose=function(disposalCode){if(disposalCode>=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j<nPix;j++){var index=this.findClosestRGB(this.pixels[k++]&255,this.pixels[k++]&255,this.pixels[k++]&255);this.usedEntry[index]=true;this.indexedPixels[j]=index}};GIFEncoder.prototype.ditherPixels=function(kernel,serpentine){var kernels={FalseFloydSteinberg:[[3/8,1,0],[3/8,0,1],[2/8,1,1]],FloydSteinberg:[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]],Stucki:[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]],Atkinson:[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]]};if(!kernel||!kernels[kernel]){throw"Unknown dithering kernel: "+kernel}var ds=kernels[kernel];var index=0,height=this.height,width=this.width,data=this.pixels;var direction=serpentine?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var y=0;y<height;y++){if(serpentine)direction=direction*-1;for(var x=direction==1?0:width-1,xend=direction==1?width:0;x!==xend;x+=direction){index=y*width+x;var idx=index*3;var r1=data[idx];var g1=data[idx+1];var b1=data[idx+2];idx=this.findClosestRGB(r1,g1,b1);this.usedEntry[idx]=true;this.indexedPixels[index]=idx;idx*=3;var r2=this.colorTab[idx];var g2=this.colorTab[idx+1];var b2=this.colorTab[idx+2];var er=r1-r2;var eg=g1-g2;var eb=b1-b2;for(var i=direction==1?0:ds.length-1,end=direction==1?ds.length:0;i!==end;i+=direction){var x1=ds[i][1];var y1=ds[i][2];if(x1+x>=0&&x1+x<width&&y1+y>=0&&y1+y<height){var d=ds[i][0];idx=index+x1+y1*width;idx*=3;data[idx]=Math.max(0,Math.min(255,data[idx]+er*d));data[idx+1]=Math.max(0,Math.min(255,data[idx+1]+eg*d));data[idx+2]=Math.max(0,Math.min(255,data[idx+2]+eb*d))}}}}};GIFEncoder.prototype.findClosest=function(c,used){return this.findClosestRGB((c&16711680)>>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i<len;index++){var dr=r-(this.colorTab[i++]&255);var dg=g-(this.colorTab[i++]&255);var db=b-(this.colorTab[i++]&255);var d=dr*dr+dg*dg+db*db;if((!used||this.usedEntry[index])&&d<dmin){dmin=d;minpos=index}}return minpos};GIFEncoder.prototype.getImagePixels=function(){var w=this.width;var h=this.height;this.pixels=new Uint8Array(w*h*3);var data=this.image;var srcPos=0;var count=0;for(var i=0;i<h;i++){for(var j=0;j<w;j++){this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];srcPos++}}};GIFEncoder.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33);this.out.writeByte(249);this.out.writeByte(4);var transp,disp;if(this.transparent===null){transp=0;disp=0}else{transp=1;disp=2}if(this.dispose>=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i<n;i++)this.out.writeByte(0)};GIFEncoder.prototype.writeShort=function(pValue){this.out.writeByte(pValue&255);this.out.writeByte(pValue>>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i<hsize;++i)htab[i]=-1}function compress(init_bits,outs){var fcode,c,i,ent,disp,hsize_reg,hshift;g_init_bits=init_bits;clear_flg=false;n_bits=g_init_bits;maxcode=MAXCODE(n_bits);ClearCode=1<<init_bits-1;EOFCode=ClearCode+1;free_ent=ClearCode+2;a_count=0;ent=nextPixel();hshift=0;for(fcode=HSIZE;fcode<65536;fcode*=2)++hshift;hshift=8-hshift;hsize_reg=HSIZE;cl_hash(hsize_reg);output(ClearCode,outs);outer_loop:while((c=nextPixel())!=EOF){fcode=(c<<BITS)+ent;i=c<<hshift^ent;if(htab[i]===fcode){ent=codetab[i];continue}else if(htab[i]>=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<<BITS){codetab[i]=free_ent++;htab[i]=fcode}else{cl_block(outs)}}output(ent,outs);output(EOFCode,outs)}function encode(outs){outs.writeByte(initCodeSize);remaining=width*height;curPixel=0;compress(initCodeSize+1,outs);outs.writeByte(0)}function flush_char(outs){if(a_count>0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<<n_bits)-1}function nextPixel(){if(remaining===0)return EOF;--remaining;var pix=pixels[curPixel++];return pix&255}function output(code,outs){cur_accum&=masks[cur_bits];if(cur_bits>0)cur_accum|=code<<cur_bits;else cur_accum=code;cur_bits+=n_bits;while(cur_bits>=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<<BITS;else maxcode=MAXCODE(n_bits)}}if(code==EOFCode){while(cur_bits>0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<<intbiasshift;var gammashift=10;var gamma=1<<gammashift;var betashift=10;var beta=intbias>>betashift;var betagamma=intbias<<gammashift-betashift;var initrad=netsize>>3;var radiusbiasshift=6;var radiusbias=1<<radiusbiasshift;var initradius=initrad*radiusbias;var radiusdec=30;var alphabiasshift=10;var initalpha=1<<alphabiasshift;var alphadec;var radbiasshift=8;var radbias=1<<radbiasshift;var alpharadbshift=alphabiasshift+radbiasshift;var alpharadbias=1<<alpharadbshift;var prime1=499;var prime2=491;var prime3=487;var prime4=503;var minpicturebytes=3*prime4;function NeuQuant(pixels,samplefac){var network;var netindex;var bias;var freq;var radpower;function init(){network=[];netindex=new Int32Array(256);bias=new Int32Array(netsize);freq=new Int32Array(netsize);radpower=new Int32Array(netsize>>3);var i,v;for(i=0;i<netsize;i++){v=(i<<netbiasshift+8)/netsize;network[i]=new Float64Array([v,v,v,0]);freq[i]=intbias/netsize;bias[i]=0}}function unbiasnet(){for(var i=0;i<netsize;i++){network[i][0]>>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(j<hi||k>lo){a=radpower[m++];if(j<hi){p=network[j++];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}if(k>lo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i<netsize;i++){n=network[i];dist=Math.abs(n[0]-b)+Math.abs(n[1]-g)+Math.abs(n[2]-r);if(dist<bestd){bestd=dist;bestpos=i}biasdist=dist-(bias[i]>>intbiasshift-netbiasshift);if(biasdist<bestbiasd){bestbiasd=biasdist;bestbiaspos=i}betafreq=freq[i]>>betashift;freq[i]-=betafreq;bias[i]+=betafreq<<gammashift}freq[bestpos]+=beta;bias[bestpos]-=betagamma;return bestbiaspos}function inxbuild(){var i,j,p,q,smallpos,smallval,previouscol=0,startpos=0;for(i=0;i<netsize;i++){p=network[i];smallpos=i;smallval=p[1];for(j=i+1;j<netsize;j++){q=network[j];if(q[1]<smallval){smallpos=j;smallval=q[1]}}q=network[smallpos];if(i!=smallpos){j=q[0];q[0]=p[0];p[0]=j;j=q[1];q[1]=p[1];p[1]=j;j=q[2];q[2]=p[2];p[2]=j;j=q[3];q[3]=p[3];p[3]=j}if(smallval!=previouscol){netindex[previouscol]=startpos+i>>1;for(j=previouscol+1;j<smallval;j++)netindex[j]=i;previouscol=smallval;startpos=i}}netindex[previouscol]=startpos+maxnetpos>>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i<netsize||j>=0){if(i<netsize){p=network[i];dist=p[1]-g;if(dist>=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}if(j>=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}}return best}function learn(){var i;var lengthcount=pixels.length;var alphadec=30+(samplefac-1)/3;var samplepixels=lengthcount/(3*samplefac);var delta=~~(samplepixels/ncycles);var alpha=initalpha;var radius=initradius;var rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i<rad;i++)radpower[i]=alpha*((rad*rad-i*i)*radbias/(rad*rad));var step;if(lengthcount<minpicturebytes){samplefac=1;step=3}else if(lengthcount%prime1!==0){step=3*prime1}else if(lengthcount%prime2!==0){step=3*prime2}else if(lengthcount%prime3!==0){step=3*prime3}else{step=3*prime4}var b,g,r,j;var pix=0;i=0;while(i<samplepixels){b=(pixels[pix]&255)<<netbiasshift;g=(pixels[pix+1]&255)<<netbiasshift;r=(pixels[pix+2]&255)<<netbiasshift;j=contest(b,g,r);altersingle(alpha,j,b,g,r);if(rad!==0)alterneigh(rad,j,b,g,r);pix+=step;if(pix>=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j<rad;j++)radpower[j]=alpha*((rad*rad-j*j)*radbias/(rad*rad))}}}function buildColormap(){init();learn();unbiasnet();inxbuild()}this.buildColormap=buildColormap;function getColormap(){var map=[];var index=[];for(var i=0;i<netsize;i++)index[network[i][3]]=i;var k=0;for(var l=0;l<netsize;l++){var j=index[l];map[k++]=network[j][0];map[k++]=network[j][1];map[k++]=network[j][2]}return map}this.getColormap=getColormap;this.lookupRGB=inxsearch}module.exports=NeuQuant},{}],4:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i<len;i++){page=ref[i];results.push(page.buffer)}return results}();return self.postMessage(frame,transfer)}else{return self.postMessage(frame)}};self.onmessage=function(event){return renderFrame(event.data)}},{"./GIFEncoder.js":1}]},{},[4]);
296
- `],{type:"application/javascript"}))})}const GC="https://api.polotno.com",$C=()=>GC+"/api",y_=$r({value:!1}),b_=$r({value:"v1"}),WC=()=>b_.value,YC=()=>y_.value,XC=Wr(()=>{y_.value=!0});let Yd=typeof window<"u"?window.location.origin:"";const KC=typeof navigator<"u"&&navigator.userAgent.indexOf("Headless")>-1,ZC=typeof navigator<"u"&&navigator.userAgent.indexOf("Electron")>-1;Yd==="file://"&&KC&&(Yd="headless"),Yd==="file://"&&ZC&&(Yd="electron");const QC=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${Yd}" here: https://polotno.com/cabinet`;let JC=fetch;async function eN(e){for(let t=0;t<5;t++)try{const r=await JC($C()+"/validate-key",{method:"POST",body:JSON.stringify({key:e,site:location.host,skdVersion:"2.25.16"})});if(tc(()=>{b_.value=r.headers.get("x-api-version")}),!e)return console.warn("Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet"),!1;if(r.status!==200){await new Promise(i=>setTimeout(i,3e3));continue}const n=await r.json();return n.is_valid||console.warn("Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet"),n.is_paid||console.log("%cPolotno Free Version. For development usage only. https://polotno.com/","background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),n.is_domain_valid||console.log(QC,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),qA(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 tN(e,t){await eN(e)&&!t||XC()}const k0=({px:e,unit:t="px",dpi:r})=>{switch(t){case"pt":default:return e;case"mm":return e/(r/25.4);case"cm":return e/(r/2.54);case"in":return e/r}},h4=({px:e,precious:t=2,dpi:r=72,unit:n="px"})=>parseFloat(k0({px:e,dpi:r,unit:n}).toFixed(t)),d4=({unitVal:e,dpi:t,unit:r})=>e/k0({px:1,unit:r,dpi:t}),rN=e=>{const t=parseFloat(k0(e).toFixed(1));switch(e.unit){case"pt":return`${Math.round(t)}pt`;case"mm":return`${t}mm`;case"cm":return`${t}cm`;case"in":return`${t}in`;default:return`${Math.round(t)}px`}};async function nN(e){for(let t=0;t<30;t++){const r=await e();if(r)return r;await new Promise(n=>setTimeout(n,50))}}function Pp(e){return new Promise((t,r)=>{const n=document.createElement("img");n.onload=()=>{t(n)},n.onerror=i=>{r(i)},n.crossOrigin="anonymous",n.src=e})}async function iN(e,t){const r=await Pp(e),n=document.createElement("canvas");n.width=2*r.width,n.height=2*r.height,n.getContext("2d").drawImage(r,0,0,n.width,n.height);const i=document.createElement("canvas");i.width=t.width,i.height=t.height;const a=i.getContext("2d");let{cropX:l,cropY:o}=t;const u=n.width*t.cropWidth,d=n.height*t.cropHeight,f=t.width/t.height;let v,g;const c=u/d;return t.type==="svg"?(v=u,g=d):f>=c?(v=u,g=u/f):(v=d*f,g=d),a.drawImage(n,l*n.width,o*n.height,v,g,0,0,i.width,i.height),i.toDataURL("image/png")}function w_(e,t){const{width:r,height:n}=e,i=r/n;let a,l;i>=t.width/t.height?(a=t.width,l=t.width/i):(a=t.height*i,l=t.height);const o=(t.width-a)/2,u=(t.height-l)/2;return{cropX:o/t.width,cropY:u/t.height,cropWidth:a/t.width,cropHeight:l/t.height}}var zs;(function(e){e.sepia="sepia",e.grayscale="grayscale",e.natural="natural",e.warm="warm",e.cold="cold",e.temperature="temperature",e.contrast="contrast",e.shadows="shadows",e.white="white",e.black="black",e.vibrance="vibrance",e.saturation="saturation"})(zs||(zs={}));function __(e,t){let r={filter:"",html:void 0};switch(e){case zs.warm:{const n=Math.max(0,Math.min(1,t??.5)),i=1+.3*n,a=1+.15*n,l=1;return r.filter="url(#warm-filter)",r.html=`
297
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
298
- <filter id="warm-filter" color-interpolation-filters="sRGB">
299
- <feColorMatrix type="matrix" values="
300
- ${i} 0 0 0 0
301
- 0 ${a} 0 0 0
302
- 0 0 ${l} 0 0
303
- 0 0 0 1 0" />
304
- </filter>
305
- </svg>`,r}case zs.cold:{const n=Math.max(0,Math.min(1,t??.5)),i=1-.15*n,a=1-.1*n,l=1+.15*n;return r.filter="url(#cold-filter)",r.html=`
306
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
307
- <filter id="cold-filter" color-interpolation-filters="sRGB">
308
- <feColorMatrix type="matrix" values="
309
- ${i} 0 0 0 0
310
- 0 ${a} 0 0 0
311
- 0 0 ${l} 0 0
312
- 0 0 0 1 0" />
313
- </filter>
314
- </svg>`,r}case"natural":{const n=Math.max(0,Math.min(1,t??.5)),i=1+.1*n,a=1+.3*n,l=1+.2*n;return r.filter=`saturate(${a}) brightness(${i}) contrast(${l})`,r}case zs.temperature:{const n=Math.max(-1,Math.min(1,t??0)),i=1+.15*n,a=1,l=1-.15*n;return r.filter="url(#temperature-filter)",r.html=`
315
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
316
- <filter id="temperature-filter" color-interpolation-filters="sRGB">
317
- <feColorMatrix type="matrix" values="
318
- ${i} 0 0 0 0
319
- 0 ${a} 0 0 0
320
- 0 0 ${l} 0 0
321
- 0 0 0 1 0" />
322
- </filter>
323
- </svg>
324
- `,r}case zs.contrast:{const n=100*Math.max(-1,Math.min(1,t??0)),i=259*(n+255)/(255*(259-n)),a=.5*(1-i);return r.filter="url(#contrast-filter)",r.html=`
325
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
326
- <filter id="contrast-filter" color-interpolation-filters="sRGB">
327
- <feComponentTransfer>
328
- <feFuncR type="linear" slope="${i}" intercept="${a}" />
329
- <feFuncG type="linear" slope="${i}" intercept="${a}" />
330
- <feFuncB type="linear" slope="${i}" intercept="${a}" />
331
- </feComponentTransfer>
332
- </filter>
333
- </svg>
334
- `,r}case zs.shadows:{const n=Math.max(-1,Math.min(1,t??0)),i=Math.min(Math.max(1-.6*n,.4),2.5);return r.filter="url(#shadows-filter)",r.html=`
335
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
336
- <filter id="shadows-filter" color-interpolation-filters="sRGB">
337
- <feComponentTransfer>
338
- <feFuncR type="gamma" amplitude="1" exponent="${i}" offset="0" />
339
- <feFuncG type="gamma" amplitude="1" exponent="${i}" offset="0" />
340
- <feFuncB type="gamma" amplitude="1" exponent="${i}" offset="0" />
341
- </feComponentTransfer>
342
- </filter>
343
- </svg>
344
- `,r}case zs.white:case zs.black:return null;case zs.vibrance:{const n=Math.max(-1,Math.min(1,t??0)),i=.299,a=.587,l=.114;let o;o=n>=0?1+1.5*n:1+n;const u=1-o,d=u*i+o,f=u*a,v=u*l,g=u*i,c=u*a+o,y=u*l,x=u*i,E=u*a,S=u*l+o;return r.filter="url(#vibrance-filter)",r.html=`
345
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
346
- <filter id="vibrance-filter" color-interpolation-filters="sRGB">
347
- <feColorMatrix type="matrix" values="
348
- ${d} ${f} ${v} 0 0
349
- ${g} ${c} ${y} 0 0
350
- ${x} ${E} ${S} 0 0
351
- 0 0 0 1 0" />
352
- </filter>
353
- </svg>
354
- `,r}case zs.saturation:{const l=1+Math.max(-1,Math.min(1,t??0)),o=1-l,u=o*.2126+l,d=o*.7152,f=o*.0722,v=o*.2126,g=o*.7152+l,c=o*.0722,y=o*.2126,x=o*.7152,E=o*.0722+l;return r.filter="url(#saturation-filter)",r.html=`
355
- <svg xmlns="http://www.w3.org/2000/svg" style="display:none">
356
- <filter id="saturation-filter" color-interpolation-filters="sRGB">
357
- <feColorMatrix type="matrix" values="
358
- ${u} ${d} ${f} 0 0
359
- ${v} ${g} ${c} 0 0
360
- ${y} ${x} ${E} 0 0
361
- 0 0 0 1 0" />
362
- </filter>
363
- </svg>
364
- `,r}default:return null}}async function aN(e){return new Promise((t,r)=>{const n=document.createElement("video");n.crossOrigin="anonymous",n.src=e,n.addEventListener("loadedmetadata",()=>{const{videoWidth:i,videoHeight:a}=n;t({width:i,height:a})}),n.addEventListener("error",i=>{const a=e.slice(0,100);r(new Error(`Failed to load video: ${a}`))})})}var oN=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};const Bi=(e,t,...r)=>({type:e,props:t,children:r||[]}),O1=async({element:e,page:t,store:r})=>{let{src:n}=e;if(e.type==="svg"&&Object.keys(e.colorsReplace).length){const _=await Ap(n);n=Pm(_,new Map(Object.entries(e.colorsReplace)))}let i="";e.flipX&&(i+="scaleX(-1)"),e.flipY&&(i+="scaleY(-1)"),i||(i="none");const a={};if(e.clipSrc){const _=await Hk(e.clipSrc);a["clip-path"]=`url(${_})`}const l=await Pp(n),o=l.width*e.cropWidth,u=l.height*e.cropHeight,d=e.width/e.height;let f,v;const g=o/u;e.type==="svg"?(f=o,v=u):d>=g?(f=o,v=o/d):(f=u*d,v=u);const c=f/l.width,y=v/l.height,x=f/v>e.width/e.height?e.height/v:e.width/f,E=f*x/c,S=v*x/y,b=e.cropX*x*l.width,w=e.cropY*x*l.height;return Bi("div",{style:Object.assign(Object.assign({},a),{width:"100%",height:"100%",borderRadius:e.cornerRadius+"px",border:e.borderSize?`${e.borderSize}px solid ${e.borderColor}`:"none",backgroundRepeat:"no-repeat",backgroundImage:`url(${n})`,transform:i,backgroundSize:`${Math.round(E)}px ${Math.round(S)}px`,backgroundPositionX:-Math.round(b)+"px",backgroundPositionY:-Math.round(w)+"px"})})},p4=({element:e,type:t})=>{const r={"stroke-width":e.height,stroke:e.color,"line-cap":"round","stroke-linejoin":"round",opacity:e.opacity};return t==="arrow"||t==="triangle"?Bi("polyline",Object.assign({points:`${3*e.height},${2*-e.height} 0,0 ${3*e.height},${2*e.height}`},r)):t==="bar"?Bi("polyline",Object.assign({points:`0,${2*-e.height} 0,${2*e.height}`},r)):t==="circle"?Bi("circle",Object.assign({r:e.height},r)):t==="square"?Bi("polyline",Object.assign({points:`${-e.height},${-e.height} ${-e.height},${e.height} ${e.height},${e.height} ${e.height},${-e.height}`},r)):null},sN={image:O1,svg:O1,text:async({element:e,page:t,store:r})=>{let n={top:0,left:0};e.fill.indexOf("gradient")>=0&&(n=Object.assign(Object.assign({},n),{backgroundColor:e.fill,backgroundImage:e.fill,backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}));const i=e.backgroundPadding*(e.fontSize*e.lineHeight),a=Bi("div",{style:{position:"absolute",top:-i/2+"px",left:-i/2+"px",display:e.backgroundEnabled?"block":"none",width:e.width+i+"px",height:e.height+i+"px",backgroundColor:e.backgroundColor,borderRadius:e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)+"px"}});e.verticalAlign==="middle"?(n.top="50%",n.transform="translateY(-50%)"):e.verticalAlign==="bottom"&&(n.bottom=0);const l=/<[a-z][\s\S]*>/i.test(e.text),o=Object.assign(Object.assign({},n),{position:"absolute",width:e.width+"px",color:e.fill,whiteSpace:"pre-wrap",fontSize:e.fontSize+"px",textAlign:e.align,fontFamily:e.fontFamily,textDecoration:e.textDecoration||"none",textTransform:e.textTransform||"none",lineHeight:e.lineHeight,letterSpacing:e.letterSpacing+"em",fontStyle:e.fontStyle,fontWeight:e.fontWeight,WebkitTextStroke:`${e.strokeWidth}px ${e.stroke}`,textStroke:`${e.strokeWidth}px ${e.stroke}`}),u="el-"+e.id,d=l?{id:u}:{},f=`<style>#${u} {${E0}}</style>`,v=Bi("div",Object.assign(Object.assign({style:o},d),{innerHTML:l?`${f}${e.text}`:e.text.split(`
365
- `).join("<br />")}));return Bi("div",{style:{position:"relative",width:"100%",height:"100%"}},a,v)},line:async({element:e,page:t,store:r})=>Bi("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},Bi("rect",{x:0,y:0,width:e.width,height:e.height,fill:e.color}),Bi("g",{transform:`translate(0 ${e.height/2})`},p4({element:e,type:e.startHead})),Bi("g",{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},p4({element:e,type:e.endHead}))),figure:async({element:e,page:t,store:r,elementHook:n})=>{const i=g_(e),a=Bi("div",{innerHTML:i});return n&&n({dom:a,element:e})||a},group:async({element:e,page:t,store:r,elementHook:n})=>{const i=await Promise.all(e.children.map(l=>x_({element:l,page:t,store:r,elementHook:n}))),a=Bi("div",{style:{transformOrigin:"top left",opacity:e.opacity}},...i);return n&&n({dom:a,element:e})||a},video:async({element:e,page:t,store:r,elementHook:n})=>{const{cropX:i,cropY:a,cropWidth:l,cropHeight:o}=e,u=await aN(e.src),d=u.width*l,f=u.height*o,v=e.width/e.height;let g,c;v>=d/f?(g=d,c=d/v):(g=f*v,c=f);const y=g/l,x=c/o,E=i*u.width,S=a*u.height,b=Math.max(e.width/u.width,e.height/u.height),w={position:"absolute",width:`${Math.round(y*b)}px`,height:`${Math.round(x*b)}px`,left:-Math.round(E*b)+"px",top:-Math.round(S*b)+"px",objectFit:"fill"},_=`video-${e.id}`,A=Bi("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",borderRadius:e.cornerRadius+"px",border:e.borderSize?`${e.borderSize}px solid ${e.borderColor}`:"none"}},Bi("video",{id:_,src:e.src,style:w,controls:!0,playsInline:!0,muted:!0,volume:e.volume}));return n&&n({dom:A,element:e})||A},gif:O1};async function x_({element:e,page:t,store:r,elementHook:n}){let i=await sN[e.type];if(i||(i=()=>Bi("div",{}),console.error(`HTML export does not support ${e.type} type...`)),!e.visible)return null;const a=await i({element:e,page:t,store:r}),l=[],o=[];if(e.blurEnabled&&l.push(`blur(${e.blurRadius/2}px)`),e.brightnessEnabled&&l.push(`brightness(${100*e.brightness+100}%)`),e.sepiaEnabled&&l.push("sepia()"),e.grayscaleEnabled&&l.push("grayscale()"),e.filters)for(const[d,f]of Object.entries(e.filters)){const v=__(zs[d],f.intensity);v&&(l.push(v.filter),v.html&&o.push(v.html))}e.shadowEnabled&&l.push(`drop-shadow(${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${e.shadowColor})`);const u=Bi("div",{id:e.id,style:{position:"absolute",left:e.x+"px",top:e.y+"px",width:e.width+"px",height:e.height+"px",transform:`rotate(${e.rotation}deg)`,transformOrigin:"top left",opacity:e.opacity,display:e.visible&&e.showInExport?"block":"none",filter:l.join(" ")||"none"}},a,...o);return n&&n({dom:u,element:e})||u}async function lN({json:e,elementHook:t}){const r=await Promise.all(e.pages.map(a=>async function({page:l,store:o,elementHook:u}){const d=await Promise.all(l.children.map(c=>x_({element:c,page:l,store:o,elementHook:u}))),f=l.width==="auto"?o.width:l.width,v=l.height==="auto"?o.height:l.height;let g={};if(l.background.indexOf("url")>=0||l.background.indexOf("http")>=0||l.background.indexOf(".jpg")>=0||l.background.indexOf(".png")>=0||l.background.indexOf(".jpeg")>=0){const{width:c,height:y}=await Pp(l.background),x=await O1({element:Object.assign({x:0,y:0,width:f,height:v,src:l.background,cornerRadius:0},w_({width:f,height:v},{width:c,height:y})),page:l,store:o});d.unshift(x)}else g=Object.assign(Object.assign({},g),{backgroundColor:l.background});return Bi("div",{className:"page",id:l.id,style:Object.assign(Object.assign({},g),{width:f+"px",height:v+"px",overflow:"hidden",position:"relative"})},...d)}({page:a,store:e,elementHook:t}))),n=[];e.pages.forEach(a=>{a.children.forEach(l=>{l.type==="text"&&n.indexOf(l.fontFamily)===-1&&n.push(l.fontFamily)})});const i=n.map(a=>e.fonts.find(l=>l.fontFamily===a)?Bi("style",{},""):Bi("link",{href:l8(a),rel:"stylesheet"}));return Bi("div",{className:"design"},...i,...r)}const S_=({dom:e})=>{if(typeof e=="string")return e;if(!e)return"";const t=e.props,{innerHTML:r}=t,n=oN(t,["innerHTML"]),i=Object.keys(n).map(a=>a==="style"&&typeof n[a]=="object"?`style="${Object.keys(n[a]).map(l=>`${l.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}: ${n[a][l]}`).join("; ")}"`:((l,o)=>typeof o=="object"?`${l}="${Object.keys(o).map(u=>`${u.replace(/-([a-z])/g,d=>d[1].toUpperCase())}:${o[u]};`).join(" ")}"`:`${l}="${o}"`)(a,n[a])).join(" ");return`<${e.type} ${i}>${r||e.children.map(a=>S_({dom:a})).join("")}</${e.type}>`};async function uN({json:e,elementHook:t}){const r=await lN({json:e,elementHook:t});return S_({dom:r})}var cN=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};const E_=(e,t)=>{if(e.children)for(const r of e.children){if(t(r)===!0)break;E_(r,t)}},Zr=(e,t,...r)=>({type:e,props:t,children:r||[]}),G2=async e=>{try{const t=await fetch(e);if(typeof Buffer<"u"){const r=await t.arrayBuffer(),n=Buffer.from(r).toString("base64");return`data:${t.headers.get("content-type")||"image/png"};base64,${n}`}{const r=await t.blob();return new Promise((n,i)=>{const a=new FileReader;a.onloadend=()=>n(a.result),a.onerror=i,a.readAsDataURL(r)})}}catch(t){return console.error("Error converting URL to data URL:",t),e}},$2=async({element:e,page:t,store:r})=>{let{src:n}=e;if(e.type==="svg"){const H=await Ap(n);n=Pm(H,new Map(Object.entries(e.colorsReplace)))}else n=await G2(n);let i,a,l,o,u="";e.flipX&&(u+="scaleX(-1)"),e.flipY&&(u+="scaleY(-1)"),e.clipSrc&&(i=`clip-img-mask-${e.id}`,a=await G2(e.clipSrc)),e.maskSrc&&(l=`mask-img-${e.id}`,o=await G2(e.maskSrc));const d=await Pp(n),f=d.width*e.cropWidth,v=d.height*e.cropHeight,g=e.width/e.height;let c,y;const x=f/v;typeof e.stretchEnabled=="boolean"&&e.stretchEnabled||e.type==="svg"?(c=f,y=v):g>=x?(c=f,y=f/g):(c=v*g,y=v);const E=c/d.width,S=y/d.height,b=c/y>e.width/e.height?e.height/y:e.width/c,w=c*b/E,_=y*b/S,A=e.cropX*d.width*b,M=e.cropY*d.height*b,O=`clip-${e.id}`,L=e.cornerRadius||0,R=n.replace(/&/g,"&amp;"),T={x:-A,y:-M,width:w,height:_,preserveAspectRatio:"none","clip-path":`url(#${O})`},k=[Zr("clipPath",{id:O},Zr("rect",{x:0,y:0,width:e.width,height:e.height,rx:L||void 0,ry:L||void 0}))];i&&a&&k.push(Zr("mask",{id:i,maskUnits:"userSpaceOnUse","mask-type":"alpha"},Zr("image",{href:a.replace(/&/g,"&amp;"),x:0,y:0,width:e.width,height:e.height,preserveAspectRatio:"none"}))),l&&k.push(Zr("mask",{id:l,maskUnits:"userSpaceOnUse","mask-type":"alpha"},Zr("image",Object.assign({href:R},T))));let C=R;const q={};l&&o&&(C=o.replace(/&/g,"&amp;"),q.mask=`url(#${l})`);const G={style:{transform:u}};i&&(G.mask=`url(#${i})`);const J=e.borderSize||0,ae=J>0?Zr("rect",{x:J/2,y:J/2,width:Math.max(0,e.width-J),height:Math.max(0,e.height-J),fill:"none",stroke:e.borderColor,"stroke-width":J,rx:Math.max(0,L-J)||void 0,ry:Math.max(0,L-J)||void 0}):null;return Zr("g",G,Zr("defs",{},...k),Zr("image",Object.assign(Object.assign({href:C},T),q)),ae)},g4=({element:e,type:t})=>{const r={"stroke-width":e.height,stroke:e.color,"line-cap":"round","stroke-linejoin":"round",fill:e.color};return t==="arrow"?Zr("polyline",Object.assign({points:`${3*e.height},${2*-e.height} 0,0 ${3*e.height},${2*e.height}`},r)):t==="triangle"?Zr("polygon",Object.assign({points:`${3*e.height},${2*-e.height} 0,0 ${3*e.height},${2*e.height}`},r)):t==="bar"?Zr("polyline",Object.assign({points:`0,${2*-e.height} 0,${2*e.height}`},r)):t==="circle"?Zr("circle",Object.assign({cx:2*e.height,cy:0,r:2*e.height},r)):t==="square"?Zr("polygon",Object.assign({points:`0,${2*-e.height} ${4*e.height},${2*-e.height} ${4*e.height},${2*e.height} 0,${2*e.height}`},r)):null},fN={image:$2,svg:$2,text:async({element:e,page:t,store:r})=>{const n=(c,y,x,E,S,b=0)=>{const w=document.createElement("canvas").getContext("2d");return w.font=`${S} ${E} ${y}px ${x}`,w.measureText(c).width+Math.max(0,(c?c.length:0)-1)*b*y},i=(c,y,x,E,S,b,w=0)=>{const _=[];return c.split(`
366
- `).forEach(A=>{const M=A.split(" ");let O="";for(let L=0;L<M.length;L++){const R=O+M[L]+" ";n(R,x,E,S,b,w)>y+.5&&L>0?(_.push(O.trim()),O=M[L]+" "):O=R}_.push(O.trim())}),_};let a=Pu(e.text);e.textTransform=="uppercase"&&(a=a.toUpperCase());let l=e.fontSize,o=[];for(;;){o=i(a,e.width,l,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing);const c=Math.max(...o.map(x=>n(x,l,e.fontFamily,e.fontWeight,e.fontStyle,e.letterSpacing))),y=o.length*l*e.lineHeight;if(c<=e.width&&y<=e.height||(l-=1,l<4))break}const u=l*e.lineHeight,d=o.length*u;let f=l;e.verticalAlign==="middle"?f=(e.height-d)/2+l:e.verticalAlign==="bottom"&&(f=e.height-d+l);const v=e.align==="center"?"middle":e.align==="right"?"end":"start",g=o.map((c,y)=>Zr("tspan",{x:e.align==="center"?e.width/2:e.align==="right"?e.width:0,dy:y===0?0:u,innerHTML:c}));return Zr("g",{},Zr("text",{fill:e.fill,y:f,"font-size":l+"px","text-anchor":v,"font-family":e.fontFamily,"font-style":e.fontStyle,"font-weight":e.fontWeight,"text-decoration":e.textDecoration,"line-height":e.lineHeight,"letter-spacing":e.letterSpacing+"em","stroke-width":e.strokeWidth,stroke:e.stroke},...g))},line:async({element:e,page:t,store:r})=>Zr("g",{},Zr("line",{x1:0,y1:e.height/2,x2:e.width,y2:e.height/2,stroke:e.color,"stroke-width":e.height,"stroke-dasharray":e.dash&&e.dash.length?e.dash.map(n=>n*e.height).join(" "):void 0}),Zr("g",{transform:`translate(0 ${e.height/2})`},g4({element:e,type:e.startHead})),Zr("g",{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},g4({element:e,type:e.endHead}))),figure:async({element:e,page:t,store:r,elementHook:n})=>{const i=function(l){let o=l.replace(/<svg[^>]*>/,"");return o=o.replace(/<\/svg>/,""),o}(g_(e)),a=Zr("g",{innerHTML:i});return n&&n({dom:a,element:e})||a},group:async({element:e,page:t,store:r,elementHook:n})=>{const i=await Promise.all(e.children.map(l=>A_({element:l,page:t,store:r,elementHook:n}))),a=Zr("g",{style:{"transform-origin":"top left"}},...i);return n&&n({dom:a,element:e})||a},gif:$2};async function A_({element:e,page:t,store:r,elementHook:n}){var i;let a=await fN[e.type];a||(a=()=>Zr("g",{}),console.error(`SVG export does not support ${e.type} type...`));const l=await a({element:e,page:t,store:r}),o=[],u=[];if(e.blurEnabled&&o.push(`blur(${e.blurRadius/2}px)`),e.brightnessEnabled&&o.push(`brightness(${100*e.brightness+100}%)`),e.sepiaEnabled&&o.push("sepia()"),e.grayscaleEnabled&&o.push("grayscale()"),e.shadowEnabled&&o.push(`drop-shadow(${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${e.shadowColor})`),e.filters)for(const[f,v]of Object.entries(e.filters)){const g=__(zs[f],v.intensity);if(g&&(o.push(g.filter),g.html)){const c=g.html.replace(/<svg([^>]*)>/,"<g$1>").replace(/<\/svg>/,"</g>");u.push(c)}}const d=Zr("g",{className:"element",id:e.id,transform:e.type!=="group"?`translate(${e.x}, ${e.y}) rotate(${e.rotation})`:void 0,display:(i=e.visible)===null||i===void 0||i?void 0:"none",opacity:e.opacity,style:{"transform-origin":"top left",filter:o.join(" ")}},l,...u);return n&&n({dom:d,element:e})||d}async function v4(e){try{const t=await fetch(e),r=t.headers.get("content-type")||"font/ttf",n=await t.arrayBuffer();return`data:${r};base64,${typeof Buffer<"u"?Buffer.from(n).toString("base64"):function(i){const a=new Uint8Array(i);let l="";for(let o=0;o<a.length;o+=32768){const u=a.subarray(o,o+32768);l+=String.fromCharCode(...u)}if(typeof btoa<"u")return btoa(l);if(typeof Buffer<"u")return Buffer.from(a).toString("base64");throw new Error("No base64 encoder available in this environment")}(n)}`}catch(t){return console.error("Error embedding font:",t),e}}async function hN({json:e,elementHook:t,fontEmbedding:r="inline"}){const n=[];E_({children:e.pages},l=>{l.type==="text"&&n.indexOf(l.fontFamily)===-1&&n.push(l.fontFamily)});const i=r==="inline"?await async function(l,o){return await Promise.all(l.map(async u=>{var d,f;if(u==="Arial")return null;const v=o.find(g=>g.fontFamily===u);if(v){c8(v),await mh(u,"normal","normal"),await mh(u,"normal","bold"),await mh(u,"normal","italic"),await mh(u,"normal","bold-italic");const g=await v4(v.url);return Zr("style",{},`@font-face { font-family: ${u}; src: url(${g}); }`)}{u8(u),await mh(u,"normal","normal");const g=`https://fonts.googleapis.com/css?family=${u}:bi,normal,i,b`;try{const c=await fetch(g),y=await c.text(),x=(f=(d=y.match(/url\((.*?)\)/g))===null||d===void 0?void 0:d.map(S=>S.replace(/url\((.*?)\)/,"$1")))===null||f===void 0?void 0:f.filter(S=>S.startsWith("https"));if(!x?.length)throw new Error("No font URLs found");const E=await Promise.all(x.map(async S=>{const b=await v4(S),w=y.match(/font-style:\s*(.*?);/),_=y.match(/font-weight:\s*(.*?);/),A=w?w[1]:"normal",M=_?_[1]:"normal";return`@font-face {
367
- font-family: ${u};
368
- font-style: ${A};
369
- font-weight: ${M};
370
- src: url(${b});
371
- }`}));return Zr("style",{},E.join(`
372
- `))}catch(c){return console.error("Error embedding Google Font:",c),Zr("defs",{},Zr("style",{type:"text/css",innerHTML:`@import url('${g}');`.replace(/&/g,"&amp;")}))}}}))}(n,e.fonts):[],a=await Promise.all(e.pages.map(l=>async function({page:o,store:u,elementHook:d}){const f=await Promise.all(o.children.map(c=>A_({element:c,page:o,store:u,elementHook:d}))),v=o.background.indexOf("url")>=0||o.background.indexOf("http")>=0||o.background.indexOf(".jpg")>=0||o.background.indexOf(".png")>=0||o.background.indexOf(".jpeg")>=0;let g;if(v){const c=await Pp(o.background);g=await iN(o.background,Object.assign({width:u.width,height:u.height,x:0,y:0},w_({width:u.width,height:u.height},{width:c.width,height:c.height})))}return Zr("g",{className:"page",style:{}},v?Zr("image",{"xlink:href":g,x:0,y:0,width:u.width,height:u.height,preserveAspectRatio:"none"}):Zr("rect",{x:0,y:0,width:u.width,height:u.height,fill:v?void 0:o.background}),...f)}({page:l,store:e,elementHook:t})));return Zr("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${e.width} ${e.height}`,width:e.width,height:e.height},...i,...a)}const P_=({dom:e,nestLevel:t=0})=>{if(typeof e=="string")return e;if(!e)return"";const r=e.props,{innerHTML:n}=r,i=cN(r,["innerHTML"]),a=Object.keys(i).map(o=>((u,d)=>typeof d=="object"?`${u}="${Object.keys(d).map(f=>`${f}:${d[f]};`).join(" ")}"`:d==null||d===""?"":`${u}="${d}"`)(o,i[o])).filter(o=>o&&o.trim().length>0).join(" "),l=" ".repeat(t);return`${l}<${e.type}${a?" "+a:""}>${n||`
373
- `+e.children.map(o=>P_({dom:o,nestLevel:t+1})).join("")}${l}</${e.type}>
374
- `};async function dN({json:e,elementHook:t,fontEmbedding:r="inline"}){const n=await hN({json:e,elementHook:t,fontEmbedding:r});return P_({dom:n})}const tp=Jt.model("Page",{id:Jt.identifier,children:Jt.array(Jt.late(()=>M_)),width:Jt.optional(Jt.union(Jt.number,Jt.literal("auto")),"auto"),height:Jt.optional(Jt.union(Jt.number,Jt.literal("auto")),"auto"),background:"white",bleed:0,custom:Jt.frozen(),duration:5e3,_exporting:!1,_rendering:!1,_forceMount:!1}).postProcessSnapshot(e=>{const t=Object.assign({},e),r={};for(var n in t)n[0]!=="_"&&(r[n]=e[n]);return r}).views(e=>({get store(){return kf(e,If)}})).views(e=>({get startTime(){let t=0;for(const r of e.store.pages){if(r.id===e.id)return t;t+=r.duration}return t},get _exportingOrRendering(){return e._exporting||e._rendering}})).views(e=>({get computedWidth(){return e.width==="auto"?e.store.width:e.width},get computedHeight(){return e.height==="auto"?e.store.height:e.height}})).actions(e=>({toJSON:()=>JSON.parse(JSON.stringify(wu(e))),_forEachElementUp(t,r){const n=t.map(i=>({id:i,index:e.children.findIndex(a=>a.id===i)}));n.sort((i,a)=>a.index-i.index);for(const{index:i}of n){if(i==-1)continue;const a=i<e.children.length-1&&e.children[i+1],l=t.indexOf(a?.id)>=0;i===e.children.length-1||l||r(i)}},_forEachElementDown(t,r){const n=t.map(i=>({id:i,index:e.children.findIndex(a=>a.id===i)}));n.sort((i,a)=>i.index-a.index);for(const{index:i}of n){if(i==-1)continue;const a=i>0&&e.children[i-1],l=t.indexOf(a?.id)>=0;i===0||l||r(i)}return!1}})).actions(e=>({clone(t={}){const r=e.toJSON();r.children.forEach(l=>{l.id=ul(10),Ai(l,o=>{o.id=ul(10)})});const n=Object.assign(Object.assign(Object.assign({},r),{id:ul(10)}),t),i=e.store.addPage(n),a=e.store.pages.indexOf(e);return i.setZIndex(a+1),i.select(),i},setZIndex(t){e.store.setPageZIndex(e.id,t)},set(t){Object.assign(e,t)},select(){e.store.selectPage(e.id)},addElement(t,{skipSelect:r=!1}={}){const n=Im[t.type];if(!n)return void console.error("Can not find model with type "+t.type);"children"in t&&Array.isArray(t.children)&&Ai(t,a=>{a.id=a.id||ul(10)});const i=n.create(Object.assign({id:ul(10)},t));return e.children.push(i),i.selectable&&!r&&e.store.selectElements([i.id]),i},canMoveElementsUp(t){let r=!1;return e._forEachElementUp(t,()=>{r=r||!0}),r},moveElementsUp(t){e._forEachElementUp(t,r=>{const n=e.children[r];Lf(n),e.children.splice(r+1,0,n)})},canMoveElementsTop(t){return this.canMoveElementsUp(t)},moveElementsTop(t){const r=[],n=[];e.children.forEach(i=>{t.indexOf(i.id)>=0?r.push(i):n.push(i)}),e.children.replace(n.concat(r))},canMoveElementsDown(t){let r=!1;return e._forEachElementDown(t,()=>{r=r||!0}),r},moveElementsDown(t){e._forEachElementDown(t,r=>{const n=e.children[r];Lf(n),e.children.splice(r-1,0,n)})},canMoveElementsBottom(t){return this.canMoveElementsDown(t)},moveElementsBottom(t){const r=[],n=[];e.children.forEach(i=>{t.indexOf(i.id)>=0?r.push(i):n.push(i)}),e.children.replace(r.concat(n))},setElementZIndex(t,r){const n=e.children.find(i=>i.id===t);n&&(Lf(n),e.children.remove(n),e.children.splice(r,0,n))},setSize({width:t,height:r,useMagic:n,softChange:i}){if(n){const a=[],l=M=>M.type==="image"&&M.x<1&&M.y<1&&M.width>=e.computedWidth-2&&M.height>=e.computedHeight-2;Ai(e,M=>{M.type!=="group"&&(l(M)||a.push(M))});const o=a.length?P0(a):{x:0,y:0,width:e.computedWidth,height:e.computedHeight},u=1/4,d=Math.max(0,Math.min(o.x,e.computedWidth-o.x-o.width)),f=e.computedWidth*u,v=Math.max(0,d-f),g=Math.max(0,Math.min(o.y,e.computedHeight-o.y-o.height)),c=e.computedHeight*u,y=Math.max(0,g-c),x=e.computedWidth-2*v,E=e.computedHeight-2*y,S=t/x,b=r/E,w=Math.min(S,b),_=(t-x*w)/2-v*w,A=(r-E*w)/2-y*w;Ai(e,M=>{M.type!=="group"&&(l(M)?M.set({x:M.x*w,y:M.y*w,width:M.width*S,height:M.height*b,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(M.set({x:_+M.x*w,y:A+M.y*w,width:M.width*w,height:M.height*w}),M.type==="text"?M.set({fontSize:M.fontSize*w}):M.type==="figure"&&M.set({strokeWidth:M.strokeWidth*w})))})}i||(e.width=t),i||(e.height=r)}})).actions(e=>({moveElementUp(t){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),e.moveElementsUp([t])},moveElementDown(t){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),e.moveElementsDown([t])},moveElementTop(t){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),e.moveElementsTop([t])},moveElementBottom(t){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),e.moveElementsBottom([t])},play(){e.store.play({startTime:e.startTime,endTime:e.startTime+e.duration})}})),m4=Jt.model("Audio",{id:Jt.identifier,src:"",duration:0,startTime:0,endTime:1,volume:1,delay:0}).actions(e=>({toJSON:()=>Object.assign({},wu(e))})).actions(e=>({set(t){Object.assign(e,t)}}));var Hd=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};YA("ignore");const pN=Jt.model("Font",{fontFamily:Jt.string,url:Jt.optional(Jt.string,""),styles:Jt.frozen()}).preProcessSnapshot(e=>Object.assign(Object.assign({},e),{fontFamily:e.fontFamily||e.name})),If=Jt.model("Store",{role:"",pages:Jt.array(tp),fonts:Jt.array(pN),audios:Jt.array(m4),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:Jt.frozen(),selectedElementsIds:Jt.array(Jt.string),animatedElementsIds:Jt.array(Jt.string),history:Jt.optional(UC,{targetPath:"../pages"}),_elementsPixelRatio:Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),_activePageId:"",_forceShowCredit:!1,_key:"",_validated:!1}).views(e=>{const t=qf(()=>{const r={};return Ai({children:e.pages},n=>(r[n.id]=n,!1)),r},{keepAlive:!0});return{get _idsMap(){return t.get()}}}).views(e=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),e.bleedVisible},get selectedElements(){return e.selectedElementsIds.map(t=>{for(const r of e.pages)for(const n of r.children)if(n.id===t)return n}).filter(t=>!!t)},get children(){return e.pages},get selectedShapes(){const t=[];return Ai({children:e.selectedElements},r=>{r.type!=="group"&&t.push(r)}),t},get activePage(){return e.pages.slice().find(t=>t.id===e._activePageId)||(e.pages.length?e.pages[0]:null)},get duration(){let t=0;return e.pages.forEach(r=>{t+=r.duration}),t},get _hasCroppedImages(){return e.find(t=>t.type==="image"&&t._cropModeEnabled)},find(t){let r;return Ai({children:e.pages},n=>{if(!r&&t(n))return r=n,!0}),r},getElementById:t=>e._idsMap[t]})).actions(e=>{let t=0,r=null,n=!1;return{afterCreate(){e.history.canUndo},setCurrentTime(i){e.currentTime=i},_togglePlaying(i=!e.isPlaying){e.isPlaying=i},play({animatedElementsIds:i=[],startTime:a=0,currentTime:l=0,endTime:o=e.duration,repeat:u=!1}={}){l&&(console.warn("currentTime property of store.play() is deprecated. Please use startTime instead."),a=l),e.animatedElementsIds=i,e.currentTime=a,e.isPlaying=!0,t=Date.now(),r=o,n=u,requestAnimationFrame(e.seek)},checkActivePage(){let i=0;for(const a of e.pages){if(e.currentTime>=a.startTime&&e.currentTime<a.startTime+a.duration){e.selectPage(a.id);break}i+=a.duration}},seek(){if(!e.isPlaying)return;const i=Date.now(),a=i-t;t=i,e.currentTime+=a,e.checkActivePage();const l=r||e.duration;e.isPlaying&&e.currentTime<l?requestAnimationFrame(e.seek):e.isPlaying&&n?(e.currentTime=0,requestAnimationFrame(e.seek)):e.stop()},stop(){e.isPlaying=!1,e.currentTime=0,e.animatedElementsIds=[],e.checkActivePage()}}}).actions(e=>({__(){e._validated||(tN(e._key,e._forceShowCredit),e._validated=!0)},set(t){Object.assign(e,t)},setUnit({unit:t,dpi:r}){e.unit=t||e.unit,e.dpi=r||e.dpi},setRole(t){e.role=t},addPage(t){const r=tp.create(Object.assign({id:ul(10)},t));return e.pages.push(r),e._activePageId=r.id,r},selectPage(t){e._activePageId=t},selectElements(t){const r=t.map(n=>e.getElementById(n)).sort((n,i)=>n.page.children.indexOf(n)-n.page.children.indexOf(i)).filter(n=>!!n).map(n=>n.id);e.selectedElementsIds=r},toggleBleed(t){e.bleedVisible=t??!e.bleedVisible},toggleRulers(t){e.rulesVisible=t??!e.rulesVisible},openSidePanel(t){e.openedSidePanel!==t&&(e.previousOpenedSidePanel=e.openedSidePanel,e.openedSidePanel=t)},setScale(t){e.scale=t},_setScaleToFit(t){e.scaleToFit=t},setElementsPixelRatio(t){e._elementsPixelRatio=t},setSize(t,r,n){e.pages.forEach(i=>{i.setSize({width:t,height:r,useMagic:n,softChange:!0})}),e.width=t,e.height=r},setPageZIndex(t,r){const n=e.pages.find(i=>i.id===t);n&&(Lf(n),e.pages.remove(n),e.pages.splice(r,0,n))},deletePages(t){const r=e.pages.indexOf(e.activePage);t.forEach(a=>{const l=e.pages.find(o=>o.id===a);Cg(l)});const n=Math.min(e.pages.length-1,r),i=e.pages[n];i&&(e._activePageId=i.id),e.selectedElementsIds=e.selectedElementsIds.filter(a=>e.getElementById(a))},groupElements(t,r={}){const n=t.map(l=>e.getElementById(l)),i=n[0].page;if(n.forEach(l=>{l&&Lf(l)}),!n.length)return;const a=Object.assign({id:ul(10),children:n,type:"group"},r);return i.children.push(a),e.selectedElementsIds=[a.id],i.children.find(l=>l.id===a.id)},ungroupElements(t){const r=t.map(i=>e.getElementById(i)),n=[];r.forEach(i=>{if(i&&i.type==="group"){const a=i.page,l=a.children.indexOf(i);i.children.forEach(o=>{n.push(o.id)}),i.children.forEach(o=>{Lf(o),a.children.push(o)}),a.children.splice(l,1)}}),e.selectedElementsIds=n},deleteElements(t){const r=[];e.find(n=>(t.includes(n.id)&&r.push(n),!1)),r.forEach(n=>{Cg(n)}),e.selectedElementsIds=e.selectedElementsIds.filter(n=>e.getElementById(n))},on(t,r){if(t==="change"){let n=e.toJSON();return p8(e,i=>{const a=e.toJSON();!ep(n,a)&&(n=a,r(a))})}},async _toCanvas({pixelRatio:t,ignoreBackground:r,pageId:n,mimeType:i,includeBleed:a,_skipTimeout:l,quickMode:o=!1}={}){var u;const d=t||1;n=n||((u=e.pages[0])===null||u===void 0?void 0:u.id);const f=e.pages.find(k=>k.id===n);if(!f)throw new Error(`No page for export with id ${n}`);const v=e._elementsPixelRatio;d>e._elementsPixelRatio&&e.setElementsPixelRatio(d),o?f?.set({_forceMount:!0}):f?.set({_exporting:!0});const g=await nN(()=>sr.stages.find(k=>k.getAttr("pageId")===n));if(!g)throw f?.set({_forceMount:!1,_exporting:!1}),e.setElementsPixelRatio(v),new Error(`Export is failed. Can not find stage for page ${n}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);await e.waitLoading({_skipTimeout:l});const c=g.findOne(".page-container");if(!c)throw e.setElementsPixelRatio(v),f?.set({_forceMount:!1,_exporting:!1}),new Error("Export is failed. Canvas was unmounted.");const y=g.position();g.position({x:0,y:0}),g.find("Transformer").forEach(k=>{k.setAttr("oldVisible",k.visible()),k.visible(!1)}),c.find(".page-background").forEach(k=>k.shadowEnabled(!1)),c.find(".page-background").forEach(k=>k.strokeEnabled(!1)),c.find(".highlighter").forEach(k=>k.visible(!1));const x=c.findOne(".page-background-group"),E=x.clip();x.clip({x:null,y:null,width:null,height:null});const S=c.findOne(".elements-container"),b=S.clip();S.clip({x:null,y:null,width:null,height:null});const w=c.find(k=>!k.visible()&&k.getAttr("editModeEnabled")&&!k.getAttr("hideInExport"));w.forEach(k=>{k.setAttr("oldVisible",k.visible()),k.show()});const _=c.find(k=>k.getAttr("hideInExport"));_.forEach(k=>{k.setAttr("oldVisible",k.visible()),k.hide()}),r&&c.find(".page-background").forEach(k=>k.hide());const A=a?f.bleed:0;let M=A;!e.bleedVisible&&a||(e.bleedVisible||a?e.bleedVisible&&a?M=0:e.bleedVisible&&!a&&(M=-f.bleed):M=0);const O=document.createElement("canvas");O.width=Math.round((f.computedWidth+2*A)*d),O.height=Math.round((f.computedHeight+2*A)*d);const L=O.getContext("2d");i==="image/jpeg"&&(L.fillStyle="white",L.fillRect(0,0,O.width,O.height));const R=c.scale();c.scale({x:1,y:1});const T=c.toCanvas({x:c.x()-M,y:c.y()-M,width:f.computedWidth+2*A,height:f.computedHeight+2*A,pixelRatio:d});return c.scale(R),L.drawImage(T,0,0,O.width,O.height),sr.Util.releaseCanvas(T),r&&c.find(".page-background").forEach(k=>k.show()),_.forEach(k=>{k.visible(k.getAttr("oldVisible"))}),w.forEach(k=>{k.visible(k.getAttr("oldVisible"))}),c.find(".page-background").forEach(k=>k.shadowEnabled(!0)),c.find(".page-background").forEach(k=>k.strokeEnabled(!0)),g.find("Transformer").forEach(k=>{k.visible(k.getAttr("oldVisible"))}),c.find(".highlighter").forEach(k=>k.visible(!0)),x.clip(E),S.clip(b),g.position(y),f?.set({_exporting:!1,_forceMount:!1}),await new Promise(k=>setTimeout(k)),e.setElementsPixelRatio(v),O},async toDataURL(t={}){var{mimeType:r,quality:n}=t,i=Hd(t,["mimeType","quality"]);const a=await e._toCanvas(Object.assign({mimeType:r},i)),l=a.toDataURL(r,n);return sr.Util.releaseCanvas(a),l},async toBlob(t={}){var{mimeType:r,quality:n}=t,i=Hd(t,["mimeType","quality"]);const a=await e._toCanvas(Object.assign({mimeType:r},i)),l=await new Promise(o=>{a.toBlob(o,r,n)});return sr.Util.releaseCanvas(a),l},async saveAsImage(t={}){var{fileName:r}=t,n=Hd(t,["fileName"]);const i=n.mimeType||"image/png",a=i.split("/")[1];c1(await e.toDataURL(n),r||"polotno."+a)},async _toPDF(t){const r=t.dpi||e.dpi,n=t.parallel||1,i=t.unit||(e.unit==="px"?"mm":e.unit),a=t.pixelRatio||1,l=t.pageIds||e.pages.map(w=>w.id),o=e.pages.filter(w=>l.includes(w.id)),u=await qC(),d=w=>k0({px:w,unit:i,dpi:r}),f=t.cropMarkSize||0,v=d(f),g=o[0]||{},c=t.includeBleed?g.bleed:0,y=d(g.computedWidth+2*c+2*v),x=d(g.computedHeight+2*c+2*v);var E=new u({unit:i,orientation:y>x?"landscape":"portrait",format:[y,x],compress:!0,putOnlyUsedFonts:!0});E.deletePage(1);const S=((w,_)=>{for(var A=[],M=0;M<w.length;M+=_)A.push(w.slice(M,M+_));return A})(o,n);let b=0;for(const w of S){const _=w.map(async A=>{const M=t.includeBleed?A.bleed:0,O=A.computedWidth+2*M+2*f,L=A.computedHeight+2*M+2*f,R=d(O),T=d(L);let k=0,C=a;for(;k<10;){k+=1,k===2&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");const q=await e.toDataURL(Object.assign(Object.assign({},t),{pageId:A.id,pixelRatio:C}));if(q.length>20)return t.onProgress&&t.onProgress(++b/l.length*.9),{url:q,width:R,height:T,widthPx:O,heightPx:L};C*=.8}});(await Promise.all(_)).forEach(({url:A,width:M,height:O,widthPx:L,heightPx:R})=>{E.addPage([M,O],M>O?"landscape":"portrait");const T=E.getCurrentPageInfo();var k;switch(i){case"pt":k=1;break;case"mm":k=72/25.4;break;case"cm":k=72/2.54;break;case"in":k=72;break;case"px":k=.75;break;case"pc":case"em":k=12;break;case"ex":k=6;break;default:throw"Invalid unit: "+i}if(T.pageContext.cropBox={bottomLeftX:0,bottomLeftY:0,topRightX:M*k,topRightY:O*k},T.pageContext.artBox={bottomLeftX:d(f+c)*k,bottomLeftY:d(f+c)*k,topRightX:d(L-f-c)*k,topRightY:d(R-f-c)*k},T.pageContext.bleedBox={bottomLeftX:d(f+c)*k,bottomLeftY:d(f+c)*k,topRightX:d(L-f-c)*k,topRightY:d(R-f-c)*k},v){E.setLineWidth(d(1));const C=v+d(c);E.line(C,0,C,v),E.line(0,C,v,C),E.line(M-C,0,M-C,v),E.line(M,C,M-v,C),E.line(0,O-C,v,O-C),E.line(C,O,C,O-v),E.line(M,O-C,M-v,O-C),E.line(M-C,O,M-C,O-v)}E.addImage(A,v,v,M-2*v,O-2*v,void 0,"FAST")})}return E},toPDFDataURL:async t=>(await e._toPDF(Object.assign({mimeType:"image/jpeg"},t))).output("datauristring"),async toGIFDataURL(t={}){const r=t.pixelRatio||1,n=await VC({width:e.width*r,height:e.height*r}),i=1e3/(t.fps||10),a=e.duration/i;for(let l=0;l<a-1;l++){const o=l*i||1;e.setCurrentTime(o);let u=0,d="";for(const v of e.pages)if(u+=v.duration,v.set({_rendering:u>o}),u>o){d=v.id;break}const f=await e._toCanvas({pixelRatio:r,pageId:d,_skipTimeout:!0});n.addFrame(f.getContext("2d"),{delay:i,copy:!0})}for(const l of e.pages)l.set({_rendering:!1});return e.stop(),n.render(),new Promise(l=>{n.on("finished",function(o){(function(u,d){var f=new FileReader;f.onload=function(v){d(v.target.result)},f.readAsDataURL(u)})(o,l)})})},async saveAsGIF(t={}){var{fileName:r}=t,n=Hd(t,["fileName"]);const i=await e.toGIFDataURL(n);c1(i,r||"polotno.gif")},async toHTML({elementHook:t}={elementHook:void 0}){const r=e.toJSON();return uN({json:r,elementHook:t})},async saveAsHTML({fileName:t}={}){const r=await e.toHTML(),n="data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(r)));c1(n,t||"polotno.html")},async toSVG({elementHook:t,pageId:r,fontEmbedding:n="inline"}={elementHook:void 0,pageId:void 0,fontEmbedding:"inline"}){var i;const a=e.toJSON();r=r||((i=a.pages[0])===null||i===void 0?void 0:i.id);const l=a.pages.find(o=>o.id===r);return dN({json:Object.assign(Object.assign({},a),{pages:l?[l]:[]}),elementHook:t,fontEmbedding:n})},async saveAsSVG({fileName:t,elementHook:r,pageId:n,fontEmbedding:i="inline"}={}){const a=await e.toSVG({elementHook:r,pageId:n,fontEmbedding:i}),l="data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(a)));c1(l,t||"polotno.svg")},async saveAsPDF(t={}){var{fileName:r}=t,n=Hd(t,["fileName"]);(await e._toPDF(Object.assign({mimeType:"image/jpeg"},n))).save(r||"polotno.pdf")},async waitLoading({_skipTimeout:t=!1}={}){t||await new Promise(r=>setTimeout(r,50)),await FA()},toJSON:()=>({width:e.width,height:e.height,fonts:wu(e.fonts),pages:wu(e.pages),audios:wu(e.audios),unit:e.unit,dpi:e.dpi,custom:e.custom,schemaVersion:e.schemaVersion}),loadJSON(t,r=!1){var n;const i=JSON.parse(JSON.stringify(t)),a=i.schemaVersion||0;a<1&&gi.htmlRenderEnabled&&Ai({children:i.pages},d=>{if(d.type==="text"){const v=d.letterSpacing*16;d.letterSpacing=v/d.fontSize}}),a<2&&Ai({children:i.pages},d=>{d.filters&&Object.keys(d.filters).forEach(f=>{if(["warm","cold","natural"].includes(f))return;const v=d.filters[f];v&&typeof v.intensity=="number"&&(v.intensity=v.intensity/100)})}),delete i.schemaVersion;const l=e.pages.indexOf(e.activePage);let o=(n=i.pages[l]||i.pages[0])===null||n===void 0?void 0:n.id;i._activePageId=o;const u=Object.assign({},wu(e));Object.assign(u,i),u.history=r?e.history.toJSON():{history:[],undoIdx:-1},Fv(e,u)},clear({keepHistory:t=!1}={}){const r=e.pages.map(n=>n.id);e.deletePages(r),e.custom=null,t||e.history.clear()},addFont(t){e.removeFont(t.fontFamily),e.fonts.push(t),e.loadFont(t.fontFamily)},removeFont(t){e.fonts.filter(r=>r.fontFamily===t).forEach(r=>Cg(r))},addAudio(t){const r=m4.create(Object.assign({id:ul(10)},t));e.audios.push(r)},removeAudio(t){const r=e.audios.find(n=>n.id===t);r&&e.audios.remove(r)},async loadFont(t){const r=e.fonts.find(i=>i.fontFamily===t)||wm.find(i=>i.fontFamily===t);let n=[{fontStyle:"normal",fontWeight:"normal"},{fontStyle:"normal",fontWeight:"bold"}];return r?(r.styles&&(n=r.styles.map(i=>({fontStyle:i.fontStyle||"normal",fontWeight:i.fontWeight||"normal"}))),c8(r)):u8(t),Promise.all(n.map(i=>mh(t,i.fontStyle,i.fontWeight)))},validate:t=>If.validate(t,[{path:"",type:If}]).map(r=>({path:"store"+r.context.map(n=>n.path).join("."),message:r.message}))}));function gN({key:e,showCredit:t}={key:"",showCredit:!1}){return If.create({_forceShowCredit:t,_key:e})}const k_=Jt.model("Node",{id:Jt.identifier,type:"none",name:"",opacity:1,custom:Jt.frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(e=>{for(var t in e)e[t]===null&&(e[t]=void 0);return e}).postProcessSnapshot(e=>{const t=Object.assign({},e),r={};for(var n in t)n[0]!=="_"&&(r[n]=e[n]);return r}).views(e=>({get locked(){return!(e.draggable||e.contentEditable||e.styleEditable||e.resizable)},get page(){return kf(e,tp)},get store(){return kf(e,If)},get top(){let t=e;for(;;){if(!s1(t,Sh))return t;t=kf(t,Sh)}},get parent(){if(s1(e,Sh)){const t=kf(e,Sh);return t&&t.children&&t.children.length,t}if(s1(e,tp)){const t=kf(e,tp);return t&&t.children&&t.children.length,t}if(s1(e,If)){const t=kf(e,If);return t&&t.pages&&t.pages.length,t}return null},get zIndex(){return e.parent.children.indexOf(e)}})).actions(e=>({toJSON:()=>Object.assign({},wu(e))})).actions(e=>({clone(t={},{skipSelect:r=!1}={}){const n=JSON.parse(JSON.stringify(e.toJSON()));return t.id=t.id||ul(10),Ai(n,i=>{i.id=ul(10)}),Object.assign(n,t),e.page.addElement(n,{skipSelect:r})},set(t){Object.assign(e,t)},moveUp(){e.page.moveElementsUp([e.id])},moveTop(){e.page.moveElementsTop([e.id])},moveDown(){e.page.moveElementsDown([e.id])},moveBottom(){e.page.moveElementsBottom([e.id])},setZIndex(t){e.parent.setElementZIndex(e.id,t)},beforeDestroy(){}})),y4={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}}},b4={right:{cropX:-1},left:{cropX:1},up:{cropY:1},down:{cropY:-1}},vN={fade:({dTime:e,element:t,animation:r})=>{const n=e/r.duration;return r.type==="enter"?{opacity:n*t.opacity}:{opacity:(1-n)*t.opacity}},rotate:({dTime:e,element:t,animation:r})=>{const n=e/r.duration*360;return cC({x:t.x,y:t.y,width:t.width,height:t.height,rotation:t.rotation},n)},blink:({dTime:e,element:t,animation:r})=>{const n=r.duration,i=e%n/(n/2),a=i<=1?i:2-i;return{opacity:t.opacity*a}},bounce:({dTime:e,element:t,animation:r})=>{var n;const i=r.duration,a=i/2,l=(n=r.data.strength)!==null&&n!==void 0?n:1,o={},u={x:t.x+t.width/3*l,y:t.y+t.height/3*l,width:t.width/3*l,height:t.height/3*l,fontSize:t.fontSize/3*l},d={x:t.x,y:t.y,width:t.width,height:t.height,fontSize:t.fontSize},f=e%i/a,v=f<=1?f:2-f;for(let g in u){const c=u[g],y=d[g]-c;o[g]=c+v*y}return o},move:({dTime:e,element:t,animation:r})=>{var n;const i=y4[r.data.direction]||y4.right,a=(n=r.data.strength)!==null&&n!==void 0?n:1,l={};for(var o in i.from){let u=i.from[o],d=i.to[o];r.type==="exit"&&(u=i.to[o],d=-i.from[o]),u*=a,d*=a;const f=t[o]+u,v=t[o]+d-f;l[o]=f+e/r.duration*v}return l},zoom:({dTime:e,element:t,animation:r})=>{var n;const i={},a=1+(((r.data.direction||"in")==="in"?.75:1.25)-1)*((n=r.data.strength)!==null&&n!==void 0?n:1),l=t.rotation*Math.PI/180,o=Math.cos(l),u=Math.sin(l),d=t.width*(1-a),f=t.height*(1-a),v=(d*o-f*u)/2,g=(d*u+f*o)/2,c={x:t.x+v,y:t.y+g,width:t.width*a,height:t.height*a,fontSize:t.fontSize*a},y={x:t.x,y:t.y,width:t.width,height:t.height,fontSize:t.fontSize};for(var x in c){let E=c[x],S=y[x];if(r.type==="exit"){const w=E;E=S,S=w}const b=S-E;i[x]=E+e/r.duration*b}return i},cameraZoom:({dTime:e,element:t,animation:r})=>{var n,i,a;const l={},o=r.data.direction||"right",u=b4[o]||b4.right,d=(n=r.data.movementStrength)!==null&&n!==void 0?n:.1,f=(i=r.data.shakeStrength)!==null&&i!==void 0?i:.015;a=r.data.zoomStrength;const v=e/r.duration,g=f*(1-v),c=Math.sin(12*v)*g*.7+Math.sin(8*v)*g*.3;r.type==="exit"&&Math.max(t.cropWidth||1,t.cropHeight||1),r.type;const y=1-Math.pow(1-v,2),x=t.cropX||0,E=t.cropY||0,S=t.cropWidth||1,b=t.cropHeight||1,w=S,_=b;let A,M,O=0,L=0;if(u.cropX){const R=u.cropX>0?1-(x+S):x;O=Math.min(R,Math.abs(d))*u.cropX}if(u.cropY){const R=u.cropY>0?1-(E+b):E;L=Math.min(R,Math.abs(d))*u.cropY}return r.type==="enter"?(A=u.cropX?x+O*(1-y):x,M=u.cropY?E+L*(1-y):E):(A=u.cropX?x+O*y:x,M=u.cropY?E+L*y:E),l.cropX=Math.max(0,Math.min(1-w,A+c*w)),l.cropY=Math.max(0,Math.min(1-_,M+c*_)),l.cropWidth=w,l.cropHeight=_,l}},W2=({element:e,dTime:t,animation:r})=>{const n=vN[r.name];return n?n({element:e,dTime:t,animation:r}):(console.error("Can not find animation type: "+r.name),{})},mN=Jt.model("Animation",{delay:0,duration:500,enabled:!0,type:Jt.enumeration("Type",["enter","exit","loop"]),name:"none",data:Jt.frozen({})}),Y2=(e,t)=>{const r={};for(const n in t)if(typeof e[n]=="number"&&typeof t[n]=="number"){const i=t[n]-e[n];i!==0&&(r[n]=i)}return r},yN=Jt.model("ShapeFilter",{intensity:1}),w4=["temperature","contrast","highlights","shadows","white","black","saturation","vibrance"],kp=k_.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:Jt.array(mN),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,filters:Jt.map(yN),shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(e=>{const t=Object.assign(Object.assign({},e),{x:e.x||0,y:e.y||0,filters:Array.isArray(e.filters)?{}:e.filters});return"width"in e&&(t.width=t.width||1),"height"in e&&(t.height=t.height||1),e.locked&&(t.draggable=!1,t.contentEditable=!1,t.styleEditable=!1,t.resizable=!1,t.removable=!1),t}).views(e=>{const t=$r({x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation,opacity:e.opacity,color:e.color,fontSize:e.fontSize}),r=Wr(i=>{Object.assign(t,i)}),n=Wr(i=>{for(const a in i)typeof t[a]=="number"&&(t[a]=t[a]+i[a])});return{get a(){const{currentTime:i}=e.store;if(r({x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation,opacity:e.opacity,color:e.color,fontSize:e.fontSize,cropX:e.cropX,cropY:e.cropY,cropWidth:e.cropWidth,cropHeight:e.cropHeight}),i===0)return t;const a=i-e.page.startTime;if(a>e.page.duration||a<0)return t;const l=e.store.animatedElementsIds;if(l.length&&!l.includes(e.id))return t;const o=e.animations.find(g=>g.type==="enter"),u=o?.enabled&&a<o.delay;u&&r({opacity:0});const d=o?.enabled&&a>=o.delay&&a<=o.delay+o.duration;if(d){const g=a-o.delay,c=W2({element:e,animation:o,dTime:g}),y=Y2(e,c);n(y)}const f=e.animations.find(g=>g.type==="exit");if(!u&&!d&&f?.enabled&&a>=e.page.duration-f.duration-f.delay&&a<=e.page.duration-f.delay){const g=a-(e.page.duration-f.duration-f.delay),c=W2({element:e,animation:f,dTime:g}),y=Y2(e,c);n(y)}f?.enabled&&a>=e.page.duration-f.delay&&r({opacity:0});const v=e.animations.find(g=>g.type==="loop");if(v?.enabled){const g=W2({element:e,animation:v,dTime:a}),c=Y2(e,g);n(c)}return t},animated:i=>e.a[i]}}).actions(e=>({setAnimation(t,r){const n=e.animations.find(i=>i.type===t);n?Object.assign(n,r):e.animations.push(Object.assign({type:t},r))},setFilter(t,r){w4.includes(t)||e.filters.forEach((n,i)=>{w4.includes(i.toString())||e.filters.delete(i.toString())}),r==null?e.filters.delete(t):e.filters.set(t,{intensity:r})}})),O_=kp.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:Jt.optional(Jt.union(Jt.number,Jt.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(e=>Object.assign({},e)).actions(e=>({toggleEditMode(t){e._editModeEnabled=t??!e._editModeEnabled,e._editModeEnabled?e.store.history.startTransaction():e.store.history.endTransaction()}})),O0=kp.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,stretchEnabled:!1,_cropModeEnabled:!1}).actions(e=>({toggleCropMode(t){e._cropModeEnabled=t??!e._cropModeEnabled,e._cropModeEnabled?e.store.history.startTransaction():e.store.history.endTransaction()},beforeDestroy(){e._cropModeEnabled&&e.store.history.endTransaction()}})),C_=O0.named("Video").props({type:"video",duration:0,startTime:0,endTime:1,volume:1}),N_=kp.named("Line").props({type:"line",width:400,height:10,color:"black",dash:Jt.array(Jt.number),startHead:"",endHead:""}).actions(e=>({})),L_=kp.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:Jt.map(Jt.string)}).preProcessSnapshot(e=>Object.assign(Object.assign({},e),{src:e.src||e.svgSource,colorsReplace:Array.isArray(e.colorsReplace)?{}:e.colorsReplace})).actions(e=>({replaceColor(t,r){e.colorsReplace.set(t,r)}})),T_=kp.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:Jt.array(Jt.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0}),R_=O0.named("Gif").props({type:"gif",duration:0,keepRatio:!0});var bN=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};const Ai=(e,t)=>{if(e.children)for(const r of e.children){if(t(r)===!0)break;Ai(r,t)}},wN=[...new Array(20)].map((e,t)=>Jt.late(()=>_N[t])),M_=Jt.union({dispatcher:e=>{const t=Im[e.type];if(!t)throw new Error(`Unknown element type: "${e.type}"`);return t}},L_,O_,O0,N_,C_,T_,R_,Jt.late(()=>Sh),...wN),Sh=k_.named("Group").props({type:"group",children:Jt.array(M_)}).views(e=>({get draggable(){let t=!0;return Ai(e,r=>{r.draggable||(t=!1)}),t},get resizable(){let t=!0;return Ai(e,r=>{r.resizable||(t=!1)}),t},get contentEditable(){let t=!0;return Ai(e,r=>{r.contentEditable||(t=!1)}),t},get styleEditable(){let t=!0;return Ai(e,r=>{r.styleEditable||(t=!1)}),t},get locked(){let t=!0;return Ai(e,r=>{r.locked||(t=!1)}),t}})).actions(e=>({set(t){var{draggable:r,contentEditable:n,styleEditable:i,resizable:a}=t,l=bN(t,["draggable","contentEditable","styleEditable","resizable"]);r!==void 0&&Ai(e,o=>{o.set({draggable:r})}),n!==void 0&&Ai(e,o=>{o.set({contentEditable:n})}),i!==void 0&&Ai(e,o=>{o.set({styleEditable:i})}),a!==void 0&&Ai(e,o=>{o.set({resizable:a})}),Object.assign(e,l)},addElement(t,{skipSelect:r=!1}={}){const n=Im[t.type];if(!n)return void console.error("Can not find model with type "+t.type);t.children&&t.children.forEach(a=>{a.id=a.id||ul(10)});const i=n.create(Object.assign({id:ul(10)},t));return e.children.push(i),i.selectable&&!r&&e.store.selectElements([i.id]),i},setElementZIndex(t,r){const n=e.children.find(i=>i.id===t);n&&(Lf(n),e.children.remove(n),e.children.splice(r,0,n))}})),_N=[],Im={svg:L_,text:O_,image:O0,group:Sh,line:N_,video:C_,figure:T_,gif:R_},xN={text:Rk,image:Bb,svg:Bb,line:gC,video:wC,figure:LC,group:Yn(e=>{const{element:t,store:r}=e,{children:n}=t,i=t.selectable||r.role==="admin";return ce.createElement(vn,{opacity:t.opacity,listening:i,hideInExport:!t.showInExport},n.map(a=>ce.createElement(I_,Object.assign({},e,{key:a.id,store:r,element:a}))))}),gif:DC},SN=(e,t)=>{const r=[];Ai(e,f=>{f.type!=="group"&&r.push(f.a)});const n=[];r.forEach(f=>{const v=[{x:0,y:0},{x:0+f.width,y:0},{x:0+f.width,y:0+f.height},{x:0,y:0+f.height}],g=new sr.Transform;g.translate(f.x,f.y),g.rotate(sr.Util.degToRad(f.rotation)),v.forEach(c=>{const y=g.point(c);n.push(y)})});const i=new sr.Transform;i.rotate(-sr.Util.degToRad(t));let a=1/0,l=1/0,o=-1/0,u=-1/0;n.forEach(f=>{const v=i.point(f);a=Math.min(a,v.x),l=Math.min(l,v.y),o=Math.max(o,v.x),u=Math.max(u,v.y)}),i.invert();const d=i.point({x:a,y:l});return{x:d.x,y:d.y,width:o-a,height:u-l,rotation:t}},I_=Yn(e=>{var t;const{element:r,store:n}=e,[i,a]=ce.useState(!1),l=n.selectedElements.indexOf(r)>=0&&r.selectable,o=((t=r.parent)===null||t===void 0?void 0:t.type)==="group",u=(v=>{const[g,c]=ce.useState(null);return ce.useEffect(()=>{const y=setTimeout(()=>{const x=v.page.id,E=sr.stages.find(S=>S.getAttr("pageId")===x);E||console.error("No stage is found for element",v.id),c(E)});return()=>clearTimeout(y)},[v.id]),g})(r),d=u?.findOne("Transformer");ce.useEffect(()=>{if(u){const v=c=>{const y=c.target.findAncestor(".element",!0),x=n.getElementById(y?.id()),E=x?.top,S=E?.id;a(S===r.id)};u.on("mouseover",v);const g=()=>{a(!1)};return u.on("mouseleave",g),()=>{u.off("mouseover",v),u.off("mouseleave",g)}}},[u]);let f=xN[e.element.type];return e.element.type==="text"&&gi.htmlRenderEnabled&&(f=oC),e.element.visible?f?ce.createElement(ce.Fragment,null,ce.createElement(f,Object.assign({},e)),(i||l)&&!o&&ce.createElement(zC,{element:r.type==="group"?{a:SN(r,d?.rotation()||0)}:r})):(console.error("Can not find component for "+e.element.type),null):null});function EN(e,t,r="scale"){const n=t.width/t.height;let i,a;n>=e.width/e.height?(i=e.width,a=e.width/n):(i=e.height*n,a=e.height);let l=0,o=0;return r==="left-top"?(l=0,o=0):r==="left-middle"?(l=0,o=(e.height-a)/2):r==="left-bottom"?(l=0,o=e.height-a):r==="center-top"?(l=(e.width-i)/2,o=0):r==="center-middle"?(l=(e.width-i)/2,o=(e.height-a)/2):r==="center-bottom"?(l=(e.width-i)/2,o=e.height-a):r==="right-top"?(l=e.width-i,o=0):r==="right-middle"?(l=e.width-i,o=(e.height-a)/2):r==="right-bottom"?(l=e.width-i,o=e.height-a):r==="scale"?(l=0,o=0,i=e.width,a=e.height):console.error(new Error("Unknown clip position property - "+r)),{cropX:l,cropY:o,cropWidth:i,cropHeight:a}}var F_=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};const _4=sr.DD._drag;window.removeEventListener("mousemove",_4),sr.DD._drag=function(e){tc(()=>{_4.call(this,e)})},window.addEventListener("mousemove",sr.DD._drag);const Uv=new sr.Group,Xc=20;Uv.add(new sr.Rect({width:Xc,height:Xc,fill:"white"})),Uv.add(new sr.Path({scaleX:Xc/24,scaleY:Xc/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 AN=Uv.toCanvas({pixelRatio:2,width:Xc,height:Xc}),X2={enabledAnchors:["top-left","top-center","top-right","middle-left","bottom-left","bottom-right","bottom-center","middle-right"],borderEnabled:!0,rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:e=>{e.hasName("rotater")&&e.setAttrs({width:20,height:20,cornerRadius:20/2,offsetX:20/2,offsetY:20/2,fillPatternImage:AN,fillPatternScaleX:20/Xc/2,fillPatternScaleY:20/Xc/2,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},K2={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"]}},PN=e=>ce.createElement(En,Object.assign({},e,{preventDefault:!1})),kN=e=>{var{url:t}=e,r=F_(e,["url"]);const[n,i]=ym(t,"anonymous"),a=n?EN(n,{width:r.width,height:r.height},"center-middle"):{};return Jd(i,t,"page background"),ce.createElement(bu,Object.assign({image:n},r,a))},ON=e=>{const t=tf({fill:e.fill,a:{width:e.width,height:e.height}});return ce.createElement(En,Object.assign({},e,t))},CN=e=>{const{background:t,scale:r,borderColor:n}=e,i=F_(e,["background","scale","borderColor"]),a=ce.useMemo(()=>!!sr.Util.colorToRGBA(t)||v0(t),[t]),l=ce.useMemo(()=>{const o=document.createElement("canvas"),u=30;o.width=60,o.height=60;const d=o.getContext("2d");return d&&(d.fillStyle="black",d.fillRect(u,0,u,u),d.fillRect(0,u,u,u)),o},[]);return ce.createElement(ce.Fragment,null,ce.createElement(En,Object.assign({fillPatternImage:l},i,{opacity:.1,hideInExport:!0})),a?ce.createElement(ON,Object.assign({fill:t},i)):ce.createElement(kN,Object.assign({url:t},i)))},NN=Yn(({selection:e,fill:t="rgba(0, 161, 255, 0.3)",stroke:r="rgb(0, 161, 255)",strokeWidth:n=1})=>e.visible?ce.createElement(En,{name:"selection",x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),width:Math.abs(e.x1-e.x2),height:Math.abs(e.y1-e.y2),fill:t,stroke:r,strokeWidth:n}):null),LN=Yn(({x:e,y:t,width:r,height:n,rotation:i,anchor:a,store:l,tagFill:o,textFill:u})=>{const d=A0({x:e,y:t,width:r,height:n,rotation:sr.Util.radToDeg(i)});if(a===void 0)return null;const f=(n/2+70)*Math.cos(i-Math.PI/2),v=(n/2+70)*Math.sin(i-Math.PI/2),g=h4({unit:l.unit,dpi:l.dpi,px:r/l.scale,precious:l.unit==="px"?0:1})+" x "+h4({unit:l.unit,dpi:l.dpi,px:n/l.scale,precious:l.unit==="px"?0:1})+(l.unit==="px"?"":" "+l.unit);return ce.createElement(ce.Fragment,null,ce.createElement(V1,{x:(d.minX+d.maxX)/2+f,y:(d.minY+d.maxY)/2+v,offsetX:14,offsetY:14,visible:a==="rotater"},ce.createElement(G1,{cornerRadius:5,fill:o||"rgb(0, 161, 255)"}),ce.createElement(Au,{align:"center",verticalAlign:"middle",fill:u||"white",padding:8,text:Math.round(sr.Util.radToDeg(i)).toString()+"°"})),ce.createElement(V1,{x:(d.minX+d.maxX)/2,y:d.maxY+20,visible:a!=="rotater"},ce.createElement(G1,{cornerRadius:5,fill:o||"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),ce.createElement(Au,{align:"center",verticalAlign:"middle",fill:u||"white",padding:8,text:g})))}),TN=Yn(({elements:e,store:t})=>{const r=e.filter(i=>i.alwaysOnTop),n=e.filter(i=>!i.alwaysOnTop).concat(r);return ce.createElement(ce.Fragment,null,n.map(i=>ce.createElement(I_,{key:i.id,store:t,element:i,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}})))}),RN=({store:e})=>{const[t,r]=ce.useState(!1),[n,i]=ce.useState({x:0,y:0});return{open:ce.useCallback(l=>{r(!0),i(l)},[]),close:ce.useCallback(()=>{r(!1)},[]),props:{isOpen:t,offset:n,setIsOpen:r}}},MN=atob("UG9sb3RubyBmcmVlIGxpY2Vuc2UgbGltaXRhdGlvbiBleGNlZWRlZCAtIFBsZWFzZSB1cGdyYWRlIHlvdXIgYWNjb3VudC4="),x4=atob("cmVk"),IN=atob("djAuOS4y"),FN=e=>ce.createElement(ce.Fragment,null,ce.createElement(V1,{fill:x4,height:200},ce.createElement(G1,{fill:x4}),ce.createElement(Au,Object.assign({},e,{fill:"white",text:MN,height:void 0,padding:10,fontSize:20})))),jN=Yn(({store:e,page:t,width:r,height:n,pageControlsEnabled:i,backColor:a,pageBorderColor:l,activePageBorderColor:o,components:u,bleedColor:d,altCloneEnabled:f,viewportSize:v,selectionRectFill:g,selectionRectStroke:c,selectionRectStrokeWidth:y,snapGuideStroke:x,snapGuideStrokeWidth:E,snapGuideDash:S,transformLabelFill:b,transformLabelTextFill:w,distanceGuideStroke:_,distanceLabelFill:A,distanceLabelTextFill:M})=>{const O=e.bleedVisible?t.bleed:0,L=t.computedWidth+2*O,R=t.computedHeight+2*O,T=(r-L*e.scale)/2,k=(n-R*e.scale)/2,C=ce.useRef(null),q=ce.useRef(null),G=ce.useRef(null),J=i==null||i,[ae,H]=ce.useState(null),[V,Y]=ce.useState({}),U=RN({store:e}),D=e.selectedElements.find(Ae=>Ae._cropModeEnabled),j=e.selectedShapes.filter(Ae=>!Ae.resizable).length>0,z=e.selectedShapes.filter(Ae=>!Ae.draggable).length>0,Z=e.selectedElements.filter(Ae=>!Ae.visible).length>0;ce.useLayoutEffect(()=>{var Ae,be,_e;if(!C.current)return;const xe=C.current.getStage(),Le=e.selectedShapes.map(Ce=>Ce._cropModeEnabled?null:xe.findOne("#"+Ce.id)).filter(Ce=>Ce),pe=e.selectedElements.length===1&&((Ae=e.selectedElements[0])===null||Ae===void 0?void 0:Ae.type)||"many";K2[pe]?(C.current.setAttrs(Object.assign(Object.assign({},X2),K2[pe])),pe!=="svg"&&pe!=="image"&&pe!=="gif"||e.selectedElements[0].keepRatio||C.current.setAttrs({enabledAnchors:X2.enabledAnchors}),pe==="text"&&gi.textVerticalResizeEnabled&&C.current.setAttrs({enabledAnchors:(be=K2.text.enabledAnchors)===null||be===void 0?void 0:be.concat(["bottom-center"])})):C.current.setAttrs(X2),j&&C.current.enabledAnchors([]),z&&C.current.rotateEnabled(!1),Le.find(Ce=>Ce?.isDragging())&&Le.forEach(Ce=>{Ce.isDragging()||Ce==null||Ce.startDrag()}),C.current.nodes(Le),c_(),(_e=C.current.getLayer())===null||_e===void 0||_e.batchDraw()},[e.selectedShapes,D,j,Z,z]);const re=yS(()=>({visible:!1,x1:0,y1:0,x2:0,y2:0})),W=ce.useRef(!1),Q=lf(),se=Wr(Ae=>{var be,_e,xe,Le;if(Q)return;W.current=!1;const pe=Ae.target.findAncestor(".elements-container"),Ce=Ae.target.findAncestor("Transformer"),je=Ae.target.findAncestor(".page-abs-container");if(pe||Ce||je)return;const He=(be=Ae.target.getStage())===null||be===void 0?void 0:be.getPointerPosition();He.x-=(_e=Ae.target.getStage())===null||_e===void 0?void 0:_e.x(),He.y-=(xe=Ae.target.getStage())===null||xe===void 0?void 0:xe.y(),He&&(re.visible=!0,re.x1=He.x,re.y1=He.y,re.x2=He.x,re.y2=He.y,((Le=Ae.target.getStage())===null||Le===void 0?void 0:Le.getPointersPositions().length)>=2&&(re.visible=!1))});(({stageRef:Ae,containerRef:be,viewportSize:_e})=>{ce.useEffect(()=>{var xe;const Le=(xe=be.current)===null||xe===void 0?void 0:xe.closest(".polotno-workspace-inner");function pe(){var Ce;if(!Ae.current)return;const je=(Ce=be.current)===null||Ce===void 0?void 0:Ce.getBoundingClientRect(),He=Le?.getBoundingClientRect(),st=Math.max(0,He.left-je.left-100),pt=Math.max(0,He.top-je.top-100);Ae.current.position({x:-st,y:-pt}),Ae.current.container().style.transform=`translate(${st}px, ${pt}px)`}return pe(),Le.addEventListener("scroll",pe),()=>{Le.removeEventListener("scroll",pe)}},[_e.width,_e.height])})({stageRef:q,containerRef:G,viewportSize:v}),ce.useEffect(()=>{const Ae=Wr(_e=>{var xe,Le,pe,Ce;if(!re.visible)return;(xe=q.current)===null||xe===void 0||xe.setPointersPositions(_e);let je=(Le=q.current)===null||Le===void 0?void 0:Le.getPointerPosition();je?(je.x-=(pe=q.current)===null||pe===void 0?void 0:pe.x(),je.y-=(Ce=q.current)===null||Ce===void 0?void 0:Ce.y()):je={x:re.x2,y:re.y2},re.x2=je.x,re.y2=je.y}),be=Wr(()=>{if(!re.visible||!q.current)return;const _e=q.current.findOne(".selection"),xe=_e?_e.getClientRect():{width:0,height:0,x:0,y:0};if(xe.width&&xe.height){const Le=[];q.current.find(".element").forEach(Ce=>{const je=Ce.getClientRect(),He=e.getElementById(Ce.id()),st=He?.draggable,pt=He?.selectable;sr.Util.haveIntersection(xe,je)&&st&&pt&&Le.push(He.top.id)});const pe=[...new Set(Le)];e.selectElements(pe)}re.visible=!1,W.current=!0});return window.addEventListener("mousemove",Ae),window.addEventListener("touchmove",Ae),window.addEventListener("mouseup",be),window.addEventListener("touchend",be),()=>{window.removeEventListener("mousemove",Ae),window.removeEventListener("touchmove",Ae),window.removeEventListener("mouseup",be),window.removeEventListener("touchend",be)}},[]);const ue=ce.useRef(!1);ce.useEffect(()=>{var Ae;let be;const _e=(Ae=G.current)===null||Ae===void 0?void 0:Ae.closest(".polotno-workspace-inner"),xe=()=>{ue.current=!0,clearTimeout(be),be=setTimeout(()=>{ue.current=!1},300)};return _e.addEventListener("scroll",xe),()=>{clearTimeout(be),_e.removeEventListener("scroll",xe)}},[]);const le=Ae=>{if(e.activePage!==t&&t.select(),ue.current||W.current)return;const be=Ae.evt.ctrlKey||Ae.evt.metaKey||Ae.evt.shiftKey,_e=Ae.target.findAncestor(".elements-container"),xe=Ae.target.findAncestor(".page-abs-container"),Le=Ae.target.findAncestor("Transformer");if(!(be||_e||Le||xe))return void e.selectElements([]);const pe=Ae.target.findAncestor(".element",!0),Ce=e.getElementById(pe?.id()),je=Ce?.top,He=je?.id,st=e.selectedElementsIds.indexOf(He)>=0;He&&be&&!st?e.selectElements(e.selectedElementsIds.concat([He])):He&&be&&st?e.selectElements(e.selectedElementsIds.filter(pt=>pt!==He)):!He||be||st||e.selectElements([He])};hC(C,e,{stroke:x,strokeWidth:E,dash:S});const ye=e.activePage===t,Re=u?.PageControls,Me=u?.Tooltip,Pe=u?.ContextMenu,de=1/e.scale,Te=0/e.scale;return ce.createElement("div",{ref:G,onDragOver:Ae=>Ae.preventDefault(),onDrop:Ae=>{if(Ae.preventDefault(),!q.current)return;q.current.setPointersPositions(Ae),q.current.findOne(".elements-container").getRelativePointerPosition();const be=q.current.getPointerPosition(),_e=q.current.getAllIntersections(be).map(Le=>Le.findAncestor(".element",!0)).filter(Boolean);[...new Set(_e.reverse())].map(Le=>e.getElementById(Le.id()))[0]},style:{position:"relative",width:r+"px",height:n+"px",overflow:"hidden"},className:"polotno-page-container"+(ye?" active-page":"")},ce.createElement(hA,{ref:q,width:Math.min(r,v.width+200),height:Math.min(v.height+200,n),onClick:le,onTap:le,onContextMenu:Ae=>{Ae.evt.preventDefault();const be=Ae.target.findAncestor(".element",!0),_e=e.getElementById(be?.id()),xe=_e?.top,Le=xe?.id;Le?e.selectedElementsIds.indexOf(Le)>=0||e.selectElements([Le]):e.selectElements([]),U.open({x:Ae.evt.clientX,y:Ae.evt.clientY})},onMouseDown:se,onMouseMove:Ae=>{if(!Ae.evt.altKey&&ae)return void H(null);if(!Ae.evt.altKey)return;const be=Ae.target.findAncestor(".element",!0),_e=be?.id();if(!e.selectedElements[0]||e.selectedElementsIds.includes(_e))return;const xe=P0(e.selectedShapes),Le=_e?e.getElementById(_e):{x:0,y:0,width:t.computedWidth,height:t.computedHeight,rotation:0},pe=A0(Le),Ce=[];xe.minX>pe.maxX&&Ce.push({distance:xe.minX-pe.maxX,box1:xe,box2:pe,points:[{x:xe.minX,y:xe.minY+xe.height/2},{x:pe.maxX,y:xe.minY+xe.height/2},{x:pe.maxX,y:pe.minY+pe.height/2}]}),xe.maxX<pe.minX&&Ce.push({distance:pe.minX-xe.maxX,box1:xe,box2:pe,points:[{x:xe.maxX,y:xe.minY+xe.height/2},{x:pe.minX,y:xe.minY+xe.height/2},{x:pe.minX,y:pe.minY+pe.height/2}]}),xe.minY>pe.maxY&&Ce.push({box1:xe,box2:pe,distance:xe.minY-pe.maxY,points:[{x:xe.minX+xe.width/2,y:xe.minY},{x:xe.minX+xe.width/2,y:pe.maxY},{x:pe.minX+pe.width/2,y:pe.maxY}]}),xe.maxY<pe.minY&&Ce.push({box1:xe,box2:pe,distance:pe.minY-xe.maxY,points:[{x:xe.minX+xe.width/2,y:xe.maxY},{x:xe.minX+xe.width/2,y:pe.minY},{x:pe.minX+pe.width/2,y:pe.minY}]}),xe.minX>=pe.minX&&xe.maxX<=pe.maxX&&xe.minY>=pe.minY&&xe.maxY<=pe.maxY&&(Ce.push({distance:xe.minX-pe.minX,box1:xe,box2:pe,points:[{x:xe.minX,y:xe.minY+xe.height/2},{x:pe.minX,y:xe.minY+xe.height/2},{x:pe.minX,y:pe.minY+pe.height/2}]}),Ce.push({distance:pe.maxX-xe.maxX,box1:xe,box2:pe,points:[{x:xe.maxX,y:xe.minY+xe.height/2},{x:pe.maxX,y:xe.minY+xe.height/2},{x:pe.maxX,y:pe.minY+pe.height/2}]}),Ce.push({box1:xe,box2:pe,distance:xe.minY-pe.minY,points:[{x:xe.minX+xe.width/2,y:xe.minY},{x:xe.minX+xe.width/2,y:pe.minY},{x:pe.minX+pe.width/2,y:pe.minY}]}),Ce.push({box1:xe,box2:pe,distance:pe.maxY-xe.maxY,points:[{x:xe.minX+xe.width/2,y:xe.maxY},{x:xe.minX+xe.width/2,y:pe.maxY},{x:pe.minX+pe.width/2,y:pe.maxY}]})),JSON.stringify(ae)!==JSON.stringify(Ce)&&H(Ce)},onDragStart:Ae=>{var be;const _e=Ae.target.findAncestor(".element",!0);if(_e){const xe=e.getElementById(_e?.id()),Le=xe?.top,pe=Le?.id;!(e.selectedElementsIds.indexOf(pe)>=0)&&pe&&(e.selectElements([pe]),Ae.target.stopDrag(),Ae.target.startDrag(Ae),(be=C.current)===null||be===void 0||be.startDrag(Ae))}ae&&H(null)},pageId:t.id,style:{position:"absolute",overflow:"hidden",top:0,left:0}},ce.createElement(cA,null,ce.createElement(PN,{width:r,height:n,fill:a}),ce.createElement(vn,{x:T,y:k,scaleX:e.scale,scaleY:e.scale,name:"page-container"},ce.createElement(vn,{name:"page-container-2"},ce.createElement(vn,{name:"page-background-group",x:O,y:O},ce.createElement(CN,{x:-t.bleed,y:-t.bleed,width:t.computedWidth+2*t.bleed,height:t.computedHeight+2*t.bleed,background:t.background,name:"page-background",preventDefault:!1,scale:e.scale})),ce.createElement(vn,{x:O,y:O,name:"elements-container",listening:!e.isPlaying},ce.createElement(En,{name:"elements-area",width:t.computedWidth,height:t.computedHeight,listening:!1}),ce.createElement(TN,{elements:t.children,store:e})),ce.createElement(En,{stroke:d,name:"bleed",strokeWidth:t.bleed,x:t.bleed/2,y:t.bleed/2,width:t.computedWidth+t.bleed,height:t.computedHeight+t.bleed,listening:!1,visible:t.bleed>0&&e.bleedVisible,hideInExport:!0}),WC()===IN&&ce.createElement(FN,{name:"hit-detection",x:-de/2-Te,y:-de/2-Te,width:L+de+2*Te,height:R+de+2*Te}))),ce.createElement(Yc,{name:"workspace-background",points:[0,0,r,0,r,n,0,n,0,0,T,k,T,n-k,r-T,n-k,r-T,k,T,k],listening:!1,closed:!0,fill:a}),ce.createElement(vn,{x:T,y:k,scaleX:e.scale,scaleY:e.scale},ce.createElement(En,{name:"page-highlight",hideInExport:!0,x:-de/2-Te,y:-de/2-Te,width:L+de+2*Te,height:R+de+2*Te,stroke:ye&&e.pages.length>1?o:l,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})),ce.createElement(vn,{x:T+O*e.scale,y:k+O*e.scale,scaleX:e.scale,scaleY:e.scale,name:"page-abs-container"},ce.createElement(lp,{ref:C,onDragStart:Ae=>{var be;!((be=Ae.evt)===null||be===void 0)&&be.altKey&&f&&e.selectedElements.forEach(_e=>{const xe=_e.clone({},{skipSelect:!0}),Le=t.children.indexOf(_e);t.setElementZIndex(xe.id,Le)}),e.history.startTransaction()},onDragEnd:()=>{e.history.endTransaction()},onTransformStart:()=>{e.history.startTransaction(),H(null)},boundBoxFunc:(Ae,be)=>{const _e=Math.abs(be.width)<1||Math.abs(be.height)<1,xe=Math.abs(Ae.width)<1||Math.abs(Ae.height)<1;return _e&&!xe?Ae:be},onTransform:Ae=>{var be,_e;const xe=C.current.nodes(),Le=xe[xe.length-1];if(Ae.target!==Le)return;const pe=(be=C.current)===null||be===void 0?void 0:be.__getNodeRect(),Ce=(_e=C.current)===null||_e===void 0?void 0:_e.getActiveAnchor();Y({anchor:Ce,x:pe.x,y:pe.y,rotation:pe.rotation,width:pe.width,height:pe.height})},onTransformEnd:Ae=>{Y({}),e.history.endTransaction()},visible:!e.isPlaying}),ae&&ae.map(({points:Ae,distance:be,box1:_e,box2:xe},Le)=>ce.createElement(vn,{name:"distances-container",hideInExport:!0,key:Le,listening:!1},ce.createElement(En,Object.assign({},_e,{stroke:_,strokeWidth:1,strokeScaleEnabled:!1})),ce.createElement(En,Object.assign({},xe,{stroke:_,strokeWidth:1,strokeScaleEnabled:!1})),ce.createElement(Yc,{points:[Ae[0].x,Ae[0].y,Ae[1].x,Ae[1].y],stroke:_,strokeWidth:1,strokeScaleEnabled:!1}),ce.createElement(Yc,{points:[Ae[1].x,Ae[1].y,Ae[2].x,Ae[2].y],stroke:_,strokeWidth:1,strokeScaleEnabled:!1}),ce.createElement(V1,{x:(Ae[0].x+Ae[1].x)/2,y:(Ae[0].y+Ae[1].y)/2,offsetY:-10,scaleX:1/e.scale,scaleY:1/e.scale},ce.createElement(G1,{cornerRadius:5,fill:A,pointerDirection:"down"}),ce.createElement(Au,{align:"center",verticalAlign:"middle",fill:M,padding:5,text:rN({unit:e.unit,dpi:e.dpi,px:be})})))),t._rendering&&ce.createElement(vn,null,ce.createElement(En,{width:L,height:R,fill:"rgba(255,255,255,0.9)"}),ce.createElement(Au,{text:"Rendering...",fontSize:60,width:L,height:R,align:"center",verticalAlign:"middle"})),Me&&ce.createElement(Me,{components:u,store:e,page:t,stageRef:q}),Pe&&ce.createElement($1,null,ce.createElement(Pe,Object.assign({components:u,store:e},U.props)))),ce.createElement(LN,Object.assign({},V,{store:e,tagFill:b,textFill:w})),ce.createElement(NN,{selection:re,fill:g,stroke:c,strokeWidth:y}),YC()&&ce.createElement(Au,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:r-170,y:n-18,onMouseEnter:Ae=>{Ae.target.getStage().container().style.cursor="pointer"},onMouseLeave:Ae=>{Ae.target.getStage().container().style.cursor=""},onTouchStart:Ae=>{Ae.cancelBubble=!0},onMouseDown:Ae=>{Ae.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),ce.createElement(vn,{name:"line-guides"}))),J&&Re&&ce.createElement(Re,{store:e,page:t,xPadding:T,yPadding:k}))}),DN=Uh("div",ce.forwardRef)`
375
- position: absolute;
376
- top: 0;
377
- left: 0;
378
- pointer-events: none;
379
- `,BN=Uh("div",ce.forwardRef)`
380
- height: 14px;
381
- position: sticky;
382
- font-size: 8px;
383
- line-height: 14px;
384
- top: 0;
385
- left: 0;
386
- color: grey;
387
- border-bottom: 1px solid grey;
388
- background-color: #e8e8e8;
389
- overflow: hidden;
390
- `,zN=Uh("div",ce.forwardRef)`
391
- left: 0;
392
- width: 14px;
393
- position: sticky;
394
- font-size: 8px;
395
- line-height: 14px;
396
- color: grey;
397
- border-right: 1px solid grey;
398
- background-color: #e8e8e8;
399
- overflow: hidden;
400
- `,UN=Uh("div",ce.forwardRef)`
401
- position: absolute;
402
- border-left: 1px solid grey;
403
- padding-left: 2px;
404
- `,qN=Uh("div",ce.forwardRef)`
405
- position: absolute;
406
- left: 14px;
407
- border-left: 1px solid grey;
408
- padding-left: 2px;
409
- transform: rotate(90deg);
410
- transform-origin: left top;
411
- overflow: hidden;
412
- `,HN=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4],VN=Yn(({store:e,width:t,height:r})=>{const n=ce.useRef(null);if(!e.activePage)return null;const i=e.activePage,a=(e.bleedVisible&&i.bleed,i.computedWidth*e.scale),l=i.computedHeight*e.scale,o=(t-a)/2,u=(d=y=>d4({unitVal:y,dpi:e.dpi,unit:e.unit})*e.scale,HN.find(y=>d(y)>30)||1e4);var d;const f=d4({unitVal:u,dpi:e.dpi,unit:e.unit})*e.scale,v=Math.round(a/f)+1,g=Math.round(l/f)+1,c=P0(e.selectedShapes);return ce.createElement(DN,{ref:n,className:"polotno-rulers"},ce.createElement(BN,{style:{width:t+"px"},className:"polotno-x-ruler"},[...Array(v)].map((y,x)=>ce.createElement(UN,{key:x,style:{left:o+x*f+"px",width:f+"px"}},e.unit==="px"||u>=1?Math.round(u*x):(u*x).toFixed(1))),!!e.selectedShapes.length&&ce.createElement("div",{style:{position:"absolute",left:o+c.x*e.scale+"px",height:"14px",width:c.width*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}})),e.pages.map((y,x)=>{var E;const S=y.computedHeight*e.scale,b=(r-S)/2;return ce.createElement(zN,{key:y.id,style:{height:r+"px"},className:"polotno-y-ruler"},[...Array(g)].map((w,_)=>ce.createElement(qN,{key:_,style:{top:b+_*f-14+"px",width:f+"px"}},e.unit==="px"||u>=1?Math.round(u*_):(u*_).toFixed(1))),((E=e.selectedShapes[0])===null||E===void 0?void 0:E.page)===y&&ce.createElement("div",{style:{position:"absolute",top:b+c.y*e.scale-14+"px",width:"14px",height:c.height*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}}))}))}),GN=Yn(({audio:e,store:t})=>{const[r,n]=function(i){const[a,l]=ce.useState(null),[o,u]=ce.useState("loading");return ce.useEffect(()=>{const d=new Audio(i),f=()=>{u("loaded"),l(d)},v=()=>{u("failed"),l(null)};return d.addEventListener("canplay",f),d.addEventListener("error",v),()=>{d.removeEventListener("canplay",f),d.removeEventListener("error",v)}},[i]),[a,o]}(e.src);return ce.useEffect(()=>{r&&t.history.ignore(()=>{e.set({duration:1e3*r.duration})})},[r,e,t.history]),ce.useEffect(()=>{if(!r)return;const i=()=>{r.currentTime=e.startTime*e.duration/1e3},a=()=>{const o=e.endTime*e.duration/1e3;r.currentTime>=o&&(r.pause(),r.currentTime=e.startTime*e.duration/1e3)};r.addEventListener("ended",i),r.addEventListener("timeupdate",a);const l=Ou(()=>{const o=t.animatedElementsIds;if(o.length&&!o.includes(e.id))return;const u=t.currentTime-e.delay,d=e.duration*(e.endTime-e.startTime),f=u>=0&&u<d;if(!t.isPlaying||t.animatedElementsIds.length!==0||!f)return void r.pause();r.volume=e.volume,r.paused&&r.play();const v=u%d/1e3+e.startTime*e.duration/1e3,g=r.currentTime;Math.abs(g-v)>.5&&v!==g&&(r.currentTime=v)});return()=>{r.pause(),r.removeEventListener("ended",i),r.removeEventListener("timeupdate",a),l()}},[t.isPlaying,e.startTime,e.endTime,e.volume,r]),null});let j_={data:[],pageId:""};const Z1="polotno_clipboard",Fm=(e,t)=>{j_={data:JSON.parse(JSON.stringify(e)),pageId:t};try{localStorage.setItem(Z1,JSON.stringify(e)),localStorage.setItem(Z1+"_page",t)}catch{}},$N=()=>{try{const e=localStorage.getItem(Z1),t=localStorage.getItem(Z1+"_page");if(e)return{data:JSON.parse(e),pageId:t}}catch{}return j_},WN=e=>{var t;e.selectedElements.length!==0&&Fm(e.selectedElements.map(r=>r.toJSON()),(t=e.activePage)===null||t===void 0?void 0:t.id)},YN=e=>{var t;Fm(e.selectedElements.map(n=>n.toJSON()),(t=e.activePage)===null||t===void 0?void 0:t.id);let r=e.selectedElements.filter(n=>n.removable).map(n=>n.id);e.deleteElements(r)},XN=e=>{e.history.transaction(()=>{var t,r;let n=0,i=0;const{data:a,pageId:l}=$N();if(l===((t=e.activePage)===null||t===void 0?void 0:t.id))n=e.width/20,i=e.height/20;else{const u=[];Ai({children:a},f=>{f.type!=="group"&&u.push(f)});const d=P0(u);d.maxX>e.width&&(n=-d.minX),d.maxY>e.height&&(i=-d.minY)}const o=[];Ai({children:a},u=>{delete u.id,u.type!=="group"&&(u.x+=n,u.y+=i)}),a.forEach(u=>{var d;const f=(d=e.activePage)===null||d===void 0?void 0:d.addElement(u);f&&o.push(f.id)}),Fm(a,(r=e.activePage)===null||r===void 0?void 0:r.id),e.selectElements(o)})};function KN(e,t){var r,n,i,a;if(((r=document.activeElement)===null||r===void 0?void 0:r.tagName)==="INPUT"||((n=document.activeElement)===null||n===void 0?void 0:n.tagName)==="TEXTAREA"||((i=document.activeElement)===null||i===void 0?void 0:i.contentEditable)==="true")return;const l=t.selectedElements.filter(d=>d.removable).map(d=>d.id);e.keyCode!==46&&e.keyCode!==8||t.deleteElements(l);const o=e.ctrlKey||e.metaKey,u=e.shiftKey;if(!o||u||e.key.toLowerCase()!=="z"&&e.key.toLowerCase()!=="y"||(e.preventDefault(),t.history.undo()),o&&u&&(e.key.toLowerCase()==="z"||e.key.toLowerCase()==="y")&&(e.preventDefault(),t.history.redo()),o&&e.code==="KeyA"){e.preventDefault();const d=(a=t.activePage)===null||a===void 0?void 0:a.children.filter(v=>v.selectable),f=d?.map(v=>v.id)||[];t.selectElements(f)}o&&e.code==="KeyC"&&(e.preventDefault(),WN(t)),o&&e.code==="KeyX"&&(e.preventDefault(),YN(t)),o&&e.code==="KeyV"&&(e.preventDefault(),XN(t)),e.code==="ArrowDown"&&(e.preventDefault(),t.selectedShapes.forEach(d=>{d.draggable&&d.set({y:d.y+1})})),e.code==="ArrowUp"&&(e.preventDefault(),t.selectedShapes.forEach(d=>{d.draggable&&d.set({y:d.y-1})})),e.code==="ArrowLeft"&&(e.preventDefault(),t.selectedShapes.forEach(d=>{d.draggable&&d.set({x:d.x-1})})),e.code==="ArrowRight"&&(e.preventDefault(),t.selectedShapes.forEach(d=>{d.draggable&&d.set({x:d.x+1})}))}const qv=$r({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",filters:"Filters",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",copyStyle:"Copy style",uppercase:"Uppercase",position:"Position",layering:"Layering",toForward:"To Front",up:"Forward",down:"Backward",toBottom:"To back",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",rotate:"Rotate",none:"None",bounce:"Bounce",blink:"Blink",strength:"Strength",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",colorPicker:{solid:"Solid",linear:"Linear",angle:"Angle"},aiText:{aiWrite:"AI write",rewrite:"Rewrite",shorten:"Shorten",continue:"Continue writing",proofread:"Proofread",tones:"Tones",friendly:"Friendly",professional:"Professional",humorous:"Humorous",formal:"Formal",customPrompt:"Custom prompt",generatedResult:"Generated result",cancel:"Cancel",generate:"Generate",back:"Back",tryAgain:"Try Again",insert:"Insert",promptPlaceholder:"Describe what you want to generate"}},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",animations:"Animations",effects:"Effects",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Add file",uploadTip:"Upload your assets",background:"Background",resize:"Resize",layers:"Layers",animate:"Animate",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"},pagesTimeline:{pages:"Pages",removePage:"Remove page",addPage:"Add page",duplicatePage:"Duplicate page",removeAudio:"Remove audio"},contextMenu:{duplicate:"Duplicate",remove:"Remove",lock:"Lock",unlock:"Unlock",copy:"Copy",paste:"Paste",copyStyle:"Copy style",moveUp:"Move up",moveDown:"Move down",moveBack:"Move back",moveForward:"Move forward"}}),Q1=e=>e&&typeof e=="object";function D_(e,t){Object.keys(t).forEach(r=>{const n=e[r],i=t[r];Q1(i)&&Q1(n)?D_(n,i):e[r]=i})}function B_(e,t,r=""){Object.keys(t).forEach(n=>{const i=t[n],a=r?`${r}.${n}`:n;Q1(i)?Q1(e[n])?B_(e[n],i,a):console.warn(`Missing nested translation object at '${a}'`):e[n]===void 0&&console.warn(`Missing translation '${a}'`)})}Wr((e,{validate:t=!1}={})=>{t&&B_(e,qv),D_(qv,e)});const S4={},E4=e=>{const t=function(i,a){var l,o=a.split("."),u=i;for(l=0;l<o.length;++l){if(u[o[l]]==null)return;u=u[o[l]]}return u}(qv,e);if(t!==void 0)return t;S4[e]||(S4[e]=!0,console.warn(`Missing translation '${e}'`));const r=e.split("."),n=r[r.length-1]||" ";return n.charAt(0).toUpperCase()+n.slice(1)},ZN=({store:e})=>ce.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"}},ce.createElement("p",null,E4("workspace.noPages")),ce.createElement("button",{onClick:()=>{e.addPage()}},E4("workspace.addPage"))),QN=({width:e,height:t,xPadding:r,yPadding:n,backgroundColor:i})=>ce.createElement("div",{style:{width:e+"px",height:t+"px",backgroundColor:i,paddingLeft:r+"px",paddingRight:r+"px",paddingTop:n+"px",paddingBottom:n+"px"}},ce.createElement("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}})),JN=[4,6],eL=Yn(({store:e,pageControlsEnabled:t,backgroundColor:r,pageBorderColor:n,activePageBorderColor:i,bleedColor:a,snapGuideStroke:l,snapGuideStrokeWidth:o,snapGuideDash:u,selectionRectFill:d,selectionRectStroke:f,selectionRectStrokeWidth:v,transformLabelFill:g,transformLabelTextFill:c,distanceGuideStroke:y,distanceLabelFill:x,distanceLabelTextFill:E,components:S,onKeyDown:b,paddingX:w,paddingY:_,altCloneEnabled:A=!0,visiblePagesOffset:M,renderOnlyActivePage:O})=>{var L;const R=w??20,T=_??55,[k,C]=ce.useState({width:100,height:100}),q=ce.useRef(k),G=ce.useRef(null),J=ce.useRef(null),ae=e.bleedVisible?Math.max(0,...e.pages.map(Pe=>Pe.bleed)):0,H=Math.max(...e.pages.map(Pe=>Pe.computedWidth)),V=Math.max(...e.pages.map(Pe=>Pe.computedHeight)),Y=((L=e.activePage)===null||L===void 0?void 0:L.computedHeight)||0,U=H+2*ae,D=(O?Y:V)+2*ae,j=async({skipTimeout:Pe}={skipTimeout:!1})=>{if(Pe||await new Promise(pe=>setTimeout(pe,50)),G.current===null)return;const de=G.current.getBoundingClientRect();de.width!==0&&de.height!==0||(console.warn(`Polotno warning: <Workspace /> component can not automatically detect its size.
413
- Width or height of parent elements is equal 0.
414
- Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
415
- For simpler debugging here is the log of the parent element:`),console.log(G.current));const Te=J.current.clientWidth||de.width,Ae={width:Te,height:de.height};(q.current.width!==Ae.width||q.current.height!==Ae.height)&&(C(Ae),q.current=Ae);const be=(Te-2*R)/U,_e=e.pages.length>1?3.1:2,xe=(de.height-T*_e)/D,Le=e.pages.length?Math.max(Math.min(be,xe),.01):1;e.scaleToFit!==Le&&(e.setScale(Le),e._setScaleToFit(Le))};ce.useLayoutEffect(()=>{j({skipTimeout:!0})},[]),ce.useEffect(()=>{j()},[U,D,_,w]),ce.useLayoutEffect(()=>{j({skipTimeout:!0})},[e.openedSidePanel]),ce.useEffect(()=>{e.__()},[]),ce.useEffect(()=>{const Pe=G.current;if(window.ResizeObserver){const de=new ResizeObserver(()=>{j({skipTimeout:!0})});return de.observe(Pe),()=>de.unobserve(Pe)}{const de=setInterval(()=>{j({skipTimeout:!0})},100);return()=>clearInterval(de)}},[U,D]);const z=Math.max(R,(k.width-U*e.scale)/2),Z=O?1:e.pages.length,re=D*e.scale*Z,W=Math.max(T,(k.height-re)/Z/2);ce.useEffect(()=>{const Pe=de=>{(b||KN)(de,e)};return window.addEventListener("keydown",Pe),()=>window.removeEventListener("keydown",Pe)},[]),ce.useEffect(()=>{var Pe;const de=Te=>{if(Te.ctrlKey||Te.metaKey){Te.preventDefault();const xe=Math.max(5,e.scaleToFit),Le=Math.min(.1,e.scaleToFit),pe=.03,Ce=(Ae=Te.deltaY<0?e.scale*(1+pe):e.scale/(1+pe),be=Le,_e=xe,Math.max(be,Math.min(_e,Ae)));return void e.setScale(Ce)}var Ae,be,_e};return(Pe=J.current)===null||Pe===void 0||Pe.addEventListener("wheel",de),()=>{var Te;return(Te=J.current)===null||Te===void 0?void 0:Te.removeEventListener("wheel",de)}},[]);const Q=ce.useRef(!1);((Pe,de,Te,Ae,be,_e)=>{const xe=ce.useRef({width:de,height:Te}),Le=ce.useRef({top:0,left:0}),pe=ce.useRef(!1),Ce=ce.useRef(be.pages.length);pe.current=Ce.current!==be.pages.length,Ce.current=be.pages.length,ce.useEffect(()=>{const je=Pe.current,He=st=>{Le.current={top:je.scrollTop,left:je.scrollLeft}};return je.addEventListener("scroll",He),()=>{je.removeEventListener("scroll",He)}},[]),ce.useLayoutEffect(()=>{if(!Pe.current||pe.current)return;const je=Pe.current,He=(Le.current.left+je.offsetWidth/2)/xe.current.width,st=(Le.current.top+je.offsetHeight/2)/xe.current.height;_e.current=!0,je.scrollLeft=He*de-je.offsetWidth/2,je.scrollTop=st*Te-je.offsetHeight/2,xe.current={width:de,height:Te}},[Ae,de,Te])})(J,U*e.scale+2*z,D*e.scale+2*W,e.scale,e,Q);const{handleScroll:se}=((Pe,de,Te,Ae,be,_e)=>{const xe=ce.useRef(!1),Le=ce.useRef(null),pe=ce.useRef(!1);ce.useEffect(()=>{const je=Pe.current,He=()=>{be.current};return je.addEventListener("scroll",He),()=>{je.removeEventListener("scroll",He)}},[]);const Ce=Te.pages.indexOf(Te.activePage);return ce.useLayoutEffect(()=>{if(_e||!Te.activePage||!Pe.current||xe.current)return;const je=Pe.current,He=Te.pages.indexOf(Te.activePage)*de;let st=()=>{};return(Math.abs(He-je.scrollTop)>.5*de||pe.current)&&(pe.current=!0,st=(({element:pt,scrollTop:ct=0,duration:bt=300,onFinish:ht=()=>{}})=>{const vt=pt.scrollTop,wr=ct-vt;let cr=0,Pt=!1;if(bt===0)return pt.scrollTop=ct,()=>{};const $t=()=>{if(Pt)return;cr+=20;const ze=$e(cr,vt,wr,bt);pt.scrollTop=ze,cr<bt?setTimeout($t,20):ht()},$e=(ze,kt,St,er)=>(ze/=er/2)<1?St/2*ze*ze+kt:-St/2*(--ze*(ze-2)-1)+kt;return $t(),()=>{Pt=!0}})({element:je,scrollTop:He,onFinish:()=>{pe.current=!1},duration:Te.isPlaying?0:300})),st},[Te.activePage,Ce,Te.isPlaying,_e]),{handleScroll:je=>{if(_e||pe.current)return;xe.current=!0,clearTimeout(Le.current),Le.current=setTimeout(()=>{xe.current=!1},300);const He=je.currentTarget.childNodes[0].offsetHeight,st=je.currentTarget.scrollTop,pt=Math.floor((st+Ae.height/3)/He),ct=Te.pages[pt];ct&&Te.activePage!==ct&&ct.select()}}})(J,D*e.scale+2*W,e,k,Q,O),ue=k.width>=U*e.scale+2*z,le=r||"rgba(232, 232, 232, 0.9)",ye=e.pages.indexOf(e.activePage),Re=S?.NoPages||ZN,Me=M??Math.min(3,Math.max(1,Math.ceil(k.height/2/(D*e.scale))));return ce.createElement("div",{ref:G,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:le,overflow:"hidden"},tabIndex:0,className:"polotno-workspace-container"},ce.createElement("div",{ref:J,onScroll:se,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:ue?"hidden":"auto"},className:"polotno-workspace-inner"},e.pages.map((Pe,de)=>{const Te=Pe===e.activePage;if(O&&!Te&&!Pe._exportingOrRendering&&!Pe._forceMount)return null;if(!(Math.abs(de-ye)<=Me||Pe._exportingOrRendering||Pe._forceMount))return ce.createElement(QN,{key:Pe.id,width:U*e.scale+2*z,height:D*e.scale+2*W,backgroundColor:le,xPadding:z,yPadding:W});const Ae=ce.createElement(jN,{key:Pe.id,page:Pe,xPadding:z,yPadding:W,width:U*e.scale+2*z,height:D*e.scale+2*W,store:e,pageControlsEnabled:t,backColor:le,pageBorderColor:n||"lightgrey",activePageBorderColor:i||"rgb(0, 161, 255)",altCloneEnabled:A,bleedColor:a||"rgba(255, 0, 0, 0.1)",selectionRectFill:d,selectionRectStroke:f,selectionRectStrokeWidth:v,snapGuideStroke:l||"rgb(0, 161, 255)",snapGuideStrokeWidth:o||1,snapGuideDash:u||JN,transformLabelFill:g,transformLabelTextFill:c,distanceGuideStroke:y||"rgb(0, 161, 255)",distanceLabelFill:x||"rgb(0, 161, 255)",distanceLabelTextFill:E||"white",components:S,viewportSize:k});return(Pe._exportingOrRendering||Pe._forceMount)&&!Te&&O?ce.createElement("div",{style:{display:"none"},key:Pe.id},Ae):Ae}),e.rulesVisible&&ce.createElement(VN,{store:e,xPadding:z,yPadding:W,width:U*e.scale+2*z,height:D*e.scale+2*W}),e.pages.length===0&&ce.createElement(Re,{store:e}),e.audios.map(Pe=>ce.createElement(GN,{key:Pe.id,audio:Pe,store:e}))))}),tL="modulepreload",rL=function(e,t){return new URL(e,t).href},A4={},Z2=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){let d=function(f){return Promise.all(f.map(v=>Promise.resolve(v).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};const l=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),u=o?.nonce||o?.getAttribute("nonce");i=d(r.map(f=>{if(f=rL(f,n),f in A4)return;A4[f]=!0;const v=f.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(!!n)for(let x=l.length-1;x>=0;x--){const E=l[x];if(E.href===f&&(!v||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${g}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":tL,v||(y.as="script"),y.crossOrigin="",y.href=f,u&&y.setAttribute("nonce",u),document.head.appendChild(y),v)return new Promise((x,E)=>{y.addEventListener("load",x),y.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(l){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l}return i.then(l=>{for(const o of l||[])o.status==="rejected"&&a(o.reason);return t().catch(a)})};function Sn(e){"@babel/helpers - typeof";return Sn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sn(e)}var Bl=Uint8Array,Hs=Uint16Array,jm=Int32Array,Dm=new Bl([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]),Bm=new Bl([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]),P4=new Bl([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),z_=function(e,t){for(var r=new Hs(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var i=new jm(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}},U_=z_(Dm,2),nL=U_.b,Hv=U_.r;nL[28]=258,Hv[258]=28;var iL=z_(Bm,0),k4=iL.r,Vv=new Hs(32768);for(var ai=0;ai<32768;++ai){var Hc=(ai&43690)>>1|(ai&21845)<<1;Hc=(Hc&52428)>>2|(Hc&13107)<<2,Hc=(Hc&61680)>>4|(Hc&3855)<<4,Vv[ai]=((Hc&65280)>>8|(Hc&255)<<8)>>1}var rp=function(e,t,r){for(var n=e.length,i=0,a=new Hs(t);i<n;++i)e[i]&&++a[e[i]-1];var l=new Hs(t);for(i=1;i<t;++i)l[i]=l[i-1]+a[i-1]<<1;var o;if(r){o=new Hs(1<<t);var u=15-t;for(i=0;i<n;++i)if(e[i])for(var d=i<<4|e[i],f=t-e[i],v=l[e[i]-1]++<<f,g=v|(1<<f)-1;v<=g;++v)o[Vv[v]>>u]=d}else for(o=new Hs(n),i=0;i<n;++i)e[i]&&(o[i]=Vv[l[e[i]-1]++]>>15-e[i]);return o},zf=new Bl(288);for(var ai=0;ai<144;++ai)zf[ai]=8;for(var ai=144;ai<256;++ai)zf[ai]=9;for(var ai=256;ai<280;++ai)zf[ai]=7;for(var ai=280;ai<288;++ai)zf[ai]=8;var J1=new Bl(32);for(var ai=0;ai<32;++ai)J1[ai]=5;var aL=rp(zf,9,0),oL=rp(J1,5,0),q_=function(e){return(e+7)/8|0},sL=function(e,t,r){return(r==null||r>e.length)&&(r=e.length),new Bl(e.subarray(t,r))},Zu=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},Vd=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},Q2=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,a=r.slice();if(!i)return{t:V_,l:0};if(i==1){var l=new Bl(r[0].s+1);return l[r[0].s]=1,{t:l,l:1}}r.sort(function(A,M){return A.f-M.f}),r.push({s:-1,f:25001});var o=r[0],u=r[1],d=0,f=1,v=2;for(r[0]={s:-1,f:o.f+u.f,l:o,r:u};f!=i-1;)o=r[r[d].f<r[v].f?d++:v++],u=r[d!=f&&r[d].f<r[v].f?d++:v++],r[f++]={s:-1,f:o.f+u.f,l:o,r:u};for(var g=a[0].s,n=1;n<i;++n)a[n].s>g&&(g=a[n].s);var c=new Hs(g+1),y=Gv(r[f-1],c,0);if(y>t){var n=0,x=0,E=y-t,S=1<<E;for(a.sort(function(M,O){return c[O.s]-c[M.s]||M.f-O.f});n<i;++n){var b=a[n].s;if(c[b]>t)x+=S-(1<<y-c[b]),c[b]=t;else break}for(x>>=E;x>0;){var w=a[n].s;c[w]<t?x-=1<<t-c[w]++-1:++n}for(;n>=0&&x;--n){var _=a[n].s;c[_]==t&&(--c[_],++x)}y=t}return{t:new Bl(c),l:y}},Gv=function(e,t,r){return e.s==-1?Math.max(Gv(e.l,t,r+1),Gv(e.r,t,r+1)):t[e.s]=r},O4=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Hs(++t),n=0,i=e[0],a=1,l=function(u){r[n++]=u},o=1;o<=t;++o)if(e[o]==i&&o!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)l(32754);a>2&&(l(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(l(i),--a;a>6;a-=6)l(8304);a>2&&(l(a-3<<5|8208),a=0)}for(;a--;)l(i);a=1,i=e[o]}return{c:r.subarray(0,n),n:t}},Gd=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},H_=function(e,t,r){var n=r.length,i=q_(t+2);e[i]=n&255,e[i+1]=n>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var a=0;a<n;++a)e[i+a+4]=r[a];return(i+4+n)*8},C4=function(e,t,r,n,i,a,l,o,u,d,f){Zu(t,f++,r),++i[256];for(var v=Q2(i,15),g=v.t,c=v.l,y=Q2(a,15),x=y.t,E=y.l,S=O4(g),b=S.c,w=S.n,_=O4(x),A=_.c,M=_.n,O=new Hs(19),L=0;L<b.length;++L)++O[b[L]&31];for(var L=0;L<A.length;++L)++O[A[L]&31];for(var R=Q2(O,7),T=R.t,k=R.l,C=19;C>4&&!T[P4[C-1]];--C);var q=d+5<<3,G=Gd(i,zf)+Gd(a,J1)+l,J=Gd(i,g)+Gd(a,x)+l+14+3*C+Gd(O,T)+2*O[16]+3*O[17]+7*O[18];if(u>=0&&q<=G&&q<=J)return H_(t,f,e.subarray(u,u+d));var ae,H,V,Y;if(Zu(t,f,1+(J<G)),f+=2,J<G){ae=rp(g,c,0),H=g,V=rp(x,E,0),Y=x;var U=rp(T,k,0);Zu(t,f,w-257),Zu(t,f+5,M-1),Zu(t,f+10,C-4),f+=14;for(var L=0;L<C;++L)Zu(t,f+3*L,T[P4[L]]);f+=3*C;for(var D=[b,A],j=0;j<2;++j)for(var z=D[j],L=0;L<z.length;++L){var Z=z[L]&31;Zu(t,f,U[Z]),f+=T[Z],Z>15&&(Zu(t,f,z[L]>>5&127),f+=z[L]>>12)}}else ae=aL,H=zf,V=oL,Y=J1;for(var L=0;L<o;++L){var re=n[L];if(re>255){var Z=re>>18&31;Vd(t,f,ae[Z+257]),f+=H[Z+257],Z>7&&(Zu(t,f,re>>23&31),f+=Dm[Z]);var W=re&31;Vd(t,f,V[W]),f+=Y[W],W>3&&(Vd(t,f,re>>5&8191),f+=Bm[W])}else Vd(t,f,ae[re]),f+=H[re]}return Vd(t,f,ae[256]),f+H[256]},lL=new jm([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),V_=new Bl(0),uL=function(e,t,r,n,i,a){var l=a.z||e.length,o=new Bl(n+l+5*(1+Math.ceil(l/7e3))+i),u=o.subarray(n,o.length-i),d=a.l,f=(a.r||0)&7;if(t){f&&(u[0]=a.r>>3);for(var v=lL[t-1],g=v>>13,c=v&8191,y=(1<<r)-1,x=a.p||new Hs(32768),E=a.h||new Hs(y+1),S=Math.ceil(r/3),b=2*S,w=function(Pe){return(e[Pe]^e[Pe+1]<<S^e[Pe+2]<<b)&y},_=new jm(25e3),A=new Hs(288),M=new Hs(32),O=0,L=0,R=a.i||0,T=0,k=a.w||0,C=0;R+2<l;++R){var q=w(R),G=R&32767,J=E[q];if(x[G]=J,E[q]=G,k<=R){var ae=l-R;if((O>7e3||T>24576)&&(ae>423||!d)){f=C4(e,u,0,_,A,M,L,T,C,R-C,f),T=O=L=0,C=R;for(var H=0;H<286;++H)A[H]=0;for(var H=0;H<30;++H)M[H]=0}var V=2,Y=0,U=c,D=G-J&32767;if(ae>2&&q==w(R-D))for(var j=Math.min(g,ae)-1,z=Math.min(32767,R),Z=Math.min(258,ae);D<=z&&--U&&G!=J;){if(e[R+V]==e[R+V-D]){for(var re=0;re<Z&&e[R+re]==e[R+re-D];++re);if(re>V){if(V=re,Y=D,re>j)break;for(var W=Math.min(D,re-2),Q=0,H=0;H<W;++H){var se=R-D+H&32767,ue=x[se],le=se-ue&32767;le>Q&&(Q=le,J=se)}}}G=J,J=x[G],D+=G-J&32767}if(Y){_[T++]=268435456|Hv[V]<<18|k4[Y];var ye=Hv[V]&31,Re=k4[Y]&31;L+=Dm[ye]+Bm[Re],++A[257+ye],++M[Re],k=R+V,++O}else _[T++]=e[R],++A[e[R]]}}for(R=Math.max(R,k);R<l;++R)_[T++]=e[R],++A[e[R]];f=C4(e,u,d,_,A,M,L,T,C,R-C,f),d||(a.r=f&7|u[f/8|0]<<3,f-=7,a.h=E,a.p=x,a.i=R,a.w=k)}else{for(var R=a.w||0;R<l+d;R+=65535){var Me=R+65535;Me>=l&&(u[f/8|0]=d,Me=l),f=H_(u,f+1,e.subarray(R,Me))}a.i=l}return sL(o,0,n+q_(f)+i)},G_=function(){var e=1,t=0;return{p:function(r){for(var n=e,i=t,a=r.length|0,l=0;l!=a;){for(var o=Math.min(l+2655,a);l<o;++l)i+=n+=r[l];n=(n&65535)+15*(n>>16),i=(i&65535)+15*(i>>16)}e=n,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},cL=function(e,t,r,n,i){if(!i&&(i={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),l=new Bl(a.length+e.length);l.set(a),l.set(e,a.length),e=l,i.w=a.length}return uL(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,i)},$_=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},fL=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;if(e[0]=120,e[1]=n<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=G_();i.p(t.dictionary),$_(e,2,i.d())}};function $v(e,t){t||(t={});var r=G_();r.p(e);var n=cL(e,t,t.dictionary?6:2,4);return fL(n,t),$_(n,n.length-4,r.d()),n}var hL=typeof TextDecoder<"u"&&new TextDecoder,dL=0;try{hL.decode(V_,{stream:!0}),dL=1}catch{}function pL(e){if(Array.isArray(e))return e}function gL(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,l,o=[],u=!0,d=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(u=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);u=!0);}catch(f){d=!0,i=f}finally{try{if(!u&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(d)throw i}}return o}}function N4(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function vL(e,t){if(e){if(typeof e=="string")return N4(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?N4(e,t):void 0}}function mL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
416
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L4(e,t){return pL(e)||gL(e,t)||vL(e,t)||mL()}function T4(e,t="utf8"){return new TextDecoder(t).decode(e)}const yL=new TextEncoder;function bL(e){return yL.encode(e)}const wL=1024*8,_L=(()=>{const e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),J2={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 zm{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(t=wL,r={}){let n=!1;typeof t=="number"?t=new ArrayBuffer(t):(n=!0,this.lastWrittenByte=t.byteLength);const i=r.offset?r.offset>>>0:0,a=t.byteLength-i;let l=i;(ArrayBuffer.isView(t)||t instanceof zm)&&(t.byteLength!==t.buffer.byteLength&&(l=t.byteOffset+i),t=t.buffer),n?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=t,this.length=a,this.byteLength=a,this.byteOffset=l,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,l,a),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,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 t=this._marks.pop();if(t===void 0)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){const n=(this.offset+t)*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(t=1){return this.readArray(t,"uint8")}readArray(t,r){const n=J2[r].BYTES_PER_ELEMENT*t,i=this.byteOffset+this.offset,a=this.buffer.slice(i,i+n);if(this.littleEndian===_L&&r!=="uint8"&&r!=="int8"){const o=new Uint8Array(this.buffer.slice(i,i+n));o.reverse();const u=new J2[r](o.buffer);return this.offset+=n,u.reverse(),u}const l=new J2[r](a);return this.offset+=n,l}readInt16(){const t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){const t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){const t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){const t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){const t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){const t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){const t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){const t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let r="";for(let n=0;n<t;n++)r+=this.readChar();return r}readUtf8(t=1){return T4(this.readBytes(t))}decodeText(t=1,r="utf8"){return T4(this.readBytes(t),r)}writeBoolean(t){return this.writeUint8(t?255:0),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let r=0;r<t.length;r++)this._data.setUint8(this.offset++,t[r]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(t){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(t){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let r=0;r<t.length;r++)this.writeUint8(t.charCodeAt(r));return this}writeUtf8(t){return this.writeBytes(bL(t))}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 qh(e){let t=e.length;for(;--t>=0;)e[t]=0}const xL=3,SL=258,W_=29,EL=256,AL=EL+1+W_,Y_=30,PL=512,kL=new Array((AL+2)*2);qh(kL);const OL=new Array(Y_*2);qh(OL);const CL=new Array(PL);qh(CL);const NL=new Array(SL-xL+1);qh(NL);const LL=new Array(W_);qh(LL);const TL=new Array(Y_);qh(TL);const RL=(e,t,r,n)=>{let i=e&65535|0,a=e>>>16&65535|0,l=0;for(;r!==0;){l=r>2e3?2e3:r,r-=l;do i=i+t[n++]|0,a=a+i|0;while(--l);i%=65521,a%=65521}return i|a<<16|0};var Wv=RL;const ML=()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t},IL=new Uint32Array(ML()),FL=(e,t,r,n)=>{const i=IL,a=n+r;e^=-1;for(let l=n;l<a;l++)e=e>>>8^i[(e^t[l])&255];return e^-1};var vu=FL,Yv={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"},X_={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 jL=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var DL=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const n in r)jL(r,n)&&(e[n]=r[n])}}return e},BL=e=>{let t=0;for(let n=0,i=e.length;n<i;n++)t+=e[n].length;const r=new Uint8Array(t);for(let n=0,i=0,a=e.length;n<a;n++){let l=e[n];r.set(l,i),i+=l.length}return r},K_={assign:DL,flattenChunks:BL};let Z_=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Z_=!1}const pp=new Uint8Array(256);for(let e=0;e<256;e++)pp[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;pp[254]=pp[254]=1;var zL=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,r,n,i,a,l=e.length,o=0;for(i=0;i<l;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<l&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),o+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(o),a=0,i=0;a<o;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<l&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|r&63):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63);return t};const UL=(e,t)=>{if(t<65534&&e.subarray&&Z_)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r};var qL=(e,t)=>{const r=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let n,i;const a=new Array(r*2);for(i=0,n=0;n<r;){let l=e[n++];if(l<128){a[i++]=l;continue}let o=pp[l];if(o>4){a[i++]=65533,n+=o-1;continue}for(l&=o===2?31:o===3?15:7;o>1&&n<r;)l=l<<6|e[n++]&63,o--;if(o>1){a[i++]=65533;continue}l<65536?a[i++]=l:(l-=65536,a[i++]=55296|l>>10&1023,a[i++]=56320|l&1023)}return UL(a,i)},HL=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let r=t-1;for(;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+pp[e[r]]>t?r:t},Xv={string2buf:zL,buf2string:qL,utf8border:HL};function VL(){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 GL=VL;const f1=16209,$L=16191;var WL=function(t,r){let n,i,a,l,o,u,d,f,v,g,c,y,x,E,S,b,w,_,A,M,O,L,R,T;const k=t.state;n=t.next_in,R=t.input,i=n+(t.avail_in-5),a=t.next_out,T=t.output,l=a-(r-t.avail_out),o=a+(t.avail_out-257),u=k.dmax,d=k.wsize,f=k.whave,v=k.wnext,g=k.window,c=k.hold,y=k.bits,x=k.lencode,E=k.distcode,S=(1<<k.lenbits)-1,b=(1<<k.distbits)-1;e:do{y<15&&(c+=R[n++]<<y,y+=8,c+=R[n++]<<y,y+=8),w=x[c&S];t:for(;;){if(_=w>>>24,c>>>=_,y-=_,_=w>>>16&255,_===0)T[a++]=w&65535;else if(_&16){A=w&65535,_&=15,_&&(y<_&&(c+=R[n++]<<y,y+=8),A+=c&(1<<_)-1,c>>>=_,y-=_),y<15&&(c+=R[n++]<<y,y+=8,c+=R[n++]<<y,y+=8),w=E[c&b];r:for(;;){if(_=w>>>24,c>>>=_,y-=_,_=w>>>16&255,_&16){if(M=w&65535,_&=15,y<_&&(c+=R[n++]<<y,y+=8,y<_&&(c+=R[n++]<<y,y+=8)),M+=c&(1<<_)-1,M>u){t.msg="invalid distance too far back",k.mode=f1;break e}if(c>>>=_,y-=_,_=a-l,M>_){if(_=M-_,_>f&&k.sane){t.msg="invalid distance too far back",k.mode=f1;break e}if(O=0,L=g,v===0){if(O+=d-_,_<A){A-=_;do T[a++]=g[O++];while(--_);O=a-M,L=T}}else if(v<_){if(O+=d+v-_,_-=v,_<A){A-=_;do T[a++]=g[O++];while(--_);if(O=0,v<A){_=v,A-=_;do T[a++]=g[O++];while(--_);O=a-M,L=T}}}else if(O+=v-_,_<A){A-=_;do T[a++]=g[O++];while(--_);O=a-M,L=T}for(;A>2;)T[a++]=L[O++],T[a++]=L[O++],T[a++]=L[O++],A-=3;A&&(T[a++]=L[O++],A>1&&(T[a++]=L[O++]))}else{O=a-M;do T[a++]=T[O++],T[a++]=T[O++],T[a++]=T[O++],A-=3;while(A>2);A&&(T[a++]=T[O++],A>1&&(T[a++]=T[O++]))}}else if((_&64)===0){w=E[(w&65535)+(c&(1<<_)-1)];continue r}else{t.msg="invalid distance code",k.mode=f1;break e}break}}else if((_&64)===0){w=x[(w&65535)+(c&(1<<_)-1)];continue t}else if(_&32){k.mode=$L;break e}else{t.msg="invalid literal/length code",k.mode=f1;break e}break}}while(n<i&&a<o);A=y>>3,n-=A,y-=A<<3,c&=(1<<y)-1,t.next_in=n,t.next_out=a,t.avail_in=n<i?5+(i-n):5-(n-i),t.avail_out=a<o?257+(o-a):257-(a-o),k.hold=c,k.bits=y};const ph=15,R4=852,M4=592,I4=0,ev=1,F4=2,YL=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]),XL=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]),KL=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]),ZL=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]),QL=(e,t,r,n,i,a,l,o)=>{const u=o.bits;let d=0,f=0,v=0,g=0,c=0,y=0,x=0,E=0,S=0,b=0,w,_,A,M,O,L=null,R;const T=new Uint16Array(ph+1),k=new Uint16Array(ph+1);let C=null,q,G,J;for(d=0;d<=ph;d++)T[d]=0;for(f=0;f<n;f++)T[t[r+f]]++;for(c=u,g=ph;g>=1&&T[g]===0;g--);if(c>g&&(c=g),g===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,o.bits=1,0;for(v=1;v<g&&T[v]===0;v++);for(c<v&&(c=v),E=1,d=1;d<=ph;d++)if(E<<=1,E-=T[d],E<0)return-1;if(E>0&&(e===I4||g!==1))return-1;for(k[1]=0,d=1;d<ph;d++)k[d+1]=k[d]+T[d];for(f=0;f<n;f++)t[r+f]!==0&&(l[k[t[r+f]]++]=f);if(e===I4?(L=C=l,R=20):e===ev?(L=YL,C=XL,R=257):(L=KL,C=ZL,R=0),b=0,f=0,d=v,O=a,y=c,x=0,A=-1,S=1<<c,M=S-1,e===ev&&S>R4||e===F4&&S>M4)return 1;for(;;){q=d-x,l[f]+1<R?(G=0,J=l[f]):l[f]>=R?(G=C[l[f]-R],J=L[l[f]-R]):(G=96,J=0),w=1<<d-x,_=1<<y,v=_;do _-=w,i[O+(b>>x)+_]=q<<24|G<<16|J|0;while(_!==0);for(w=1<<d-1;b&w;)w>>=1;if(w!==0?(b&=w-1,b+=w):b=0,f++,--T[d]===0){if(d===g)break;d=t[r+l[f]]}if(d>c&&(b&M)!==A){for(x===0&&(x=c),O+=v,y=d-x,E=1<<y;y+x<g&&(E-=T[y+x],!(E<=0));)y++,E<<=1;if(S+=1<<y,e===ev&&S>R4||e===F4&&S>M4)return 1;A=b&M,i[A]=c<<24|y<<16|O-a|0}}return b!==0&&(i[O+b]=d-x<<24|64<<16|0),o.bits=c,0};var np=QL;const JL=0,Q_=1,J_=2,{Z_FINISH:j4,Z_BLOCK:eT,Z_TREES:h1,Z_OK:Uf,Z_STREAM_END:tT,Z_NEED_DICT:rT,Z_STREAM_ERROR:cl,Z_DATA_ERROR:e7,Z_MEM_ERROR:t7,Z_BUF_ERROR:nT,Z_DEFLATED:D4}=X_,C0=16180,B4=16181,z4=16182,U4=16183,q4=16184,H4=16185,V4=16186,G4=16187,$4=16188,W4=16189,e0=16190,Qu=16191,tv=16192,Y4=16193,rv=16194,X4=16195,K4=16196,Z4=16197,Q4=16198,d1=16199,p1=16200,J4=16201,ew=16202,tw=16203,rw=16204,nw=16205,nv=16206,iw=16207,aw=16208,pi=16209,r7=16210,n7=16211,iT=852,aT=592,oT=15,sT=oT,ow=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function lT(){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 Wf=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<C0||t.mode>n7?1:0},i7=e=>{if(Wf(e))return cl;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=C0,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(iT),t.distcode=t.distdyn=new Int32Array(aT),t.sane=1,t.back=-1,Uf},a7=e=>{if(Wf(e))return cl;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,i7(e)},o7=(e,t)=>{let r;if(Wf(e))return cl;const n=e.state;return t<0?(r=0,t=-t):(r=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?cl:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,a7(e))},s7=(e,t)=>{if(!e)return cl;const r=new lT;e.state=r,r.strm=e,r.window=null,r.mode=C0;const n=o7(e,t);return n!==Uf&&(e.state=null),n},uT=e=>s7(e,sT);let sw=!0,iv,av;const cT=e=>{if(sw){iv=new Int32Array(512),av=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(np(Q_,e.lens,0,288,iv,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;np(J_,e.lens,0,32,av,0,e.work,{bits:5}),sw=!1}e.lencode=iv,e.lenbits=9,e.distcode=av,e.distbits=5},l7=(e,t,r,n)=>{let i;const a=e.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(t.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(t.subarray(r-n,r-n+i),a.wnext),n-=i,n?(a.window.set(t.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},fT=(e,t)=>{let r,n,i,a,l,o,u,d,f,v,g,c,y,x,E=0,S,b,w,_,A,M,O,L;const R=new Uint8Array(4);let T,k;const C=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Wf(e)||!e.output||!e.input&&e.avail_in!==0)return cl;r=e.state,r.mode===Qu&&(r.mode=tv),l=e.next_out,i=e.output,u=e.avail_out,a=e.next_in,n=e.input,o=e.avail_in,d=r.hold,f=r.bits,v=o,g=u,L=Uf;e:for(;;)switch(r.mode){case C0:if(r.wrap===0){r.mode=tv;break}for(;f<16;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}if(r.wrap&2&&d===35615){r.wbits===0&&(r.wbits=15),r.check=0,R[0]=d&255,R[1]=d>>>8&255,r.check=vu(r.check,R,2,0),d=0,f=0,r.mode=B4;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((d&255)<<8)+(d>>8))%31){e.msg="incorrect header check",r.mode=pi;break}if((d&15)!==D4){e.msg="unknown compression method",r.mode=pi;break}if(d>>>=4,f-=4,O=(d&15)+8,r.wbits===0&&(r.wbits=O),O>15||O>r.wbits){e.msg="invalid window size",r.mode=pi;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=d&512?W4:Qu,d=0,f=0;break;case B4:for(;f<16;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}if(r.flags=d,(r.flags&255)!==D4){e.msg="unknown compression method",r.mode=pi;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=pi;break}r.head&&(r.head.text=d>>8&1),r.flags&512&&r.wrap&4&&(R[0]=d&255,R[1]=d>>>8&255,r.check=vu(r.check,R,2,0)),d=0,f=0,r.mode=z4;case z4:for(;f<32;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}r.head&&(r.head.time=d),r.flags&512&&r.wrap&4&&(R[0]=d&255,R[1]=d>>>8&255,R[2]=d>>>16&255,R[3]=d>>>24&255,r.check=vu(r.check,R,4,0)),d=0,f=0,r.mode=U4;case U4:for(;f<16;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}r.head&&(r.head.xflags=d&255,r.head.os=d>>8),r.flags&512&&r.wrap&4&&(R[0]=d&255,R[1]=d>>>8&255,r.check=vu(r.check,R,2,0)),d=0,f=0,r.mode=q4;case q4:if(r.flags&1024){for(;f<16;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}r.length=d,r.head&&(r.head.extra_len=d),r.flags&512&&r.wrap&4&&(R[0]=d&255,R[1]=d>>>8&255,r.check=vu(r.check,R,2,0)),d=0,f=0}else r.head&&(r.head.extra=null);r.mode=H4;case H4:if(r.flags&1024&&(c=r.length,c>o&&(c=o),c&&(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+c),O)),r.flags&512&&r.wrap&4&&(r.check=vu(r.check,n,c,a)),o-=c,a+=c,r.length-=c),r.length))break e;r.length=0,r.mode=V4;case V4:if(r.flags&2048){if(o===0)break e;c=0;do O=n[a+c++],r.head&&O&&r.length<65536&&(r.head.name+=String.fromCharCode(O));while(O&&c<o);if(r.flags&512&&r.wrap&4&&(r.check=vu(r.check,n,c,a)),o-=c,a+=c,O)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=G4;case G4:if(r.flags&4096){if(o===0)break e;c=0;do O=n[a+c++],r.head&&O&&r.length<65536&&(r.head.comment+=String.fromCharCode(O));while(O&&c<o);if(r.flags&512&&r.wrap&4&&(r.check=vu(r.check,n,c,a)),o-=c,a+=c,O)break e}else r.head&&(r.head.comment=null);r.mode=$4;case $4:if(r.flags&512){for(;f<16;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}if(r.wrap&4&&d!==(r.check&65535)){e.msg="header crc mismatch",r.mode=pi;break}d=0,f=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Qu;break;case W4:for(;f<32;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}e.adler=r.check=ow(d),d=0,f=0,r.mode=e0;case e0:if(r.havedict===0)return e.next_out=l,e.avail_out=u,e.next_in=a,e.avail_in=o,r.hold=d,r.bits=f,rT;e.adler=r.check=1,r.mode=Qu;case Qu:if(t===eT||t===h1)break e;case tv:if(r.last){d>>>=f&7,f-=f&7,r.mode=nv;break}for(;f<3;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}switch(r.last=d&1,d>>>=1,f-=1,d&3){case 0:r.mode=Y4;break;case 1:if(cT(r),r.mode=d1,t===h1){d>>>=2,f-=2;break e}break;case 2:r.mode=K4;break;case 3:e.msg="invalid block type",r.mode=pi}d>>>=2,f-=2;break;case Y4:for(d>>>=f&7,f-=f&7;f<32;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}if((d&65535)!==(d>>>16^65535)){e.msg="invalid stored block lengths",r.mode=pi;break}if(r.length=d&65535,d=0,f=0,r.mode=rv,t===h1)break e;case rv:r.mode=X4;case X4:if(c=r.length,c){if(c>o&&(c=o),c>u&&(c=u),c===0)break e;i.set(n.subarray(a,a+c),l),o-=c,a+=c,u-=c,l+=c,r.length-=c;break}r.mode=Qu;break;case K4:for(;f<14;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}if(r.nlen=(d&31)+257,d>>>=5,f-=5,r.ndist=(d&31)+1,d>>>=5,f-=5,r.ncode=(d&15)+4,d>>>=4,f-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=pi;break}r.have=0,r.mode=Z4;case Z4:for(;r.have<r.ncode;){for(;f<3;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}r.lens[C[r.have++]]=d&7,d>>>=3,f-=3}for(;r.have<19;)r.lens[C[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,T={bits:r.lenbits},L=np(JL,r.lens,0,19,r.lencode,0,r.work,T),r.lenbits=T.bits,L){e.msg="invalid code lengths set",r.mode=pi;break}r.have=0,r.mode=Q4;case Q4:for(;r.have<r.nlen+r.ndist;){for(;E=r.lencode[d&(1<<r.lenbits)-1],S=E>>>24,b=E>>>16&255,w=E&65535,!(S<=f);){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}if(w<16)d>>>=S,f-=S,r.lens[r.have++]=w;else{if(w===16){for(k=S+2;f<k;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}if(d>>>=S,f-=S,r.have===0){e.msg="invalid bit length repeat",r.mode=pi;break}O=r.lens[r.have-1],c=3+(d&3),d>>>=2,f-=2}else if(w===17){for(k=S+3;f<k;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}d>>>=S,f-=S,O=0,c=3+(d&7),d>>>=3,f-=3}else{for(k=S+7;f<k;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}d>>>=S,f-=S,O=0,c=11+(d&127),d>>>=7,f-=7}if(r.have+c>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=pi;break}for(;c--;)r.lens[r.have++]=O}}if(r.mode===pi)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=pi;break}if(r.lenbits=9,T={bits:r.lenbits},L=np(Q_,r.lens,0,r.nlen,r.lencode,0,r.work,T),r.lenbits=T.bits,L){e.msg="invalid literal/lengths set",r.mode=pi;break}if(r.distbits=6,r.distcode=r.distdyn,T={bits:r.distbits},L=np(J_,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,T),r.distbits=T.bits,L){e.msg="invalid distances set",r.mode=pi;break}if(r.mode=d1,t===h1)break e;case d1:r.mode=p1;case p1:if(o>=6&&u>=258){e.next_out=l,e.avail_out=u,e.next_in=a,e.avail_in=o,r.hold=d,r.bits=f,WL(e,g),l=e.next_out,i=e.output,u=e.avail_out,a=e.next_in,n=e.input,o=e.avail_in,d=r.hold,f=r.bits,r.mode===Qu&&(r.back=-1);break}for(r.back=0;E=r.lencode[d&(1<<r.lenbits)-1],S=E>>>24,b=E>>>16&255,w=E&65535,!(S<=f);){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}if(b&&(b&240)===0){for(_=S,A=b,M=w;E=r.lencode[M+((d&(1<<_+A)-1)>>_)],S=E>>>24,b=E>>>16&255,w=E&65535,!(_+S<=f);){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}d>>>=_,f-=_,r.back+=_}if(d>>>=S,f-=S,r.back+=S,r.length=w,b===0){r.mode=nw;break}if(b&32){r.back=-1,r.mode=Qu;break}if(b&64){e.msg="invalid literal/length code",r.mode=pi;break}r.extra=b&15,r.mode=J4;case J4:if(r.extra){for(k=r.extra;f<k;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}r.length+=d&(1<<r.extra)-1,d>>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=ew;case ew:for(;E=r.distcode[d&(1<<r.distbits)-1],S=E>>>24,b=E>>>16&255,w=E&65535,!(S<=f);){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}if((b&240)===0){for(_=S,A=b,M=w;E=r.distcode[M+((d&(1<<_+A)-1)>>_)],S=E>>>24,b=E>>>16&255,w=E&65535,!(_+S<=f);){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}d>>>=_,f-=_,r.back+=_}if(d>>>=S,f-=S,r.back+=S,b&64){e.msg="invalid distance code",r.mode=pi;break}r.offset=w,r.extra=b&15,r.mode=tw;case tw:if(r.extra){for(k=r.extra;f<k;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}r.offset+=d&(1<<r.extra)-1,d>>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=pi;break}r.mode=rw;case rw:if(u===0)break e;if(c=g-u,r.offset>c){if(c=r.offset-c,c>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=pi;break}c>r.wnext?(c-=r.wnext,y=r.wsize-c):y=r.wnext-c,c>r.length&&(c=r.length),x=r.window}else x=i,y=l-r.offset,c=r.length;c>u&&(c=u),u-=c,r.length-=c;do i[l++]=x[y++];while(--c);r.length===0&&(r.mode=p1);break;case nw:if(u===0)break e;i[l++]=r.length,u--,r.mode=p1;break;case nv:if(r.wrap){for(;f<32;){if(o===0)break e;o--,d|=n[a++]<<f,f+=8}if(g-=u,e.total_out+=g,r.total+=g,r.wrap&4&&g&&(e.adler=r.check=r.flags?vu(r.check,i,g,l-g):Wv(r.check,i,g,l-g)),g=u,r.wrap&4&&(r.flags?d:ow(d))!==r.check){e.msg="incorrect data check",r.mode=pi;break}d=0,f=0}r.mode=iw;case iw:if(r.wrap&&r.flags){for(;f<32;){if(o===0)break e;o--,d+=n[a++]<<f,f+=8}if(r.wrap&4&&d!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=pi;break}d=0,f=0}r.mode=aw;case aw:L=tT;break e;case pi:L=e7;break e;case r7:return t7;case n7:default:return cl}return e.next_out=l,e.avail_out=u,e.next_in=a,e.avail_in=o,r.hold=d,r.bits=f,(r.wsize||g!==e.avail_out&&r.mode<pi&&(r.mode<nv||t!==j4))&&l7(e,e.output,e.next_out,g-e.avail_out),v-=e.avail_in,g-=e.avail_out,e.total_in+=v,e.total_out+=g,r.total+=g,r.wrap&4&&g&&(e.adler=r.check=r.flags?vu(r.check,i,g,e.next_out-g):Wv(r.check,i,g,e.next_out-g)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Qu?128:0)+(r.mode===d1||r.mode===rv?256:0),(v===0&&g===0||t===j4)&&L===Uf&&(L=nT),L},hT=e=>{if(Wf(e))return cl;let t=e.state;return t.window&&(t.window=null),e.state=null,Uf},dT=(e,t)=>{if(Wf(e))return cl;const r=e.state;return(r.wrap&2)===0?cl:(r.head=t,t.done=!1,Uf)},pT=(e,t)=>{const r=t.length;let n,i,a;return Wf(e)||(n=e.state,n.wrap!==0&&n.mode!==e0)?cl:n.mode===e0&&(i=1,i=Wv(i,t,r,0),i!==n.check)?e7:(a=l7(e,t,r,r),a?(n.mode=r7,t7):(n.havedict=1,Uf))};var gT=a7,vT=o7,mT=i7,yT=uT,bT=s7,wT=fT,_T=hT,xT=dT,ST=pT,ET="pako inflate (from Nodeca project)",Ju={inflateReset:gT,inflateReset2:vT,inflateResetKeep:mT,inflateInit:yT,inflateInit2:bT,inflate:wT,inflateEnd:_T,inflateGetHeader:xT,inflateSetDictionary:ST,inflateInfo:ET};function AT(){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 PT=AT;const u7=Object.prototype.toString,{Z_NO_FLUSH:kT,Z_FINISH:OT,Z_OK:gp,Z_STREAM_END:ov,Z_NEED_DICT:sv,Z_STREAM_ERROR:CT,Z_DATA_ERROR:lw,Z_MEM_ERROR:NT}=X_;function Op(e){this.options=K_.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new GL,this.strm.avail_out=0;let r=Ju.inflateInit2(this.strm,t.windowBits);if(r!==gp)throw new Error(Yv[r]);if(this.header=new PT,Ju.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Xv.string2buf(t.dictionary):u7.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Ju.inflateSetDictionary(this.strm,t.dictionary),r!==gp)))throw new Error(Yv[r])}Op.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let a,l,o;if(this.ended)return!1;for(t===~~t?l=t:l=t===!0?OT:kT,u7.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,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=Ju.inflate(r,l),a===sv&&i&&(a=Ju.inflateSetDictionary(r,i),a===gp?a=Ju.inflate(r,l):a===lw&&(a=sv));r.avail_in>0&&a===ov&&r.state.wrap>0&&e[r.next_in]!==0;)Ju.inflateReset(r),a=Ju.inflate(r,l);switch(a){case CT:case lw:case sv:case NT:return this.onEnd(a),this.ended=!0,!1}if(o=r.avail_out,r.next_out&&(r.avail_out===0||a===ov))if(this.options.to==="string"){let u=Xv.utf8border(r.output,r.next_out),d=r.next_out-u,f=Xv.buf2string(r.output,u);r.next_out=d,r.avail_out=n-d,d&&r.output.set(r.output.subarray(u,u+d),0),this.onData(f)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===gp&&o===0)){if(a===ov)return a=Ju.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Op.prototype.onData=function(e){this.chunks.push(e)};Op.prototype.onEnd=function(e){e===gp&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=K_.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function LT(e,t){const r=new Op(t);if(r.push(e),r.err)throw r.msg||Yv[r.err];return r.result}var TT=Op,RT=LT,MT={Inflate:TT,inflate:RT};const{Inflate:IT,inflate:FT}=MT;var uw=IT,jT=FT;const c7=[];for(let e=0;e<256;e++){let t=e;for(let r=0;r<8;r++)t&1?t=3988292384^t>>>1:t=t>>>1;c7[e]=t}const cw=4294967295;function DT(e,t,r){let n=e;for(let i=0;i<r;i++)n=c7[(n^t[i])&255]^n>>>8;return n}function BT(e,t){return(DT(cw,e,t)^cw)>>>0}function fw(e,t,r){const n=e.readUint32(),i=BT(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(i!==n)throw new Error(`CRC mismatch for chunk ${r}. Expected ${n}, found ${i}`)}function f7(e,t,r){for(let n=0;n<r;n++)t[n]=e[n]}function h7(e,t,r,n){let i=0;for(;i<n;i++)t[i]=e[i];for(;i<r;i++)t[i]=e[i]+t[i-n]&255}function d7(e,t,r,n){let i=0;if(r.length===0)for(;i<n;i++)t[i]=e[i];else for(;i<n;i++)t[i]=e[i]+r[i]&255}function p7(e,t,r,n,i){let a=0;if(r.length===0){for(;a<i;a++)t[a]=e[a];for(;a<n;a++)t[a]=e[a]+(t[a-i]>>1)&255}else{for(;a<i;a++)t[a]=e[a]+(r[a]>>1)&255;for(;a<n;a++)t[a]=e[a]+(t[a-i]+r[a]>>1)&255}}function g7(e,t,r,n,i){let a=0;if(r.length===0){for(;a<i;a++)t[a]=e[a];for(;a<n;a++)t[a]=e[a]+t[a-i]&255}else{for(;a<i;a++)t[a]=e[a]+r[a]&255;for(;a<n;a++)t[a]=e[a]+zT(t[a-i],r[a],r[a-i])&255}}function zT(e,t,r){const n=e+t-r,i=Math.abs(n-e),a=Math.abs(n-t),l=Math.abs(n-r);return i<=a&&i<=l?e:a<=l?t:r}function UT(e,t,r,n,i,a){switch(e){case 0:f7(t,r,i);break;case 1:h7(t,r,i,a);break;case 2:d7(t,r,n,i);break;case 3:p7(t,r,n,i,a);break;case 4:g7(t,r,n,i,a);break;default:throw new Error(`Unsupported filter: ${e}`)}}const qT=new Uint16Array([255]),HT=new Uint8Array(qT.buffer),VT=HT[0]===255;function GT(e){const{data:t,width:r,height:n,channels:i,depth:a}=e,l=[{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}],o=Math.ceil(a/8)*i,u=new Uint8Array(n*r*o);let d=0;for(let f=0;f<7;f++){const v=l[f],g=Math.ceil((r-v.x)/v.xStep),c=Math.ceil((n-v.y)/v.yStep);if(g<=0||c<=0)continue;const y=g*o,x=new Uint8Array(y);for(let E=0;E<c;E++){const S=t[d++],b=t.subarray(d,d+y);d+=y;const w=new Uint8Array(y);UT(S,b,w,x,y,o),x.set(w);for(let _=0;_<g;_++){const A=v.x+_*v.xStep,M=v.y+E*v.yStep;if(!(A>=r||M>=n))for(let O=0;O<o;O++)u[(M*r+A)*o+O]=w[_*o+O]}}}if(a===16){const f=new Uint16Array(u.buffer);if(VT)for(let v=0;v<f.length;v++)f[v]=$T(f[v]);return f}else return u}function $T(e){return(e&255)<<8|e>>8&255}const WT=new Uint16Array([255]),YT=new Uint8Array(WT.buffer),XT=YT[0]===255,KT=new Uint8Array(0);function hw(e){const{data:t,width:r,height:n,channels:i,depth:a}=e,l=Math.ceil(a/8)*i,o=Math.ceil(a/8*i*r),u=new Uint8Array(n*o);let d=KT,f=0,v,g;for(let c=0;c<n;c++){switch(v=t.subarray(f+1,f+1+o),g=u.subarray(c*o,(c+1)*o),t[f]){case 0:f7(v,g,o);break;case 1:h7(v,g,o,l);break;case 2:d7(v,g,d,o);break;case 3:p7(v,g,d,o,l);break;case 4:g7(v,g,d,o,l);break;default:throw new Error(`Unsupported filter: ${t[f]}`)}d=g,f+=o+1}if(a===16){const c=new Uint16Array(u.buffer);if(XT)for(let y=0;y<c.length;y++)c[y]=ZT(c[y]);return c}else return u}function ZT(e){return(e&255)<<8|e>>8&255}const C1=Uint8Array.of(137,80,78,71,13,10,26,10);function dw(e){if(!QT(e.readBytes(C1.length)))throw new Error("wrong PNG signature")}function QT(e){if(e.length<C1.length)return!1;for(let t=0;t<C1.length;t++)if(e[t]!==C1[t])return!1;return!0}const JT="tEXt",eR=0,v7=new TextDecoder("latin1");function tR(e){if(nR(e),e.length===0||e.length>79)throw new Error("keyword length must be between 1 and 79")}const rR=/^[\u0000-\u00FF]*$/;function nR(e){if(!rR.test(e))throw new Error("invalid latin1 text")}function iR(e,t,r){const n=m7(t);e[n]=aR(t,r-n.length-1)}function m7(e){for(e.mark();e.readByte()!==eR;);const t=e.offset;e.reset();const r=v7.decode(e.readBytes(t-e.offset-1));return e.skip(1),tR(r),r}function aR(e,t){return v7.decode(e.readBytes(t))}const Ds={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},lv={UNKNOWN:-1,DEFLATE:0},pw={UNKNOWN:-1,ADAPTIVE:0},uv={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},g1={NONE:0,BACKGROUND:1,PREVIOUS:2},cv={SOURCE:0,OVER:1};class oR extends zm{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(t,r={}){super(t);const{checkCrc:n=!1}=r;this._checkCrc=n,this._inflator=new uw,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=lv.UNKNOWN,this._filterMethod=pw.UNKNOWN,this._interlaceMethod=uv.UNKNOWN,this._colorType=Ds.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(dw(this);!this._end;){const t=this.readUint32(),r=this.readChars(4);this.decodeChunk(t,r)}return this.decodeImage(),this._png}decodeApng(){for(dw(this);!this._end;){const t=this.readUint32(),r=this.readChars(4);this.decodeApngChunk(t,r)}return this.decodeApngImage(),this._apng}decodeChunk(t,r){const n=this.offset;switch(r){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"iCCP":this.decodeiCCP(t);break;case JT:iR(this._png.text,this,t);break;case"pHYs":this.decodepHYs();break;default:this.skip(t);break}if(this.offset-n!==t)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?fw(this,t+4,r):this.skip(4)}decodeApngChunk(t,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(t);break;default:this.decodeChunk(t,r),this.offset=n+t;break}if(this.offset-n!==t)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?fw(this,t+4,r):this.skip(4)}decodeIHDR(){const t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=sR(this.readUint8());const r=this.readUint8();this._colorType=r;let n;switch(r){case Ds.GREYSCALE:n=1;break;case Ds.TRUECOLOUR:n=3;break;case Ds.INDEXED_COLOUR:n=1;break;case Ds.GREYSCALE_ALPHA:n=2;break;case Ds.TRUECOLOUR_ALPHA:n=4;break;case Ds.UNKNOWN:default:throw new Error(`Unknown color type: ${r}`)}if(this._png.channels=n,this._compressionMethod=this.readUint8(),this._compressionMethod!==lv.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const t={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(t)}decodePLTE(t){if(t%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);const r=t/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(t){this._writingDataChunks=!0;const r=t,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(t)}decodeFDAT(t){this._writingDataChunks=!0;let r=t,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(t)}decodetRNS(t){switch(this._colorType){case Ds.GREYSCALE:case Ds.TRUECOLOUR:{if(t%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${t}`);if(t/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${t/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(t/2);for(let r=0;r<t/2;r++)this._transparency[r]=this.readUint16();break}case Ds.INDEXED_COLOUR:{if(t>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let r=0;for(;r<t;r++){const n=this.readByte();this._palette[r].push(n)}for(;r<this._palette.length;r++)this._palette[r].push(255);break}case Ds.UNKNOWN:case Ds.GREYSCALE_ALPHA:case Ds.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(t){const r=m7(this),n=this.readUint8();if(n!==lv.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${n}`);const i=this.readBytes(t-r.length-2);this._png.iccEmbeddedProfile={name:r,profile:jT(i)}}decodepHYs(){const t=this.readUint32(),r=this.readUint32(),n=this.readByte();this._png.resolution={x:t,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 t=0;t<this._numberOfFrames;t++){const r={sequenceNumber:this._frames[t].sequenceNumber,delayNumber:this._frames[t].delayNumber,delayDenominator:this._frames[t].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(t);if(n){if(n.data=hw({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),t===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(t-1);this.disposeFrame(n,i,r),this.addFrameDataToCanvas(r,n)}this._apng.frames.push(r)}}return this._apng}disposeFrame(t,r,n){switch(t.disposeOp){case g1.NONE:break;case g1.BACKGROUND:for(let i=0;i<this._png.height;i++)for(let a=0;a<this._png.width;a++){const l=(i*t.width+a)*this._png.channels;for(let o=0;o<this._png.channels;o++)n.data[l+o]=0}break;case g1.PREVIOUS:n.data.set(r.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(t,r){const n=1<<this._png.depth,i=(a,l)=>{const o=((a+r.yOffset)*this._png.width+r.xOffset+l)*this._png.channels,u=(a*r.width+l)*this._png.channels;return{index:o,frameIndex:u}};switch(r.blendOp){case cv.SOURCE:for(let a=0;a<r.height;a++)for(let l=0;l<r.width;l++){const{index:o,frameIndex:u}=i(a,l);for(let d=0;d<this._png.channels;d++)t.data[o+d]=r.data[u+d]}break;case cv.OVER:for(let a=0;a<r.height;a++)for(let l=0;l<r.width;l++){const{index:o,frameIndex:u}=i(a,l);for(let d=0;d<this._png.channels;d++){const f=r.data[u+this._png.channels-1]/n,v=d%(this._png.channels-1)===0?1:r.data[u+d],g=Math.floor(f*v+(1-f)*t.data[o+d]);t.data[o+d]+=g}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const t=this._isAnimated?(this._frames?.at(0)).data:this._inflator.result;if(this._filterMethod!==pw.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===uv.NO_INTERLACE)this._png.data=hw({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===uv.ADAM7)this._png.data=GT({data:t,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 t=this._inflator.result,r=this._frames.at(-1);r?r.data=t:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:g1.NONE,blendOp:cv.SOURCE,data:t}),this._inflator=new uw,this._writingDataChunks=!1}}function sR(e){if(e!==1&&e!==2&&e!==4&&e!==8&&e!==16)throw new Error(`invalid bit depth: ${e}`);return e}var gw;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.METRE=1]="METRE"})(gw||(gw={}));function lR(e,t){return new oR(e,t).decode()}var dr=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function fv(){dr.console&&typeof dr.console.log=="function"&&dr.console.log.apply(dr.console,arguments)}var zn={log:fv,warn:function(e){dr.console&&(typeof dr.console.warn=="function"?dr.console.warn.apply(dr.console,arguments):fv.call(null,arguments))},error:function(e){dr.console&&(typeof dr.console.error=="function"?dr.console.error.apply(dr.console,arguments):fv(e))}};function hv(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){Of(n.response,t,r)},n.onerror=function(){zn.error("could not download file")},n.send()}function vw(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function v1(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var Of=dr.saveAs||((typeof window>"u"?"undefined":Sn(window))!=="object"||window!==dr?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,r){var n=dr.URL||dr.webkitURL,i=document.createElement("a");t=t||e.name||"download",i.download=t,i.rel="noopener",typeof e=="string"?(i.href=e,i.origin!==location.origin?vw(i.href)?hv(e,t,r):v1(i,i.target="_blank"):v1(i)):(i.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(i.href)},4e4),setTimeout(function(){v1(i)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download",typeof e=="string")if(vw(e))hv(e,t,r);else{var n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){v1(n)})}else navigator.msSaveOrOpenBlob(function(i,a){return a===void 0?a={autoBom:!1}:Sn(a)!=="object"&&(zn.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i}(e,r),t)}:function(e,t,r,n){if((n=n||open("","_blank"))&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return hv(e,t,r);var i=e.type==="application/octet-stream",a=/constructor/i.test(dr.HTMLElement)||dr.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||i&&a)&&(typeof FileReader>"u"?"undefined":Sn(FileReader))==="object"){var o=new FileReader;o.onloadend=function(){var f=o.result;f=l?f:f.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=f:location=f,n=null},o.readAsDataURL(e)}else{var u=dr.URL||dr.webkitURL,d=u.createObjectURL(e);n?n.location=d:location.href=d,n=null,setTimeout(function(){u.revokeObjectURL(d)},4e4)}});/**
417
- * A class to parse color values
418
- * @author Stoyan Stefanov <sstoo@gmail.com>
419
- * {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
420
- * @license Use it if you like it
421
- */function y7(e){var t;e=e||"",this.ok=!1,e.charAt(0)=="#"&&(e=e.substr(1,6)),e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var r=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(o){return[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(o){return[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(o){return[parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16)]}}],n=0;n<r.length;n++){var i=r[n].re,a=r[n].process,l=i.exec(e);l&&(t=a(l),this.r=t[0],this.g=t[1],this.b=t[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var o=this.r.toString(16),u=this.g.toString(16),d=this.b.toString(16);return o.length==1&&(o="0"+o),u.length==1&&(u="0"+u),d.length==1&&(d="0"+d),"#"+o+u+d}}var N1=dr.atob.bind(dr),mw=dr.btoa.bind(dr);/**
422
- * @license
423
- * Joseph Myers does not specify a particular license for his work.
424
- *
425
- * Author: Joseph Myers
426
- * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
427
- *
428
- * Modified by: Owen Leong
429
- */function dv(e,t){var r=e[0],n=e[1],i=e[2],a=e[3];r=No(r,n,i,a,t[0],7,-680876936),a=No(a,r,n,i,t[1],12,-389564586),i=No(i,a,r,n,t[2],17,606105819),n=No(n,i,a,r,t[3],22,-1044525330),r=No(r,n,i,a,t[4],7,-176418897),a=No(a,r,n,i,t[5],12,1200080426),i=No(i,a,r,n,t[6],17,-1473231341),n=No(n,i,a,r,t[7],22,-45705983),r=No(r,n,i,a,t[8],7,1770035416),a=No(a,r,n,i,t[9],12,-1958414417),i=No(i,a,r,n,t[10],17,-42063),n=No(n,i,a,r,t[11],22,-1990404162),r=No(r,n,i,a,t[12],7,1804603682),a=No(a,r,n,i,t[13],12,-40341101),i=No(i,a,r,n,t[14],17,-1502002290),r=Lo(r,n=No(n,i,a,r,t[15],22,1236535329),i,a,t[1],5,-165796510),a=Lo(a,r,n,i,t[6],9,-1069501632),i=Lo(i,a,r,n,t[11],14,643717713),n=Lo(n,i,a,r,t[0],20,-373897302),r=Lo(r,n,i,a,t[5],5,-701558691),a=Lo(a,r,n,i,t[10],9,38016083),i=Lo(i,a,r,n,t[15],14,-660478335),n=Lo(n,i,a,r,t[4],20,-405537848),r=Lo(r,n,i,a,t[9],5,568446438),a=Lo(a,r,n,i,t[14],9,-1019803690),i=Lo(i,a,r,n,t[3],14,-187363961),n=Lo(n,i,a,r,t[8],20,1163531501),r=Lo(r,n,i,a,t[13],5,-1444681467),a=Lo(a,r,n,i,t[2],9,-51403784),i=Lo(i,a,r,n,t[7],14,1735328473),r=To(r,n=Lo(n,i,a,r,t[12],20,-1926607734),i,a,t[5],4,-378558),a=To(a,r,n,i,t[8],11,-2022574463),i=To(i,a,r,n,t[11],16,1839030562),n=To(n,i,a,r,t[14],23,-35309556),r=To(r,n,i,a,t[1],4,-1530992060),a=To(a,r,n,i,t[4],11,1272893353),i=To(i,a,r,n,t[7],16,-155497632),n=To(n,i,a,r,t[10],23,-1094730640),r=To(r,n,i,a,t[13],4,681279174),a=To(a,r,n,i,t[0],11,-358537222),i=To(i,a,r,n,t[3],16,-722521979),n=To(n,i,a,r,t[6],23,76029189),r=To(r,n,i,a,t[9],4,-640364487),a=To(a,r,n,i,t[12],11,-421815835),i=To(i,a,r,n,t[15],16,530742520),r=Ro(r,n=To(n,i,a,r,t[2],23,-995338651),i,a,t[0],6,-198630844),a=Ro(a,r,n,i,t[7],10,1126891415),i=Ro(i,a,r,n,t[14],15,-1416354905),n=Ro(n,i,a,r,t[5],21,-57434055),r=Ro(r,n,i,a,t[12],6,1700485571),a=Ro(a,r,n,i,t[3],10,-1894986606),i=Ro(i,a,r,n,t[10],15,-1051523),n=Ro(n,i,a,r,t[1],21,-2054922799),r=Ro(r,n,i,a,t[8],6,1873313359),a=Ro(a,r,n,i,t[15],10,-30611744),i=Ro(i,a,r,n,t[6],15,-1560198380),n=Ro(n,i,a,r,t[13],21,1309151649),r=Ro(r,n,i,a,t[4],6,-145523070),a=Ro(a,r,n,i,t[11],10,-1120210379),i=Ro(i,a,r,n,t[2],15,718787259),n=Ro(n,i,a,r,t[9],21,-343485551),e[0]=Kc(r,e[0]),e[1]=Kc(n,e[1]),e[2]=Kc(i,e[2]),e[3]=Kc(a,e[3])}function N0(e,t,r,n,i,a){return t=Kc(Kc(t,e),Kc(n,a)),Kc(t<<i|t>>>32-i,r)}function No(e,t,r,n,i,a,l){return N0(t&r|~t&n,e,t,i,a,l)}function Lo(e,t,r,n,i,a,l){return N0(t&n|r&~n,e,t,i,a,l)}function To(e,t,r,n,i,a,l){return N0(t^r^n,e,t,i,a,l)}function Ro(e,t,r,n,i,a,l){return N0(r^(t|~n),e,t,i,a,l)}function b7(e){var t,r=e.length,n=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)dv(n,uR(e.substring(t-64,t)));e=e.substring(t-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)i[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(dv(n,i),t=0;t<16;t++)i[t]=0;return i[14]=8*r,dv(n,i),n}function uR(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}var yw="0123456789abcdef".split("");function cR(e){for(var t="",r=0;r<4;r++)t+=yw[e>>8*r+4&15]+yw[e>>8*r&15];return t}function fR(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function Kv(e){return b7(e).map(fR).join("")}var hR=function(e){for(var t=0;t<e.length;t++)e[t]=cR(e[t]);return e.join("")}(b7("hello"))!="5d41402abc4b2a76b9719d911017c592";function Kc(e,t){if(hR){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}return e+t&4294967295}/**
430
- * @license
431
- * FPDF is released under a permissive license: there is no usage restriction.
432
- * You may embed it freely in your application (commercial or not), with or
433
- * without modifications.
434
- *
435
- * Reference: http://www.fpdf.org/en/script/script37.php
436
- */function Zv(e,t){var r,n,i,a;if(e!==r){for(var l=(i=e,a=1+(256/e.length|0),new Array(a+1).join(i)),o=[],u=0;u<256;u++)o[u]=u;var d=0;for(u=0;u<256;u++){var f=o[u];d=(d+f+l.charCodeAt(u))%256,o[u]=o[d],o[d]=f}r=e,n=o}else o=n;var v=t.length,g=0,c=0,y="";for(u=0;u<v;u++)c=(c+(f=o[g=(g+1)%256]))%256,o[g]=o[c],o[c]=f,l=o[(o[g]+o[c])%256],y+=String.fromCharCode(t.charCodeAt(u)^l);return y}/**
437
- * @license
438
- * Licensed under the MIT License.
439
- * http://opensource.org/licenses/mit-license
440
- * Author: Owen Leong (@owenl131)
441
- * Date: 15 Oct 2020
442
- * References:
443
- * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
444
- * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
445
- * http://www.fpdf.org/en/script/script37.php
446
- */var bw={print:4,modify:8,copy:16,"annot-forms":32};function yh(e,t,r,n){this.v=1,this.r=2;var i=192;e.forEach(function(o){if(bw.perm!==void 0)throw new Error("Invalid permission: "+o);i+=bw[o]}),this.padding="(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";var a=(t+this.padding).substr(0,32),l=(r+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,l),this.P=-(1+(255^i)),this.encryptionKey=Kv(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=Zv(this.encryptionKey,this.padding)}function bh(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",r=e.length,n=0;n<r;n++){var i=e.charCodeAt(n);t+=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):e[n]}return t}function ww(e){if(Sn(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(r,n,i){if(i=i||!1,typeof r!="string"||typeof n!="function"||typeof i!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(r)||(t[r]={});var a=Math.random().toString(35);return t[r][a]=[n,!!i],a},this.unsubscribe=function(r){for(var n in t)if(t[n][r])return delete t[n][r],Object.keys(t[n]).length===0&&delete t[n],!0;return!1},this.publish=function(r){if(t.hasOwnProperty(r)){var n=Array.prototype.slice.call(arguments,1),i=[];for(var a in t[r]){var l=t[r][a];try{l[0].apply(e,n)}catch(o){dr.console&&zn.error("jsPDF PubSub Error",o.message,o)}l[1]&&i.push(a)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function t0(e){if(!(this instanceof t0))return new t0(e);var t="opacity,stroke-opacity".split(",");for(var r in e)e.hasOwnProperty(r)&&t.indexOf(r)>=0&&(this[r]=e[r]);this.id="",this.objectNumber=-1}function w7(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function Cf(e,t,r,n,i){if(!(this instanceof Cf))return new Cf(e,t,r,n,i);this.type=e==="axial"?2:3,this.coords=t,this.colors=r,w7.call(this,n,i)}function Eh(e,t,r,n,i){if(!(this instanceof Eh))return new Eh(e,t,r,n,i);this.boundingBox=e,this.xStep=t,this.yStep=r,this.stream="",this.cloneIndex=0,w7.call(this,n,i)}function Kt(e){var t,r=typeof arguments[0]=="string"?arguments[0]:"p",n=arguments[1],i=arguments[2],a=arguments[3],l=[],o=1,u=16,d="S",f=null;Sn(e=e||{})==="object"&&(r=e.orientation,n=e.unit||n,i=e.format||i,a=e.compress||e.compressPdf||a,(f=e.encryption||null)!==null&&(f.userPassword=f.userPassword||"",f.ownerPassword=f.ownerPassword||"",f.userPermissions=f.userPermissions||[]),o=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(t=e.precision),e.floatPrecision!==void 0&&(u=e.floatPrecision),d=e.defaultPathOperation||"S"),l=e.filters||(a===!0?["FlateEncode"]:l),n=n||"mm",r=(""+(r||"P")).toLowerCase();var v=e.putOnlyUsedFonts||!1,g={},c={internal:{},__private__:{}};c.__private__.PubSub=ww;var y="1.3",x=c.__private__.getPdfVersion=function(){return y};c.__private__.setPdfVersion=function(X){y=X};var E={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]};c.__private__.getPageFormats=function(){return E};var S=c.__private__.getPageFormat=function(X){return E[X]};i=i||"a4";var b="compat",w="advanced",_=b;function A(){this.saveGraphicsState(),de(new Yt(ht,0,0,-ht,0,yi()*ht).toString()+" cm"),this.setFontSize(this.getFontSize()/ht),d="n",_=w}function M(){this.restoreGraphicsState(),d="S",_=b}var O=c.__private__.combineFontStyleAndFontWeight=function(X,fe){if(X=="bold"&&fe=="normal"||X=="bold"&&fe==400||X=="normal"&&fe=="italic"||X=="bold"&&fe=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return fe&&(X=fe==400||fe==="normal"?X==="italic"?"italic":"normal":fe!=700&&fe!=="bold"||X!=="normal"?(fe==700?"bold":fe)+""+X:"bold"),X};c.advancedAPI=function(X){var fe=_===b;return fe&&A.call(this),typeof X!="function"||(X(this),fe&&M.call(this)),this},c.compatAPI=function(X){var fe=_===w;return fe&&M.call(this),typeof X!="function"||(X(this),fe&&A.call(this)),this},c.isAdvancedAPI=function(){return _===w};var L,R=function(X){if(_!==w)throw new Error(X+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},T=c.roundToPrecision=c.__private__.roundToPrecision=function(X,fe){var Ne=t||fe;if(isNaN(X)||isNaN(Ne))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return X.toFixed(Ne).replace(/0+$/,"")};L=c.hpf=c.__private__.hpf=typeof u=="number"?function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.hpf");return T(X,u)}:u==="smart"?function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.hpf");return T(X,X>-1&&X<1?16:5)}:function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.hpf");return T(X,16)};var k=c.f2=c.__private__.f2=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.f2");return T(X,2)},C=c.__private__.f3=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.f3");return T(X,3)},q=c.scale=c.__private__.scale=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.scale");return _===b?X*ht:_===w?X:void 0},G=function(X){return q(function(fe){return _===b?yi()-fe:_===w?fe:void 0}(X))};c.__private__.setPrecision=c.setPrecision=function(X){typeof parseInt(X,10)=="number"&&(t=parseInt(X,10))};var J,ae="00000000000000000000000000000000",H=c.__private__.getFileId=function(){return ae},V=c.__private__.setFileId=function(X){return ae=X!==void 0&&/^[a-fA-F0-9]{32}$/.test(X)?X.toUpperCase():ae.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),f!==null&&(qn=new yh(f.userPermissions,f.userPassword,f.ownerPassword,ae)),ae};c.setFileId=function(X){return V(X),this},c.getFileId=function(){return H()};var Y=c.__private__.convertDateToPDFDate=function(X){var fe=X.getTimezoneOffset(),Ne=fe<0?"+":"-",Fe=Math.floor(Math.abs(fe/60)),Ge=Math.abs(fe%60),lt=[Ne,Z(Fe),"'",Z(Ge),"'"].join("");return["D:",X.getFullYear(),Z(X.getMonth()+1),Z(X.getDate()),Z(X.getHours()),Z(X.getMinutes()),Z(X.getSeconds()),lt].join("")},U=c.__private__.convertPDFDateToDate=function(X){var fe=parseInt(X.substr(2,4),10),Ne=parseInt(X.substr(6,2),10)-1,Fe=parseInt(X.substr(8,2),10),Ge=parseInt(X.substr(10,2),10),lt=parseInt(X.substr(12,2),10),ft=parseInt(X.substr(14,2),10);return new Date(fe,Ne,Fe,Ge,lt,ft,0)},D=c.__private__.setCreationDate=function(X){var fe;if(X===void 0&&(X=new Date),X instanceof Date)fe=Y(X);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(X))throw new Error("Invalid argument passed to jsPDF.setCreationDate");fe=X}return J=fe},j=c.__private__.getCreationDate=function(X){var fe=J;return X==="jsDate"&&(fe=U(J)),fe};c.setCreationDate=function(X){return D(X),this},c.getCreationDate=function(X){return j(X)};var z,Z=c.__private__.padd2=function(X){return("0"+parseInt(X)).slice(-2)},re=c.__private__.padd2Hex=function(X){return("00"+(X=X.toString())).substr(X.length)},W=0,Q=[],se=[],ue=0,le=[],ye=[],Re=!1,Me=se;c.__private__.setCustomOutputDestination=function(X){Re=!0,Me=X};var Pe=function(X){Re||(Me=X)};c.__private__.resetCustomOutputDestination=function(){Re=!1,Me=se};var de=c.__private__.out=function(X){return X=X.toString(),ue+=X.length+1,Me.push(X),Me},Te=c.__private__.write=function(X){return de(arguments.length===1?X.toString():Array.prototype.join.call(arguments," "))},Ae=c.__private__.getArrayBuffer=function(X){for(var fe=X.length,Ne=new ArrayBuffer(fe),Fe=new Uint8Array(Ne);fe--;)Fe[fe]=X.charCodeAt(fe);return Ne},be=[["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]];c.__private__.getStandardFonts=function(){return be};var _e=e.fontSize||16;c.__private__.setFontSize=c.setFontSize=function(X){return _e=_===w?X/ht:X,this};var xe,Le=c.__private__.getFontSize=c.getFontSize=function(){return _===b?_e:_e*ht},pe=e.R2L||!1;c.__private__.setR2L=c.setR2L=function(X){return pe=X,this},c.__private__.getR2L=c.getR2L=function(){return pe};var Ce,je=c.__private__.setZoomMode=function(X){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(X))xe=X;else if(isNaN(X)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(X)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+X+'" is not recognized.');xe=X}else xe=parseInt(X,10)};c.__private__.getZoomMode=function(){return xe};var He,st=c.__private__.setPageMode=function(X){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(X)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+X+'" is not recognized.');Ce=X};c.__private__.getPageMode=function(){return Ce};var pt=c.__private__.setLayoutMode=function(X){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(X)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+X+'" is not recognized.');He=X};c.__private__.getLayoutMode=function(){return He},c.__private__.setDisplayMode=c.setDisplayMode=function(X,fe,Ne){return je(X),pt(fe),st(Ne),this};var ct={title:"",subject:"",author:"",keywords:"",creator:""};c.__private__.getDocumentProperty=function(X){if(Object.keys(ct).indexOf(X)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return ct[X]},c.__private__.getDocumentProperties=function(){return ct},c.__private__.setDocumentProperties=c.setProperties=c.setDocumentProperties=function(X){for(var fe in ct)ct.hasOwnProperty(fe)&&X[fe]&&(ct[fe]=X[fe]);return this},c.__private__.setDocumentProperty=function(X,fe){if(Object.keys(ct).indexOf(X)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return ct[X]=fe};var bt,ht,vt,wr,cr,Pt={},$t={},$e=[],ze={},kt={},St={},er={},jt=null,vr=0,Xt=[],lr=new ww(c),Oi=e.hotfixes||[],Zn={},vi={},mn=[],Yt=function X(fe,Ne,Fe,Ge,lt,ft){if(!(this instanceof X))return new X(fe,Ne,Fe,Ge,lt,ft);isNaN(fe)&&(fe=1),isNaN(Ne)&&(Ne=0),isNaN(Fe)&&(Fe=0),isNaN(Ge)&&(Ge=1),isNaN(lt)&&(lt=0),isNaN(ft)&&(ft=0),this._matrix=[fe,Ne,Fe,Ge,lt,ft]};Object.defineProperty(Yt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(X){this._matrix[0]=X}}),Object.defineProperty(Yt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(X){this._matrix[1]=X}}),Object.defineProperty(Yt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(X){this._matrix[2]=X}}),Object.defineProperty(Yt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(X){this._matrix[3]=X}}),Object.defineProperty(Yt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(X){this._matrix[4]=X}}),Object.defineProperty(Yt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(X){this._matrix[5]=X}}),Object.defineProperty(Yt.prototype,"a",{get:function(){return this._matrix[0]},set:function(X){this._matrix[0]=X}}),Object.defineProperty(Yt.prototype,"b",{get:function(){return this._matrix[1]},set:function(X){this._matrix[1]=X}}),Object.defineProperty(Yt.prototype,"c",{get:function(){return this._matrix[2]},set:function(X){this._matrix[2]=X}}),Object.defineProperty(Yt.prototype,"d",{get:function(){return this._matrix[3]},set:function(X){this._matrix[3]=X}}),Object.defineProperty(Yt.prototype,"e",{get:function(){return this._matrix[4]},set:function(X){this._matrix[4]=X}}),Object.defineProperty(Yt.prototype,"f",{get:function(){return this._matrix[5]},set:function(X){this._matrix[5]=X}}),Object.defineProperty(Yt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Yt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Yt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Yt.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Yt.prototype.join=function(X){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(L).join(X)},Yt.prototype.multiply=function(X){var fe=X.sx*this.sx+X.shy*this.shx,Ne=X.sx*this.shy+X.shy*this.sy,Fe=X.shx*this.sx+X.sy*this.shx,Ge=X.shx*this.shy+X.sy*this.sy,lt=X.tx*this.sx+X.ty*this.shx+this.tx,ft=X.tx*this.shy+X.ty*this.sy+this.ty;return new Yt(fe,Ne,Fe,Ge,lt,ft)},Yt.prototype.decompose=function(){var X=this.sx,fe=this.shy,Ne=this.shx,Fe=this.sy,Ge=this.tx,lt=this.ty,ft=Math.sqrt(X*X+fe*fe),Lt=(X/=ft)*Ne+(fe/=ft)*Fe;Ne-=X*Lt,Fe-=fe*Lt;var Et=Math.sqrt(Ne*Ne+Fe*Fe);return Lt/=Et,X*(Fe/=Et)<fe*(Ne/=Et)&&(X=-X,fe=-fe,Lt=-Lt,ft=-ft),{scale:new Yt(ft,0,0,Et,0,0),translate:new Yt(1,0,0,1,Ge,lt),rotate:new Yt(X,fe,-fe,X,0,0),skew:new Yt(1,0,Lt,1,0,0)}},Yt.prototype.toString=function(X){return this.join(" ")},Yt.prototype.inversed=function(){var X=this.sx,fe=this.shy,Ne=this.shx,Fe=this.sy,Ge=this.tx,lt=this.ty,ft=1/(X*Fe-fe*Ne),Lt=Fe*ft,Et=-fe*ft,Ut=-Ne*ft,Rt=X*ft;return new Yt(Lt,Et,Ut,Rt,-Lt*Ge-Ut*lt,-Et*Ge-Rt*lt)},Yt.prototype.applyToPoint=function(X){var fe=X.x*this.sx+X.y*this.shx+this.tx,Ne=X.x*this.shy+X.y*this.sy+this.ty;return new yo(fe,Ne)},Yt.prototype.applyToRectangle=function(X){var fe=this.applyToPoint(X),Ne=this.applyToPoint(new yo(X.x+X.w,X.y+X.h));return new Zs(fe.x,fe.y,Ne.x-fe.x,Ne.y-fe.y)},Yt.prototype.clone=function(){var X=this.sx,fe=this.shy,Ne=this.shx,Fe=this.sy,Ge=this.tx,lt=this.ty;return new Yt(X,fe,Ne,Fe,Ge,lt)},c.Matrix=Yt;var sa=c.matrixMult=function(X,fe){return fe.multiply(X)},Ra=new Yt(1,0,0,1,0,0);c.unitMatrix=c.identityMatrix=Ra;var Un=function(X,fe){if(!kt[X]){var Ne=(fe instanceof Cf?"Sh":"P")+(Object.keys(ze).length+1).toString(10);fe.id=Ne,kt[X]=Ne,ze[Ne]=fe,lr.publish("addPattern",fe)}};c.ShadingPattern=Cf,c.TilingPattern=Eh,c.addShadingPattern=function(X,fe){return R("addShadingPattern()"),Un(X,fe),this},c.beginTilingPattern=function(X){R("beginTilingPattern()"),Jn(X.boundingBox[0],X.boundingBox[1],X.boundingBox[2]-X.boundingBox[0],X.boundingBox[3]-X.boundingBox[1],X.matrix)},c.endTilingPattern=function(X,fe){R("endTilingPattern()"),fe.stream=ye[z].join(`
447
- `),Un(X,fe),lr.publish("endTilingPattern",fe),mn.pop().restore()};var Ui,Rr=c.__private__.newObject=function(){var X=yn();return An(X,!0),X},yn=c.__private__.newObjectDeferred=function(){return W++,Q[W]=function(){return ue},W},An=function(X,fe){return fe=typeof fe=="boolean"&&fe,Q[X]=ue,fe&&de(X+" 0 obj"),X},ba=c.__private__.newAdditionalObject=function(){var X={objId:yn(),content:""};return le.push(X),X},Mo=yn(),wa=yn(),Ya=c.__private__.decodeColorString=function(X){var fe=X.split(" ");if(fe.length!==2||fe[1]!=="g"&&fe[1]!=="G")fe.length!==5||fe[4]!=="k"&&fe[4]!=="K"||(fe=[(1-fe[0])*(1-fe[3]),(1-fe[1])*(1-fe[3]),(1-fe[2])*(1-fe[3]),"r"]);else{var Ne=parseFloat(fe[0]);fe=[Ne,Ne,Ne,"r"]}for(var Fe="#",Ge=0;Ge<3;Ge++)Fe+=("0"+Math.floor(255*parseFloat(fe[Ge])).toString(16)).slice(-2);return Fe},Qn=c.__private__.encodeColorString=function(X){var fe;typeof X=="string"&&(X={ch1:X});var Ne=X.ch1,Fe=X.ch2,Ge=X.ch3,lt=X.ch4,ft=X.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof Ne=="string"&&Ne.charAt(0)!=="#"){var Lt=new y7(Ne);if(Lt.ok)Ne=Lt.toHex();else if(!/^\d*\.?\d*$/.test(Ne))throw new Error('Invalid color "'+Ne+'" passed to jsPDF.encodeColorString.')}if(typeof Ne=="string"&&/^#[0-9A-Fa-f]{3}$/.test(Ne)&&(Ne="#"+Ne[1]+Ne[1]+Ne[2]+Ne[2]+Ne[3]+Ne[3]),typeof Ne=="string"&&/^#[0-9A-Fa-f]{6}$/.test(Ne)){var Et=parseInt(Ne.substr(1),16);Ne=Et>>16&255,Fe=Et>>8&255,Ge=255&Et}if(Fe===void 0||lt===void 0&&Ne===Fe&&Fe===Ge)fe=typeof Ne=="string"?Ne+" "+ft[0]:X.precision===2?k(Ne/255)+" "+ft[0]:C(Ne/255)+" "+ft[0];else if(lt===void 0||Sn(lt)==="object"){if(lt&&!isNaN(lt.a)&&lt.a===0)return["1.","1.","1.",ft[1]].join(" ");fe=typeof Ne=="string"?[Ne,Fe,Ge,ft[1]].join(" "):X.precision===2?[k(Ne/255),k(Fe/255),k(Ge/255),ft[1]].join(" "):[C(Ne/255),C(Fe/255),C(Ge/255),ft[1]].join(" ")}else fe=typeof Ne=="string"?[Ne,Fe,Ge,lt,ft[2]].join(" "):X.precision===2?[k(Ne),k(Fe),k(Ge),k(lt),ft[2]].join(" "):[C(Ne),C(Fe),C(Ge),C(lt),ft[2]].join(" ");return fe},_a=c.__private__.getFilters=function(){return l},xa=c.__private__.putStream=function(X){var fe=(X=X||{}).data||"",Ne=X.filters||_a(),Fe=X.alreadyAppliedFilters||[],Ge=X.addLength1||!1,lt=fe.length,ft=X.objectId,Lt=function(ti){return ti};if(f!==null&&ft===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");f!==null&&(Lt=qn.encryptor(ft,0));var Et={};Ne===!0&&(Ne=["FlateEncode"]);var Ut=X.additionalKeyValues||[],Rt=(Et=Kt.API.processDataByFilters!==void 0?Kt.API.processDataByFilters(fe,Ne):{data:fe,reverseChain:[]}).reverseChain+(Array.isArray(Fe)?Fe.join(" "):Fe.toString());if(Et.data.length!==0&&(Ut.push({key:"Length",value:Et.data.length}),Ge===!0&&Ut.push({key:"Length1",value:lt})),Rt.length!=0)if(Rt.split("/").length-1==1)Ut.push({key:"Filter",value:Rt});else{Ut.push({key:"Filter",value:"["+Rt+"]"});for(var Pr=0;Pr<Ut.length;Pr+=1)if(Ut[Pr].key==="DecodeParms"){for(var Mr=[],ei=0;ei<Et.reverseChain.split("/").length-1;ei+=1)Mr.push("null");Mr.push(Ut[Pr].value),Ut[Pr].value="["+Mr.join(" ")+"]"}}de("<<");for(var Hr=0;Hr<Ut.length;Hr++)de("/"+Ut[Hr].key+" "+Ut[Hr].value);de(">>"),Et.data.length!==0&&(de("stream"),de(Lt(Et.data)),de("endstream"))},Io=c.__private__.putPage=function(X){var fe=X.number,Ne=X.data,Fe=X.objId,Ge=X.contentsObjId;An(Fe,!0),de("<</Type /Page"),de("/Parent "+X.rootDictionaryObjId+" 0 R"),de("/Resources "+X.resourceDictionaryObjId+" 0 R"),de("/MediaBox ["+parseFloat(L(X.mediaBox.bottomLeftX))+" "+parseFloat(L(X.mediaBox.bottomLeftY))+" "+L(X.mediaBox.topRightX)+" "+L(X.mediaBox.topRightY)+"]"),X.cropBox!==null&&de("/CropBox ["+L(X.cropBox.bottomLeftX)+" "+L(X.cropBox.bottomLeftY)+" "+L(X.cropBox.topRightX)+" "+L(X.cropBox.topRightY)+"]"),X.bleedBox!==null&&de("/BleedBox ["+L(X.bleedBox.bottomLeftX)+" "+L(X.bleedBox.bottomLeftY)+" "+L(X.bleedBox.topRightX)+" "+L(X.bleedBox.topRightY)+"]"),X.trimBox!==null&&de("/TrimBox ["+L(X.trimBox.bottomLeftX)+" "+L(X.trimBox.bottomLeftY)+" "+L(X.trimBox.topRightX)+" "+L(X.trimBox.topRightY)+"]"),X.artBox!==null&&de("/ArtBox ["+L(X.artBox.bottomLeftX)+" "+L(X.artBox.bottomLeftY)+" "+L(X.artBox.topRightX)+" "+L(X.artBox.topRightY)+"]"),typeof X.userUnit=="number"&&X.userUnit!==1&&de("/UserUnit "+X.userUnit),lr.publish("putPage",{objId:Fe,pageContext:Xt[fe],pageNumber:fe,page:Ne}),de("/Contents "+Ge+" 0 R"),de(">>"),de("endobj");var lt=Ne.join(`
448
- `);return _===w&&(lt+=`
449
- Q`),An(Ge,!0),xa({data:lt,filters:_a(),objectId:Ge}),de("endobj"),Fe},Ci=c.__private__.putPages=function(){var X,fe,Ne=[];for(X=1;X<=vr;X++)Xt[X].objId=yn(),Xt[X].contentsObjId=yn();for(X=1;X<=vr;X++)Ne.push(Io({number:X,data:ye[X],objId:Xt[X].objId,contentsObjId:Xt[X].contentsObjId,mediaBox:Xt[X].mediaBox,cropBox:Xt[X].cropBox,bleedBox:Xt[X].bleedBox,trimBox:Xt[X].trimBox,artBox:Xt[X].artBox,userUnit:Xt[X].userUnit,rootDictionaryObjId:Mo,resourceDictionaryObjId:wa}));An(Mo,!0),de("<</Type /Pages");var Fe="/Kids [";for(fe=0;fe<vr;fe++)Fe+=Ne[fe]+" 0 R ";de(Fe+"]"),de("/Count "+vr),de(">>"),de("endobj"),lr.publish("postPutPages")},Xa=function(X){lr.publish("putFont",{font:X,out:de,newObject:Rr,putStream:xa}),X.isAlreadyPutted!==!0&&(X.objectNumber=Rr(),de("<<"),de("/Type /Font"),de("/BaseFont /"+bh(X.postScriptName)),de("/Subtype /Type1"),typeof X.encoding=="string"&&de("/Encoding /"+X.encoding),de("/FirstChar 32"),de("/LastChar 255"),de(">>"),de("endobj"))},Ps=function(X){X.objectNumber=Rr();var fe=[];fe.push({key:"Type",value:"/XObject"}),fe.push({key:"Subtype",value:"/Form"}),fe.push({key:"BBox",value:"["+[L(X.x),L(X.y),L(X.x+X.width),L(X.y+X.height)].join(" ")+"]"}),fe.push({key:"Matrix",value:"["+X.matrix.toString()+"]"});var Ne=X.pages[1].join(`
450
- `);xa({data:Ne,additionalKeyValues:fe,objectId:X.objectNumber}),de("endobj")},Ko=function(X,fe){fe||(fe=21);var Ne=Rr(),Fe=function(ft,Lt){var Et,Ut=[],Rt=1/(Lt-1);for(Et=0;Et<1;Et+=Rt)Ut.push(Et);if(Ut.push(1),ft[0].offset!=0){var Pr={offset:0,color:ft[0].color};ft.unshift(Pr)}if(ft[ft.length-1].offset!=1){var Mr={offset:1,color:ft[ft.length-1].color};ft.push(Mr)}for(var ei="",Hr=0,ti=0;ti<Ut.length;ti++){for(Et=Ut[ti];Et>ft[Hr+1].offset;)Hr++;var Hn=ft[Hr].offset,Ni=(Et-Hn)/(ft[Hr+1].offset-Hn),bo=ft[Hr].color,Cs=ft[Hr+1].color;ei+=re(Math.round((1-Ni)*bo[0]+Ni*Cs[0]).toString(16))+re(Math.round((1-Ni)*bo[1]+Ni*Cs[1]).toString(16))+re(Math.round((1-Ni)*bo[2]+Ni*Cs[2]).toString(16))}return ei.trim()}(X.colors,fe),Ge=[];Ge.push({key:"FunctionType",value:"0"}),Ge.push({key:"Domain",value:"[0.0 1.0]"}),Ge.push({key:"Size",value:"["+fe+"]"}),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]"}),xa({data:Fe,additionalKeyValues:Ge,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:Ne}),de("endobj"),X.objectNumber=Rr(),de("<< /ShadingType "+X.type),de("/ColorSpace /DeviceRGB");var lt="/Coords ["+L(parseFloat(X.coords[0]))+" "+L(parseFloat(X.coords[1]))+" ";X.type===2?lt+=L(parseFloat(X.coords[2]))+" "+L(parseFloat(X.coords[3])):lt+=L(parseFloat(X.coords[2]))+" "+L(parseFloat(X.coords[3]))+" "+L(parseFloat(X.coords[4]))+" "+L(parseFloat(X.coords[5])),de(lt+="]"),X.matrix&&de("/Matrix ["+X.matrix.toString()+"]"),de("/Function "+Ne+" 0 R"),de("/Extend [true true]"),de(">>"),de("endobj")},Vl=function(X,fe){var Ne=yn(),Fe=Rr();fe.push({resourcesOid:Ne,objectOid:Fe}),X.objectNumber=Fe;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:"["+X.boundingBox.map(L).join(" ")+"]"}),Ge.push({key:"XStep",value:L(X.xStep)}),Ge.push({key:"YStep",value:L(X.yStep)}),Ge.push({key:"Resources",value:Ne+" 0 R"}),X.matrix&&Ge.push({key:"Matrix",value:"["+X.matrix.toString()+"]"}),xa({data:X.stream,additionalKeyValues:Ge,objectId:X.objectNumber}),de("endobj")},cf=function(X){for(var fe in X.objectNumber=Rr(),de("<<"),X)switch(fe){case"opacity":de("/ca "+k(X[fe]));break;case"stroke-opacity":de("/CA "+k(X[fe]))}de(">>"),de("endobj")},bn=function(X){An(X.resourcesOid,!0),de("<<"),de("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var fe in de("/Font <<"),Pt)Pt.hasOwnProperty(fe)&&(v===!1||v===!0&&g.hasOwnProperty(fe))&&de("/"+fe+" "+Pt[fe].objectNumber+" 0 R");de(">>")}(),function(){if(Object.keys(ze).length>0){for(var fe in de("/Shading <<"),ze)ze.hasOwnProperty(fe)&&ze[fe]instanceof Cf&&ze[fe].objectNumber>=0&&de("/"+fe+" "+ze[fe].objectNumber+" 0 R");lr.publish("putShadingPatternDict"),de(">>")}}(),function(fe){if(Object.keys(ze).length>0){for(var Ne in de("/Pattern <<"),ze)ze.hasOwnProperty(Ne)&&ze[Ne]instanceof c.TilingPattern&&ze[Ne].objectNumber>=0&&ze[Ne].objectNumber<fe&&de("/"+Ne+" "+ze[Ne].objectNumber+" 0 R");lr.publish("putTilingPatternDict"),de(">>")}}(X.objectOid),function(){if(Object.keys(St).length>0){var fe;for(fe in de("/ExtGState <<"),St)St.hasOwnProperty(fe)&&St[fe].objectNumber>=0&&de("/"+fe+" "+St[fe].objectNumber+" 0 R");lr.publish("putGStateDict"),de(">>")}}(),function(){for(var fe in de("/XObject <<"),Zn)Zn.hasOwnProperty(fe)&&Zn[fe].objectNumber>=0&&de("/"+fe+" "+Zn[fe].objectNumber+" 0 R");lr.publish("putXobjectDict"),de(">>")}(),de(">>"),de("endobj")},Gl=function(X){$t[X.fontName]=$t[X.fontName]||{},$t[X.fontName][X.fontStyle]=X.id},Zo=function(X,fe,Ne,Fe,Ge){var lt={id:"F"+(Object.keys(Pt).length+1).toString(10),postScriptName:X,fontName:fe,fontStyle:Ne,encoding:Fe,isStandardFont:Ge||!1,metadata:{}};return lr.publish("addFont",{font:lt,instance:this}),Pt[lt.id]=lt,Gl(lt),lt.id},Sa=c.__private__.pdfEscape=c.pdfEscape=function(X,fe){return function(Ne,Fe){var Ge,lt,ft,Lt,Et,Ut,Rt,Pr,Mr;if(ft=(Fe=Fe||{}).sourceEncoding||"Unicode",Et=Fe.outputEncoding,(Fe.autoencode||Et)&&Pt[bt].metadata&&Pt[bt].metadata[ft]&&Pt[bt].metadata[ft].encoding&&(Lt=Pt[bt].metadata[ft].encoding,!Et&&Pt[bt].encoding&&(Et=Pt[bt].encoding),!Et&&Lt.codePages&&(Et=Lt.codePages[0]),typeof Et=="string"&&(Et=Lt[Et]),Et)){for(Rt=!1,Ut=[],Ge=0,lt=Ne.length;Ge<lt;Ge++)(Pr=Et[Ne.charCodeAt(Ge)])?Ut.push(String.fromCharCode(Pr)):Ut.push(Ne[Ge]),Ut[Ge].charCodeAt(0)>>8&&(Rt=!0);Ne=Ut.join("")}for(Ge=Ne.length;Rt===void 0&&Ge!==0;)Ne.charCodeAt(Ge-1)>>8&&(Rt=!0),Ge--;if(!Rt)return Ne;for(Ut=Fe.noBOM?[]:[254,255],Ge=0,lt=Ne.length;Ge<lt;Ge++){if((Mr=(Pr=Ne.charCodeAt(Ge))>>8)>>8)throw new Error("Character at position "+Ge+" of string '"+Ne+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");Ut.push(Mr),Ut.push(Pr-(Mr<<8))}return String.fromCharCode.apply(void 0,Ut)}(X,fe).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Qo=c.__private__.beginPage=function(X){ye[++vr]=[],Xt[vr]={objId:0,contentsObjId:0,userUnit:Number(o),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(X[0]),topRightY:Number(X[1])}},po(vr),Pe(ye[z])},cc=function(X,fe){var Ne,Fe,Ge;switch(r=fe||r,typeof X=="string"&&(Ne=S(X.toLowerCase()),Array.isArray(Ne)&&(Fe=Ne[0],Ge=Ne[1])),Array.isArray(X)&&(Fe=X[0]*ht,Ge=X[1]*ht),isNaN(Fe)&&(Fe=i[0],Ge=i[1]),(Fe>14400||Ge>14400)&&(zn.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),Fe=Math.min(14400,Fe),Ge=Math.min(14400,Ge)),i=[Fe,Ge],r.substr(0,1)){case"l":Ge>Fe&&(i=[Ge,Fe]);break;case"p":Fe>Ge&&(i=[Ge,Fe])}Qo(i),Ks(Fa),de(ks),Aa!==0&&de(Aa+" J"),Ja!==0&&de(Ja+" j"),lr.publish("addPage",{pageNumber:vr})},$s=function(X){X>0&&X<=vr&&(ye.splice(X,1),Xt.splice(X,1),vr--,z>vr&&(z=vr),this.setPage(z))},po=function(X){X>0&&X<=vr&&(z=X)},oi=c.__private__.getNumberOfPages=c.getNumberOfPages=function(){return ye.length-1},an=function(X,fe,Ne){var Fe,Ge=void 0;return Ne=Ne||{},X=X!==void 0?X:Pt[bt].fontName,fe=fe!==void 0?fe:Pt[bt].fontStyle,Fe=X.toLowerCase(),$t[Fe]!==void 0&&$t[Fe][fe]!==void 0?Ge=$t[Fe][fe]:$t[X]!==void 0&&$t[X][fe]!==void 0?Ge=$t[X][fe]:Ne.disableWarning===!1&&zn.warn("Unable to look up font label for font '"+X+"', '"+fe+"'. Refer to getFontList() for available fonts."),Ge||Ne.noFallback||(Ge=$t.times[fe])==null&&(Ge=$t.times.normal),Ge},mr=c.__private__.putInfo=function(){var X=Rr(),fe=function(Fe){return Fe};for(var Ne in f!==null&&(fe=qn.encryptor(X,0)),de("<<"),de("/Producer ("+Sa(fe("jsPDF "+Kt.version))+")"),ct)ct.hasOwnProperty(Ne)&&ct[Ne]&&de("/"+Ne.substr(0,1).toUpperCase()+Ne.substr(1)+" ("+Sa(fe(ct[Ne]))+")");de("/CreationDate ("+Sa(fe(J))+")"),de(">>"),de("endobj")},Jo=c.__private__.putCatalog=function(X){var fe=(X=X||{}).rootDictionaryObjId||Mo;switch(Rr(),de("<<"),de("/Type /Catalog"),de("/Pages "+fe+" 0 R"),xe||(xe="fullwidth"),xe){case"fullwidth":de("/OpenAction [3 0 R /FitH null]");break;case"fullheight":de("/OpenAction [3 0 R /FitV null]");break;case"fullpage":de("/OpenAction [3 0 R /Fit]");break;case"original":de("/OpenAction [3 0 R /XYZ null null 1]");break;default:var Ne=""+xe;Ne.substr(Ne.length-1)==="%"&&(xe=parseInt(xe)/100),typeof xe=="number"&&de("/OpenAction [3 0 R /XYZ null null "+k(xe)+"]")}switch(He||(He="continuous"),He){case"continuous":de("/PageLayout /OneColumn");break;case"single":de("/PageLayout /SinglePage");break;case"two":case"twoleft":de("/PageLayout /TwoColumnLeft");break;case"tworight":de("/PageLayout /TwoColumnRight")}Ce&&de("/PageMode /"+Ce),lr.publish("putCatalog"),de(">>"),de("endobj")},Er=c.__private__.putTrailer=function(){de("trailer"),de("<<"),de("/Size "+(W+1)),de("/Root "+W+" 0 R"),de("/Info "+(W-1)+" 0 R"),f!==null&&de("/Encrypt "+qn.oid+" 0 R"),de("/ID [ <"+ae+"> <"+ae+"> ]"),de(">>")},qi=c.__private__.putHeader=function(){de("%PDF-"+y),de("%ºß¬à")},Ka=c.__private__.putXRef=function(){var X="0000000000";de("xref"),de("0 "+(W+1)),de("0000000000 65535 f ");for(var fe=1;fe<=W;fe++)typeof Q[fe]=="function"?de((X+Q[fe]()).slice(-10)+" 00000 n "):Q[fe]!==void 0?de((X+Q[fe]).slice(-10)+" 00000 n "):de("0000000000 00000 n ")},Hi=c.__private__.buildDocument=function(){var X;W=0,ue=0,se=[],Q=[],le=[],Mo=yn(),wa=yn(),Pe(se),lr.publish("buildDocument"),qi(),Ci(),function(){lr.publish("putAdditionalObjects");for(var Ne=0;Ne<le.length;Ne++){var Fe=le[Ne];An(Fe.objId,!0),de(Fe.content),de("endobj")}lr.publish("postPutAdditionalObjects")}(),X=[],function(){for(var Ne in Pt)Pt.hasOwnProperty(Ne)&&(v===!1||v===!0&&g.hasOwnProperty(Ne))&&Xa(Pt[Ne])}(),function(){var Ne;for(Ne in St)St.hasOwnProperty(Ne)&&cf(St[Ne])}(),function(){for(var Ne in Zn)Zn.hasOwnProperty(Ne)&&Ps(Zn[Ne])}(),function(Ne){var Fe;for(Fe in ze)ze.hasOwnProperty(Fe)&&(ze[Fe]instanceof Cf?Ko(ze[Fe]):ze[Fe]instanceof Eh&&Vl(ze[Fe],Ne))}(X),lr.publish("putResources"),X.forEach(bn),bn({resourcesOid:wa,objectOid:Number.MAX_SAFE_INTEGER}),lr.publish("postPutResources"),f!==null&&(qn.oid=Rr(),de("<<"),de("/Filter /Standard"),de("/V "+qn.v),de("/R "+qn.r),de("/U <"+qn.toHexString(qn.U)+">"),de("/O <"+qn.toHexString(qn.O)+">"),de("/P "+qn.P),de(">>"),de("endobj")),mr(),Jo();var fe=ue;return Ka(),Er(),de("startxref"),de(""+fe),de("%%EOF"),Pe(ye[z]),se.join(`
451
- `)},Pn=c.__private__.getBlob=function(X){return new Blob([Ae(X)],{type:"application/pdf"})},Vi=c.output=c.__private__.output=(Ui=function(X,fe){switch(typeof(fe=fe||{})=="string"?fe={filename:fe}:fe.filename=fe.filename||"generated.pdf",X){case void 0:return Hi();case"save":c.save(fe.filename);break;case"arraybuffer":return Ae(Hi());case"blob":return Pn(Hi());case"bloburi":case"bloburl":if(dr.URL!==void 0&&typeof dr.URL.createObjectURL=="function")return dr.URL&&dr.URL.createObjectURL(Pn(Hi()))||void 0;zn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var Ne="",Fe=Hi();try{Ne=mw(Fe)}catch{Ne=mw(unescape(encodeURIComponent(Fe)))}return"data:application/pdf;filename="+fe.filename+";base64,"+Ne;case"pdfobjectnewwindow":if(Object.prototype.toString.call(dr)==="[object Window]"){var Ge="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",lt=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';fe.pdfObjectUrl&&(Ge=fe.pdfObjectUrl,lt="");var ft='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+Ge+'"'+lt+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(fe)+");<\/script></body></html>",Lt=dr.open();return Lt!==null&&Lt.document.write(ft),Lt}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(dr)==="[object Window]"){var Et='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(fe.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+fe.filename+'" width="500px" height="400px" /></body></html>',Ut=dr.open();if(Ut!==null){Ut.document.write(Et);var Rt=this;Ut.document.documentElement.querySelector("#pdfViewer").onload=function(){Ut.document.title=fe.filename,Ut.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(Rt.output("bloburl"))}}return Ut}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(dr)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Pr='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",fe)+'"></iframe></body></html>',Mr=dr.open();if(Mr!==null&&(Mr.document.write(Pr),Mr.document.title=fe.filename),Mr||typeof safari>"u")return Mr;break;case"datauri":case"dataurl":return dr.document.location.href=this.output("datauristring",fe);default:return null}},Ui.foo=function(){try{return Ui.apply(this,arguments)}catch(Ne){var X=Ne.stack||"";~X.indexOf(" at ")&&(X=X.split(" at ")[1]);var fe="Error in function "+X.split(`
452
- `)[0].split("<")[0]+": "+Ne.message;if(!dr.console)throw new Error(fe);dr.console.error(fe,Ne),dr.alert&&alert(fe)}},Ui.foo.bar=Ui,Ui.foo),Ws=function(X){return Array.isArray(Oi)===!0&&Oi.indexOf(X)>-1};switch(n){case"pt":ht=1;break;case"mm":ht=72/25.4;break;case"cm":ht=72/2.54;break;case"in":ht=72;break;case"px":ht=Ws("px_scaling")==1?.75:96/72;break;case"pc":case"em":ht=12;break;case"ex":ht=6;break;default:if(typeof n!="number")throw new Error("Invalid unit: "+n);ht=n}var qn=null;D(),V();var es=c.__private__.getPageInfo=c.getPageInfo=function(X){if(isNaN(X)||X%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Xt[X].objId,pageNumber:X,pageContext:Xt[X]}},Ru=c.__private__.getPageInfoByObjId=function(X){if(isNaN(X)||X%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var fe in Xt)if(Xt[fe].objId===X)break;return es(fe)},Ea=c.__private__.getCurrentPageInfo=c.getCurrentPageInfo=function(){return{objId:Xt[z].objId,pageNumber:z,pageContext:Xt[z]}};c.addPage=function(){return cc.apply(this,arguments),this},c.setPage=function(){return po.apply(this,arguments),Pe.call(this,ye[z]),this},c.insertPage=function(X){return this.addPage(),this.movePage(z,X),this},c.movePage=function(X,fe){var Ne,Fe;if(X>fe){Ne=ye[X],Fe=Xt[X];for(var Ge=X;Ge>fe;Ge--)ye[Ge]=ye[Ge-1],Xt[Ge]=Xt[Ge-1];ye[fe]=Ne,Xt[fe]=Fe,this.setPage(fe)}else if(X<fe){Ne=ye[X],Fe=Xt[X];for(var lt=X;lt<fe;lt++)ye[lt]=ye[lt+1],Xt[lt]=Xt[lt+1];ye[fe]=Ne,Xt[fe]=Fe,this.setPage(fe)}return this},c.deletePage=function(){return $s.apply(this,arguments),this},c.__private__.text=c.text=function(X,fe,Ne,Fe,Ge){var lt,ft,Lt,Et,Ut,Rt,Pr,Mr,ei,Hr=(Fe=Fe||{}).scope||this;if(typeof X=="number"&&typeof fe=="number"&&(typeof Ne=="string"||Array.isArray(Ne))){var ti=Ne;Ne=fe,fe=X,X=ti}if(arguments[3]instanceof Yt==0?(Lt=arguments[4],Et=arguments[5],Sn(Pr=arguments[3])==="object"&&Pr!==null||(typeof Lt=="string"&&(Et=Lt,Lt=null),typeof Pr=="string"&&(Et=Pr,Pr=null),typeof Pr=="number"&&(Lt=Pr,Pr=null),Fe={flags:Pr,angle:Lt,align:Et})):(R("The transform parameter of text() with a Matrix value"),ei=Ge),isNaN(fe)||isNaN(Ne)||X==null)throw new Error("Invalid arguments passed to jsPDF.text");if(X.length===0)return Hr;var Hn,Ni="",bo=typeof Fe.lineHeightFactor=="number"?Fe.lineHeightFactor:Ia,Cs=Hr.internal.scaleFactor;function Ns(tr){return tr=tr.split(" ").join(Array(Fe.TabLen||9).join(" ")),Sa(tr,Pr)}function Kl(tr){for(var en,Ln=tr.concat(),Tn=[],Gn=Ln.length;Gn--;)typeof(en=Ln.shift())=="string"?Tn.push(en):Array.isArray(tr)&&(en.length===1||en[1]===void 0&&en[2]===void 0)?Tn.push(en[0]):Tn.push([en[0],en[1],en[2]]);return Tn}function pl(tr,en){var Ln;if(typeof tr=="string")Ln=en(tr)[0];else if(Array.isArray(tr)){for(var Tn,Gn,Eo=tr.concat(),Xi=[],on=Eo.length;on--;)typeof(Tn=Eo.shift())=="string"?Xi.push(en(Tn)[0]):Array.isArray(Tn)&&typeof Tn[0]=="string"&&(Gn=en(Tn[0],Tn[1],Tn[2]),Xi.push([Gn[0],Gn[1],Gn[2]]));Ln=Xi}return Ln}var Ba=!1,Iu=!0;if(typeof X=="string")Ba=!0;else if(Array.isArray(X)){var wo=X.concat();ft=[];for(var jo,bi=wo.length;bi--;)(typeof(jo=wo.shift())!="string"||Array.isArray(jo)&&typeof jo[0]!="string")&&(Iu=!1);Ba=Iu}if(Ba===!1)throw new Error('Type of text must be string or Array. "'+X+'" is not recognized.');typeof X=="string"&&(X=X.match(/[\r?\n]/)?X.split(/\r\n|\r|\n/g):[X]);var is=_e/Hr.internal.scaleFactor,Pa=is*(bo-1);switch(Fe.baseline){case"bottom":Ne-=Pa;break;case"top":Ne+=is-Pa;break;case"hanging":Ne+=is-2*Pa;break;case"middle":Ne+=is/2-Pa}if((Rt=Fe.maxWidth||0)>0&&(typeof X=="string"?X=Hr.splitTextToSize(X,Rt):Object.prototype.toString.call(X)==="[object Array]"&&(X=X.reduce(function(tr,en){return tr.concat(Hr.splitTextToSize(en,Rt))},[]))),lt={text:X,x:fe,y:Ne,options:Fe,mutex:{pdfEscape:Sa,activeFontKey:bt,fonts:Pt,activeFontSize:_e}},lr.publish("preProcessText",lt),X=lt.text,Lt=(Fe=lt.options).angle,ei instanceof Yt==0&&Lt&&typeof Lt=="number"){Lt*=Math.PI/180,Fe.rotationDirection===0&&(Lt=-Lt),_===w&&(Lt=-Lt);var gl=Math.cos(Lt),Qs=Math.sin(Lt);ei=new Yt(gl,Qs,-Qs,gl,0,0)}else Lt&&Lt instanceof Yt&&(ei=Lt);_!==w||ei||(ei=Ra),(Ut=Fe.charSpace||Fo)!==void 0&&(Ni+=L(q(Ut))+` Tc
453
- `,this.setCharSpace(this.getCharSpace()||0)),(Mr=Fe.horizontalScale)!==void 0&&(Ni+=L(100*Mr)+` Tz
454
- `),Fe.lang;var Li=-1,Ls=Fe.renderingMode!==void 0?Fe.renderingMode:Fe.stroke,Js=Hr.internal.getCurrentPageInfo().pageContext;switch(Ls){case 0:case!1:case"fill":Li=0;break;case 1:case!0:case"stroke":Li=1;break;case 2:case"fillThenStroke":Li=2;break;case 3:case"invisible":Li=3;break;case 4:case"fillAndAddForClipping":Li=4;break;case 5:case"strokeAndAddPathForClipping":Li=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":Li=6;break;case 7:case"addToPathForClipping":Li=7}var Zl=Js.usedRenderingMode!==void 0?Js.usedRenderingMode:-1;Li!==-1?Ni+=Li+` Tr
455
- `:Zl!==-1&&(Ni+=`0 Tr
456
- `),Li!==-1&&(Js.usedRenderingMode=Li),Et=Fe.align||"left";var si,la=_e*bo,Do=Hr.internal.pageSize.getWidth(),as=Pt[bt];Ut=Fe.charSpace||Fo,Rt=Fe.maxWidth||0,Pr=Object.assign({autoencode:!0,noBOM:!0},Fe.flags);var li=[],to=function(tr){return Hr.getStringUnitWidth(tr,{font:as,charSpace:Ut,fontSize:_e,doKerning:!1})*_e/Cs};if(Object.prototype.toString.call(X)==="[object Array]"){var Gi;ft=Kl(X),Et!=="left"&&(si=ft.map(to));var ua,$i=0;if(Et==="right"){fe-=si[0],X=[],bi=ft.length;for(var Vn=0;Vn<bi;Vn++)Vn===0?(ua=Qa(fe),Gi=pn(Ne)):(ua=q($i-si[Vn]),Gi=-la),X.push([ft[Vn],ua,Gi]),$i=si[Vn]}else if(Et==="center"){fe-=si[0]/2,X=[],bi=ft.length;for(var os=0;os<bi;os++)os===0?(ua=Qa(fe),Gi=pn(Ne)):(ua=q(($i-si[os])/2),Gi=-la),X.push([ft[os],ua,Gi]),$i=si[os]}else if(Et==="left"){X=[],bi=ft.length;for(var Ql=0;Ql<bi;Ql++)X.push(ft[Ql])}else if(Et==="justify"&&as.encoding==="Identity-H"){X=[],bi=ft.length,Rt=Rt!==0?Rt:Do;for(var ca=0,Jr=0;Jr<bi;Jr++)if(Gi=Jr===0?pn(Ne):-la,ua=Jr===0?Qa(fe):ca,Jr<bi-1){var vl=q((Rt-si[Jr])/(ft[Jr].split(" ").length-1)),ka=ft[Jr].split(" ");X.push([ka[0]+" ",ua,Gi]),ca=0;for(var Wi=1;Wi<ka.length;Wi++){var ml=(to(ka[Wi-1]+" "+ka[Wi])-to(ka[Wi]))*Cs+vl;Wi==ka.length-1?X.push([ka[Wi],ml,0]):X.push([ka[Wi]+" ",ml,0]),ca-=ml}}else X.push([ft[Jr],ua,Gi]);X.push(["",ca,0])}else{if(Et!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(X=[],bi=ft.length,Rt=Rt!==0?Rt:Do,Jr=0;Jr<bi;Jr++)Gi=Jr===0?pn(Ne):-la,ua=Jr===0?Qa(fe):0,Jr<bi-1?li.push(L(q((Rt-si[Jr])/(ft[Jr].split(" ").length-1)))):li.push(0),X.push([ft[Jr],ua,Gi])}}(typeof Fe.R2L=="boolean"?Fe.R2L:pe)===!0&&(X=pl(X,function(tr,en,Ln){return[tr.split("").reverse().join(""),en,Ln]})),lt={text:X,x:fe,y:Ne,options:Fe,mutex:{pdfEscape:Sa,activeFontKey:bt,fonts:Pt,activeFontSize:_e}},lr.publish("postProcessText",lt),X=lt.text,Hn=lt.mutex.isHex||!1;var _o=Pt[bt].encoding;_o!=="WinAnsiEncoding"&&_o!=="StandardEncoding"||(X=pl(X,function(tr,en,Ln){return[Ns(tr),en,Ln]})),ft=Kl(X),X=[];for(var Yi,Bo,za,Ti=Array.isArray(ft[0])?1:0,xo="",zo=function(tr,en,Ln){var Tn="";return Ln instanceof Yt?(Ln=typeof Fe.angle=="number"?sa(Ln,new Yt(1,0,0,1,tr,en)):sa(new Yt(1,0,0,1,tr,en),Ln),_===w&&(Ln=sa(new Yt(1,0,0,-1,0,0),Ln)),Tn=Ln.join(" ")+` Tm
457
- `):Tn=L(tr)+" "+L(en)+` Td
458
- `,Tn},Oa=0;Oa<ft.length;Oa++){switch(xo="",Ti){case 1:za=(Hn?"<":"(")+ft[Oa][0]+(Hn?">":")"),Yi=parseFloat(ft[Oa][1]),Bo=parseFloat(ft[Oa][2]);break;case 0:za=(Hn?"<":"(")+ft[Oa]+(Hn?">":")"),Yi=Qa(fe),Bo=pn(Ne)}li!==void 0&&li[Oa]!==void 0&&(xo=li[Oa]+` Tw
459
- `),Oa===0?X.push(xo+zo(Yi,Bo,ei)+za):Ti===0?X.push(xo+za):Ti===1&&X.push(xo+zo(Yi,Bo,ei)+za)}X=Ti===0?X.join(` Tj
460
- T* `):X.join(` Tj
461
- `),X+=` Tj
462
- `;var So=`BT
463
- /`;return So+=bt+" "+_e+` Tf
464
- `,So+=L(_e*bo)+` TL
465
- `,So+=ja+`
466
- `,So+=Ni,So+=X,de(So+="ET"),g[bt]=!0,Hr};var hl=c.__private__.clip=c.clip=function(X){return de(X==="evenodd"?"W*":"W"),this};c.clipEvenOdd=function(){return hl("evenodd")},c.__private__.discardPath=c.discardPath=function(){return de("n"),this};var ts=c.__private__.isValidStyle=function(X){var fe=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(X)!==-1&&(fe=!0),fe};c.__private__.setDefaultPathOperation=c.setDefaultPathOperation=function(X){return ts(X)&&(d=X),this};var $l=c.__private__.getStyle=c.getStyle=function(X){var fe=d;switch(X){case"D":case"S":fe="S";break;case"F":fe="f";break;case"FD":case"DF":fe="B";break;case"f":case"f*":case"B":case"B*":fe=X}return fe},Ar=c.close=function(){return de("h"),this};c.stroke=function(){return de("S"),this},c.fill=function(X){return go("f",X),this},c.fillEvenOdd=function(X){return go("f*",X),this},c.fillStroke=function(X){return go("B",X),this},c.fillStrokeEvenOdd=function(X){return go("B*",X),this};var go=function(X,fe){Sn(fe)==="object"?fc(fe,X):de(X)},rs=function(X){X===null||_===w&&X===void 0||(X=$l(X),de(X))};function Ys(X,fe,Ne,Fe,Ge){var lt=new Eh(fe||this.boundingBox,Ne||this.xStep,Fe||this.yStep,this.gState,Ge||this.matrix);lt.stream=this.stream;var ft=X+"$$"+this.cloneIndex+++"$$";return Un(ft,lt),lt}var fc=function(X,fe){var Ne=kt[X.key],Fe=ze[Ne];if(Fe instanceof Cf)de("q"),de(hc(fe)),Fe.gState&&c.setGState(Fe.gState),de(X.matrix.toString()+" cm"),de("/"+Ne+" sh"),de("Q");else if(Fe instanceof Eh){var Ge=new Yt(1,0,0,-1,0,yi());X.matrix&&(Ge=Ge.multiply(X.matrix||Ra),Ne=Ys.call(Fe,X.key,X.boundingBox,X.xStep,X.yStep,Ge).id),de("q"),de("/Pattern cs"),de("/"+Ne+" scn"),Fe.gState&&c.setGState(Fe.gState),de(fe),de("Q")}},hc=function(X){switch(X){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"}},Xs=c.moveTo=function(X,fe){return de(L(q(X))+" "+L(G(fe))+" m"),this},ns=c.lineTo=function(X,fe){return de(L(q(X))+" "+L(G(fe))+" l"),this},Za=c.curveTo=function(X,fe,Ne,Fe,Ge,lt){return de([L(q(X)),L(G(fe)),L(q(Ne)),L(G(Fe)),L(q(Ge)),L(G(lt)),"c"].join(" ")),this};c.__private__.line=c.line=function(X,fe,Ne,Fe,Ge){if(isNaN(X)||isNaN(fe)||isNaN(Ne)||isNaN(Fe)||!ts(Ge))throw new Error("Invalid arguments passed to jsPDF.line");return _===b?this.lines([[Ne-X,Fe-fe]],X,fe,[1,1],Ge||"S"):this.lines([[Ne-X,Fe-fe]],X,fe,[1,1]).stroke()},c.__private__.lines=c.lines=function(X,fe,Ne,Fe,Ge,lt){var ft,Lt,Et,Ut,Rt,Pr,Mr,ei,Hr,ti,Hn,Ni;if(typeof X=="number"&&(Ni=Ne,Ne=fe,fe=X,X=Ni),Fe=Fe||[1,1],lt=lt||!1,isNaN(fe)||isNaN(Ne)||!Array.isArray(X)||!Array.isArray(Fe)||!ts(Ge)||typeof lt!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(Xs(fe,Ne),ft=Fe[0],Lt=Fe[1],Ut=X.length,ti=fe,Hn=Ne,Et=0;Et<Ut;Et++)(Rt=X[Et]).length===2?(ti=Rt[0]*ft+ti,Hn=Rt[1]*Lt+Hn,ns(ti,Hn)):(Pr=Rt[0]*ft+ti,Mr=Rt[1]*Lt+Hn,ei=Rt[2]*ft+ti,Hr=Rt[3]*Lt+Hn,ti=Rt[4]*ft+ti,Hn=Rt[5]*Lt+Hn,Za(Pr,Mr,ei,Hr,ti,Hn));return lt&&Ar(),rs(Ge),this},c.path=function(X){for(var fe=0;fe<X.length;fe++){var Ne=X[fe],Fe=Ne.c;switch(Ne.op){case"m":Xs(Fe[0],Fe[1]);break;case"l":ns(Fe[0],Fe[1]);break;case"c":Za.apply(this,Fe);break;case"h":Ar()}}return this},c.__private__.rect=c.rect=function(X,fe,Ne,Fe,Ge){if(isNaN(X)||isNaN(fe)||isNaN(Ne)||isNaN(Fe)||!ts(Ge))throw new Error("Invalid arguments passed to jsPDF.rect");return _===b&&(Fe=-Fe),de([L(q(X)),L(G(fe)),L(q(Ne)),L(q(Fe)),"re"].join(" ")),rs(Ge),this},c.__private__.triangle=c.triangle=function(X,fe,Ne,Fe,Ge,lt,ft){if(isNaN(X)||isNaN(fe)||isNaN(Ne)||isNaN(Fe)||isNaN(Ge)||isNaN(lt)||!ts(ft))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[Ne-X,Fe-fe],[Ge-Ne,lt-Fe],[X-Ge,fe-lt]],X,fe,[1,1],ft,!0),this},c.__private__.roundedRect=c.roundedRect=function(X,fe,Ne,Fe,Ge,lt,ft){if(isNaN(X)||isNaN(fe)||isNaN(Ne)||isNaN(Fe)||isNaN(Ge)||isNaN(lt)||!ts(ft))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var Lt=4/3*(Math.SQRT2-1);return Ge=Math.min(Ge,.5*Ne),lt=Math.min(lt,.5*Fe),this.lines([[Ne-2*Ge,0],[Ge*Lt,0,Ge,lt-lt*Lt,Ge,lt],[0,Fe-2*lt],[0,lt*Lt,-Ge*Lt,lt,-Ge,lt],[2*Ge-Ne,0],[-Ge*Lt,0,-Ge,-lt*Lt,-Ge,-lt],[0,2*lt-Fe],[0,-lt*Lt,Ge*Lt,-lt,Ge,-lt]],X+Ge,fe,[1,1],ft,!0),this},c.__private__.ellipse=c.ellipse=function(X,fe,Ne,Fe,Ge){if(isNaN(X)||isNaN(fe)||isNaN(Ne)||isNaN(Fe)||!ts(Ge))throw new Error("Invalid arguments passed to jsPDF.ellipse");var lt=4/3*(Math.SQRT2-1)*Ne,ft=4/3*(Math.SQRT2-1)*Fe;return Xs(X+Ne,fe),Za(X+Ne,fe-ft,X+lt,fe-Fe,X,fe-Fe),Za(X-lt,fe-Fe,X-Ne,fe-ft,X-Ne,fe),Za(X-Ne,fe+ft,X-lt,fe+Fe,X,fe+Fe),Za(X+lt,fe+Fe,X+Ne,fe+ft,X+Ne,fe),rs(Ge),this},c.__private__.circle=c.circle=function(X,fe,Ne,Fe){if(isNaN(X)||isNaN(fe)||isNaN(Ne)||!ts(Fe))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(X,fe,Ne,Ne,Fe)},c.setFont=function(X,fe,Ne){return Ne&&(fe=O(fe,Ne)),bt=an(X,fe,{disableWarning:!1}),this};var Ma=c.__private__.getFont=c.getFont=function(){return Pt[an.apply(c,arguments)]};c.__private__.getFontList=c.getFontList=function(){var X,fe,Ne={};for(X in $t)if($t.hasOwnProperty(X))for(fe in Ne[X]=[],$t[X])$t[X].hasOwnProperty(fe)&&Ne[X].push(fe);return Ne},c.addFont=function(X,fe,Ne,Fe,Ge){var lt=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&lt.indexOf(arguments[3])!==-1?Ge=arguments[3]:arguments[3]&&lt.indexOf(arguments[3])==-1&&(Ne=O(Ne,Fe)),Zo.call(this,X,fe,Ne,Ge=Ge||"Identity-H")};var Ia,Fa=e.lineWidth||.200025,xt=c.__private__.getLineWidth=c.getLineWidth=function(){return Fa},Ks=c.__private__.setLineWidth=c.setLineWidth=function(X){return Fa=X,de(L(q(X))+" w"),this};c.__private__.setLineDash=Kt.API.setLineDash=Kt.API.setLineDashPattern=function(X,fe){if(X=X||[],fe=fe||0,isNaN(fe)||!Array.isArray(X))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return X=X.map(function(Ne){return L(q(Ne))}).join(" "),fe=L(q(fe)),de("["+X+"] "+fe+" d"),this};var vo=c.__private__.getLineHeight=c.getLineHeight=function(){return _e*Ia};c.__private__.getLineHeight=c.getLineHeight=function(){return _e*Ia};var dc=c.__private__.setLineHeightFactor=c.setLineHeightFactor=function(X){return typeof(X=X||1.15)=="number"&&(Ia=X),this},pc=c.__private__.getLineHeightFactor=c.getLineHeightFactor=function(){return Ia};dc(e.lineHeight);var Qa=c.__private__.getHorizontalCoordinate=function(X){return q(X)},pn=c.__private__.getVerticalCoordinate=function(X){return _===w?X:Xt[z].mediaBox.topRightY-Xt[z].mediaBox.bottomLeftY-q(X)},Wl=c.__private__.getHorizontalCoordinateString=c.getHorizontalCoordinateString=function(X){return L(Qa(X))},Yl=c.__private__.getVerticalCoordinateString=c.getVerticalCoordinateString=function(X){return L(pn(X))},ks=e.strokeColor||"0 G";c.__private__.getStrokeColor=c.getDrawColor=function(){return Ya(ks)},c.__private__.setStrokeColor=c.setDrawColor=function(X,fe,Ne,Fe){return ks=Qn({ch1:X,ch2:fe,ch3:Ne,ch4:Fe,pdfColorType:"draw",precision:2}),de(ks),this};var Mu=e.fillColor||"0 g";c.__private__.getFillColor=c.getFillColor=function(){return Ya(Mu)},c.__private__.setFillColor=c.setFillColor=function(X,fe,Ne,Fe){return Mu=Qn({ch1:X,ch2:fe,ch3:Ne,ch4:Fe,pdfColorType:"fill",precision:2}),de(Mu),this};var ja=e.textColor||"0 g",mi=c.__private__.getTextColor=c.getTextColor=function(){return Ya(ja)};c.__private__.setTextColor=c.setTextColor=function(X,fe,Ne,Fe){return ja=Qn({ch1:X,ch2:fe,ch3:Ne,ch4:Fe,pdfColorType:"text",precision:3}),this};var Fo=e.charSpace,Xl=c.__private__.getCharSpace=c.getCharSpace=function(){return parseFloat(Fo||0)};c.__private__.setCharSpace=c.setCharSpace=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Fo=X,this};var Aa=0;c.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},c.__private__.setLineCap=c.setLineCap=function(X){var fe=c.CapJoinStyles[X];if(fe===void 0)throw new Error("Line cap style of '"+X+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Aa=fe,de(fe+" J"),this};var Ja=0;c.__private__.setLineJoin=c.setLineJoin=function(X){var fe=c.CapJoinStyles[X];if(fe===void 0)throw new Error("Line join style of '"+X+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Ja=fe,de(fe+" j"),this},c.__private__.setLineMiterLimit=c.__private__.setMiterLimit=c.setLineMiterLimit=c.setMiterLimit=function(X){if(X=X||0,isNaN(X))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return de(L(q(X))+" M"),this},c.GState=t0,c.setGState=function(X){(X=typeof X=="string"?St[er[X]]:mo(null,X)).equals(jt)||(de("/"+X.id+" gs"),jt=X)};var mo=function(X,fe){if(!X||!er[X]){var Ne=!1;for(var Fe in St)if(St.hasOwnProperty(Fe)&&St[Fe].equals(fe)){Ne=!0;break}if(Ne)fe=St[Fe];else{var Ge="GS"+(Object.keys(St).length+1).toString(10);St[Ge]=fe,fe.id=Ge}return X&&(er[X]=fe.id),lr.publish("addGState",fe),fe}};c.addGState=function(X,fe){return mo(X,fe),this},c.saveGraphicsState=function(){return de("q"),$e.push({key:bt,size:_e,color:ja}),this},c.restoreGraphicsState=function(){de("Q");var X=$e.pop();return bt=X.key,_e=X.size,ja=X.color,jt=null,this},c.setCurrentTransformationMatrix=function(X){return de(X.toString()+" cm"),this},c.comment=function(X){return de("#"+X),this};var yo=function(X,fe){var Ne=X||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return Ne},set:function(lt){isNaN(lt)||(Ne=parseFloat(lt))}});var Fe=fe||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return Fe},set:function(lt){isNaN(lt)||(Fe=parseFloat(lt))}});var Ge="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return Ge},set:function(lt){Ge=lt.toString()}}),this},Zs=function(X,fe,Ne,Fe){yo.call(this,X,fe),this.type="rect";var Ge=Ne||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return Ge},set:function(ft){isNaN(ft)||(Ge=parseFloat(ft))}});var lt=Fe||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return lt},set:function(ft){isNaN(ft)||(lt=parseFloat(ft))}}),this},dl=function(){this.page=vr,this.currentPage=z,this.pages=ye.slice(0),this.pagesContext=Xt.slice(0),this.x=vt,this.y=wr,this.matrix=cr,this.width=eo(z),this.height=yi(z),this.outputDestination=Me,this.id="",this.objectNumber=-1};dl.prototype.restore=function(){vr=this.page,z=this.currentPage,Xt=this.pagesContext,ye=this.pages,vt=this.x,wr=this.y,cr=this.matrix,Os(z,this.width),kn(z,this.height),Me=this.outputDestination};var Jn=function(X,fe,Ne,Fe,Ge){mn.push(new dl),vr=z=0,ye=[],vt=X,wr=fe,cr=Ge,Qo([Ne,Fe])};for(var Da in c.beginFormObject=function(X,fe,Ne,Fe,Ge){return Jn(X,fe,Ne,Fe,Ge),this},c.endFormObject=function(X){return function(fe){if(vi[fe])mn.pop().restore();else{var Ne=new dl,Fe="Xo"+(Object.keys(Zn).length+1).toString(10);Ne.id=Fe,vi[fe]=Fe,Zn[Fe]=Ne,lr.publish("addFormObject",Ne),mn.pop().restore()}}(X),this},c.doFormObject=function(X,fe){var Ne=Zn[vi[X]];return de("q"),de(fe.toString()+" cm"),de("/"+Ne.id+" Do"),de("Q"),this},c.getFormObject=function(X){var fe=Zn[vi[X]];return{x:fe.x,y:fe.y,width:fe.width,height:fe.height,matrix:fe.matrix}},c.save=function(X,fe){return X=X||"generated.pdf",(fe=fe||{}).returnPromise=fe.returnPromise||!1,fe.returnPromise===!1?(Of(Pn(Hi()),X),typeof Of.unload=="function"&&dr.setTimeout&&setTimeout(Of.unload,911),this):new Promise(function(Ne,Fe){try{var Ge=Of(Pn(Hi()),X);typeof Of.unload=="function"&&dr.setTimeout&&setTimeout(Of.unload,911),Ne(Ge)}catch(lt){Fe(lt.message)}})},Kt.API)Kt.API.hasOwnProperty(Da)&&(Da==="events"&&Kt.API.events.length?function(X,fe){var Ne,Fe,Ge;for(Ge=fe.length-1;Ge!==-1;Ge--)Ne=fe[Ge][0],Fe=fe[Ge][1],X.subscribe.apply(X,[Ne].concat(typeof Fe=="function"?[Fe]:Fe))}(lr,Kt.API.events):c[Da]=Kt.API[Da]);var eo=c.getPageWidth=function(X){return(Xt[X=X||z].mediaBox.topRightX-Xt[X].mediaBox.bottomLeftX)/ht},Os=c.setPageWidth=function(X,fe){Xt[X].mediaBox.topRightX=fe*ht+Xt[X].mediaBox.bottomLeftX},yi=c.getPageHeight=function(X){return(Xt[X=X||z].mediaBox.topRightY-Xt[X].mediaBox.bottomLeftY)/ht},kn=c.setPageHeight=function(X,fe){Xt[X].mediaBox.topRightY=fe*ht+Xt[X].mediaBox.bottomLeftY};return c.internal={pdfEscape:Sa,getStyle:$l,getFont:Ma,getFontSize:Le,getCharSpace:Xl,getTextColor:mi,getLineHeight:vo,getLineHeightFactor:pc,getLineWidth:xt,write:Te,getHorizontalCoordinate:Qa,getVerticalCoordinate:pn,getCoordinateString:Wl,getVerticalCoordinateString:Yl,collections:{},newObject:Rr,newAdditionalObject:ba,newObjectDeferred:yn,newObjectDeferredBegin:An,getFilters:_a,putStream:xa,events:lr,scaleFactor:ht,pageSize:{getWidth:function(){return eo(z)},setWidth:function(X){Os(z,X)},getHeight:function(){return yi(z)},setHeight:function(X){kn(z,X)}},encryptionOptions:f,encryption:qn,getEncryptor:function(X){return f!==null?qn.encryptor(X,0):function(fe){return fe}},output:Vi,getNumberOfPages:oi,pages:ye,out:de,f2:k,f3:C,getPageInfo:es,getPageInfoByObjId:Ru,getCurrentPageInfo:Ea,getPDFVersion:x,Point:yo,Rectangle:Zs,Matrix:Yt,hasHotfix:Ws},Object.defineProperty(c.internal.pageSize,"width",{get:function(){return eo(z)},set:function(X){Os(z,X)},enumerable:!0,configurable:!0}),Object.defineProperty(c.internal.pageSize,"height",{get:function(){return yi(z)},set:function(X){kn(z,X)},enumerable:!0,configurable:!0}),(function(X){for(var fe=0,Ne=be.length;fe<Ne;fe++){var Fe=Zo.call(this,X[fe][0],X[fe][1],X[fe][2],be[fe][3],!0);v===!1&&(g[Fe]=!0);var Ge=X[fe][0].split("-");Gl({id:Fe,fontName:Ge[0],fontStyle:Ge[1]||""})}lr.publish("addFonts",{fonts:Pt,dictionary:$t})}).call(c,be),bt="F1",cc(i,r),lr.publish("initialized"),c}yh.prototype.lsbFirstWord=function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)},yh.prototype.toHexString=function(e){return e.split("").map(function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)}).join("")},yh.prototype.hexToBytes=function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(String.fromCharCode(parseInt(e.substr(r,2),16)));return t.join("")},yh.prototype.processOwnerPassword=function(e,t){return Zv(Kv(t).substr(0,5),e)},yh.prototype.encryptor=function(e,t){var r=Kv(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(n){return Zv(r,n)}},t0.prototype.equals=function(e){var t,r="id,objectNumber,equals";if(!e||Sn(e)!==Sn(this))return!1;var n=0;for(t in this)if(!(r.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t)||this[t]!==e[t])return!1;n++}for(t in e)e.hasOwnProperty(t)&&r.indexOf(t)<0&&n--;return n===0},Kt.API={events:[]},Kt.version="3.0.2";var Di=Kt.API,Um=1,Yf=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},gh=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},br=function(e){return e.toFixed(2)},Vc=function(e){return e.toFixed(5)};Di.__acroform__={};var As=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},_w=function(e){return e*Um},mu=function(e){var t=new x7,r=Vt.internal.getHeight(e)||0,n=Vt.internal.getWidth(e)||0;return t.BBox=[0,0,Number(br(n)),Number(br(r))],t},dR=Di.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|1<<t},pR=Di.__acroform__.clearBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&~(1<<t)},gR=Di.__acroform__.getBit=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return e&1<<t?1:0},na=Di.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return gR(e,t-1)},ia=Di.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return dR(e,t-1)},aa=Di.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return pR(e,t-1)},vR=Di.__acroform__.calculateCoordinates=function(e,t){var r=t.internal.getHorizontalCoordinate,n=t.internal.getVerticalCoordinate,i=e[0],a=e[1],l=e[2],o=e[3],u={};return u.lowerLeft_X=r(i)||0,u.lowerLeft_Y=n(a+o)||0,u.upperRight_X=r(i+l)||0,u.upperRight_Y=n(a)||0,[Number(br(u.lowerLeft_X)),Number(br(u.lowerLeft_Y)),Number(br(u.upperRight_X)),Number(br(u.upperRight_Y))]},mR=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],r=e._V||e.DV,n=Qv(e,r),i=e.scope.internal.getFont(e.fontName,e.fontStyle).id;t.push("/Tx BMC"),t.push("q"),t.push("BT"),t.push(e.scope.__private__.encodeColorString(e.color)),t.push("/"+i+" "+br(n.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(n.text),t.push("ET"),t.push("Q"),t.push("EMC");var a=mu(e);return a.scope=e.scope,a.stream=t.join(`
467
- `),a}},Qv=function(e,t){var r=e.fontSize===0?e.maxFontSize:e.fontSize,n={text:"",fontSize:""},i=(t=(t=t.substr(0,1)=="("?t.substr(1):t).substr(t.length-1)==")"?t.substr(0,t.length-1):t).split(" ");i=e.multiline?i.map(function(k){return k.split(`
468
- `)}):i.map(function(k){return[k]});var a=r,l=Vt.internal.getHeight(e)||0;l=l<0?-l:l;var o=Vt.internal.getWidth(e)||0;o=o<0?-o:o;var u=function(k,C,q){if(k+1<i.length){var G=C+" "+i[k+1][0];return m1(G,e,q).width<=o-4}return!1};a++;e:for(;a>0;){t="",a--;var d,f,v=m1("3",e,a).height,g=e.multiline?l-a:(l-v)/2,c=g+=2,y=0,x=0,E=0;if(a<=0){t=`(...) Tj
469
- `,t+="% Width of Text: "+m1(t,e,a=12).width+", FieldWidth:"+o+`
470
- `;break}for(var S="",b=0,w=0;w<i.length;w++)if(i.hasOwnProperty(w)){var _=!1;if(i[w].length!==1&&E!==i[w].length-1){if((v+2)*(b+2)+2>l)continue e;S+=i[w][E],_=!0,x=w,w--}else{S=(S+=i[w][E]+" ").substr(S.length-1)==" "?S.substr(0,S.length-1):S;var A=parseInt(w),M=u(A,S,a),O=w>=i.length-1;if(M&&!O){S+=" ",E=0;continue}if(M||O){if(O)x=A;else if(e.multiline&&(v+2)*(b+2)+2>l)continue e}else{if(!e.multiline||(v+2)*(b+2)+2>l)continue e;x=A}}for(var L="",R=y;R<=x;R++){var T=i[R];if(e.multiline){if(R===x){L+=T[E]+" ",E=(E+1)%T.length;continue}if(R===y){L+=T[T.length-1]+" ";continue}}L+=T[0]+" "}switch(L=L.substr(L.length-1)==" "?L.substr(0,L.length-1):L,f=m1(L,e,a).width,e.textAlign){case"right":d=o-f-2;break;case"center":d=(o-f)/2;break;default:d=2}t+=br(d)+" "+br(c)+` Td
471
- `,t+="("+Yf(L)+`) Tj
472
- `,t+=-br(d)+` 0 Td
473
- `,c=-(a+2),f=0,y=_?x:x+1,b++,S=""}break}return n.text=t,n.fontSize=a,n},m1=function(e,t,r){var n=t.scope.internal.getFont(t.fontName,t.fontStyle),i=t.scope.getStringUnitWidth(e,{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r);return{height:t.scope.getStringUnitWidth("3",{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r)*1.5,width:i}},yR={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},bR=function(e,t){var r={type:"reference",object:e};t.internal.getPageInfo(e.page).pageContext.annotations.find(function(n){return n.type===r.type&&n.object===r.object})===void 0&&t.internal.getPageInfo(e.page).pageContext.annotations.push(r)},wR=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(ql.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(yR)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");Um=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new S7,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){(function(r){r.internal.events.unsubscribe(r.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete r.internal.acroformPlugin.acroFormDictionaryRoot._eventID,r.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe("buildDocument",function(){(function(r){r.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var n=r.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var i in n)if(n.hasOwnProperty(i)){var a=n[i];a.objId=void 0,a.hasAnnotation&&bR(a,r)}})(e)}),e.internal.events.subscribe("putCatalog",function(){(function(r){if(r.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");r.internal.write("/AcroForm "+r.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(e)}),e.internal.events.subscribe("postPutPages",function(r){(function(n,i){var a=!n;for(var l 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(l)){var o=n[l],u=[],d=o.Rect;if(o.Rect&&(o.Rect=vR(o.Rect,i)),i.internal.newObjectDeferredBegin(o.objId,!0),o.DA=Vt.createDefaultAppearanceStream(o),Sn(o)==="object"&&typeof o.getKeyValueListForStream=="function"&&(u=o.getKeyValueListForStream()),o.Rect=d,o.hasAppearanceStream&&!o.appearanceStreamContent){var f=mR(o);u.push({key:"AP",value:"<</N "+f+">>"}),i.internal.acroformPlugin.xForms.push(f)}if(o.appearanceStreamContent){var v="";for(var g in o.appearanceStreamContent)if(o.appearanceStreamContent.hasOwnProperty(g)){var c=o.appearanceStreamContent[g];if(v+="/"+g+" ",v+="<<",Object.keys(c).length>=1||Array.isArray(c)){for(var l in c)if(c.hasOwnProperty(l)){var y=c[l];typeof y=="function"&&(y=y.call(i,o)),v+="/"+l+" "+y+" ",i.internal.acroformPlugin.xForms.indexOf(y)>=0||i.internal.acroformPlugin.xForms.push(y)}}else typeof(y=c)=="function"&&(y=y.call(i,o)),v+="/"+l+" "+y,i.internal.acroformPlugin.xForms.indexOf(y)>=0||i.internal.acroformPlugin.xForms.push(y);v+=">>"}u.push({key:"AP",value:`<<
474
- `+v+">>"})}i.internal.putStream({additionalKeyValues:u,objectId:o.objId}),i.internal.out("endobj")}a&&function(x,E){for(var S in x)if(x.hasOwnProperty(S)){var b=S,w=x[S];E.internal.newObjectDeferredBegin(w.objId,!0),Sn(w)==="object"&&typeof w.putStream=="function"&&w.putStream(),delete x[b]}}(i.internal.acroformPlugin.xForms,i)})(r,e)}),e.internal.acroformPlugin.isInitialized=!0}},_7=Di.__acroform__.arrayToPdfArray=function(e,t,r){var n=function(l){return l};if(Array.isArray(e)){for(var i="[",a=0;a<e.length;a++)switch(a!==0&&(i+=" "),Sn(e[a])){case"boolean":case"number":case"object":i+=e[a].toString();break;case"string":e[a].substr(0,1)!=="/"?(t!==void 0&&r&&(n=r.internal.getEncryptor(t)),i+="("+Yf(n(e[a].toString()))+")"):i+=e[a].toString()}return i+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},pv=function(e,t,r){var n=function(i){return i};return t!==void 0&&r&&(n=r.internal.getEncryptor(t)),(e=e||"").toString(),"("+Yf(n(e))+")"},_u=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};_u.prototype.toString=function(){return this.objId+" 0 R"},_u.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},_u.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(a){return a!="content"&&a!="appearanceStreamContent"&&a!="scope"&&a!="objId"&&a.substring(0,1)!="_"});for(var r in t)if(Object.getOwnPropertyDescriptor(this,t[r]).configurable===!1){var n=t[r],i=this[n];i&&(Array.isArray(i)?e.push({key:n,value:_7(i,this.objId,this.scope)}):i instanceof _u?(i.scope=this.scope,e.push({key:n,value:i.objId+" 0 R"})):typeof i!="function"&&e.push({key:n,value:i}))}return e};var x7=function(){_u.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(r){t=r}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(r){e=r.trim()},get:function(){return e||null}})};As(x7,_u);var S7=function(){_u.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var r=function(n){return n};return this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),"("+Yf(r(e))+")"}},set:function(r){e=r}})};As(S7,_u);var ql=function e(){_u.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(S){if(isNaN(S))throw new Error('Invalid value "'+S+'" for attribute F supplied.');t=S}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!na(t,3)},set:function(S){S?this.F=ia(t,3):this.F=aa(t,3)}});var r=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return r},set:function(S){if(isNaN(S))throw new Error('Invalid value "'+S+'" for attribute Ff supplied.');r=S}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(n.length!==0)return n},set:function(S){n=S!==void 0?S:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:n[0]},set:function(S){n[0]=S}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:n[1]},set:function(S){n[1]=S}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:n[2]},set:function(S){n[2]=S}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:n[3]},set:function(S){n[3]=S}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(S){switch(S){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=S;break;default:throw new Error('Invalid value "'+S+'" 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 r0)return;a="FieldObject"+e.FieldNum++}var S=function(b){return b};return this.scope&&(S=this.scope.internal.getEncryptor(this.objId)),"("+Yf(S(a))+")"},set:function(S){a=S.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return a},set:function(S){a=S}});var l="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return l},set:function(S){l=S}});var o="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return o},set:function(S){o=S}});var u=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return u},set:function(S){u=S}});var d=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return d===void 0?50/Um:d},set:function(S){d=S}});var f="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return f},set:function(S){f=S}});var v="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!v||this instanceof r0||this instanceof Ff))return pv(v,this.objId,this.scope)},set:function(S){S=S.toString(),v=S}});var g=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(g)return this instanceof $a==0?pv(g,this.objId,this.scope):g},set:function(S){S=S.toString(),g=this instanceof $a==0?S.substr(0,1)==="("?gh(S.substr(1,S.length-2)):gh(S):S}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof $a==1?gh(g.substr(1,g.length-1)):g},set:function(S){S=S.toString(),g=this instanceof $a==1?"/"+S:S}});var c=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(c)return c},set:function(S){this.V=S}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(c)return this instanceof $a==0?pv(c,this.objId,this.scope):c},set:function(S){S=S.toString(),c=this instanceof $a==0?S.substr(0,1)==="("?gh(S.substr(1,S.length-2)):gh(S):S}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof $a==1?gh(c.substr(1,c.length-1)):c},set:function(S){S=S.toString(),c=this instanceof $a==1?"/"+S:S}}),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,x=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return x},set:function(S){S=!!S,x=S}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(y)return y},set:function(S){y=S}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,1)},set:function(S){S?this.Ff=ia(this.Ff,1):this.Ff=aa(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,2)},set:function(S){S?this.Ff=ia(this.Ff,2):this.Ff=aa(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,3)},set:function(S){S?this.Ff=ia(this.Ff,3):this.Ff=aa(this.Ff,3)}});var E=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(E!==null)return E},set:function(S){if([0,1,2].indexOf(S)===-1)throw new Error('Invalid value "'+S+'" for attribute Q supplied.');E=S}}),Object.defineProperty(this,"textAlign",{get:function(){var S;switch(E){case 0:default:S="left";break;case 1:S="center";break;case 2:S="right"}return S},configurable:!0,enumerable:!0,set:function(S){switch(S){case"right":case 2:E=2;break;case"center":case 1:E=1;break;default:E=0}}})};As(ql,_u);var Ah=function(){ql.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(r){e=r}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(r){e=r}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return _7(t,this.objId,this.scope)},set:function(r){var n,i;i=[],typeof(n=r)=="string"&&(i=function(a,l,o){o||(o=1);for(var u,d=[];u=l.exec(a);)d.push(u[o]);return d}(n,/\((.*?)\)/g)),t=i}}),this.getOptions=function(){return t},this.setOptions=function(r){t=r,this.sort&&t.sort()},this.addOption=function(r){r=(r=r||"").toString(),t.push(r),this.sort&&t.sort()},this.removeOption=function(r,n){for(n=n||!1,r=(r=r||"").toString();t.indexOf(r)!==-1&&(t.splice(t.indexOf(r),1),n!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,18)},set:function(r){r?this.Ff=ia(this.Ff,18):this.Ff=aa(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,19)},set:function(r){this.combo===!0&&(r?this.Ff=ia(this.Ff,19):this.Ff=aa(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,20)},set:function(r){r?(this.Ff=ia(this.Ff,20),t.sort()):this.Ff=aa(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,22)},set:function(r){r?this.Ff=ia(this.Ff,22):this.Ff=aa(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,23)},set:function(r){r?this.Ff=ia(this.Ff,23):this.Ff=aa(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,27)},set:function(r){r?this.Ff=ia(this.Ff,27):this.Ff=aa(this.Ff,27)}}),this.hasAppearanceStream=!1};As(Ah,ql);var Ph=function(){Ah.call(this),this.fontName="helvetica",this.combo=!1};As(Ph,Ah);var kh=function(){Ph.call(this),this.combo=!0};As(kh,Ph);var L1=function(){kh.call(this),this.edit=!0};As(L1,kh);var $a=function(){ql.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,15)},set:function(r){r?this.Ff=ia(this.Ff,15):this.Ff=aa(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,16)},set:function(r){r?this.Ff=ia(this.Ff,16):this.Ff=aa(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,17)},set:function(r){r?this.Ff=ia(this.Ff,17):this.Ff=aa(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,26)},set:function(r){r?this.Ff=ia(this.Ff,26):this.Ff=aa(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var r=function(a){return a};if(this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),Object.keys(t).length!==0){var n,i=[];for(n in i.push("<<"),t)i.push("/"+n+" ("+Yf(r(t[n]))+")");return i.push(">>"),i.join(`
475
- `)}},set:function(r){Sn(r)==="object"&&(t=r)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(r){typeof r=="string"&&(t.CA=r)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(r){e=r}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(r){e="/"+r}})};As($a,ql);var T1=function(){$a.call(this),this.pushButton=!0};As(T1,$a);var Oh=function(){$a.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t!==void 0?t:[]}})};As(Oh,$a);var r0=function(){var e,t;ql.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(i){e=i}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(i){t=i}});var r,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var i=function(o){return o};this.scope&&(i=this.scope.internal.getEncryptor(this.objId));var a,l=[];for(a in l.push("<<"),n)l.push("/"+a+" ("+Yf(i(n[a]))+")");return l.push(">>"),l.join(`
476
- `)},set:function(i){Sn(i)==="object"&&(n=i)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(i){typeof i=="string"&&(n.CA=i)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(i){r=i}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(i){r="/"+i}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Vt.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};As(r0,ql),Oh.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var r=this.Kids[t];r.appearanceStreamContent=e.createAppearanceStream(r.optionName),r.caption=e.getCA()}},Oh.prototype.createOption=function(e){var t=new r0;return t.Parent=this,t.optionName=e,this.Kids.push(t),_R.call(this.scope,t),t};var R1=function(){$a.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Vt.CheckBox.createAppearanceStream()};As(R1,$a);var Ff=function(){ql.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,13)},set:function(t){t?this.Ff=ia(this.Ff,13):this.Ff=aa(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,21)},set:function(t){t?this.Ff=ia(this.Ff,21):this.Ff=aa(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,23)},set:function(t){t?this.Ff=ia(this.Ff,23):this.Ff=aa(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,24)},set:function(t){t?this.Ff=ia(this.Ff,24):this.Ff=aa(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,25)},set:function(t){t?this.Ff=ia(this.Ff,25):this.Ff=aa(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,26)},set:function(t){t?this.Ff=ia(this.Ff,26):this.Ff=aa(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};As(Ff,ql);var M1=function(){Ff.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!na(this.Ff,14)},set:function(e){e?this.Ff=ia(this.Ff,14):this.Ff=aa(this.Ff,14)}}),this.password=!0};As(M1,Ff);var Vt={CheckBox:{createAppearanceStream:function(){return{N:{On:Vt.CheckBox.YesNormal},D:{On:Vt.CheckBox.YesPushDown,Off:Vt.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=mu(e);t.scope=e.scope;var r=[],n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,i=e.scope.__private__.encodeColorString(e.color),a=Qv(e,e.caption);return r.push("0.749023 g"),r.push("0 0 "+br(Vt.internal.getWidth(e))+" "+br(Vt.internal.getHeight(e))+" re"),r.push("f"),r.push("BMC"),r.push("q"),r.push("0 0 1 rg"),r.push("/"+n+" "+br(a.fontSize)+" Tf "+i),r.push("BT"),r.push(a.text),r.push("ET"),r.push("Q"),r.push("EMC"),t.stream=r.join(`
477
- `),t},YesNormal:function(e){var t=mu(e);t.scope=e.scope;var r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color),i=[],a=Vt.internal.getHeight(e),l=Vt.internal.getWidth(e),o=Qv(e,e.caption);return i.push("1 g"),i.push("0 0 "+br(l)+" "+br(a)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+br(l-1)+" "+br(a-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+r+" "+br(o.fontSize)+" Tf "+n),i.push(o.text),i.push("ET"),i.push("Q"),t.stream=i.join(`
478
- `),t},OffPushDown:function(e){var t=mu(e);t.scope=e.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+br(Vt.internal.getWidth(e))+" "+br(Vt.internal.getHeight(e))+" re"),r.push("f"),t.stream=r.join(`
479
- `),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:Vt.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=Vt.RadioButton.Circle.YesNormal,t.D[e]=Vt.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=mu(e);t.scope=e.scope;var r=[],n=Vt.internal.getWidth(e)<=Vt.internal.getHeight(e)?Vt.internal.getWidth(e)/4:Vt.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var i=Vt.internal.Bezier_C,a=Number((n*i).toFixed(5));return r.push("q"),r.push("1 0 0 1 "+Vc(Vt.internal.getWidth(e)/2)+" "+Vc(Vt.internal.getHeight(e)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+a+" "+a+" "+n+" 0 "+n+" c"),r.push("-"+a+" "+n+" -"+n+" "+a+" -"+n+" 0 c"),r.push("-"+n+" -"+a+" -"+a+" -"+n+" 0 -"+n+" c"),r.push(a+" -"+n+" "+n+" -"+a+" "+n+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join(`
480
- `),t},YesPushDown:function(e){var t=mu(e);t.scope=e.scope;var r=[],n=Vt.internal.getWidth(e)<=Vt.internal.getHeight(e)?Vt.internal.getWidth(e)/4:Vt.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var i=Number((2*n).toFixed(5)),a=Number((i*Vt.internal.Bezier_C).toFixed(5)),l=Number((n*Vt.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+Vc(Vt.internal.getWidth(e)/2)+" "+Vc(Vt.internal.getHeight(e)/2)+" cm"),r.push(i+" 0 m"),r.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),r.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),r.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),r.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),r.push("f"),r.push("Q"),r.push("0 g"),r.push("q"),r.push("1 0 0 1 "+Vc(Vt.internal.getWidth(e)/2)+" "+Vc(Vt.internal.getHeight(e)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+l+" "+l+" "+n+" 0 "+n+" c"),r.push("-"+l+" "+n+" -"+n+" "+l+" -"+n+" 0 c"),r.push("-"+n+" -"+l+" -"+l+" -"+n+" 0 -"+n+" c"),r.push(l+" -"+n+" "+n+" -"+l+" "+n+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join(`
481
- `),t},OffPushDown:function(e){var t=mu(e);t.scope=e.scope;var r=[],n=Vt.internal.getWidth(e)<=Vt.internal.getHeight(e)?Vt.internal.getWidth(e)/4:Vt.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var i=Number((2*n).toFixed(5)),a=Number((i*Vt.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+Vc(Vt.internal.getWidth(e)/2)+" "+Vc(Vt.internal.getHeight(e)/2)+" cm"),r.push(i+" 0 m"),r.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),r.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),r.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),r.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join(`
482
- `),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:Vt.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=Vt.RadioButton.Cross.YesNormal,t.D[e]=Vt.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=mu(e);t.scope=e.scope;var r=[],n=Vt.internal.calculateCross(e);return r.push("q"),r.push("1 1 "+br(Vt.internal.getWidth(e)-2)+" "+br(Vt.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(br(n.x1.x)+" "+br(n.x1.y)+" m"),r.push(br(n.x2.x)+" "+br(n.x2.y)+" l"),r.push(br(n.x4.x)+" "+br(n.x4.y)+" m"),r.push(br(n.x3.x)+" "+br(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join(`
483
- `),t},YesPushDown:function(e){var t=mu(e);t.scope=e.scope;var r=Vt.internal.calculateCross(e),n=[];return n.push("0.749023 g"),n.push("0 0 "+br(Vt.internal.getWidth(e))+" "+br(Vt.internal.getHeight(e))+" re"),n.push("f"),n.push("q"),n.push("1 1 "+br(Vt.internal.getWidth(e)-2)+" "+br(Vt.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(br(r.x1.x)+" "+br(r.x1.y)+" m"),n.push(br(r.x2.x)+" "+br(r.x2.y)+" l"),n.push(br(r.x4.x)+" "+br(r.x4.y)+" m"),n.push(br(r.x3.x)+" "+br(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join(`
484
- `),t},OffPushDown:function(e){var t=mu(e);t.scope=e.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+br(Vt.internal.getWidth(e))+" "+br(Vt.internal.getHeight(e))+" re"),r.push("f"),t.stream=r.join(`
485
- `),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+r}};Vt.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=Vt.internal.getWidth(e),r=Vt.internal.getHeight(e),n=Math.min(t,r);return{x1:{x:(t-n)/2,y:(r-n)/2+n},x2:{x:(t-n)/2+n,y:(r-n)/2},x3:{x:(t-n)/2,y:(r-n)/2},x4:{x:(t-n)/2+n,y:(r-n)/2+n}}}},Vt.internal.getWidth=function(e){var t=0;return Sn(e)==="object"&&(t=_w(e.Rect[2])),t},Vt.internal.getHeight=function(e){var t=0;return Sn(e)==="object"&&(t=_w(e.Rect[3])),t};var _R=Di.addField=function(e){if(wR(this,e),!(e instanceof ql))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};Di.AcroFormChoiceField=Ah,Di.AcroFormListBox=Ph,Di.AcroFormComboBox=kh,Di.AcroFormEditBox=L1,Di.AcroFormButton=$a,Di.AcroFormPushButton=T1,Di.AcroFormRadioButton=Oh,Di.AcroFormCheckBox=R1,Di.AcroFormTextField=Ff,Di.AcroFormPasswordField=M1,Di.AcroFormAppearance=Vt,Di.AcroForm={ChoiceField:Ah,ListBox:Ph,ComboBox:kh,EditBox:L1,Button:$a,PushButton:T1,RadioButton:Oh,CheckBox:R1,TextField:Ff,PasswordField:M1,Appearance:Vt},Kt.AcroForm={ChoiceField:Ah,ListBox:Ph,ComboBox:kh,EditBox:L1,Button:$a,PushButton:T1,RadioButton:Oh,CheckBox:R1,TextField:Ff,PasswordField:M1,Appearance:Vt};Kt.AcroForm;function E7(e){return e.reduce(function(t,r,n){return t[r]=n,t},{})}(function(e){var t="addImage_";e.__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=e.__addimage__.getImageFileTypeByImageData=function(k,C){var q,G,J,ae,H,V=r;if((C=C||r)==="RGBA"||k.data!==void 0&&k.data instanceof Uint8ClampedArray&&"height"in k&&"width"in k)return"RGBA";if(M(k))for(H in n)for(J=n[H],q=0;q<J.length;q+=1){for(ae=!0,G=0;G<J[q].length;G+=1)if(J[q][G]!==void 0&&J[q][G]!==k[G]){ae=!1;break}if(ae===!0){V=H;break}}else for(H in n)for(J=n[H],q=0;q<J.length;q+=1){for(ae=!0,G=0;G<J[q].length;G+=1)if(J[q][G]!==void 0&&J[q][G]!==k.charCodeAt(G)){ae=!1;break}if(ae===!0){V=H;break}}return V===r&&C!==r&&(V=C),V},a=function k(C){for(var q=this.internal.write,G=this.internal.putStream,J=(0,this.internal.getFilters)();J.indexOf("FlateEncode")!==-1;)J.splice(J.indexOf("FlateEncode"),1);C.objectId=this.internal.newObject();var ae=[];if(ae.push({key:"Type",value:"/XObject"}),ae.push({key:"Subtype",value:"/Image"}),ae.push({key:"Width",value:C.width}),ae.push({key:"Height",value:C.height}),C.colorSpace===S.INDEXED?ae.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(C.palette.length/3-1)+" "+("sMask"in C&&C.sMask!==void 0?C.objectId+2:C.objectId+1)+" 0 R]"}):(ae.push({key:"ColorSpace",value:"/"+C.colorSpace}),C.colorSpace===S.DEVICE_CMYK&&ae.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),ae.push({key:"BitsPerComponent",value:C.bitsPerComponent}),"decodeParameters"in C&&C.decodeParameters!==void 0&&ae.push({key:"DecodeParms",value:"<<"+C.decodeParameters+">>"}),"transparency"in C&&Array.isArray(C.transparency)){for(var H="",V=0,Y=C.transparency.length;V<Y;V++)H+=C.transparency[V]+" "+C.transparency[V]+" ";ae.push({key:"Mask",value:"["+H+"]"})}C.sMask!==void 0&&ae.push({key:"SMask",value:C.objectId+1+" 0 R"});var U=C.filter!==void 0?["/"+C.filter]:void 0;if(G({data:C.data,additionalKeyValues:ae,alreadyAppliedFilters:U,objectId:C.objectId}),q("endobj"),"sMask"in C&&C.sMask!==void 0){var D=(C.predictor!=null?"/Predictor "+C.predictor:"")+" /Colors 1 /BitsPerComponent 8 /Columns "+C.width,j={width:C.width,height:C.height,colorSpace:"DeviceGray",bitsPerComponent:C.bitsPerComponent,decodeParameters:D,data:C.sMask};"filter"in C&&(j.filter=C.filter),k.call(this,j)}if(C.colorSpace===S.INDEXED){var z=this.internal.newObject();G({data:L(new Uint8Array(C.palette)),objectId:z}),q("endobj")}},l=function(){var k=this.internal.collections[t+"images"];for(var C in k)a.call(this,k[C])},o=function(){var k,C=this.internal.collections[t+"images"],q=this.internal.write;for(var G in C)q("/I"+(k=C[G]).index,k.objectId,"0","R")},u=function(){this.internal.collections[t+"images"]||(this.internal.collections[t+"images"]={},this.internal.events.subscribe("putResources",l),this.internal.events.subscribe("putXobjectDict",o))},d=function(){var k=this.internal.collections[t+"images"];return u.call(this),k},f=function(){return Object.keys(this.internal.collections[t+"images"]).length},v=function(k){return typeof e["process"+k.toUpperCase()]=="function"},g=function(k){return Sn(k)==="object"&&k.nodeType===1},c=function(k,C){if(k.nodeName==="IMG"&&k.hasAttribute("src")){var q=""+k.getAttribute("src");if(q.indexOf("data:image/")===0)return N1(unescape(q).split("base64,").pop());var G=e.loadFile(q,!0);if(G!==void 0)return G}if(k.nodeName==="CANVAS"){if(k.width===0||k.height===0)throw new Error("Given canvas must have data. Canvas width: "+k.width+", height: "+k.height);var J;switch(C){case"PNG":J="image/png";break;case"WEBP":J="image/webp";break;default:J="image/jpeg"}return N1(k.toDataURL(J,1).split("base64,").pop())}},y=function(k){var C=this.internal.collections[t+"images"];if(C){for(var q in C)if(k===C[q].alias)return C[q]}},x=function(k,C,q){return k||C||(k=-96,C=-96),k<0&&(k=-1*q.width*72/k/this.internal.scaleFactor),C<0&&(C=-1*q.height*72/C/this.internal.scaleFactor),k===0&&(k=C*q.width/q.height),C===0&&(C=k*q.height/q.width),[k,C]},E=function(k,C,q,G,J,ae){var H=x.call(this,q,G,J),V=this.internal.getCoordinateString,Y=this.internal.getVerticalCoordinateString,U=d.call(this);if(q=H[0],G=H[1],U[J.index]=J,ae){ae*=Math.PI/180;var D=Math.cos(ae),j=Math.sin(ae),z=function(re){return re.toFixed(4)},Z=[z(D),z(j),z(-1*j),z(D),0,0,"cm"]}this.internal.write("q"),ae?(this.internal.write([1,"0","0",1,V(k),Y(C+G),"cm"].join(" ")),this.internal.write(Z.join(" ")),this.internal.write([V(q),"0","0",V(G),"0","0","cm"].join(" "))):this.internal.write([V(q),"0","0",V(G),V(k),Y(C+G),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+J.index+" Do"),this.internal.write("Q")},S=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var b=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},w=e.__addimage__.sHashCode=function(k){var C,q,G=0;if(typeof k=="string")for(q=k.length,C=0;C<q;C++)G=(G<<5)-G+k.charCodeAt(C),G|=0;else if(M(k))for(q=k.byteLength/2,C=0;C<q;C++)G=(G<<5)-G+k[C],G|=0;return G},_=e.__addimage__.validateStringAsBase64=function(k){(k=k||"").toString().trim();var C=!0;return k.length===0&&(C=!1),k.length%4!=0&&(C=!1),/^[A-Za-z0-9+/]+$/.test(k.substr(0,k.length-2))===!1&&(C=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(k.substr(-2))===!1&&(C=!1),C},A=e.__addimage__.extractImageFromDataUrl=function(k){if(k==null||!(k=k.trim()).startsWith("data:"))return null;var C=k.indexOf(",");return C<0?null:k.substring(0,C).trim().endsWith("base64")?k.substring(C+1):null};e.__addimage__.isArrayBuffer=function(k){return k instanceof ArrayBuffer};var M=e.__addimage__.isArrayBufferView=function(k){return k instanceof Int8Array||k instanceof Uint8Array||k instanceof Uint8ClampedArray||k instanceof Int16Array||k instanceof Uint16Array||k instanceof Int32Array||k instanceof Uint32Array||k instanceof Float32Array||k instanceof Float64Array},O=e.__addimage__.binaryStringToUint8Array=function(k){for(var C=k.length,q=new Uint8Array(C),G=0;G<C;G++)q[G]=k.charCodeAt(G);return q},L=e.__addimage__.arrayBufferToBinaryString=function(k){for(var C="",q=M(k)?k:new Uint8Array(k),G=0;G<q.length;G+=8192)C+=String.fromCharCode.apply(null,q.subarray(G,G+8192));return C};e.addImage=function(){var k,C,q,G,J,ae,H,V,Y;if(typeof arguments[1]=="number"?(C=r,q=arguments[1],G=arguments[2],J=arguments[3],ae=arguments[4],H=arguments[5],V=arguments[6],Y=arguments[7]):(C=arguments[1],q=arguments[2],G=arguments[3],J=arguments[4],ae=arguments[5],H=arguments[6],V=arguments[7],Y=arguments[8]),Sn(k=arguments[0])==="object"&&!g(k)&&"imageData"in k){var U=k;k=U.imageData,C=U.format||C||r,q=U.x||q||0,G=U.y||G||0,J=U.w||U.width||J,ae=U.h||U.height||ae,H=U.alias||H,V=U.compression||V,Y=U.rotation||U.angle||Y}var D=this.internal.getFilters();if(V===void 0&&D.indexOf("FlateEncode")!==-1&&(V="SLOW"),isNaN(q)||isNaN(G))throw new Error("Invalid coordinates passed to jsPDF.addImage");u.call(this);var j=R.call(this,k,C,H,V);return E.call(this,q,G,J,ae,j,Y),this};var R=function(k,C,q,G){var J,ae,H;if(typeof k=="string"&&i(k)===r){k=unescape(k);var V=T(k,!1);(V!==""||(V=e.loadFile(k,!0))!==void 0)&&(k=V)}if(g(k)&&(k=c(k,C)),C=i(k,C),!v(C))throw new Error("addImage does not support files of type '"+C+"', please ensure that a plugin for '"+C+"' support is added.");if(((H=q)==null||H.length===0)&&(q=function(Y){return typeof Y=="string"||M(Y)?w(Y):M(Y.data)?w(Y.data):null}(k)),(J=y.call(this,q))||(k instanceof Uint8Array||C==="RGBA"||(ae=k,k=O(k)),J=this["process"+C.toUpperCase()](k,f.call(this),q,function(Y){return Y&&typeof Y=="string"&&(Y=Y.toUpperCase()),Y in e.image_compression?Y:b.NONE}(G),ae)),!J)throw new Error("An unknown error occurred whilst processing the image.");return J},T=e.__addimage__.convertBase64ToBinaryString=function(k,C){C=typeof C!="boolean"||C;var q,G="";if(typeof k=="string"){var J;q=(J=A(k))!==null&&J!==void 0?J:k;try{G=N1(q)}catch(ae){if(C)throw _(q)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+ae.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return G};e.getImageProperties=function(k){var C,q,G="";if(g(k)&&(k=c(k)),typeof k=="string"&&i(k)===r&&((G=T(k,!1))===""&&(G=e.loadFile(k)||""),k=G),q=i(k),!v(q))throw new Error("addImage does not support files of type '"+q+"', please ensure that a plugin for '"+q+"' support is added.");if(k instanceof Uint8Array||(k=O(k)),!(C=this["process"+q.toUpperCase()](k)))throw new Error("An unknown error occurred whilst processing the image");return C.fileType=q,C}})(Kt.API),function(e){var t=function(r){if(r!==void 0&&r!="")return!0};Kt.API.events.push(["addPage",function(r){this.internal.getPageInfo(r.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(r){for(var n,i,a,l=this.internal.getCoordinateString,o=this.internal.getVerticalCoordinateString,u=this.internal.getPageInfoByObjId(r.objId),d=r.pageContext.annotations,f=!1,v=0;v<d.length&&!f;v++)switch((n=d[v]).type){case"link":(t(n.options.url)||t(n.options.pageNumber))&&(f=!0);break;case"reference":case"text":case"freetext":f=!0}if(f!=0){this.internal.write("/Annots [");for(var g=0;g<d.length;g++){n=d[g];var c=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 x=this.internal.newAdditionalObject(),E=this.internal.newAdditionalObject(),S=this.internal.getEncryptor(x.objId),b=n.title||"Note";a="<</Type /Annot /Subtype /Text "+(i="/Rect ["+l(n.bounds.x)+" "+o(n.bounds.y+n.bounds.h)+" "+l(n.bounds.x+n.bounds.w)+" "+o(n.bounds.y)+"] ")+"/Contents ("+c(S(n.contents))+")",a+=" /Popup "+E.objId+" 0 R",a+=" /P "+u.objId+" 0 R",a+=" /T ("+c(S(b))+") >>",x.content=a;var w=x.objId+" 0 R";a="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+l(n.bounds.x+30)+" "+o(n.bounds.y+n.bounds.h)+" "+l(n.bounds.x+n.bounds.w+30)+" "+o(n.bounds.y)+"] ")+" /Parent "+w,n.open&&(a+=" /Open true"),a+=" >>",E.content=a,this.internal.write(x.objId,"0 R",E.objId,"0 R");break;case"freetext":i="/Rect ["+l(n.bounds.x)+" "+o(n.bounds.y)+" "+l(n.bounds.x+n.bounds.w)+" "+o(n.bounds.y+n.bounds.h)+"] ";var _=n.color||"#000000";a="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+c(y(n.contents))+")",a+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+_+")",a+=" /Border [0 0 0]",a+=" >>",this.internal.write(a);break;case"link":if(n.options.name){var A=this.annotations._nameMap[n.options.name];n.options.pageNumber=A.page,n.options.top=A.y}else n.options.top||(n.options.top=0);if(i="/Rect ["+n.finalBounds.x+" "+n.finalBounds.y+" "+n.finalBounds.w+" "+n.finalBounds.h+"] ",a="",n.options.url)a="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+c(y(n.options.url))+") >>";else if(n.options.pageNumber)switch(a="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(n.options.pageNumber).objId+" 0 R",n.options.magFactor=n.options.magFactor||"XYZ",n.options.magFactor){case"Fit":a+=" /Fit]";break;case"FitH":a+=" /FitH "+n.options.top+"]";break;case"FitV":n.options.left=n.options.left||0,a+=" /FitV "+n.options.left+"]";break;default:var M=o(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),a+=" /XYZ "+n.options.left+" "+M+" "+n.options.zoom+"]"}a!=""&&(a+=" >>",this.internal.write(a))}}this.internal.write("]")}}]),e.createAnnotation=function(r){var n=this.internal.getCurrentPageInfo();switch(r.type){case"link":this.link(r.bounds.x,r.bounds.y,r.bounds.w,r.bounds.h,r);break;case"text":case"freetext":n.pageContext.annotations.push(r)}},e.link=function(r,n,i,a,l){var o=this.internal.getCurrentPageInfo(),u=this.internal.getCoordinateString,d=this.internal.getVerticalCoordinateString;o.pageContext.annotations.push({finalBounds:{x:u(r),y:d(n),w:u(r+i),h:d(n+a)},options:l,type:"link"})},e.textWithLink=function(r,n,i,a){var l,o,u=this.getTextWidth(r),d=this.internal.getLineHeight()/this.internal.scaleFactor;if(a.maxWidth!==void 0){o=a.maxWidth;var f=this.splitTextToSize(r,o).length;l=Math.ceil(d*f)}else o=u,l=d;return this.text(r,n,i,a),i+=.2*d,a.align==="center"&&(n-=u/2),a.align==="right"&&(n-=u),this.link(n,i-d,o,l,a),u},e.getTextWidth=function(r){var n=this.internal.getFontSize();return this.getStringUnitWidth(r)*n/this.internal.scaleFactor}}(Kt.API),function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},r={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},n={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];e.__arabicParser__={};var a=e.__arabicParser__.isInArabicSubstitutionA=function(x){return t[x.charCodeAt(0)]!==void 0},l=e.__arabicParser__.isArabicLetter=function(x){return typeof x=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(x)},o=e.__arabicParser__.isArabicEndLetter=function(x){return l(x)&&a(x)&&t[x.charCodeAt(0)].length<=2},u=e.__arabicParser__.isArabicAlfLetter=function(x){return l(x)&&i.indexOf(x.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(x){return l(x)&&a(x)&&t[x.charCodeAt(0)].length>=1};var d=e.__arabicParser__.arabicLetterHasFinalForm=function(x){return l(x)&&a(x)&&t[x.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(x){return l(x)&&a(x)&&t[x.charCodeAt(0)].length>=3};var f=e.__arabicParser__.arabicLetterHasMedialForm=function(x){return l(x)&&a(x)&&t[x.charCodeAt(0)].length==4},v=e.__arabicParser__.resolveLigatures=function(x){var E=0,S=r,b="",w=0;for(E=0;E<x.length;E+=1)S[x.charCodeAt(E)]!==void 0?(w++,typeof(S=S[x.charCodeAt(E)])=="number"&&(b+=String.fromCharCode(S),S=r,w=0),E===x.length-1&&(S=r,b+=x.charAt(E-(w-1)),E-=w-1,w=0)):(S=r,b+=x.charAt(E-w),E-=w,w=0);return b};e.__arabicParser__.isArabicDiacritic=function(x){return x!==void 0&&n[x.charCodeAt(0)]!==void 0};var g=e.__arabicParser__.getCorrectForm=function(x,E,S){return l(x)?a(x)===!1?-1:!d(x)||!l(E)&&!l(S)||!l(S)&&o(E)||o(x)&&!l(E)||o(x)&&u(E)||o(x)&&o(E)?0:f(x)&&l(E)&&!o(E)&&l(S)&&d(S)?3:o(x)||!l(S)?1:2:-1},c=function(x){var E=0,S=0,b=0,w="",_="",A="",M=(x=x||"").split("\\s+"),O=[];for(E=0;E<M.length;E+=1){for(O.push(""),S=0;S<M[E].length;S+=1)w=M[E][S],_=M[E][S-1],A=M[E][S+1],l(w)?(b=g(w,_,A),O[E]+=b!==-1?String.fromCharCode(t[w.charCodeAt(0)][b]):w):O[E]+=w;O[E]=v(O[E])}return O.join(" ")},y=e.__arabicParser__.processArabic=e.processArabic=function(){var x,E=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,S=[];if(Array.isArray(E)){var b=0;for(S=[],b=0;b<E.length;b+=1)Array.isArray(E[b])?S.push([c(E[b][0]),E[b][1],E[b][2]]):S.push([c(E[b])]);x=S}else x=c(E);return typeof arguments[0]=="string"?x:(arguments[0].text=x,arguments[0])};e.events.push(["preProcessText",y])}(Kt.API),Kt.API.autoPrint=function(e){var t;return(e=e||{}).variant=e.variant||"non-conform",e.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+t+" 0 R")})),this},function(e){var t=function(){var r=void 0;Object.defineProperty(this,"pdf",{get:function(){return r},set:function(o){r=o}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(o){n=isNaN(o)||Number.isInteger(o)===!1||o<0?150:o,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(o){i=isNaN(o)||Number.isInteger(o)===!1||o<0?300:o,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var a=[];Object.defineProperty(this,"childNodes",{get:function(){return a},set:function(o){a=o}});var l={};Object.defineProperty(this,"style",{get:function(){return l},set:function(o){l=o}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(r,n){var i;if((r=r||"2d")!=="2d")return null;for(i in n)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=n[i]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])}(Kt.API),function(e){var t={left:0,top:0,bottom:0,right:0},r=!1,n=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},t),this.internal.__cell__.margins.width=this.getPageWidth(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new a,this.internal.__cell__.pages=1},a=function(){var u=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return u},set:function(x){u=x}});var d=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return d},set:function(x){d=x}});var f=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return f},set:function(x){f=x}});var v=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return v},set:function(x){v=x}});var g=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return g},set:function(x){g=x}});var c=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return c},set:function(x){c=x}});var y=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return y},set:function(x){y=x}}),this};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},a.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(u){return n.call(this),this.internal.__cell__.headerFunction=typeof u=="function"?u:void 0,this},e.getTextDimensions=function(u,d){n.call(this);var f=(d=d||{}).fontSize||this.getFontSize(),v=d.font||this.getFont(),g=d.scaleFactor||this.internal.scaleFactor,c=0,y=0,x=0,E=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 S=d.maxWidth;S>0?typeof u=="string"?u=this.splitTextToSize(u,S):Object.prototype.toString.call(u)==="[object Array]"&&(u=u.reduce(function(w,_){return w.concat(E.splitTextToSize(_,S))},[])):u=Array.isArray(u)?u:[u];for(var b=0;b<u.length;b++)c<(x=this.getStringUnitWidth(u[b],{font:v})*f)&&(c=x);return c!==0&&(y=u.length),{w:c/=g,h:Math.max((y*f*this.getLineHeightFactor()-f*(this.getLineHeightFactor()-1))/g,0)}},e.cellAddPage=function(){n.call(this),this.addPage();var u=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new a(u.left,u.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var l=e.cell=function(){var u;u=arguments[0]instanceof a?arguments[0]:new a(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),n.call(this);var d=this.internal.__cell__.lastCell,f=this.internal.__cell__.padding,v=this.internal.__cell__.margins||t,g=this.internal.__cell__.tableHeaderRow,c=this.internal.__cell__.printHeaders;return d.lineNumber!==void 0&&(d.lineNumber===u.lineNumber?(u.x=(d.x||0)+(d.width||0),u.y=d.y||0):d.y+d.height+u.height+v.bottom>this.getPageHeight()?(this.cellAddPage(),u.y=v.top,c&&g&&(this.printHeaderRow(u.lineNumber,!0),u.y+=g[0].height)):u.y=d.y+d.height||u.y),u.text[0]!==void 0&&(this.rect(u.x,u.y,u.width,u.height,r===!0?"FD":void 0),u.align==="right"?this.text(u.text,u.x+u.width-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};e.table=function(u,d,f,v,g){if(n.call(this),!f)throw new Error("No data for PDF table.");var c,y,x,E,S=[],b=[],w=[],_={},A={},M=[],O=[],L=(g=g||{}).autoSize||!1,R=g.printHeaders!==!1,T=g.css&&g.css["font-size"]!==void 0?16*g.css["font-size"]:g.fontSize||12,k=g.margins||Object.assign({width:this.getPageWidth()},t),C=typeof g.padding=="number"?g.padding:3,q=g.headerBackgroundColor||"#c8c8c8",G=g.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=R,this.internal.__cell__.margins=k,this.internal.__cell__.table_font_size=T,this.internal.__cell__.padding=C,this.internal.__cell__.headerBackgroundColor=q,this.internal.__cell__.headerTextColor=G,this.setFontSize(T),v==null)b=S=Object.keys(f[0]),w=S.map(function(){return"left"});else if(Array.isArray(v)&&Sn(v[0])==="object")for(S=v.map(function(U){return U.name}),b=v.map(function(U){return U.prompt||U.name||""}),w=v.map(function(U){return U.align||"left"}),c=0;c<v.length;c+=1)A[v[c].name]=.7499990551181103*v[c].width;else Array.isArray(v)&&typeof v[0]=="string"&&(b=S=v,w=S.map(function(){return"left"}));if(L||Array.isArray(v)&&typeof v[0]=="string")for(c=0;c<S.length;c+=1){for(_[E=S[c]]=f.map(function(U){return U[E]}),this.setFont(void 0,"bold"),M.push(this.getTextDimensions(b[c],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),y=_[E],this.setFont(void 0,"normal"),x=0;x<y.length;x+=1)M.push(this.getTextDimensions(y[x],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);A[E]=Math.max.apply(null,M)+C+C,M=[]}if(R){var J={};for(c=0;c<S.length;c+=1)J[S[c]]={},J[S[c]].text=b[c],J[S[c]].align=w[c];var ae=o.call(this,J,A);O=S.map(function(U){return new a(u,d,A[U],ae,J[U].text,void 0,J[U].align)}),this.setTableHeaderRow(O),this.printHeaderRow(1,!1)}var H=v.reduce(function(U,D){return U[D.name]=D.align,U},{});for(c=0;c<f.length;c+=1){"rowStart"in g&&g.rowStart instanceof Function&&g.rowStart({row:c,data:f[c]},this);var V=o.call(this,f[c],A);for(x=0;x<S.length;x+=1){var Y=f[c][S[x]];"cellStart"in g&&g.cellStart instanceof Function&&g.cellStart({row:c,col:x,data:Y},this),l.call(this,new a(u,d,A[S[x]],V,Y,c+2,H[S[x]]))}}return this.internal.__cell__.table_x=u,this.internal.__cell__.table_y=d,this};var o=function(u,d){var f=this.internal.__cell__.padding,v=this.internal.__cell__.table_font_size,g=this.internal.scaleFactor;return Object.keys(u).map(function(c){var y=u[c];return this.splitTextToSize(y.hasOwnProperty("text")?y.text:y,d[c]-f-f)},this).map(function(c){return this.getLineHeightFactor()*c.length*v/g+f+f},this).reduce(function(c,y){return Math.max(c,y)},0)};e.setTableHeaderRow=function(u){n.call(this),this.internal.__cell__.tableHeaderRow=u},e.printHeaderRow=function(u,d){if(n.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var f;if(r=!0,typeof this.internal.__cell__.headerFunction=="function"){var v=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new a(v[0],v[1],v[2],v[3],void 0,-1)}this.setFont(void 0,"bold");for(var g=[],c=0;c<this.internal.__cell__.tableHeaderRow.length;c+=1){f=this.internal.__cell__.tableHeaderRow[c].clone(),d&&(f.y=this.internal.__cell__.margins.top||0,g.push(f)),f.lineNumber=u;var y=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),l.call(this,f),this.setTextColor(y)}g.length>0&&this.setTableHeaderRow(g),this.setFont(void 0,"normal"),r=!1}}(Kt.API);var A7={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},P7=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Jv=E7(P7),k7=[100,200,300,400,500,600,700,800,900],xR=E7(k7);function gv(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),r=function(a){return A7[a=a||"normal"]?a:"normal"}(e.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}(e.weight),i=function(a){return typeof Jv[a=a||"normal"]=="number"?a:"normal"}(e.stretch);return{family:t,style:r,weight:n,stretch:i,src:e.src||[],ref:e.ref||{name:t,style:[i,r,n].join(" ")}}}function xw(e,t,r,n){var i;for(i=r;i>=0&&i<t.length;i+=n)if(e[t[i]])return e[t[i]];for(i=r;i>=0&&i<t.length;i-=n)if(e[t[i]])return e[t[i]]}var SR={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Sw={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Ew(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function Aw(e){return e.trimLeft()}function ER(e,t){for(var r=0;r<e.length;){if(e.charAt(r)===t)return[e.substring(0,r),e.substring(r+1)];r+=1}return null}function AR(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return t===null?null:[t[0],e.substring(t[0].length)]}var y1,Pw,kw,vh,b1,Ow,Cw,Nw,vv=["times"];function Lw(e,t,r,n){var i=4,a=Rw;switch(n){case Kt.API.image_compression.FAST:i=1,a=Tw;break;case Kt.API.image_compression.MEDIUM:i=6,a=Mw;break;case Kt.API.image_compression.SLOW:i=9,a=Iw}e=function(o,u,d,f){for(var v,g=o.length/u,c=new Uint8Array(o.length+g),y=[PR,Tw,Rw,Mw,Iw],x=0;x<g;x+=1){var E=x*u,S=o.subarray(E,E+u);if(f)c.set(f(S,d,v),E+x);else{for(var b=y.length,w=[],_=0;_<b;_+=1)w[_]=y[_](S,d,v);var A=OR(w.concat());c.set(w[A],E+x)}v=S}return c}(e,t,r,a);var l=$v(e,{level:i});return Kt.API.__addimage__.arrayBufferToBinaryString(l)}function PR(e){var t=Array.apply([],e);return t.unshift(0),t}function Tw(e,t){var r=e.length,n=[];n[0]=1;for(var i=0;i<r;i+=1){var a=e[i-t]||0;n[i+1]=e[i]-a+256&255}return n}function Rw(e,t,r){var n=e.length,i=[];i[0]=2;for(var a=0;a<n;a+=1){var l=r&&r[a]||0;i[a+1]=e[a]-l+256&255}return i}function Mw(e,t,r){var n=e.length,i=[];i[0]=3;for(var a=0;a<n;a+=1){var l=e[a-t]||0,o=r&&r[a]||0;i[a+1]=e[a]+256-(l+o>>>1)&255}return i}function Iw(e,t,r){var n=e.length,i=[];i[0]=4;for(var a=0;a<n;a+=1){var l=kR(e[a-t]||0,r&&r[a]||0,r&&r[a-t]||0);i[a+1]=e[a]-l+256&255}return i}function kR(e,t,r){if(e===t&&t===r)return e;var n=Math.abs(t-r),i=Math.abs(e-r),a=Math.abs(e+t-r-r);return n<=i&&n<=a?e:i<=a?t:r}function OR(e){var t=e.map(function(r){return r.reduce(function(n,i){return n+Math.abs(i)},0)});return t.indexOf(Math.min.apply(null,t))}function mv(e,t,r){var n=t*r,i=Math.floor(n/8),a=16-(n-8*i+r),l=(1<<r)-1;return O7(e,i)>>a&l}function Fw(e,t,r,n){var i=r*n,a=Math.floor(i/8),l=16-(i-8*a+n),o=(1<<n)-1,u=(t&o)<<l;(function(d,f,v){if(f+1<d.byteLength)d.setUint16(f,v,!1);else{var g=v>>8&255;d.setUint8(f,g)}})(e,a,O7(e,a)&~(o<<l)&65535|u)}function O7(e,t){return t+1<e.byteLength?e.getUint16(t,!1):e.getUint8(t)<<8}function CR(e){var t=0;if(e[t++]!==71||e[t++]!==73||e[t++]!==70||e[t++]!==56||(e[t++]+1&253)!=56||e[t++]!==97)throw new Error("Invalid GIF 87a/89a header.");var r=e[t++]|e[t++]<<8,n=e[t++]|e[t++]<<8,i=e[t++],a=i>>7,l=1<<1+(7&i);e[t++],e[t++];var o=null,u=null;a&&(o=t,u=l,t+=3*l);var d=!0,f=[],v=0,g=null,c=0,y=null;for(this.width=r,this.height=n;d&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(e[t]!==11||e[t+1]==78&&e[t+2]==69&&e[t+3]==84&&e[t+4]==83&&e[t+5]==67&&e[t+6]==65&&e[t+7]==80&&e[t+8]==69&&e[t+9]==50&&e[t+10]==46&&e[t+11]==48&&e[t+12]==3&&e[t+13]==1&&e[t+16]==0)t+=14,y=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((k=e[t++])>=0))throw Error("Invalid block size");if(k===0)break;t+=k}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw new Error("Invalid graphics extension block.");var x=e[t++];v=e[t++]|e[t++]<<8,g=e[t++],1&x||(g=null),c=x>>2&7,t++;break;case 254:for(;;){if(!((k=e[t++])>=0))throw Error("Invalid block size");if(k===0)break;t+=k}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var E=e[t++]|e[t++]<<8,S=e[t++]|e[t++]<<8,b=e[t++]|e[t++]<<8,w=e[t++]|e[t++]<<8,_=e[t++],A=_>>6&1,M=1<<1+(7&_),O=o,L=u,R=!1;_>>7&&(R=!0,O=t,L=M,t+=3*M);var T=t;for(t++;;){var k;if(!((k=e[t++])>=0))throw Error("Invalid block size");if(k===0)break;t+=k}f.push({x:E,y:S,width:b,height:w,has_local_palette:R,palette_offset:O,palette_size:L,data_offset:T,data_length:t-T,transparent_index:g,interlaced:!!A,delay:v,disposal:c});break;case 59:d=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return f.length},this.loopCount=function(){return y},this.frameInfo=function(C){if(C<0||C>=f.length)throw new Error("Frame index out of range.");return f[C]},this.decodeAndBlitFrameBGRA=function(C,q){var G=this.frameInfo(C),J=G.width*G.height,ae=new Uint8Array(J);jw(e,G.data_offset,ae,J);var H=G.palette_offset,V=G.transparent_index;V===null&&(V=256);var Y=G.width,U=r-Y,D=Y,j=4*(G.y*r+G.x),z=4*((G.y+G.height)*r+G.x),Z=j,re=4*U;G.interlaced===!0&&(re+=4*r*7);for(var W=8,Q=0,se=ae.length;Q<se;++Q){var ue=ae[Q];if(D===0&&(D=Y,(Z+=re)>=z&&(re=4*U+4*r*(W-1),Z=j+(Y+U)*(W<<1),W>>=1)),ue===V)Z+=4;else{var le=e[H+3*ue],ye=e[H+3*ue+1],Re=e[H+3*ue+2];q[Z++]=Re,q[Z++]=ye,q[Z++]=le,q[Z++]=255}--D}},this.decodeAndBlitFrameRGBA=function(C,q){var G=this.frameInfo(C),J=G.width*G.height,ae=new Uint8Array(J);jw(e,G.data_offset,ae,J);var H=G.palette_offset,V=G.transparent_index;V===null&&(V=256);var Y=G.width,U=r-Y,D=Y,j=4*(G.y*r+G.x),z=4*((G.y+G.height)*r+G.x),Z=j,re=4*U;G.interlaced===!0&&(re+=4*r*7);for(var W=8,Q=0,se=ae.length;Q<se;++Q){var ue=ae[Q];if(D===0&&(D=Y,(Z+=re)>=z&&(re=4*U+4*r*(W-1),Z=j+(Y+U)*(W<<1),W>>=1)),ue===V)Z+=4;else{var le=e[H+3*ue],ye=e[H+3*ue+1],Re=e[H+3*ue+2];q[Z++]=le,q[Z++]=ye,q[Z++]=Re,q[Z++]=255}--D}}}function jw(e,t,r,n){for(var i=e[t++],a=1<<i,l=a+1,o=l+1,u=i+1,d=(1<<u)-1,f=0,v=0,g=0,c=e[t++],y=new Int32Array(4096),x=null;;){for(;f<16&&c!==0;)v|=e[t++]<<f,f+=8,c===1?c=e[t++]:--c;if(f<u)break;var E=v&d;if(v>>=u,f-=u,E!==a){if(E===l)break;for(var S=E<o?E:x,b=0,w=S;w>a;)w=y[w]>>8,++b;var _=w;if(g+b+(S!==E?1:0)>n)return void zn.log("Warning, gif stream longer than expected.");r[g++]=_;var A=g+=b;for(S!==E&&(r[g++]=_),w=S;b--;)w=y[w],r[--A]=255&w,w>>=8;x!==null&&o<4096&&(y[o++]=x<<8|_,o>=d+1&&u<12&&(++u,d=d<<1|1)),x=E}else o=l+1,d=(1<<(u=i+1))-1,x=null}return g!==n&&zn.log("Warning, gif stream shorter than expected."),r}/**
486
- * @license
487
- Copyright (c) 2008, Adobe Systems Incorporated
488
- All rights reserved.
489
-
490
- Redistribution and use in source and binary forms, with or without
491
- modification, are permitted provided that the following conditions are
492
- met:
493
-
494
- * Redistributions of source code must retain the above copyright notice,
495
- this list of conditions and the following disclaimer.
496
-
497
- * Redistributions in binary form must reproduce the above copyright
498
- notice, this list of conditions and the following disclaimer in the
499
- documentation and/or other materials provided with the distribution.
500
-
501
- * Neither the name of Adobe Systems Incorporated nor the names of its
502
- contributors may be used to endorse or promote products derived from
503
- this software without specific prior written permission.
504
-
505
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
506
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
507
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
508
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
509
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
510
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
511
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
512
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
513
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
514
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
515
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
516
- */function yv(e){var t,r,n,i,a,l=Math.floor,o=new Array(64),u=new Array(64),d=new Array(64),f=new Array(64),v=new Array(65535),g=new Array(65535),c=new Array(64),y=new Array(64),x=[],E=0,S=7,b=new Array(64),w=new Array(64),_=new Array(64),A=new Array(256),M=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],L=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],R=[0,1,2,3,4,5,6,7,8,9,10,11],T=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],k=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],C=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],q=[0,1,2,3,4,5,6,7,8,9,10,11],G=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],J=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function ae(j,z){for(var Z=0,re=0,W=new Array,Q=1;Q<=16;Q++){for(var se=1;se<=j[Q];se++)W[z[re]]=[],W[z[re]][0]=Z,W[z[re]][1]=Q,re++,Z++;Z*=2}return W}function H(j){for(var z=j[0],Z=j[1]-1;Z>=0;)z&1<<Z&&(E|=1<<S),Z--,--S<0&&(E==255?(V(255),V(0)):V(E),S=7,E=0)}function V(j){x.push(j)}function Y(j){V(j>>8&255),V(255&j)}function U(j,z,Z,re,W){for(var Q,se=W[0],ue=W[240],le=function(_e,xe){var Le,pe,Ce,je,He,st,pt,ct,bt,ht,vt=0;for(bt=0;bt<8;++bt){Le=_e[vt],pe=_e[vt+1],Ce=_e[vt+2],je=_e[vt+3],He=_e[vt+4],st=_e[vt+5],pt=_e[vt+6];var wr=Le+(ct=_e[vt+7]),cr=Le-ct,Pt=pe+pt,$t=pe-pt,$e=Ce+st,ze=Ce-st,kt=je+He,St=je-He,er=wr+kt,jt=wr-kt,vr=Pt+$e,Xt=Pt-$e;_e[vt]=er+vr,_e[vt+4]=er-vr;var lr=.707106781*(Xt+jt);_e[vt+2]=jt+lr,_e[vt+6]=jt-lr;var Oi=.382683433*((er=St+ze)-(Xt=$t+cr)),Zn=.5411961*er+Oi,vi=1.306562965*Xt+Oi,mn=.707106781*(vr=ze+$t),Yt=cr+mn,sa=cr-mn;_e[vt+5]=sa+Zn,_e[vt+3]=sa-Zn,_e[vt+1]=Yt+vi,_e[vt+7]=Yt-vi,vt+=8}for(vt=0,bt=0;bt<8;++bt){Le=_e[vt],pe=_e[vt+8],Ce=_e[vt+16],je=_e[vt+24],He=_e[vt+32],st=_e[vt+40],pt=_e[vt+48];var Ra=Le+(ct=_e[vt+56]),Un=Le-ct,Ui=pe+pt,Rr=pe-pt,yn=Ce+st,An=Ce-st,ba=je+He,Mo=je-He,wa=Ra+ba,Ya=Ra-ba,Qn=Ui+yn,_a=Ui-yn;_e[vt]=wa+Qn,_e[vt+32]=wa-Qn;var xa=.707106781*(_a+Ya);_e[vt+16]=Ya+xa,_e[vt+48]=Ya-xa;var Io=.382683433*((wa=Mo+An)-(_a=Rr+Un)),Ci=.5411961*wa+Io,Xa=1.306562965*_a+Io,Ps=.707106781*(Qn=An+Rr),Ko=Un+Ps,Vl=Un-Ps;_e[vt+40]=Vl+Ci,_e[vt+24]=Vl-Ci,_e[vt+8]=Ko+Xa,_e[vt+56]=Ko-Xa,vt++}for(bt=0;bt<64;++bt)ht=_e[bt]*xe[bt],c[bt]=ht>0?ht+.5|0:ht-.5|0;return c}(j,z),ye=0;ye<64;++ye)y[O[ye]]=le[ye];var Re=y[0]-Z;Z=y[0],Re==0?H(re[0]):(H(re[g[Q=32767+Re]]),H(v[Q]));for(var Me=63;Me>0&&y[Me]==0;)Me--;if(Me==0)return H(se),Z;for(var Pe,de=1;de<=Me;){for(var Te=de;y[de]==0&&de<=Me;)++de;var Ae=de-Te;if(Ae>=16){Pe=Ae>>4;for(var be=1;be<=Pe;++be)H(ue);Ae&=15}Q=32767+y[de],H(W[(Ae<<4)+g[Q]]),H(v[Q]),de++}return Me!=63&&H(se),Z}function D(j){j=Math.min(Math.max(j,1),100),a!=j&&(function(z){for(var Z=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],re=0;re<64;re++){var W=l((Z[re]*z+50)/100);W=Math.min(Math.max(W,1),255),o[O[re]]=W}for(var Q=[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],se=0;se<64;se++){var ue=l((Q[se]*z+50)/100);ue=Math.min(Math.max(ue,1),255),u[O[se]]=ue}for(var le=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],ye=0,Re=0;Re<8;Re++)for(var Me=0;Me<8;Me++)d[ye]=1/(o[O[ye]]*le[Re]*le[Me]*8),f[ye]=1/(u[O[ye]]*le[Re]*le[Me]*8),ye++}(j<50?Math.floor(5e3/j):Math.floor(200-2*j)),a=j)}this.encode=function(j,z){z&&D(z),x=new Array,E=0,S=7,Y(65496),Y(65504),Y(16),V(74),V(70),V(73),V(70),V(0),V(1),V(1),V(0),Y(1),Y(1),V(0),V(0),function(){Y(65499),Y(132),V(0);for(var pe=0;pe<64;pe++)V(o[pe]);V(1);for(var Ce=0;Ce<64;Ce++)V(u[Ce])}(),function(pe,Ce){Y(65472),Y(17),V(8),Y(Ce),Y(pe),V(3),V(1),V(17),V(0),V(2),V(17),V(1),V(3),V(17),V(1)}(j.width,j.height),function(){Y(65476),Y(418),V(0);for(var pe=0;pe<16;pe++)V(L[pe+1]);for(var Ce=0;Ce<=11;Ce++)V(R[Ce]);V(16);for(var je=0;je<16;je++)V(T[je+1]);for(var He=0;He<=161;He++)V(k[He]);V(1);for(var st=0;st<16;st++)V(C[st+1]);for(var pt=0;pt<=11;pt++)V(q[pt]);V(17);for(var ct=0;ct<16;ct++)V(G[ct+1]);for(var bt=0;bt<=161;bt++)V(J[bt])}(),Y(65498),Y(12),V(3),V(1),V(0),V(2),V(17),V(3),V(17),V(0),V(63),V(0);var Z=0,re=0,W=0;E=0,S=7,this.encode.displayName="_encode_";for(var Q,se,ue,le,ye,Re,Me,Pe,de,Te=j.data,Ae=j.width,be=j.height,_e=4*Ae,xe=0;xe<be;){for(Q=0;Q<_e;){for(ye=_e*xe+Q,Me=-1,Pe=0,de=0;de<64;de++)Re=ye+(Pe=de>>3)*_e+(Me=4*(7&de)),xe+Pe>=be&&(Re-=_e*(xe+1+Pe-be)),Q+Me>=_e&&(Re-=Q+Me-_e+4),se=Te[Re++],ue=Te[Re++],le=Te[Re++],b[de]=(M[se]+M[ue+256|0]+M[le+512|0]>>16)-128,w[de]=(M[se+768|0]+M[ue+1024|0]+M[le+1280|0]>>16)-128,_[de]=(M[se+1280|0]+M[ue+1536|0]+M[le+1792|0]>>16)-128;Z=U(b,d,Z,t,n),re=U(w,f,re,r,i),W=U(_,f,W,r,i),Q+=32}xe+=8}if(S>=0){var Le=[];Le[1]=S+1,Le[0]=(1<<S+1)-1,H(Le)}return Y(65497),new Uint8Array(x)},e=e||50,function(){for(var j=String.fromCharCode,z=0;z<256;z++)A[z]=j(z)}(),t=ae(L,R),r=ae(C,q),n=ae(T,k),i=ae(G,J),function(){for(var j=1,z=2,Z=1;Z<=15;Z++){for(var re=j;re<z;re++)g[32767+re]=Z,v[32767+re]=[],v[32767+re][1]=Z,v[32767+re][0]=re;for(var W=-(z-1);W<=-j;W++)g[32767+W]=Z,v[32767+W]=[],v[32767+W][1]=Z,v[32767+W][0]=z-1+W;j<<=1,z<<=1}}(),function(){for(var j=0;j<256;j++)M[j]=19595*j,M[j+256|0]=38470*j,M[j+512|0]=7471*j+32768,M[j+768|0]=-11059*j,M[j+1024|0]=-21709*j,M[j+1280|0]=32768*j+8421375,M[j+1536|0]=-27439*j,M[j+1792|0]=-5329*j}(),D(e)}/**
517
- * @license
518
- * Copyright (c) 2017 Aras Abbasi
519
- *
520
- * Licensed under the MIT License.
521
- * http://opensource.org/licenses/mit-license
522
- */function Ml(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function Dw(e){function t(R){if(!R)throw Error("assert :P")}function r(R,T,k){for(var C=0;4>C;C++)if(R[T+C]!=k.charCodeAt(C))return!0;return!1}function n(R,T,k,C,q){for(var G=0;G<q;G++)R[T+G]=k[C+G]}function i(R,T,k,C){for(var q=0;q<C;q++)R[T+q]=k}function a(R){return new Int32Array(R)}function l(R,T){for(var k=[],C=0;C<R;C++)k.push(new T);return k}function o(R,T){var k=[];return function C(q,G,J){for(var ae=J[G],H=0;H<ae&&(q.push(J.length>G+1?[]:new T),!(J.length<G+1));H++)C(q[H],G+1,J)}(k,0,R),k}var u=function(){var R=this;function T(N,B){for(var te=1<<B-1>>>0;N&te;)te>>>=1;return te?(N&te-1)+te:N}function k(N,B,te,ie,he){t(!(ie%te));do N[B+(ie-=te)]=he;while(0<ie)}function C(N,B,te,ie,he){if(t(2328>=he),512>=he)var ve=a(512);else if((ve=a(he))==null)return 0;return function(me,we,Se,Oe,De,Ze){var ke,qe,Ke=we,it=1<<Se,Ye=a(16),nt=a(16);for(t(De!=0),t(Oe!=null),t(me!=null),t(0<Se),qe=0;qe<De;++qe){if(15<Oe[qe])return 0;++Ye[Oe[qe]]}if(Ye[0]==De)return 0;for(nt[1]=0,ke=1;15>ke;++ke){if(Ye[ke]>1<<ke)return 0;nt[ke+1]=nt[ke]+Ye[ke]}for(qe=0;qe<De;++qe)ke=Oe[qe],0<Oe[qe]&&(Ze[nt[ke]++]=qe);if(nt[15]==1)return(Oe=new q).g=0,Oe.value=Ze[0],k(me,Ke,1,it,Oe),it;var Ue,ot=-1,ut=it-1,qt=0,Mt=1,ar=1,It=1<<Se;for(qe=0,ke=1,De=2;ke<=Se;++ke,De<<=1){if(Mt+=ar<<=1,0>(ar-=Ye[ke]))return 0;for(;0<Ye[ke];--Ye[ke])(Oe=new q).g=ke,Oe.value=Ze[qe++],k(me,Ke+qt,De,It,Oe),qt=T(qt,ke)}for(ke=Se+1,De=2;15>=ke;++ke,De<<=1){if(Mt+=ar<<=1,0>(ar-=Ye[ke]))return 0;for(;0<Ye[ke];--Ye[ke]){if(Oe=new q,(qt&ut)!=ot){for(Ke+=It,Ue=1<<(ot=ke)-Se;15>ot&&!(0>=(Ue-=Ye[ot]));)++ot,Ue<<=1;it+=It=1<<(Ue=ot-Se),me[we+(ot=qt&ut)].g=Ue+Se,me[we+ot].value=Ke-we-ot}Oe.g=ke-Se,Oe.value=Ze[qe++],k(me,Ke+(qt>>Se),De,It,Oe),qt=T(qt,ke)}}return Mt!=2*nt[15]-1?0:it}(N,B,te,ie,he,ve)}function q(){this.value=this.g=0}function G(){this.value=this.g=0}function J(){this.G=l(5,q),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=l(Vn,G)}function ae(N,B,te,ie){t(N!=null),t(B!=null),t(2147483648>ie),N.Ca=254,N.I=0,N.b=-8,N.Ka=0,N.oa=B,N.pa=te,N.Jd=B,N.Yc=te+ie,N.Zc=4<=ie?te+ie-4+1:te,se(N)}function H(N,B){for(var te=0;0<B--;)te|=le(N,128)<<B;return te}function V(N,B){var te=H(N,B);return ue(N)?-te:te}function Y(N,B,te,ie){var he,ve=0;for(t(N!=null),t(B!=null),t(4294967288>ie),N.Sb=ie,N.Ra=0,N.u=0,N.h=0,4<ie&&(ie=4),he=0;he<ie;++he)ve+=B[te+he]<<8*he;N.Ra=ve,N.bb=ie,N.oa=B,N.pa=te}function U(N){for(;8<=N.u&&N.bb<N.Sb;)N.Ra>>>=8,N.Ra+=N.oa[N.pa+N.bb]<<ca-8>>>0,++N.bb,N.u-=8;re(N)&&(N.h=1,N.u=0)}function D(N,B){if(t(0<=B),!N.h&&B<=Ql){var te=Z(N)&os[B];return N.u+=B,U(N),te}return N.h=1,N.u=0}function j(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function z(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function Z(N){return N.Ra>>>(N.u&ca-1)>>>0}function re(N){return t(N.bb<=N.Sb),N.h||N.bb==N.Sb&&N.u>ca}function W(N,B){N.u=B,N.h=re(N)}function Q(N){N.u>=Jr&&(t(N.u>=Jr),U(N))}function se(N){t(N!=null&&N.oa!=null),N.pa<N.Zc?(N.I=(N.oa[N.pa++]|N.I<<8)>>>0,N.b+=8):(t(N!=null&&N.oa!=null),N.pa<N.Yc?(N.b+=8,N.I=N.oa[N.pa++]|N.I<<8):N.Ka?N.b=0:(N.I<<=8,N.b+=8,N.Ka=1))}function ue(N){return H(N,1)}function le(N,B){var te=N.Ca;0>N.b&&se(N);var ie=N.b,he=te*B>>>8,ve=(N.I>>>ie>he)+0;for(ve?(te-=he,N.I-=he+1<<ie>>>0):te=he+1,ie=te,he=0;256<=ie;)he+=8,ie>>=8;return ie=7^he+vl[ie],N.b-=ie,N.Ca=(te<<ie)-1,ve}function ye(N,B,te){N[B+0]=te>>24&255,N[B+1]=te>>16&255,N[B+2]=te>>8&255,N[B+3]=255&te}function Re(N,B){return N[B+0]|N[B+1]<<8}function Me(N,B){return Re(N,B)|N[B+2]<<16}function Pe(N,B){return Re(N,B)|Re(N,B+2)<<16}function de(N,B){var te=1<<B;return t(N!=null),t(0<B),N.X=a(te),N.X==null?0:(N.Mb=32-B,N.Xa=B,1)}function Te(N,B){t(N!=null),t(B!=null),t(N.Xa==B.Xa),n(B.X,0,N.X,0,1<<B.Xa)}function Ae(){this.X=[],this.Xa=this.Mb=0}function be(N,B,te,ie){t(te!=null),t(ie!=null);var he=te[0],ve=ie[0];return he==0&&(he=(N*ve+B/2)/B),ve==0&&(ve=(B*he+N/2)/N),0>=he||0>=ve?0:(te[0]=he,ie[0]=ve,1)}function _e(N,B){return N+(1<<B)-1>>>B}function xe(N,B){return((4278255360&N)+(4278255360&B)>>>0&4278255360)+((16711935&N)+(16711935&B)>>>0&16711935)>>>0}function Le(N,B){R[B]=function(te,ie,he,ve,me,we,Se){var Oe;for(Oe=0;Oe<me;++Oe){var De=R[N](we[Se+Oe-1],he,ve+Oe);we[Se+Oe]=xe(te[ie+Oe],De)}}}function pe(){this.ud=this.hd=this.jd=0}function Ce(N,B){return((4278124286&(N^B))>>>1)+(N&B)>>>0}function je(N){return 0<=N&&256>N?N:0>N?0:255<N?255:void 0}function He(N,B){return je(N+(N-B+.5>>1))}function st(N,B,te){return Math.abs(B-te)-Math.abs(N-te)}function pt(N,B,te,ie,he,ve,me){for(ie=ve[me-1],te=0;te<he;++te)ve[me+te]=ie=xe(N[B+te],ie)}function ct(N,B,te,ie,he){var ve;for(ve=0;ve<te;++ve){var me=N[B+ve],we=me>>8&255,Se=16711935&(Se=(Se=16711935&me)+((we<<16)+we));ie[he+ve]=(4278255360&me)+Se>>>0}}function bt(N,B){B.jd=255&N,B.hd=N>>8&255,B.ud=N>>16&255}function ht(N,B,te,ie,he,ve){var me;for(me=0;me<ie;++me){var we=B[te+me],Se=we>>>8,Oe=we,De=255&(De=(De=we>>>16)+((N.jd<<24>>24)*(Se<<24>>24)>>>5));Oe=255&(Oe=(Oe+=(N.hd<<24>>24)*(Se<<24>>24)>>>5)+((N.ud<<24>>24)*(De<<24>>24)>>>5)),he[ve+me]=(4278255360&we)+(De<<16)+Oe}}function vt(N,B,te,ie,he){R[B]=function(ve,me,we,Se,Oe,De,Ze,ke,qe){for(Se=Ze;Se<ke;++Se)for(Ze=0;Ze<qe;++Ze)Oe[De++]=he(we[ie(ve[me++])])},R[N]=function(ve,me,we,Se,Oe,De,Ze){var ke=8>>ve.b,qe=ve.Ea,Ke=ve.K[0],it=ve.w;if(8>ke)for(ve=(1<<ve.b)-1,it=(1<<ke)-1;me<we;++me){var Ye,nt=0;for(Ye=0;Ye<qe;++Ye)Ye&ve||(nt=ie(Se[Oe++])),De[Ze++]=he(Ke[nt&it]),nt>>=ke}else R["VP8LMapColor"+te](Se,Oe,Ke,it,De,Ze,me,we,qe)}}function wr(N,B,te,ie,he){for(te=B+te;B<te;){var ve=N[B++];ie[he++]=ve>>16&255,ie[he++]=ve>>8&255,ie[he++]=255&ve}}function cr(N,B,te,ie,he){for(te=B+te;B<te;){var ve=N[B++];ie[he++]=ve>>16&255,ie[he++]=ve>>8&255,ie[he++]=255&ve,ie[he++]=ve>>24&255}}function Pt(N,B,te,ie,he){for(te=B+te;B<te;){var ve=(me=N[B++])>>16&240|me>>12&15,me=240&me|me>>28&15;ie[he++]=ve,ie[he++]=me}}function $t(N,B,te,ie,he){for(te=B+te;B<te;){var ve=(me=N[B++])>>16&248|me>>13&7,me=me>>5&224|me>>3&31;ie[he++]=ve,ie[he++]=me}}function $e(N,B,te,ie,he){for(te=B+te;B<te;){var ve=N[B++];ie[he++]=255&ve,ie[he++]=ve>>8&255,ie[he++]=ve>>16&255}}function ze(N,B,te,ie,he,ve){if(ve==0)for(te=B+te;B<te;)ye(ie,((ve=N[B++])[0]>>24|ve[1]>>8&65280|ve[2]<<8&16711680|ve[3]<<24)>>>0),he+=32;else n(ie,he,N,B,te)}function kt(N,B){R[B][0]=R[N+"0"],R[B][1]=R[N+"1"],R[B][2]=R[N+"2"],R[B][3]=R[N+"3"],R[B][4]=R[N+"4"],R[B][5]=R[N+"5"],R[B][6]=R[N+"6"],R[B][7]=R[N+"7"],R[B][8]=R[N+"8"],R[B][9]=R[N+"9"],R[B][10]=R[N+"10"],R[B][11]=R[N+"11"],R[B][12]=R[N+"12"],R[B][13]=R[N+"13"],R[B][14]=R[N+"0"],R[B][15]=R[N+"0"]}function St(N){return N==El||N==Ts||N==nu||N==iu}function er(){this.eb=[],this.size=this.A=this.fb=0}function jt(){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 vr(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new er,this.f.kb=new jt,this.sd=null}function Xt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function lr(){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 Oi(N){return alert("todo:WebPSamplerProcessPlane"),N.T}function Zn(N,B){var te=N.T,ie=B.ba.f.RGBA,he=ie.eb,ve=ie.fb+N.ka*ie.A,me=Ca[B.ba.S],we=N.y,Se=N.O,Oe=N.f,De=N.N,Ze=N.ea,ke=N.W,qe=B.cc,Ke=B.dc,it=B.Mc,Ye=B.Nc,nt=N.ka,Ue=N.ka+N.T,ot=N.U,ut=ot+1>>1;for(nt==0?me(we,Se,null,null,Oe,De,Ze,ke,Oe,De,Ze,ke,he,ve,null,null,ot):(me(B.ec,B.fc,we,Se,qe,Ke,it,Ye,Oe,De,Ze,ke,he,ve-ie.A,he,ve,ot),++te);nt+2<Ue;nt+=2)qe=Oe,Ke=De,it=Ze,Ye=ke,De+=N.Rc,ke+=N.Rc,ve+=2*ie.A,me(we,(Se+=2*N.fa)-N.fa,we,Se,qe,Ke,it,Ye,Oe,De,Ze,ke,he,ve-ie.A,he,ve,ot);return Se+=N.fa,N.j+Ue<N.o?(n(B.ec,B.fc,we,Se,ot),n(B.cc,B.dc,Oe,De,ut),n(B.Mc,B.Nc,Ze,ke,ut),te--):1&Ue||me(we,Se,null,null,Oe,De,Ze,ke,Oe,De,Ze,ke,he,ve+ie.A,null,null,ot),te}function vi(N,B,te){var ie=N.F,he=[N.J];if(ie!=null){var ve=N.U,me=B.ba.S,we=me==ru||me==nu;B=B.ba.f.RGBA;var Se=[0],Oe=N.ka;Se[0]=N.T,N.Kb&&(Oe==0?--Se[0]:(--Oe,he[0]-=N.width),N.j+N.ka+N.T==N.o&&(Se[0]=N.o-N.j-Oe));var De=B.eb;Oe=B.fb+Oe*B.A,N=wl(ie,he[0],N.width,ve,Se,De,Oe+(we?0:3),B.A),t(te==Se),N&&St(me)&&Uo(De,Oe,we,ve,Se,B.A)}return 0}function mn(N){var B=N.ma,te=B.ba.S,ie=11>te,he=te==Ho||te==Sl||te==ru||te==sn||te==12||St(te);if(B.memory=null,B.Ib=null,B.Jb=null,B.Nd=null,!Gi(B.Oa,N,he?11:12))return 0;if(he&&St(te)&&Iu(),N.da)alert("todo:use_scaling");else{if(ie){if(B.Ib=Oi,N.Kb){if(te=N.U+1>>1,B.memory=a(N.U+2*te),B.memory==null)return 0;B.ec=B.memory,B.fc=0,B.cc=B.ec,B.dc=B.fc+N.U,B.Mc=B.cc,B.Nc=B.dc+te,B.Ib=Zn,Iu()}}else alert("todo:EmitYUV");he&&(B.Jb=vi,ie&&pl())}if(ie&&!Mi){for(N=0;256>N;++N)ha[N]=89858*(N-128)+Po>>ss,da[N]=-22014*(N-128)+Po,Pl[N]=-45773*(N-128),rl[N]=113618*(N-128)+Po>>ss;for(N=Yr;N<tn;++N)B=76283*(N-16)+Po>>ss,lu[N-Yr]=si(B,255),pf[N-Yr]=si(B+8>>4,15);Mi=1}return 1}function Yt(N){var B=N.ma,te=N.U,ie=N.T;return t(!(1&N.ka)),0>=te||0>=ie?0:(te=B.Ib(N,B),B.Jb!=null&&B.Jb(N,B,te),B.Dc+=te,1)}function sa(N){N.ma.memory=null}function Ra(N,B,te,ie){return D(N,8)!=47?0:(B[0]=D(N,14)+1,te[0]=D(N,14)+1,ie[0]=D(N,1),D(N,3)!=0?0:!N.h)}function Un(N,B){if(4>N)return N+1;var te=N-2>>1;return(2+(1&N)<<te)+D(B,te)+1}function Ui(N,B){return 120<B?B-120:1<=(te=((te=Kf[B-1])>>4)*N+(8-(15&te)))?te:1;var te}function Rr(N,B,te){var ie=Z(te),he=N[B+=255&ie].g-8;return 0<he&&(W(te,te.u+8),ie=Z(te),B+=N[B].value,B+=ie&(1<<he)-1),W(te,te.u+N[B].g),N[B].value}function yn(N,B,te){return te.g+=N.g,te.value+=N.value<<B>>>0,t(8>=te.g),N.g}function An(N,B,te){var ie=N.xc;return t((B=ie==0?0:N.vc[N.md*(te>>ie)+(B>>ie)])<N.Wb),N.Ya[B]}function ba(N,B,te,ie){var he=N.ab,ve=N.c*B,me=N.C;B=me+B;var we=te,Se=ie;for(ie=N.Ta,te=N.Ua;0<he--;){var Oe=N.gc[he],De=me,Ze=B,ke=we,qe=Se,Ke=(Se=ie,we=te,Oe.Ea);switch(t(De<Ze),t(Ze<=Oe.nc),Oe.hc){case 2:ml(ke,qe,(Ze-De)*Ke,Se,we);break;case 0:var it=De,Ye=Ze,nt=Se,Ue=we,ot=(It=Oe).Ea;it==0&&(ka(ke,qe,null,null,1,nt,Ue),pt(ke,qe+1,0,0,ot-1,nt,Ue+1),qe+=ot,Ue+=ot,++it);for(var ut=1<<It.b,qt=ut-1,Mt=_e(ot,It.b),ar=It.K,It=It.w+(it>>It.b)*Mt;it<Ye;){var _r=ar,Rn=It,fr=1;for(Wi(ke,qe,nt,Ue-ot,1,nt,Ue);fr<ot;){var Tt=(fr&~qt)+ut;Tt>ot&&(Tt=ot),(0,Ti[_r[Rn++]>>8&15])(ke,qe+ +fr,nt,Ue+fr-ot,Tt-fr,nt,Ue+fr),fr=Tt}qe+=ot,Ue+=ot,++it&qt||(It+=Mt)}Ze!=Oe.nc&&n(Se,we-Ke,Se,we+(Ze-De-1)*Ke,Ke);break;case 1:for(Ke=ke,Ye=qe,ot=(ke=Oe.Ea)-(Ue=ke&~(nt=(qe=1<<Oe.b)-1)),it=_e(ke,Oe.b),ut=Oe.K,Oe=Oe.w+(De>>Oe.b)*it;De<Ze;){for(qt=ut,Mt=Oe,ar=new pe,It=Ye+Ue,_r=Ye+ke;Ye<It;)bt(qt[Mt++],ar),xo(ar,Ke,Ye,qe,Se,we),Ye+=qe,we+=qe;Ye<_r&&(bt(qt[Mt++],ar),xo(ar,Ke,Ye,ot,Se,we),Ye+=ot,we+=ot),++De&nt||(Oe+=it)}break;case 3:if(ke==Se&&qe==we&&0<Oe.b){for(Ye=Se,ke=Ke=we+(Ze-De)*Ke-(Ue=(Ze-De)*_e(Oe.Ea,Oe.b)),qe=Se,nt=we,it=[],Ue=(ot=Ue)-1;0<=Ue;--Ue)it[Ue]=qe[nt+Ue];for(Ue=ot-1;0<=Ue;--Ue)Ye[ke+Ue]=it[Ue];_o(Oe,De,Ze,Se,Ke,Se,we)}else _o(Oe,De,Ze,ke,qe,Se,we)}we=ie,Se=te}Se!=te&&n(ie,te,we,Se,ve)}function Mo(N,B){var te=N.V,ie=N.Ba+N.c*N.C,he=B-N.C;if(t(B<=N.l.o),t(16>=he),0<he){var ve=N.l,me=N.Ta,we=N.Ua,Se=ve.width;if(ba(N,he,te,ie),he=we=[we],t((te=N.C)<(ie=B)),t(ve.v<ve.va),ie>ve.o&&(ie=ve.o),te<ve.j){var Oe=ve.j-te;te=ve.j,he[0]+=Oe*Se}if(te>=ie?te=0:(he[0]+=4*ve.v,ve.ka=te-ve.j,ve.U=ve.va-ve.v,ve.T=ie-te,te=1),te){if(we=we[0],11>(te=N.ca).S){var De=te.f.RGBA,Ze=(ie=te.S,he=ve.U,ve=ve.T,Oe=De.eb,De.A),ke=ve;for(De=De.fb+N.Ma*De.A;0<ke--;){var qe=me,Ke=we,it=he,Ye=Oe,nt=De;switch(ie){case xl:zo(qe,Ke,it,Ye,nt);break;case Ho:Oa(qe,Ke,it,Ye,nt);break;case El:Oa(qe,Ke,it,Ye,nt),Uo(Ye,nt,0,it,1,0);break;case ff:en(qe,Ke,it,Ye,nt);break;case Sl:ze(qe,Ke,it,Ye,nt,1);break;case Ts:ze(qe,Ke,it,Ye,nt,1),Uo(Ye,nt,0,it,1,0);break;case ru:ze(qe,Ke,it,Ye,nt,0);break;case nu:ze(qe,Ke,it,Ye,nt,0),Uo(Ye,nt,1,it,1,0);break;case sn:So(qe,Ke,it,Ye,nt);break;case iu:So(qe,Ke,it,Ye,nt),ju(Ye,nt,it,1,0);break;case Du:tr(qe,Ke,it,Ye,nt);break;default:t(0)}we+=Se,De+=Ze}N.Ma+=ve}else alert("todo:EmitRescaledRowsYUVA");t(N.Ma<=te.height)}}N.C=B,t(N.C<=N.i)}function wa(N){var B;if(0<N.ua)return 0;for(B=0;B<N.Wb;++B){var te=N.Ya[B].G,ie=N.Ya[B].H;if(0<te[1][ie[1]+0].g||0<te[2][ie[2]+0].g||0<te[3][ie[3]+0].g)return 0}return 1}function Ya(N,B,te,ie,he,ve){if(N.Z!=0){var me=N.qd,we=N.rd;for(t(Qi[N.Z]!=null);B<te;++B)Qi[N.Z](me,we,ie,he,ie,he,ve),me=ie,we=he,he+=ve;N.qd=me,N.rd=we}}function Qn(N,B){var te=N.l.ma,ie=te.Z==0||te.Z==1?N.l.j:N.C;if(ie=N.C<ie?ie:N.C,t(B<=N.l.o),B>ie){var he=N.l.width,ve=te.ca,me=te.tb+he*ie,we=N.V,Se=N.Ba+N.c*ie,Oe=N.gc;t(N.ab==1),t(Oe[0].hc==3),Bo(Oe[0],ie,B,we,Se,ve,me),Ya(te,ie,B,ve,me,he)}N.C=N.Ma=B}function _a(N,B,te,ie,he,ve,me){var we=N.$/ie,Se=N.$%ie,Oe=N.m,De=N.s,Ze=te+N.$,ke=Ze;he=te+ie*he;var qe=te+ie*ve,Ke=280+De.ua,it=N.Pb?we:16777216,Ye=0<De.ua?De.Wa:null,nt=De.wc,Ue=Ze<qe?An(De,Se,we):null;t(N.C<ve),t(qe<=he);var ot=!1;e:for(;;){for(;ot||Ze<qe;){var ut=0;if(we>=it){var qt=Ze-te;t((it=N).Pb),it.wd=it.m,it.xd=qt,0<it.s.ua&&Te(it.s.Wa,it.s.vb),it=we+Bu}if(Se&nt||(Ue=An(De,Se,we)),t(Ue!=null),Ue.Qb&&(B[Ze]=Ue.qb,ot=!0),!ot)if(Q(Oe),Ue.jc){ut=Oe,qt=B;var Mt=Ze,ar=Ue.pd[Z(ut)&Vn-1];t(Ue.jc),256>ar.g?(W(ut,ut.u+ar.g),qt[Mt]=ar.value,ut=0):(W(ut,ut.u+ar.g-256),t(256<=ar.value),ut=ar.value),ut==0&&(ot=!0)}else ut=Rr(Ue.G[0],Ue.H[0],Oe);if(Oe.h)break;if(ot||256>ut){if(!ot)if(Ue.nd)B[Ze]=(Ue.qb|ut<<8)>>>0;else{if(Q(Oe),ot=Rr(Ue.G[1],Ue.H[1],Oe),Q(Oe),qt=Rr(Ue.G[2],Ue.H[2],Oe),Mt=Rr(Ue.G[3],Ue.H[3],Oe),Oe.h)break;B[Ze]=(Mt<<24|ot<<16|ut<<8|qt)>>>0}if(ot=!1,++Ze,++Se>=ie&&(Se=0,++we,me!=null&&we<=ve&&!(we%16)&&me(N,we),Ye!=null))for(;ke<Ze;)ut=B[ke++],Ye.X[(506832829*ut&4294967295)>>>Ye.Mb]=ut}else if(280>ut){if(ut=Un(ut-256,Oe),qt=Rr(Ue.G[4],Ue.H[4],Oe),Q(Oe),qt=Ui(ie,qt=Un(qt,Oe)),Oe.h)break;if(Ze-te<qt||he-Ze<ut)break e;for(Mt=0;Mt<ut;++Mt)B[Ze+Mt]=B[Ze+Mt-qt];for(Ze+=ut,Se+=ut;Se>=ie;)Se-=ie,++we,me!=null&&we<=ve&&!(we%16)&&me(N,we);if(t(Ze<=he),Se&nt&&(Ue=An(De,Se,we)),Ye!=null)for(;ke<Ze;)ut=B[ke++],Ye.X[(506832829*ut&4294967295)>>>Ye.Mb]=ut}else{if(!(ut<Ke))break e;for(ot=ut-280,t(Ye!=null);ke<Ze;)ut=B[ke++],Ye.X[(506832829*ut&4294967295)>>>Ye.Mb]=ut;ut=Ze,t(!(ot>>>(qt=Ye).Xa)),B[ut]=qt.X[ot],ot=!0}ot||t(Oe.h==re(Oe))}if(N.Pb&&Oe.h&&Ze<he)t(N.m.h),N.a=5,N.m=N.wd,N.$=N.xd,0<N.s.ua&&Te(N.s.vb,N.s.Wa);else{if(Oe.h)break e;me?.(N,we>ve?ve:we),N.a=0,N.$=Ze-te}return 1}return N.a=3,0}function xa(N){t(N!=null),N.vc=null,N.yc=null,N.Ya=null;var B=N.Wa;B!=null&&(B.X=null),N.vb=null,t(N!=null)}function Io(){var N=new Mr;return N==null?null:(N.a=0,N.xb=ou,kt("Predictor","VP8LPredictors"),kt("Predictor","VP8LPredictors_C"),kt("PredictorAdd","VP8LPredictorsAdd"),kt("PredictorAdd","VP8LPredictorsAdd_C"),ml=ct,xo=ht,zo=wr,Oa=cr,So=Pt,tr=$t,en=$e,R.VP8LMapColor32b=Yi,R.VP8LMapColor8b=za,N)}function Ci(N,B,te,ie,he){var ve=1,me=[N],we=[B],Se=ie.m,Oe=ie.s,De=null,Ze=0;e:for(;;){if(te)for(;ve&&D(Se,1);){var ke=me,qe=we,Ke=ie,it=1,Ye=Ke.m,nt=Ke.gc[Ke.ab],Ue=D(Ye,2);if(Ke.Oc&1<<Ue)ve=0;else{switch(Ke.Oc|=1<<Ue,nt.hc=Ue,nt.Ea=ke[0],nt.nc=qe[0],nt.K=[null],++Ke.ab,t(4>=Ke.ab),Ue){case 0:case 1:nt.b=D(Ye,3)+2,it=Ci(_e(nt.Ea,nt.b),_e(nt.nc,nt.b),0,Ke,nt.K),nt.K=nt.K[0];break;case 3:var ot,ut=D(Ye,8)+1,qt=16<ut?0:4<ut?1:2<ut?2:3;if(ke[0]=_e(nt.Ea,qt),nt.b=qt,ot=it=Ci(ut,1,0,Ke,nt.K)){var Mt,ar=ut,It=nt,_r=1<<(8>>It.b),Rn=a(_r);if(Rn==null)ot=0;else{var fr=It.K[0],Tt=It.w;for(Rn[0]=It.K[0][0],Mt=1;Mt<1*ar;++Mt)Rn[Mt]=xe(fr[Tt+Mt],Rn[Mt-1]);for(;Mt<4*_r;++Mt)Rn[Mt]=0;It.K[0]=null,It.K[0]=Rn,ot=1}}it=ot;break;case 2:break;default:t(0)}ve=it}}if(me=me[0],we=we[0],ve&&D(Se,1)&&!(ve=1<=(Ze=D(Se,4))&&11>=Ze)){ie.a=3;break e}var _t;if(_t=ve)t:{var Mn,Dt,or,kr=ie,fi=me,ni=we,Ir=Ze,hi=te,hn=kr.m,On=kr.s,Sr=[null],Dr=1,wn=0,Br=hf[Ir];r:for(;;){if(hi&&D(hn,1)){var _n=D(hn,3)+2,xn=_e(fi,_n),Xr=_e(ni,_n),Si=xn*Xr;if(!Ci(xn,Xr,0,kr,Sr))break r;for(Sr=Sr[0],On.xc=_n,Mn=0;Mn<Si;++Mn){var Vr=Sr[Mn]>>8&65535;Sr[Mn]=Vr,Vr>=Dr&&(Dr=Vr+1)}}if(hn.h)break r;for(Dt=0;5>Dt;++Dt){var Gr=tl[Dt];!Dt&&0<Ir&&(Gr+=1<<Ir),wn<Gr&&(wn=Gr)}var $n=l(Dr*Br,q),Ei=Dr,pa=l(Ei,J);if(pa==null)var Wn=null;else t(65536>=Ei),Wn=pa;var In=a(wn);if(Wn==null||In==null||$n==null){kr.a=1;break r}var ga=$n;for(Mn=or=0;Mn<Dr;++Mn){var Kr=Wn[Mn],Ii=Kr.G,zr=Kr.H,rr=0,Or=1,yr=0;for(Dt=0;5>Dt;++Dt){Gr=tl[Dt],Ii[Dt]=ga,zr[Dt]=or,!Dt&&0<Ir&&(Gr+=1<<Ir);i:{var Cn,ii=Gr,Vo=kr,ln=In,uu=ga,Is=or,un=0,io=Vo.m,Ol=D(io,1);if(i(ln,0,0,ii),Ol){var va=D(io,1)+1,cu=D(io,1),fu=D(io,cu==0?1:8);ln[fu]=1,va==2&&(ln[fu=D(io,8)]=1);var Fi=1}else{var rn=a(19),Fn=D(io,4)+4;if(19<Fn){Vo.a=3;var jn=0;break i}for(Cn=0;Cn<Fn;++Cn)rn[Hh[Cn]]=D(io,3);var ao=void 0,ko=void 0,oo=Vo,Ac=rn,Dn=ii,hu=ln,nl=0,so=oo.m,gn=8,di=l(128,q);n:for(;C(di,0,7,Ac,19);){if(D(so,1)){var ma=2+2*D(so,3);if((ao=2+D(so,ma))>Dn)break n}else ao=Dn;for(ko=0;ko<Dn&&ao--;){Q(so);var Ji=di[0+(127&Z(so))];W(so,so.u+Ji.g);var Fs=Ji.value;if(16>Fs)hu[ko++]=Fs,Fs!=0&&(gn=Fs);else{var Pc=Fs==16,Hu=Fs-16,rh=_c[Hu],fs=D(so,au[Hu])+rh;if(ko+fs>Dn)break n;for(var gf=Pc?gn:0;0<fs--;)hu[ko++]=gf}}nl=1;break n}nl||(oo.a=3),Fi=nl}(Fi=Fi&&!io.h)&&(un=C(uu,Is,8,ln,ii)),Fi&&un!=0?jn=un:(Vo.a=3,jn=0)}if(jn==0)break r;if(Or&&Xf[Dt]==1&&(Or=ga[or].g==0),rr+=ga[or].g,or+=jn,3>=Dt){var Cl,du=In[0];for(Cl=1;Cl<Gr;++Cl)In[Cl]>du&&(du=In[Cl]);yr+=du}}if(Kr.nd=Or,Kr.Qb=0,Or&&(Kr.qb=(Ii[3][zr[3]+0].value<<24|Ii[1][zr[1]+0].value<<16|Ii[2][zr[2]+0].value)>>>0,rr==0&&256>Ii[0][zr[0]+0].value&&(Kr.Qb=1,Kr.qb+=Ii[0][zr[0]+0].value<<8)),Kr.jc=!Kr.Qb&&6>yr,Kr.jc){var Go,qa=Kr;for(Go=0;Go<Vn;++Go){var hs=Go,lo=qa.pd[hs],ds=qa.G[0][qa.H[0]+hs];256<=ds.value?(lo.g=ds.g+256,lo.value=ds.value):(lo.g=0,lo.value=0,hs>>=yn(ds,8,lo),hs>>=yn(qa.G[1][qa.H[1]+hs],16,lo),hs>>=yn(qa.G[2][qa.H[2]+hs],0,lo),yn(qa.G[3][qa.H[3]+hs],24,lo))}}}On.vc=Sr,On.Wb=Dr,On.Ya=Wn,On.yc=$n,_t=1;break t}_t=0}if(!(ve=_t)){ie.a=3;break e}if(0<Ze){if(Oe.ua=1<<Ze,!de(Oe.Wa,Ze)){ie.a=1,ve=0;break e}}else Oe.ua=0;var kc=ie,Oc=me,vf=we,Vu=kc.s,ps=Vu.xc;if(kc.c=Oc,kc.i=vf,Vu.md=_e(Oc,ps),Vu.wc=ps==0?-1:(1<<ps)-1,te){ie.xb=Ao;break e}if((De=a(me*we))==null){ie.a=1,ve=0;break e}ve=(ve=_a(ie,De,0,me,we,we,null))&&!Se.h;break e}return ve?(he!=null?he[0]=De:(t(De==null),t(te)),ie.$=0,te||xa(Oe)):xa(Oe),ve}function Xa(N,B){var te=N.c*N.i,ie=te+B+16*B;return t(N.c<=B),N.V=a(ie),N.V==null?(N.Ta=null,N.Ua=0,N.a=1,0):(N.Ta=N.V,N.Ua=N.Ba+te+B,1)}function Ps(N,B){var te=N.C,ie=B-te,he=N.V,ve=N.Ba+N.c*te;for(t(B<=N.l.o);0<ie;){var me=16<ie?16:ie,we=N.l.ma,Se=N.l.width,Oe=Se*me,De=we.ca,Ze=we.tb+Se*te,ke=N.Ta,qe=N.Ua;ba(N,me,he,ve),gc(ke,qe,De,Ze,Oe),Ya(we,te,te+me,De,Ze,Se),ie-=me,he+=me*N.c,te+=me}t(te==B),N.C=N.Ma=B}function Ko(){this.ub=this.yd=this.td=this.Rb=0}function Vl(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function cf(){this.Fb=this.Bb=this.Cb=0,this.Zb=a(4),this.Lb=a(4)}function bn(){this.Yb=function(){var N=[];return function B(te,ie,he){for(var ve=he[ie],me=0;me<ve&&(te.push(he.length>ie+1?[]:0),!(he.length<ie+1));me++)B(te[me],ie+1,he)}(N,0,[3,11]),N}()}function Gl(){this.jb=a(3),this.Wc=o([4,8],bn),this.Xc=o([4,17],bn)}function Zo(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new a(4),this.od=new a(4)}function Sa(){this.ld=this.La=this.dd=this.tc=0}function Qo(){this.Na=this.la=0}function cc(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function $s(){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 po(){this.uc=this.M=this.Nb=0,this.wa=Array(new Sa),this.Y=0,this.ya=Array(new $s),this.aa=0,this.l=new mr}function oi(){this.y=a(16),this.f=a(8),this.ea=a(8)}function an(){this.cb=this.a=0,this.sc="",this.m=new j,this.Od=new Ko,this.Kc=new Vl,this.ed=new Zo,this.Qa=new cf,this.Ic=this.$c=this.Aa=0,this.D=new po,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=l(8,j),this.ia=0,this.pb=l(4,cc),this.Pa=new Gl,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new oi),this.Hd=0,this.rb=Array(new Qo),this.sb=0,this.wa=Array(new Sa),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 $s),this.L=this.aa=0,this.gd=o([4,2],Sa),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 mr(){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 Jo(){var N=new an;return N!=null&&(N.a=0,N.sc="OK",N.cb=0,N.Xb=0,Al||(Al=Hi)),N}function Er(N,B,te){return N.a==0&&(N.a=B,N.sc=te,N.cb=0),0}function qi(N,B,te){return 3<=te&&N[B+0]==157&&N[B+1]==1&&N[B+2]==42}function Ka(N,B){if(N==null)return 0;if(N.a=0,N.sc="OK",B==null)return Er(N,2,"null VP8Io passed to VP8GetHeaders()");var te=B.data,ie=B.w,he=B.ha;if(4>he)return Er(N,7,"Truncated header.");var ve=te[ie+0]|te[ie+1]<<8|te[ie+2]<<16,me=N.Od;if(me.Rb=!(1&ve),me.td=ve>>1&7,me.yd=ve>>4&1,me.ub=ve>>5,3<me.td)return Er(N,3,"Incorrect keyframe parameters.");if(!me.yd)return Er(N,4,"Frame not displayable.");ie+=3,he-=3;var we=N.Kc;if(me.Rb){if(7>he)return Er(N,7,"cannot parse picture header");if(!qi(te,ie,he))return Er(N,3,"Bad code word");we.c=16383&(te[ie+4]<<8|te[ie+3]),we.Td=te[ie+4]>>6,we.i=16383&(te[ie+6]<<8|te[ie+5]),we.Ud=te[ie+6]>>6,ie+=7,he-=7,N.za=we.c+15>>4,N.Ub=we.i+15>>4,B.width=we.c,B.height=we.i,B.Da=0,B.j=0,B.v=0,B.va=B.width,B.o=B.height,B.da=0,B.ib=B.width,B.hb=B.height,B.U=B.width,B.T=B.height,i((ve=N.Pa).jb,0,255,ve.jb.length),t((ve=N.Qa)!=null),ve.Cb=0,ve.Bb=0,ve.Fb=1,i(ve.Zb,0,0,ve.Zb.length),i(ve.Lb,0,0,ve.Lb)}if(me.ub>he)return Er(N,7,"bad partition length");ae(ve=N.m,te,ie,me.ub),ie+=me.ub,he-=me.ub,me.Rb&&(we.Ld=ue(ve),we.Kd=ue(ve)),we=N.Qa;var Se,Oe=N.Pa;if(t(ve!=null),t(we!=null),we.Cb=ue(ve),we.Cb){if(we.Bb=ue(ve),ue(ve)){for(we.Fb=ue(ve),Se=0;4>Se;++Se)we.Zb[Se]=ue(ve)?V(ve,7):0;for(Se=0;4>Se;++Se)we.Lb[Se]=ue(ve)?V(ve,6):0}if(we.Bb)for(Se=0;3>Se;++Se)Oe.jb[Se]=ue(ve)?H(ve,8):255}else we.Bb=0;if(ve.Ka)return Er(N,3,"cannot parse segment header");if((we=N.ed).zd=ue(ve),we.Tb=H(ve,6),we.wb=H(ve,3),we.Pc=ue(ve),we.Pc&&ue(ve)){for(Oe=0;4>Oe;++Oe)ue(ve)&&(we.vd[Oe]=V(ve,6));for(Oe=0;4>Oe;++Oe)ue(ve)&&(we.od[Oe]=V(ve,6))}if(N.L=we.Tb==0?0:we.zd?1:2,ve.Ka)return Er(N,3,"cannot parse filter header");var De=he;if(he=Se=ie,ie=Se+De,we=De,N.Xb=(1<<H(N.m,2))-1,De<3*(Oe=N.Xb))te=7;else{for(Se+=3*Oe,we-=3*Oe,De=0;De<Oe;++De){var Ze=te[he+0]|te[he+1]<<8|te[he+2]<<16;Ze>we&&(Ze=we),ae(N.Jc[+De],te,Se,Ze),Se+=Ze,we-=Ze,he+=3}ae(N.Jc[+Oe],te,Se,we),te=Se<ie?0:5}if(te!=0)return Er(N,te,"cannot parse partitions");for(te=H(Se=N.m,7),he=ue(Se)?V(Se,4):0,ie=ue(Se)?V(Se,4):0,we=ue(Se)?V(Se,4):0,Oe=ue(Se)?V(Se,4):0,Se=ue(Se)?V(Se,4):0,De=N.Qa,Ze=0;4>Ze;++Ze){if(De.Cb){var ke=De.Zb[Ze];De.Fb||(ke+=te)}else{if(0<Ze){N.pb[Ze]=N.pb[0];continue}ke=te}var qe=N.pb[Ze];qe.Sc[0]=Rs[si(ke+he,127)],qe.Sc[1]=zu[si(ke+0,127)],qe.Eb[0]=2*Rs[si(ke+ie,127)],qe.Eb[1]=101581*zu[si(ke+we,127)]>>16,8>qe.Eb[1]&&(qe.Eb[1]=8),qe.Qc[0]=Rs[si(ke+Oe,117)],qe.Qc[1]=zu[si(ke+Se,127)],qe.lc=ke+Se}if(!me.Rb)return Er(N,4,"Not a key frame.");for(ue(ve),me=N.Pa,te=0;4>te;++te){for(he=0;8>he;++he)for(ie=0;3>ie;++ie)for(we=0;11>we;++we)Oe=le(ve,Qf[te][he][ie][we])?H(ve,8):Uu[te][he][ie][we],me.Wc[te][he].Yb[ie][we]=Oe;for(he=0;17>he;++he)me.Xc[te][he]=me.Wc[te][Sc[he]]}return N.kc=ue(ve),N.kc&&(N.Bd=H(ve,8)),N.cb=1}function Hi(N,B,te,ie,he,ve,me){var we=B[he].Yb[te];for(te=0;16>he;++he){if(!le(N,we[te+0]))return he;for(;!le(N,we[te+1]);)if(we=B[++he].Yb[0],te=0,he==16)return 16;var Se=B[he+1].Yb;if(le(N,we[te+2])){var Oe=N,De=0;if(le(Oe,(ke=we)[(Ze=te)+3]))if(le(Oe,ke[Ze+6])){for(we=0,Ze=2*(De=le(Oe,ke[Ze+8]))+(ke=le(Oe,ke[Ze+9+De])),De=0,ke=df[Ze];ke[we];++we)De+=De+le(Oe,ke[we]);De+=3+(8<<Ze)}else le(Oe,ke[Ze+7])?(De=7+2*le(Oe,165),De+=le(Oe,145)):De=5+le(Oe,159);else De=le(Oe,ke[Ze+4])?3+le(Oe,ke[Ze+5]):2;we=Se[2]}else De=1,we=Se[1];Se=me+no[he],0>(Oe=N).b&&se(Oe);var Ze,ke=Oe.b,qe=(Ze=Oe.Ca>>1)-(Oe.I>>ke)>>31;--Oe.b,Oe.Ca+=qe,Oe.Ca|=1,Oe.I-=(Ze+1&qe)<<ke,ve[Se]=((De^qe)-qe)*ie[(0<he)+0]}return 16}function Pn(N){var B=N.rb[N.sb-1];B.la=0,B.Na=0,i(N.zc,0,0,N.zc.length),N.ja=0}function Vi(N,B,te,ie,he){he=N[B+te+32*ie]+(he>>3),N[B+te+32*ie]=-256&he?0>he?0:255:he}function Ws(N,B,te,ie,he,ve){Vi(N,B,0,te,ie+he),Vi(N,B,1,te,ie+ve),Vi(N,B,2,te,ie-ve),Vi(N,B,3,te,ie-he)}function qn(N){return(20091*N>>16)+N}function es(N,B,te,ie){var he,ve=0,me=a(16);for(he=0;4>he;++he){var we=N[B+0]+N[B+8],Se=N[B+0]-N[B+8],Oe=(35468*N[B+4]>>16)-qn(N[B+12]),De=qn(N[B+4])+(35468*N[B+12]>>16);me[ve+0]=we+De,me[ve+1]=Se+Oe,me[ve+2]=Se-Oe,me[ve+3]=we-De,ve+=4,B++}for(he=ve=0;4>he;++he)we=(N=me[ve+0]+4)+me[ve+8],Se=N-me[ve+8],Oe=(35468*me[ve+4]>>16)-qn(me[ve+12]),Vi(te,ie,0,0,we+(De=qn(me[ve+4])+(35468*me[ve+12]>>16))),Vi(te,ie,1,0,Se+Oe),Vi(te,ie,2,0,Se-Oe),Vi(te,ie,3,0,we-De),ve++,ie+=32}function Ru(N,B,te,ie){var he=N[B+0]+4,ve=35468*N[B+4]>>16,me=qn(N[B+4]),we=35468*N[B+1]>>16;Ws(te,ie,0,he+me,N=qn(N[B+1]),we),Ws(te,ie,1,he+ve,N,we),Ws(te,ie,2,he-ve,N,we),Ws(te,ie,3,he-me,N,we)}function Ea(N,B,te,ie,he){es(N,B,te,ie),he&&es(N,B+16,te,ie+4)}function hl(N,B,te,ie){Tn(N,B+0,te,ie,1),Tn(N,B+32,te,ie+128,1)}function ts(N,B,te,ie){var he;for(N=N[B+0]+4,he=0;4>he;++he)for(B=0;4>B;++B)Vi(te,ie,B,he,N)}function $l(N,B,te,ie){N[B+0]&&Xi(N,B+0,te,ie),N[B+16]&&Xi(N,B+16,te,ie+4),N[B+32]&&Xi(N,B+32,te,ie+128),N[B+48]&&Xi(N,B+48,te,ie+128+4)}function Ar(N,B,te,ie){var he,ve=a(16);for(he=0;4>he;++he){var me=N[B+0+he]+N[B+12+he],we=N[B+4+he]+N[B+8+he],Se=N[B+4+he]-N[B+8+he],Oe=N[B+0+he]-N[B+12+he];ve[0+he]=me+we,ve[8+he]=me-we,ve[4+he]=Oe+Se,ve[12+he]=Oe-Se}for(he=0;4>he;++he)me=(N=ve[0+4*he]+3)+ve[3+4*he],we=ve[1+4*he]+ve[2+4*he],Se=ve[1+4*he]-ve[2+4*he],Oe=N-ve[3+4*he],te[ie+0]=me+we>>3,te[ie+16]=Oe+Se>>3,te[ie+32]=me-we>>3,te[ie+48]=Oe-Se>>3,ie+=64}function go(N,B,te){var ie,he=B-32,ve=_i,me=255-N[he-1];for(ie=0;ie<te;++ie){var we,Se=ve,Oe=me+N[B-1];for(we=0;we<te;++we)N[B+we]=Se[Oe+N[he+we]];B+=32}}function rs(N,B){go(N,B,4)}function Ys(N,B){go(N,B,8)}function fc(N,B){go(N,B,16)}function hc(N,B){var te;for(te=0;16>te;++te)n(N,B+32*te,N,B-32,16)}function Xs(N,B){var te;for(te=16;0<te;--te)i(N,B,N[B-1],16),B+=32}function ns(N,B,te){var ie;for(ie=0;16>ie;++ie)i(B,te+32*ie,N,16)}function Za(N,B){var te,ie=16;for(te=0;16>te;++te)ie+=N[B-1+32*te]+N[B+te-32];ns(ie>>5,N,B)}function Ma(N,B){var te,ie=8;for(te=0;16>te;++te)ie+=N[B-1+32*te];ns(ie>>4,N,B)}function Ia(N,B){var te,ie=8;for(te=0;16>te;++te)ie+=N[B+te-32];ns(ie>>4,N,B)}function Fa(N,B){ns(128,N,B)}function xt(N,B,te){return N+2*B+te+2>>2}function Ks(N,B){var te,ie=B-32;for(ie=new Uint8Array([xt(N[ie-1],N[ie+0],N[ie+1]),xt(N[ie+0],N[ie+1],N[ie+2]),xt(N[ie+1],N[ie+2],N[ie+3]),xt(N[ie+2],N[ie+3],N[ie+4])]),te=0;4>te;++te)n(N,B+32*te,ie,0,ie.length)}function vo(N,B){var te=N[B-1],ie=N[B-1+32],he=N[B-1+64],ve=N[B-1+96];ye(N,B+0,16843009*xt(N[B-1-32],te,ie)),ye(N,B+32,16843009*xt(te,ie,he)),ye(N,B+64,16843009*xt(ie,he,ve)),ye(N,B+96,16843009*xt(he,ve,ve))}function dc(N,B){var te,ie=4;for(te=0;4>te;++te)ie+=N[B+te-32]+N[B-1+32*te];for(ie>>=3,te=0;4>te;++te)i(N,B+32*te,ie,4)}function pc(N,B){var te=N[B-1+0],ie=N[B-1+32],he=N[B-1+64],ve=N[B-1-32],me=N[B+0-32],we=N[B+1-32],Se=N[B+2-32],Oe=N[B+3-32];N[B+0+96]=xt(ie,he,N[B-1+96]),N[B+1+96]=N[B+0+64]=xt(te,ie,he),N[B+2+96]=N[B+1+64]=N[B+0+32]=xt(ve,te,ie),N[B+3+96]=N[B+2+64]=N[B+1+32]=N[B+0+0]=xt(me,ve,te),N[B+3+64]=N[B+2+32]=N[B+1+0]=xt(we,me,ve),N[B+3+32]=N[B+2+0]=xt(Se,we,me),N[B+3+0]=xt(Oe,Se,we)}function Qa(N,B){var te=N[B+1-32],ie=N[B+2-32],he=N[B+3-32],ve=N[B+4-32],me=N[B+5-32],we=N[B+6-32],Se=N[B+7-32];N[B+0+0]=xt(N[B+0-32],te,ie),N[B+1+0]=N[B+0+32]=xt(te,ie,he),N[B+2+0]=N[B+1+32]=N[B+0+64]=xt(ie,he,ve),N[B+3+0]=N[B+2+32]=N[B+1+64]=N[B+0+96]=xt(he,ve,me),N[B+3+32]=N[B+2+64]=N[B+1+96]=xt(ve,me,we),N[B+3+64]=N[B+2+96]=xt(me,we,Se),N[B+3+96]=xt(we,Se,Se)}function pn(N,B){var te=N[B-1+0],ie=N[B-1+32],he=N[B-1+64],ve=N[B-1-32],me=N[B+0-32],we=N[B+1-32],Se=N[B+2-32],Oe=N[B+3-32];N[B+0+0]=N[B+1+64]=ve+me+1>>1,N[B+1+0]=N[B+2+64]=me+we+1>>1,N[B+2+0]=N[B+3+64]=we+Se+1>>1,N[B+3+0]=Se+Oe+1>>1,N[B+0+96]=xt(he,ie,te),N[B+0+64]=xt(ie,te,ve),N[B+0+32]=N[B+1+96]=xt(te,ve,me),N[B+1+32]=N[B+2+96]=xt(ve,me,we),N[B+2+32]=N[B+3+96]=xt(me,we,Se),N[B+3+32]=xt(we,Se,Oe)}function Wl(N,B){var te=N[B+0-32],ie=N[B+1-32],he=N[B+2-32],ve=N[B+3-32],me=N[B+4-32],we=N[B+5-32],Se=N[B+6-32],Oe=N[B+7-32];N[B+0+0]=te+ie+1>>1,N[B+1+0]=N[B+0+64]=ie+he+1>>1,N[B+2+0]=N[B+1+64]=he+ve+1>>1,N[B+3+0]=N[B+2+64]=ve+me+1>>1,N[B+0+32]=xt(te,ie,he),N[B+1+32]=N[B+0+96]=xt(ie,he,ve),N[B+2+32]=N[B+1+96]=xt(he,ve,me),N[B+3+32]=N[B+2+96]=xt(ve,me,we),N[B+3+64]=xt(me,we,Se),N[B+3+96]=xt(we,Se,Oe)}function Yl(N,B){var te=N[B-1+0],ie=N[B-1+32],he=N[B-1+64],ve=N[B-1+96];N[B+0+0]=te+ie+1>>1,N[B+2+0]=N[B+0+32]=ie+he+1>>1,N[B+2+32]=N[B+0+64]=he+ve+1>>1,N[B+1+0]=xt(te,ie,he),N[B+3+0]=N[B+1+32]=xt(ie,he,ve),N[B+3+32]=N[B+1+64]=xt(he,ve,ve),N[B+3+64]=N[B+2+64]=N[B+0+96]=N[B+1+96]=N[B+2+96]=N[B+3+96]=ve}function ks(N,B){var te=N[B-1+0],ie=N[B-1+32],he=N[B-1+64],ve=N[B-1+96],me=N[B-1-32],we=N[B+0-32],Se=N[B+1-32],Oe=N[B+2-32];N[B+0+0]=N[B+2+32]=te+me+1>>1,N[B+0+32]=N[B+2+64]=ie+te+1>>1,N[B+0+64]=N[B+2+96]=he+ie+1>>1,N[B+0+96]=ve+he+1>>1,N[B+3+0]=xt(we,Se,Oe),N[B+2+0]=xt(me,we,Se),N[B+1+0]=N[B+3+32]=xt(te,me,we),N[B+1+32]=N[B+3+64]=xt(ie,te,me),N[B+1+64]=N[B+3+96]=xt(he,ie,te),N[B+1+96]=xt(ve,he,ie)}function Mu(N,B){var te;for(te=0;8>te;++te)n(N,B+32*te,N,B-32,8)}function ja(N,B){var te;for(te=0;8>te;++te)i(N,B,N[B-1],8),B+=32}function mi(N,B,te){var ie;for(ie=0;8>ie;++ie)i(B,te+32*ie,N,8)}function Fo(N,B){var te,ie=8;for(te=0;8>te;++te)ie+=N[B+te-32]+N[B-1+32*te];mi(ie>>4,N,B)}function Xl(N,B){var te,ie=4;for(te=0;8>te;++te)ie+=N[B+te-32];mi(ie>>3,N,B)}function Aa(N,B){var te,ie=4;for(te=0;8>te;++te)ie+=N[B-1+32*te];mi(ie>>3,N,B)}function Ja(N,B){mi(128,N,B)}function mo(N,B,te){var ie=N[B-te],he=N[B+0],ve=3*(he-ie)+qo[1020+N[B-2*te]-N[B+te]],me=_l[112+(ve+4>>3)];N[B-te]=_i[255+ie+_l[112+(ve+3>>3)]],N[B+0]=_i[255+he-me]}function yo(N,B,te,ie){var he=N[B+0],ve=N[B+te];return ro[255+N[B-2*te]-N[B-te]]>ie||ro[255+ve-he]>ie}function Zs(N,B,te,ie){return 4*ro[255+N[B-te]-N[B+0]]+ro[255+N[B-2*te]-N[B+te]]<=ie}function dl(N,B,te,ie,he){var ve=N[B-3*te],me=N[B-2*te],we=N[B-te],Se=N[B+0],Oe=N[B+te],De=N[B+2*te],Ze=N[B+3*te];return 4*ro[255+we-Se]+ro[255+me-Oe]>ie?0:ro[255+N[B-4*te]-ve]<=he&&ro[255+ve-me]<=he&&ro[255+me-we]<=he&&ro[255+Ze-De]<=he&&ro[255+De-Oe]<=he&&ro[255+Oe-Se]<=he}function Jn(N,B,te,ie){var he=2*ie+1;for(ie=0;16>ie;++ie)Zs(N,B+ie,te,he)&&mo(N,B+ie,te)}function Da(N,B,te,ie){var he=2*ie+1;for(ie=0;16>ie;++ie)Zs(N,B+ie*te,1,he)&&mo(N,B+ie*te,1)}function eo(N,B,te,ie){var he;for(he=3;0<he;--he)Jn(N,B+=4*te,te,ie)}function Os(N,B,te,ie){var he;for(he=3;0<he;--he)Da(N,B+=4,te,ie)}function yi(N,B,te,ie,he,ve,me,we){for(ve=2*ve+1;0<he--;){if(dl(N,B,te,ve,me))if(yo(N,B,te,we))mo(N,B,te);else{var Se=N,Oe=B,De=te,Ze=Se[Oe-2*De],ke=Se[Oe-De],qe=Se[Oe+0],Ke=Se[Oe+De],it=Se[Oe+2*De],Ye=27*(Ue=qo[1020+3*(qe-ke)+qo[1020+Ze-Ke]])+63>>7,nt=18*Ue+63>>7,Ue=9*Ue+63>>7;Se[Oe-3*De]=_i[255+Se[Oe-3*De]+Ue],Se[Oe-2*De]=_i[255+Ze+nt],Se[Oe-De]=_i[255+ke+Ye],Se[Oe+0]=_i[255+qe-Ye],Se[Oe+De]=_i[255+Ke-nt],Se[Oe+2*De]=_i[255+it-Ue]}B+=ie}}function kn(N,B,te,ie,he,ve,me,we){for(ve=2*ve+1;0<he--;){if(dl(N,B,te,ve,me))if(yo(N,B,te,we))mo(N,B,te);else{var Se=N,Oe=B,De=te,Ze=Se[Oe-De],ke=Se[Oe+0],qe=Se[Oe+De],Ke=_l[112+(4+(it=3*(ke-Ze))>>3)],it=_l[112+(it+3>>3)],Ye=Ke+1>>1;Se[Oe-2*De]=_i[255+Se[Oe-2*De]+Ye],Se[Oe-De]=_i[255+Ze+it],Se[Oe+0]=_i[255+ke-Ke],Se[Oe+De]=_i[255+qe-Ye]}B+=ie}}function X(N,B,te,ie,he,ve){yi(N,B,te,1,16,ie,he,ve)}function fe(N,B,te,ie,he,ve){yi(N,B,1,te,16,ie,he,ve)}function Ne(N,B,te,ie,he,ve){var me;for(me=3;0<me;--me)kn(N,B+=4*te,te,1,16,ie,he,ve)}function Fe(N,B,te,ie,he,ve){var me;for(me=3;0<me;--me)kn(N,B+=4,1,te,16,ie,he,ve)}function Ge(N,B,te,ie,he,ve,me,we){yi(N,B,he,1,8,ve,me,we),yi(te,ie,he,1,8,ve,me,we)}function lt(N,B,te,ie,he,ve,me,we){yi(N,B,1,he,8,ve,me,we),yi(te,ie,1,he,8,ve,me,we)}function ft(N,B,te,ie,he,ve,me,we){kn(N,B+4*he,he,1,8,ve,me,we),kn(te,ie+4*he,he,1,8,ve,me,we)}function Lt(N,B,te,ie,he,ve,me,we){kn(N,B+4,1,he,8,ve,me,we),kn(te,ie+4,1,he,8,ve,me,we)}function Et(){this.ba=new vr,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new lr,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function Ut(){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 Rt(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Pr(){this.ua=0,this.Wa=new Ae,this.vb=new Ae,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new J,this.yc=new q}function Mr(){this.xb=this.a=0,this.l=new mr,this.ca=new vr,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new z,this.Pb=0,this.wd=new z,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Pr,this.ab=0,this.gc=l(4,Rt),this.Oc=0}function ei(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new mr,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Hr(N,B,te,ie,he,ve,me){for(N=N==null?0:N[B+0],B=0;B<me;++B)he[ve+B]=N+te[ie+B]&255,N=he[ve+B]}function ti(N,B,te,ie,he,ve,me){var we;if(N==null)Hr(null,null,te,ie,he,ve,me);else for(we=0;we<me;++we)he[ve+we]=N[B+we]+te[ie+we]&255}function Hn(N,B,te,ie,he,ve,me){if(N==null)Hr(null,null,te,ie,he,ve,me);else{var we,Se=N[B+0],Oe=Se,De=Se;for(we=0;we<me;++we)Oe=De+(Se=N[B+we])-Oe,De=te[ie+we]+(-256&Oe?0>Oe?0:255:Oe)&255,Oe=Se,he[ve+we]=De}}function Ni(N,B,te,ie){var he=B.width,ve=B.o;if(t(N!=null&&B!=null),0>te||0>=ie||te+ie>ve)return null;if(!N.Cc){if(N.ga==null){var me;if(N.ga=new ei,(me=N.ga==null)||(me=B.width*B.o,t(N.Gb.length==0),N.Gb=a(me),N.Uc=0,N.Gb==null?me=0:(N.mb=N.Gb,N.nb=N.Uc,N.rc=null,me=1),me=!me),!me){me=N.ga;var we=N.Fa,Se=N.P,Oe=N.qc,De=N.mb,Ze=N.nb,ke=Se+1,qe=Oe-1,Ke=me.l;if(t(we!=null&&De!=null&&B!=null),Qi[0]=null,Qi[1]=Hr,Qi[2]=ti,Qi[3]=Hn,me.ca=De,me.tb=Ze,me.c=B.width,me.i=B.height,t(0<me.c&&0<me.i),1>=Oe)B=0;else if(me.$a=3&we[Se+0],me.Z=we[Se+0]>>2&3,me.Lc=we[Se+0]>>4&3,Se=we[Se+0]>>6&3,0>me.$a||1<me.$a||4<=me.Z||1<me.Lc||Se)B=0;else if(Ke.put=Yt,Ke.ac=mn,Ke.bc=sa,Ke.ma=me,Ke.width=B.width,Ke.height=B.height,Ke.Da=B.Da,Ke.v=B.v,Ke.va=B.va,Ke.j=B.j,Ke.o=B.o,me.$a)e:{t(me.$a==1),B=Io();t:for(;;){if(B==null){B=0;break e}if(t(me!=null),me.mc=B,B.c=me.c,B.i=me.i,B.l=me.l,B.l.ma=me,B.l.width=me.c,B.l.height=me.i,B.a=0,Y(B.m,we,ke,qe),!Ci(me.c,me.i,1,B,null)||(B.ab==1&&B.gc[0].hc==3&&wa(B.s)?(me.ic=1,we=B.c*B.i,B.Ta=null,B.Ua=0,B.V=a(we),B.Ba=0,B.V==null?(B.a=1,B=0):B=1):(me.ic=0,B=Xa(B,me.c)),!B))break t;B=1;break e}me.mc=null,B=0}else B=qe>=me.c*me.i;me=!B}if(me)return null;N.ga.Lc!=1?N.Ga=0:ie=ve-te}t(N.ga!=null),t(te+ie<=ve);e:{if(B=(we=N.ga).c,ve=we.l.o,we.$a==0){if(ke=N.rc,qe=N.Vc,Ke=N.Fa,Se=N.P+1+te*B,Oe=N.mb,De=N.nb+te*B,t(Se<=N.P+N.qc),we.Z!=0)for(t(Qi[we.Z]!=null),me=0;me<ie;++me)Qi[we.Z](ke,qe,Ke,Se,Oe,De,B),ke=Oe,qe=De,De+=B,Se+=B;else for(me=0;me<ie;++me)n(Oe,De,Ke,Se,B),ke=Oe,qe=De,De+=B,Se+=B;N.rc=ke,N.Vc=qe}else{if(t(we.mc!=null),B=te+ie,t((me=we.mc)!=null),t(B<=me.i),me.C>=B)B=1;else if(we.ic||pl(),we.ic){we=me.V,ke=me.Ba,qe=me.c;var it=me.i,Ye=(Ke=1,Se=me.$/qe,Oe=me.$%qe,De=me.m,Ze=me.s,me.$),nt=qe*it,Ue=qe*B,ot=Ze.wc,ut=Ye<Ue?An(Ze,Oe,Se):null;t(Ye<=nt),t(B<=it),t(wa(Ze));t:for(;;){for(;!De.h&&Ye<Ue;){if(Oe&ot||(ut=An(Ze,Oe,Se)),t(ut!=null),Q(De),256>(it=Rr(ut.G[0],ut.H[0],De)))we[ke+Ye]=it,++Ye,++Oe>=qe&&(Oe=0,++Se<=B&&!(Se%16)&&Qn(me,Se));else{if(!(280>it)){Ke=0;break t}it=Un(it-256,De);var qt,Mt=Rr(ut.G[4],ut.H[4],De);if(Q(De),!(Ye>=(Mt=Ui(qe,Mt=Un(Mt,De)))&&nt-Ye>=it)){Ke=0;break t}for(qt=0;qt<it;++qt)we[ke+Ye+qt]=we[ke+Ye+qt-Mt];for(Ye+=it,Oe+=it;Oe>=qe;)Oe-=qe,++Se<=B&&!(Se%16)&&Qn(me,Se);Ye<Ue&&Oe&ot&&(ut=An(Ze,Oe,Se))}t(De.h==re(De))}Qn(me,Se>B?B:Se);break t}!Ke||De.h&&Ye<nt?(Ke=0,me.a=De.h?5:3):me.$=Ye,B=Ke}else B=_a(me,me.V,me.Ba,me.c,me.i,B,Ps);if(!B){ie=0;break e}}te+ie>=ve&&(N.Cc=1),ie=1}if(!ie)return null;if(N.Cc&&((ie=N.ga)!=null&&(ie.mc=null),N.ga=null,0<N.Ga))return alert("todo:WebPDequantizeLevels"),null}return N.nb+te*he}function bo(N,B,te,ie,he,ve){for(;0<he--;){var me,we=N,Se=B+(te?1:0),Oe=N,De=B+(te?0:3);for(me=0;me<ie;++me){var Ze=Oe[De+4*me];Ze!=255&&(Ze*=32897,we[Se+4*me+0]=we[Se+4*me+0]*Ze>>23,we[Se+4*me+1]=we[Se+4*me+1]*Ze>>23,we[Se+4*me+2]=we[Se+4*me+2]*Ze>>23)}B+=ve}}function Cs(N,B,te,ie,he){for(;0<ie--;){var ve;for(ve=0;ve<te;++ve){var me=N[B+2*ve+0],we=15&(Oe=N[B+2*ve+1]),Se=4369*we,Oe=(240&Oe|Oe>>4)*Se>>16;N[B+2*ve+0]=(240&me|me>>4)*Se>>16&240|(15&me|me<<4)*Se>>16>>4&15,N[B+2*ve+1]=240&Oe|we}B+=he}}function Ns(N,B,te,ie,he,ve,me,we){var Se,Oe,De=255;for(Oe=0;Oe<he;++Oe){for(Se=0;Se<ie;++Se){var Ze=N[B+Se];ve[me+4*Se]=Ze,De&=Ze}B+=te,me+=we}return De!=255}function Kl(N,B,te,ie,he){var ve;for(ve=0;ve<he;++ve)te[ie+ve]=N[B+ve]>>8}function pl(){Uo=bo,ju=Cs,wl=Ns,gc=Kl}function Ba(N,B,te){R[N]=function(ie,he,ve,me,we,Se,Oe,De,Ze,ke,qe,Ke,it,Ye,nt,Ue,ot){var ut,qt=ot-1>>1,Mt=we[Se+0]|Oe[De+0]<<16,ar=Ze[ke+0]|qe[Ke+0]<<16;t(ie!=null);var It=3*Mt+ar+131074>>2;for(B(ie[he+0],255&It,It>>16,it,Ye),ve!=null&&(It=3*ar+Mt+131074>>2,B(ve[me+0],255&It,It>>16,nt,Ue)),ut=1;ut<=qt;++ut){var _r=we[Se+ut]|Oe[De+ut]<<16,Rn=Ze[ke+ut]|qe[Ke+ut]<<16,fr=Mt+_r+ar+Rn+524296,Tt=fr+2*(_r+ar)>>3;It=Tt+Mt>>1,Mt=(fr=fr+2*(Mt+Rn)>>3)+_r>>1,B(ie[he+2*ut-1],255&It,It>>16,it,Ye+(2*ut-1)*te),B(ie[he+2*ut-0],255&Mt,Mt>>16,it,Ye+(2*ut-0)*te),ve!=null&&(It=fr+ar>>1,Mt=Tt+Rn>>1,B(ve[me+2*ut-1],255&It,It>>16,nt,Ue+(2*ut-1)*te),B(ve[me+2*ut+0],255&Mt,Mt>>16,nt,Ue+(2*ut+0)*te)),Mt=_r,ar=Rn}1&ot||(It=3*Mt+ar+131074>>2,B(ie[he+ot-1],255&It,It>>16,it,Ye+(ot-1)*te),ve!=null&&(It=3*ar+Mt+131074>>2,B(ve[me+ot-1],255&It,It>>16,nt,Ue+(ot-1)*te)))}}function Iu(){Ca[xl]=Jf,Ca[Ho]=Ms,Ca[ff]=eh,Ca[Sl]=su,Ca[ru]=ci,Ca[sn]=xi,Ca[Du]=Ec,Ca[El]=Ms,Ca[Ts]=su,Ca[nu]=ci,Ca[iu]=xi}function wo(N){return N&-16384?0>N?0:255:N>>ls}function jo(N,B){return wo((19077*N>>8)+(26149*B>>8)-14234)}function bi(N,B,te){return wo((19077*N>>8)-(6419*B>>8)-(13320*te>>8)+8708)}function is(N,B){return wo((19077*N>>8)+(33050*B>>8)-17685)}function Pa(N,B,te,ie,he){ie[he+0]=jo(N,te),ie[he+1]=bi(N,B,te),ie[he+2]=is(N,B)}function gl(N,B,te,ie,he){ie[he+0]=is(N,B),ie[he+1]=bi(N,B,te),ie[he+2]=jo(N,te)}function Qs(N,B,te,ie,he){var ve=bi(N,B,te);B=ve<<3&224|is(N,B)>>3,ie[he+0]=248&jo(N,te)|ve>>5,ie[he+1]=B}function Li(N,B,te,ie,he){var ve=240&is(N,B)|15;ie[he+0]=240&jo(N,te)|bi(N,B,te)>>4,ie[he+1]=ve}function Ls(N,B,te,ie,he){ie[he+0]=255,Pa(N,B,te,ie,he+1)}function Js(N,B,te,ie,he){gl(N,B,te,ie,he),ie[he+3]=255}function Zl(N,B,te,ie,he){Pa(N,B,te,ie,he),ie[he+3]=255}function si(N,B){return 0>N?0:N>B?B:N}function la(N,B,te){R[N]=function(ie,he,ve,me,we,Se,Oe,De,Ze){for(var ke=De+(-2&Ze)*te;De!=ke;)B(ie[he+0],ve[me+0],we[Se+0],Oe,De),B(ie[he+1],ve[me+0],we[Se+0],Oe,De+te),he+=2,++me,++Se,De+=2*te;1&Ze&&B(ie[he+0],ve[me+0],we[Se+0],Oe,De)}}function Do(N,B,te){return te==0?N==0?B==0?6:5:B==0?4:0:te}function as(N,B,te,ie,he){switch(N>>>30){case 3:Tn(B,te,ie,he,0);break;case 2:Gn(B,te,ie,he);break;case 1:Xi(B,te,ie,he)}}function li(N,B){var te,ie,he=B.M,ve=B.Nb,me=N.oc,we=N.pc+40,Se=N.oc,Oe=N.pc+584,De=N.oc,Ze=N.pc+600;for(te=0;16>te;++te)me[we+32*te-1]=129;for(te=0;8>te;++te)Se[Oe+32*te-1]=129,De[Ze+32*te-1]=129;for(0<he?me[we-1-32]=Se[Oe-1-32]=De[Ze-1-32]=129:(i(me,we-32-1,127,21),i(Se,Oe-32-1,127,9),i(De,Ze-32-1,127,9)),ie=0;ie<N.za;++ie){var ke=B.ya[B.aa+ie];if(0<ie){for(te=-1;16>te;++te)n(me,we+32*te-4,me,we+32*te+12,4);for(te=-1;8>te;++te)n(Se,Oe+32*te-4,Se,Oe+32*te+4,4),n(De,Ze+32*te-4,De,Ze+32*te+4,4)}var qe=N.Gd,Ke=N.Hd+ie,it=ke.ad,Ye=ke.Hc;if(0<he&&(n(me,we-32,qe[Ke].y,0,16),n(Se,Oe-32,qe[Ke].f,0,8),n(De,Ze-32,qe[Ke].ea,0,8)),ke.Za){var nt=me,Ue=we-32+16;for(0<he&&(ie>=N.za-1?i(nt,Ue,qe[Ke].y[15],4):n(nt,Ue,qe[Ke+1].y,0,4)),te=0;4>te;te++)nt[Ue+128+te]=nt[Ue+256+te]=nt[Ue+384+te]=nt[Ue+0+te];for(te=0;16>te;++te,Ye<<=2)nt=me,Ue=we+qu[te],Zi[ke.Ob[te]](nt,Ue),as(Ye,it,16*+te,nt,Ue)}else if(nt=Do(ie,he,ke.Ob[0]),Ki[nt](me,we),Ye!=0)for(te=0;16>te;++te,Ye<<=2)as(Ye,it,16*+te,me,we+qu[te]);for(te=ke.Gc,nt=Do(ie,he,ke.Dd),fa[nt](Se,Oe),fa[nt](De,Ze),Ye=it,nt=Se,Ue=Oe,255&(ke=0|te)&&(170&ke?Eo(Ye,256,nt,Ue):on(Ye,256,nt,Ue)),ke=De,Ye=Ze,255&(te>>=8)&&(170&te?Eo(it,320,ke,Ye):on(it,320,ke,Ye)),he<N.Ub-1&&(n(qe[Ke].y,0,me,we+480,16),n(qe[Ke].f,0,Se,Oe+224,8),n(qe[Ke].ea,0,De,Ze+224,8)),te=8*ve*N.B,qe=N.sa,Ke=N.ta+16*ie+16*ve*N.R,it=N.qa,ke=N.ra+8*ie+te,Ye=N.Ha,nt=N.Ia+8*ie+te,te=0;16>te;++te)n(qe,Ke+te*N.R,me,we+32*te,16);for(te=0;8>te;++te)n(it,ke+te*N.B,Se,Oe+32*te,8),n(Ye,nt+te*N.B,De,Ze+32*te,8)}}function to(N,B,te,ie,he,ve,me,we,Se){var Oe=[0],De=[0],Ze=0,ke=Se!=null?Se.kd:0,qe=Se??new Ut;if(N==null||12>te)return 7;qe.data=N,qe.w=B,qe.ha=te,B=[B],te=[te],qe.gb=[qe.gb];e:{var Ke=B,it=te,Ye=qe.gb;if(t(N!=null),t(it!=null),t(Ye!=null),Ye[0]=0,12<=it[0]&&!r(N,Ke[0],"RIFF")){if(r(N,Ke[0]+8,"WEBP")){Ye=3;break e}var nt=Pe(N,Ke[0]+4);if(12>nt||4294967286<nt){Ye=3;break e}if(ke&&nt>it[0]-8){Ye=7;break e}Ye[0]=nt,Ke[0]+=12,it[0]-=12}Ye=0}if(Ye!=0)return Ye;for(nt=0<qe.gb[0],te=te[0];;){e:{var Ue=N;it=B,Ye=te;var ot=Oe,ut=De,qt=Ke=[0];if((It=Ze=[Ze])[0]=0,8>Ye[0])Ye=7;else{if(!r(Ue,it[0],"VP8X")){if(Pe(Ue,it[0]+4)!=10){Ye=3;break e}if(18>Ye[0]){Ye=7;break e}var Mt=Pe(Ue,it[0]+8),ar=1+Me(Ue,it[0]+12);if(2147483648<=ar*(Ue=1+Me(Ue,it[0]+15))){Ye=3;break e}qt!=null&&(qt[0]=Mt),ot!=null&&(ot[0]=ar),ut!=null&&(ut[0]=Ue),it[0]+=18,Ye[0]-=18,It[0]=1}Ye=0}}if(Ze=Ze[0],Ke=Ke[0],Ye!=0)return Ye;if(it=!!(2&Ke),!nt&&Ze)return 3;if(ve!=null&&(ve[0]=!!(16&Ke)),me!=null&&(me[0]=it),we!=null&&(we[0]=0),me=Oe[0],Ke=De[0],Ze&&it&&Se==null){Ye=0;break}if(4>te){Ye=7;break}if(nt&&Ze||!nt&&!Ze&&!r(N,B[0],"ALPH")){te=[te],qe.na=[qe.na],qe.P=[qe.P],qe.Sa=[qe.Sa];e:{Mt=N,Ye=B,nt=te;var It=qe.gb;ot=qe.na,ut=qe.P,qt=qe.Sa,ar=22,t(Mt!=null),t(nt!=null),Ue=Ye[0];var _r=nt[0];for(t(ot!=null),t(qt!=null),ot[0]=null,ut[0]=null,qt[0]=0;;){if(Ye[0]=Ue,nt[0]=_r,8>_r){Ye=7;break e}var Rn=Pe(Mt,Ue+4);if(4294967286<Rn){Ye=3;break e}var fr=8+Rn+1&-2;if(ar+=fr,0<It&&ar>It){Ye=3;break e}if(!r(Mt,Ue,"VP8 ")||!r(Mt,Ue,"VP8L")){Ye=0;break e}if(_r[0]<fr){Ye=7;break e}r(Mt,Ue,"ALPH")||(ot[0]=Mt,ut[0]=Ue+8,qt[0]=Rn),Ue+=fr,_r-=fr}}if(te=te[0],qe.na=qe.na[0],qe.P=qe.P[0],qe.Sa=qe.Sa[0],Ye!=0)break}te=[te],qe.Ja=[qe.Ja],qe.xa=[qe.xa];e:if(It=N,Ye=B,nt=te,ot=qe.gb[0],ut=qe.Ja,qt=qe.xa,Mt=Ye[0],Ue=!r(It,Mt,"VP8 "),ar=!r(It,Mt,"VP8L"),t(It!=null),t(nt!=null),t(ut!=null),t(qt!=null),8>nt[0])Ye=7;else{if(Ue||ar){if(It=Pe(It,Mt+4),12<=ot&&It>ot-12){Ye=3;break e}if(ke&&It>nt[0]-8){Ye=7;break e}ut[0]=It,Ye[0]+=8,nt[0]-=8,qt[0]=ar}else qt[0]=5<=nt[0]&&It[Mt+0]==47&&!(It[Mt+4]>>5),ut[0]=nt[0];Ye=0}if(te=te[0],qe.Ja=qe.Ja[0],qe.xa=qe.xa[0],B=B[0],Ye!=0)break;if(4294967286<qe.Ja)return 3;if(we==null||it||(we[0]=qe.xa?2:1),me=[me],Ke=[Ke],qe.xa){if(5>te){Ye=7;break}we=me,ke=Ke,it=ve,N==null||5>te?N=0:5<=te&&N[B+0]==47&&!(N[B+4]>>5)?(nt=[0],It=[0],ot=[0],Y(ut=new z,N,B,te),Ra(ut,nt,It,ot)?(we!=null&&(we[0]=nt[0]),ke!=null&&(ke[0]=It[0]),it!=null&&(it[0]=ot[0]),N=1):N=0):N=0}else{if(10>te){Ye=7;break}we=Ke,N==null||10>te||!qi(N,B+3,te-3)?N=0:(ke=N[B+0]|N[B+1]<<8|N[B+2]<<16,it=16383&(N[B+7]<<8|N[B+6]),N=16383&(N[B+9]<<8|N[B+8]),1&ke||3<(ke>>1&7)||!(ke>>4&1)||ke>>5>=qe.Ja||!it||!N?N=0:(me&&(me[0]=it),we&&(we[0]=N),N=1))}if(!N||(me=me[0],Ke=Ke[0],Ze&&(Oe[0]!=me||De[0]!=Ke)))return 3;Se!=null&&(Se[0]=qe,Se.offset=B-Se.w,t(4294967286>B-Se.w),t(Se.offset==Se.ha-te));break}return Ye==0||Ye==7&&Ze&&Se==null?(ve!=null&&(ve[0]|=qe.na!=null&&0<qe.na.length),ie!=null&&(ie[0]=me),he!=null&&(he[0]=Ke),0):Ye}function Gi(N,B,te){var ie=B.width,he=B.height,ve=0,me=0,we=ie,Se=he;if(B.Da=N!=null&&0<N.Da,B.Da&&(we=N.cd,Se=N.bd,ve=N.v,me=N.j,11>te||(ve&=-2,me&=-2),0>ve||0>me||0>=we||0>=Se||ve+we>ie||me+Se>he))return 0;if(B.v=ve,B.j=me,B.va=ve+we,B.o=me+Se,B.U=we,B.T=Se,B.da=N!=null&&0<N.da,B.da){if(!be(we,Se,te=[N.ib],ve=[N.hb]))return 0;B.ib=te[0],B.hb=ve[0]}return B.ob=N!=null&&N.ob,B.Kb=N==null||!N.Sd,B.da&&(B.ob=B.ib<3*ie/4&&B.hb<3*he/4,B.Kb=0),1}function ua(N){if(N==null)return 2;if(11>N.S){var B=N.f.RGBA;B.fb+=(N.height-1)*B.A,B.A=-B.A}else B=N.f.kb,N=N.height,B.O+=(N-1)*B.fa,B.fa=-B.fa,B.N+=(N-1>>1)*B.Ab,B.Ab=-B.Ab,B.W+=(N-1>>1)*B.Db,B.Db=-B.Db,B.F!=null&&(B.J+=(N-1)*B.lb,B.lb=-B.lb);return 0}function $i(N,B,te,ie){if(ie==null||0>=N||0>=B)return 2;if(te!=null){if(te.Da){var he=te.cd,ve=te.bd,me=-2&te.v,we=-2&te.j;if(0>me||0>we||0>=he||0>=ve||me+he>N||we+ve>B)return 2;N=he,B=ve}if(te.da){if(!be(N,B,he=[te.ib],ve=[te.hb]))return 2;N=he[0],B=ve[0]}}ie.width=N,ie.height=B;e:{var Se=ie.width,Oe=ie.height;if(N=ie.S,0>=Se||0>=Oe||!(N>=xl&&13>N))N=2;else{if(0>=ie.Rd&&ie.sd==null){me=ve=he=B=0;var De=(we=Se*kl[N])*Oe;if(11>N||(ve=(Oe+1)/2*(B=(Se+1)/2),N==12&&(me=(he=Se)*Oe)),(Oe=a(De+2*ve+me))==null){N=1;break e}ie.sd=Oe,11>N?((Se=ie.f.RGBA).eb=Oe,Se.fb=0,Se.A=we,Se.size=De):((Se=ie.f.kb).y=Oe,Se.O=0,Se.fa=we,Se.Fd=De,Se.f=Oe,Se.N=0+De,Se.Ab=B,Se.Cd=ve,Se.ea=Oe,Se.W=0+De+ve,Se.Db=B,Se.Ed=ve,N==12&&(Se.F=Oe,Se.J=0+De+2*ve),Se.Tc=me,Se.lb=he)}if(B=1,he=ie.S,ve=ie.width,me=ie.height,he>=xl&&13>he)if(11>he)N=ie.f.RGBA,B&=(we=Math.abs(N.A))*(me-1)+ve<=N.size,B&=we>=ve*kl[he],B&=N.eb!=null;else{N=ie.f.kb,we=(ve+1)/2,De=(me+1)/2,Se=Math.abs(N.fa),Oe=Math.abs(N.Ab);var Ze=Math.abs(N.Db),ke=Math.abs(N.lb),qe=ke*(me-1)+ve;B&=Se*(me-1)+ve<=N.Fd,B&=Oe*(De-1)+we<=N.Cd,B=(B&=Ze*(De-1)+we<=N.Ed)&Se>=ve&Oe>=we&Ze>=we,B&=N.y!=null,B&=N.f!=null,B&=N.ea!=null,he==12&&(B&=ke>=ve,B&=qe<=N.Tc,B&=N.F!=null)}else B=0;N=B?0:2}}return N!=0||te!=null&&te.fd&&(N=ua(ie)),N}var Vn=64,os=[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],Ql=24,ca=32,Jr=8,vl=[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];Le("Predictor0","PredictorAdd0"),R.Predictor0=function(){return 4278190080},R.Predictor1=function(N){return N},R.Predictor2=function(N,B,te){return B[te+0]},R.Predictor3=function(N,B,te){return B[te+1]},R.Predictor4=function(N,B,te){return B[te-1]},R.Predictor5=function(N,B,te){return Ce(Ce(N,B[te+1]),B[te+0])},R.Predictor6=function(N,B,te){return Ce(N,B[te-1])},R.Predictor7=function(N,B,te){return Ce(N,B[te+0])},R.Predictor8=function(N,B,te){return Ce(B[te-1],B[te+0])},R.Predictor9=function(N,B,te){return Ce(B[te+0],B[te+1])},R.Predictor10=function(N,B,te){return Ce(Ce(N,B[te-1]),Ce(B[te+0],B[te+1]))},R.Predictor11=function(N,B,te){var ie=B[te+0];return 0>=st(ie>>24&255,N>>24&255,(B=B[te-1])>>24&255)+st(ie>>16&255,N>>16&255,B>>16&255)+st(ie>>8&255,N>>8&255,B>>8&255)+st(255&ie,255&N,255&B)?ie:N},R.Predictor12=function(N,B,te){var ie=B[te+0];return(je((N>>24&255)+(ie>>24&255)-((B=B[te-1])>>24&255))<<24|je((N>>16&255)+(ie>>16&255)-(B>>16&255))<<16|je((N>>8&255)+(ie>>8&255)-(B>>8&255))<<8|je((255&N)+(255&ie)-(255&B)))>>>0},R.Predictor13=function(N,B,te){var ie=B[te-1];return(He((N=Ce(N,B[te+0]))>>24&255,ie>>24&255)<<24|He(N>>16&255,ie>>16&255)<<16|He(N>>8&255,ie>>8&255)<<8|He(255&N,255&ie))>>>0};var ka=R.PredictorAdd0;R.PredictorAdd1=pt,Le("Predictor2","PredictorAdd2"),Le("Predictor3","PredictorAdd3"),Le("Predictor4","PredictorAdd4"),Le("Predictor5","PredictorAdd5"),Le("Predictor6","PredictorAdd6"),Le("Predictor7","PredictorAdd7"),Le("Predictor8","PredictorAdd8"),Le("Predictor9","PredictorAdd9"),Le("Predictor10","PredictorAdd10"),Le("Predictor11","PredictorAdd11"),Le("Predictor12","PredictorAdd12"),Le("Predictor13","PredictorAdd13");var Wi=R.PredictorAdd2;vt("ColorIndexInverseTransform","MapARGB","32b",function(N){return N>>8&255},function(N){return N}),vt("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(N){return N},function(N){return N>>8&255});var ml,_o=R.ColorIndexInverseTransform,Yi=R.MapARGB,Bo=R.VP8LColorIndexInverseTransformAlpha,za=R.MapAlpha,Ti=R.VP8LPredictorsAdd=[];Ti.length=16,(R.VP8LPredictors=[]).length=16,(R.VP8LPredictorsAdd_C=[]).length=16,(R.VP8LPredictors_C=[]).length=16;var xo,zo,Oa,So,tr,en,Ln,Tn,Gn,Eo,Xi,on,ri,ui,yl,Jl,eu,bl,wi,el,tu,Fu,Ua,Ri,Uo,ju,wl,gc,vc=a(511),mc=a(2041),yc=a(225),bc=a(767),wc=0,qo=mc,_l=yc,_i=bc,ro=vc,xl=0,Ho=1,ff=2,Sl=3,ru=4,sn=5,Du=6,El=7,Ts=8,nu=9,iu=10,au=[2,3,7],_c=[3,3,11],tl=[280,256,256,256,40],Xf=[0,1,1,1,0],Hh=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Kf=[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],hf=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Bu=8,Rs=[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],zu=[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],Al=null,df=[[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]],no=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],xc=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Uu=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],Zf=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],Qf=[[[[255,255,255,255,255,255,255,255,255,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]]]],Sc=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Ki=[],Zi=[],fa=[],Ao=1,ou=2,Qi=[],Ca=[];Ba("UpsampleRgbLinePair",Pa,3),Ba("UpsampleBgrLinePair",gl,3),Ba("UpsampleRgbaLinePair",Zl,4),Ba("UpsampleBgraLinePair",Js,4),Ba("UpsampleArgbLinePair",Ls,4),Ba("UpsampleRgba4444LinePair",Li,2),Ba("UpsampleRgb565LinePair",Qs,2);var Jf=R.UpsampleRgbLinePair,eh=R.UpsampleBgrLinePair,Ms=R.UpsampleRgbaLinePair,su=R.UpsampleBgraLinePair,ci=R.UpsampleArgbLinePair,xi=R.UpsampleRgba4444LinePair,Ec=R.UpsampleRgb565LinePair,ss=16,Po=1<<ss-1,Yr=-227,tn=482,ls=6,Mi=0,ha=a(256),rl=a(256),Pl=a(256),da=a(256),lu=a(tn-Yr),pf=a(tn-Yr);la("YuvToRgbRow",Pa,3),la("YuvToBgrRow",gl,3),la("YuvToRgbaRow",Zl,4),la("YuvToBgraRow",Js,4),la("YuvToArgbRow",Ls,4),la("YuvToRgba4444Row",Li,2),la("YuvToRgb565Row",Qs,2);var qu=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],us=[0,2,8],th=[8,7,6,4,4,2,2,2,1,1,1,1],cs=1;this.WebPDecodeRGBA=function(N,B,te,ie,he){var ve=Ho,me=new Et,we=new vr;me.ba=we,we.S=ve,we.width=[we.width],we.height=[we.height];var Se=we.width,Oe=we.height,De=new Xt;if(De==null||N==null)var Ze=2;else t(De!=null),Ze=to(N,B,te,De.width,De.height,De.Pd,De.Qd,De.format,null);if(Ze!=0?Se=0:(Se!=null&&(Se[0]=De.width[0]),Oe!=null&&(Oe[0]=De.height[0]),Se=1),Se){we.width=we.width[0],we.height=we.height[0],ie!=null&&(ie[0]=we.width),he!=null&&(he[0]=we.height);e:{if(ie=new mr,(he=new Ut).data=N,he.w=B,he.ha=te,he.kd=1,B=[0],t(he!=null),((N=to(he.data,he.w,he.ha,null,null,null,B,null,he))==0||N==7)&&B[0]&&(N=4),(B=N)==0){if(t(me!=null),ie.data=he.data,ie.w=he.w+he.offset,ie.ha=he.ha-he.offset,ie.put=Yt,ie.ac=mn,ie.bc=sa,ie.ma=me,he.xa){if((N=Io())==null){me=1;break e}if(function(ke,qe){var Ke=[0],it=[0],Ye=[0];t:for(;;){if(ke==null)return 0;if(qe==null)return ke.a=2,0;if(ke.l=qe,ke.a=0,Y(ke.m,qe.data,qe.w,qe.ha),!Ra(ke.m,Ke,it,Ye)){ke.a=3;break t}if(ke.xb=ou,qe.width=Ke[0],qe.height=it[0],!Ci(Ke[0],it[0],1,ke,null))break t;return 1}return t(ke.a!=0),0}(N,ie)){if(ie=(B=$i(ie.width,ie.height,me.Oa,me.ba))==0){t:{ie=N;r:for(;;){if(ie==null){ie=0;break t}if(t(ie.s.yc!=null),t(ie.s.Ya!=null),t(0<ie.s.Wb),t((te=ie.l)!=null),t((he=te.ma)!=null),ie.xb!=0){if(ie.ca=he.ba,ie.tb=he.tb,t(ie.ca!=null),!Gi(he.Oa,te,Sl)){ie.a=2;break r}if(!Xa(ie,te.width)||te.da)break r;if((te.da||St(ie.ca.S))&&pl(),11>ie.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),ie.ca.f.kb.F!=null&&pl()),ie.Pb&&0<ie.s.ua&&ie.s.vb.X==null&&!de(ie.s.vb,ie.s.Wa.Xa)){ie.a=1;break r}ie.xb=0}if(!_a(ie,ie.V,ie.Ba,ie.c,ie.i,te.o,Mo))break r;he.Dc=ie.Ma,ie=1;break t}t(ie.a!=0),ie=0}ie=!ie}ie&&(B=N.a)}else B=N.a}else{if((N=new Jo)==null){me=1;break e}if(N.Fa=he.na,N.P=he.P,N.qc=he.Sa,Ka(N,ie)){if((B=$i(ie.width,ie.height,me.Oa,me.ba))==0){if(N.Aa=0,te=me.Oa,t((he=N)!=null),te!=null){if(0<(Se=0>(Se=te.Md)?0:100<Se?255:255*Se/100)){for(Oe=De=0;4>Oe;++Oe)12>(Ze=he.pb[Oe]).lc&&(Ze.ia=Se*th[0>Ze.lc?0:Ze.lc]>>3),De|=Ze.ia;De&&(alert("todo:VP8InitRandom"),he.ia=1)}he.Ga=te.Id,100<he.Ga?he.Ga=100:0>he.Ga&&(he.Ga=0)}(function(ke,qe){if(ke==null)return 0;if(qe==null)return Er(ke,2,"NULL VP8Io parameter in VP8Decode().");if(!ke.cb&&!Ka(ke,qe))return 0;if(t(ke.cb),qe.ac==null||qe.ac(qe)){qe.ob&&(ke.L=0);var Ke=us[ke.L];if(ke.L==2?(ke.yb=0,ke.zb=0):(ke.yb=qe.v-Ke>>4,ke.zb=qe.j-Ke>>4,0>ke.yb&&(ke.yb=0),0>ke.zb&&(ke.zb=0)),ke.Va=qe.o+15+Ke>>4,ke.Hb=qe.va+15+Ke>>4,ke.Hb>ke.za&&(ke.Hb=ke.za),ke.Va>ke.Ub&&(ke.Va=ke.Ub),0<ke.L){var it=ke.ed;for(Ke=0;4>Ke;++Ke){var Ye;if(ke.Qa.Cb){var nt=ke.Qa.Lb[Ke];ke.Qa.Fb||(nt+=it.Tb)}else nt=it.Tb;for(Ye=0;1>=Ye;++Ye){var Ue=ke.gd[Ke][Ye],ot=nt;if(it.Pc&&(ot+=it.vd[0],Ye&&(ot+=it.od[0])),0<(ot=0>ot?0:63<ot?63:ot)){var ut=ot;0<it.wb&&(ut=4<it.wb?ut>>2:ut>>1)>9-it.wb&&(ut=9-it.wb),1>ut&&(ut=1),Ue.dd=ut,Ue.tc=2*ot+ut,Ue.ld=40<=ot?2:15<=ot?1:0}else Ue.tc=0;Ue.La=Ye}}}Ke=0}else Er(ke,6,"Frame setup failed"),Ke=ke.a;if(Ke=Ke==0){if(Ke){ke.$c=0,0<ke.Aa||(ke.Ic=cs);t:{Ke=ke.Ic,it=4*(ut=ke.za);var qt=32*ut,Mt=ut+1,ar=0<ke.L?ut*(0<ke.Aa?2:1):0,It=(ke.Aa==2?2:1)*ut;if((Ue=it+832+(Ye=3*(16*Ke+us[ke.L])/2*qt)+(nt=ke.Fa!=null&&0<ke.Fa.length?ke.Kc.c*ke.Kc.i:0))!=Ue)Ke=0;else{if(Ue>ke.Vb){if(ke.Vb=0,ke.Ec=a(Ue),ke.Fc=0,ke.Ec==null){Ke=Er(ke,1,"no memory during frame initialization.");break t}ke.Vb=Ue}Ue=ke.Ec,ot=ke.Fc,ke.Ac=Ue,ke.Bc=ot,ot+=it,ke.Gd=l(qt,oi),ke.Hd=0,ke.rb=l(Mt+1,Qo),ke.sb=1,ke.wa=ar?l(ar,Sa):null,ke.Y=0,ke.D.Nb=0,ke.D.wa=ke.wa,ke.D.Y=ke.Y,0<ke.Aa&&(ke.D.Y+=ut),t(!0),ke.oc=Ue,ke.pc=ot,ot+=832,ke.ya=l(It,$s),ke.aa=0,ke.D.ya=ke.ya,ke.D.aa=ke.aa,ke.Aa==2&&(ke.D.aa+=ut),ke.R=16*ut,ke.B=8*ut,ut=(qt=us[ke.L])*ke.R,qt=qt/2*ke.B,ke.sa=Ue,ke.ta=ot+ut,ke.qa=ke.sa,ke.ra=ke.ta+16*Ke*ke.R+qt,ke.Ha=ke.qa,ke.Ia=ke.ra+8*Ke*ke.B+qt,ke.$c=0,ot+=Ye,ke.mb=nt?Ue:null,ke.nb=nt?ot:null,t(ot+nt<=ke.Fc+ke.Vb),Pn(ke),i(ke.Ac,ke.Bc,0,it),Ke=1}}if(Ke){if(qe.ka=0,qe.y=ke.sa,qe.O=ke.ta,qe.f=ke.qa,qe.N=ke.ra,qe.ea=ke.Ha,qe.Vd=ke.Ia,qe.fa=ke.R,qe.Rc=ke.B,qe.F=null,qe.J=0,!wc){for(Ke=-255;255>=Ke;++Ke)vc[255+Ke]=0>Ke?-Ke:Ke;for(Ke=-1020;1020>=Ke;++Ke)mc[1020+Ke]=-128>Ke?-128:127<Ke?127:Ke;for(Ke=-112;112>=Ke;++Ke)yc[112+Ke]=-16>Ke?-16:15<Ke?15:Ke;for(Ke=-255;510>=Ke;++Ke)bc[255+Ke]=0>Ke?0:255<Ke?255:Ke;wc=1}Ln=Ar,Tn=Ea,Eo=hl,Xi=ts,on=$l,Gn=Ru,ri=X,ui=fe,yl=Ge,Jl=lt,eu=Ne,bl=Fe,wi=ft,el=Lt,tu=Jn,Fu=Da,Ua=eo,Ri=Os,Zi[0]=dc,Zi[1]=rs,Zi[2]=Ks,Zi[3]=vo,Zi[4]=pc,Zi[5]=pn,Zi[6]=Qa,Zi[7]=Wl,Zi[8]=ks,Zi[9]=Yl,Ki[0]=Za,Ki[1]=fc,Ki[2]=hc,Ki[3]=Xs,Ki[4]=Ma,Ki[5]=Ia,Ki[6]=Fa,fa[0]=Fo,fa[1]=Ys,fa[2]=Mu,fa[3]=ja,fa[4]=Aa,fa[5]=Xl,fa[6]=Ja,Ke=1}else Ke=0}Ke&&(Ke=function(_r,Rn){for(_r.M=0;_r.M<_r.Va;++_r.M){var fr,Tt=_r.Jc[_r.M&_r.Xb],_t=_r.m,Mn=_r;for(fr=0;fr<Mn.za;++fr){var Dt=_t,or=Mn,kr=or.Ac,fi=or.Bc+4*fr,ni=or.zc,Ir=or.ya[or.aa+fr];if(or.Qa.Bb?Ir.$b=le(Dt,or.Pa.jb[0])?2+le(Dt,or.Pa.jb[2]):le(Dt,or.Pa.jb[1]):Ir.$b=0,or.kc&&(Ir.Ad=le(Dt,or.Bd)),Ir.Za=!le(Dt,145)+0,Ir.Za){var hi=Ir.Ob,hn=0;for(or=0;4>or;++or){var On,Sr=ni[0+or];for(On=0;4>On;++On){Sr=Zf[kr[fi+On]][Sr];for(var Dr=xc[le(Dt,Sr[0])];0<Dr;)Dr=xc[2*Dr+le(Dt,Sr[Dr])];Sr=-Dr,kr[fi+On]=Sr}n(hi,hn,kr,fi,4),hn+=4,ni[0+or]=Sr}}else Sr=le(Dt,156)?le(Dt,128)?1:3:le(Dt,163)?2:0,Ir.Ob[0]=Sr,i(kr,fi,Sr,4),i(ni,0,Sr,4);Ir.Dd=le(Dt,142)?le(Dt,114)?le(Dt,183)?1:3:2:0}if(Mn.m.Ka)return Er(_r,7,"Premature end-of-partition0 encountered.");for(;_r.ja<_r.za;++_r.ja){if(Mn=Tt,Dt=(_t=_r).rb[_t.sb-1],kr=_t.rb[_t.sb+_t.ja],fr=_t.ya[_t.aa+_t.ja],fi=_t.kc?fr.Ad:0)Dt.la=kr.la=0,fr.Za||(Dt.Na=kr.Na=0),fr.Hc=0,fr.Gc=0,fr.ia=0;else{var wn,Br;if(Dt=kr,kr=Mn,fi=_t.Pa.Xc,ni=_t.ya[_t.aa+_t.ja],Ir=_t.pb[ni.$b],or=ni.ad,hi=0,hn=_t.rb[_t.sb-1],Sr=On=0,i(or,hi,0,384),ni.Za)var _n=0,xn=fi[3];else{Dr=a(16);var Xr=Dt.Na+hn.Na;if(Xr=Al(kr,fi[1],Xr,Ir.Eb,0,Dr,0),Dt.Na=hn.Na=(0<Xr)+0,1<Xr)Ln(Dr,0,or,hi);else{var Si=Dr[0]+3>>3;for(Dr=0;256>Dr;Dr+=16)or[hi+Dr]=Si}_n=1,xn=fi[0]}var Vr=15&Dt.la,Gr=15&hn.la;for(Dr=0;4>Dr;++Dr){var $n=1&Gr;for(Si=Br=0;4>Si;++Si)Vr=Vr>>1|($n=(Xr=Al(kr,xn,Xr=$n+(1&Vr),Ir.Sc,_n,or,hi))>_n)<<7,Br=Br<<2|(3<Xr?3:1<Xr?2:or[hi+0]!=0),hi+=16;Vr>>=4,Gr=Gr>>1|$n<<7,On=(On<<8|Br)>>>0}for(xn=Vr,_n=Gr>>4,wn=0;4>wn;wn+=2){for(Br=0,Vr=Dt.la>>4+wn,Gr=hn.la>>4+wn,Dr=0;2>Dr;++Dr){for($n=1&Gr,Si=0;2>Si;++Si)Xr=$n+(1&Vr),Vr=Vr>>1|($n=0<(Xr=Al(kr,fi[2],Xr,Ir.Qc,0,or,hi)))<<3,Br=Br<<2|(3<Xr?3:1<Xr?2:or[hi+0]!=0),hi+=16;Vr>>=2,Gr=Gr>>1|$n<<5}Sr|=Br<<4*wn,xn|=Vr<<4<<wn,_n|=(240&Gr)<<wn}Dt.la=xn,hn.la=_n,ni.Hc=On,ni.Gc=Sr,ni.ia=43690&Sr?0:Ir.ia,fi=!(On|Sr)}if(0<_t.L&&(_t.wa[_t.Y+_t.ja]=_t.gd[fr.$b][fr.Za],_t.wa[_t.Y+_t.ja].La|=!fi),Mn.Ka)return Er(_r,7,"Premature end-of-file encountered.")}if(Pn(_r),_t=Rn,Mn=1,fr=(Tt=_r).D,Dt=0<Tt.L&&Tt.M>=Tt.zb&&Tt.M<=Tt.Va,Tt.Aa==0)t:{if(fr.M=Tt.M,fr.uc=Dt,li(Tt,fr),Mn=1,fr=(Br=Tt.D).Nb,Dt=(Sr=us[Tt.L])*Tt.R,kr=Sr/2*Tt.B,Dr=16*fr*Tt.R,Si=8*fr*Tt.B,fi=Tt.sa,ni=Tt.ta-Dt+Dr,Ir=Tt.qa,or=Tt.ra-kr+Si,hi=Tt.Ha,hn=Tt.Ia-kr+Si,Gr=(Vr=Br.M)==0,On=Vr>=Tt.Va-1,Tt.Aa==2&&li(Tt,Br),Br.uc)for($n=(Xr=Tt).D.M,t(Xr.D.uc),Br=Xr.yb;Br<Xr.Hb;++Br){_n=Br,xn=$n;var Ei=(pa=(yr=Xr).D).Nb;wn=yr.R;var pa=pa.wa[pa.Y+_n],Wn=yr.sa,In=yr.ta+16*Ei*wn+16*_n,ga=pa.dd,Kr=pa.tc;if(Kr!=0)if(t(3<=Kr),yr.L==1)0<_n&&Fu(Wn,In,wn,Kr+4),pa.La&&Ri(Wn,In,wn,Kr),0<xn&&tu(Wn,In,wn,Kr+4),pa.La&&Ua(Wn,In,wn,Kr);else{var Ii=yr.B,zr=yr.qa,rr=yr.ra+8*Ei*Ii+8*_n,Or=yr.Ha,yr=yr.Ia+8*Ei*Ii+8*_n;Ei=pa.ld,0<_n&&(ui(Wn,In,wn,Kr+4,ga,Ei),Jl(zr,rr,Or,yr,Ii,Kr+4,ga,Ei)),pa.La&&(bl(Wn,In,wn,Kr,ga,Ei),el(zr,rr,Or,yr,Ii,Kr,ga,Ei)),0<xn&&(ri(Wn,In,wn,Kr+4,ga,Ei),yl(zr,rr,Or,yr,Ii,Kr+4,ga,Ei)),pa.La&&(eu(Wn,In,wn,Kr,ga,Ei),wi(zr,rr,Or,yr,Ii,Kr,ga,Ei))}}if(Tt.ia&&alert("todo:DitherRow"),_t.put!=null){if(Br=16*Vr,Vr=16*(Vr+1),Gr?(_t.y=Tt.sa,_t.O=Tt.ta+Dr,_t.f=Tt.qa,_t.N=Tt.ra+Si,_t.ea=Tt.Ha,_t.W=Tt.Ia+Si):(Br-=Sr,_t.y=fi,_t.O=ni,_t.f=Ir,_t.N=or,_t.ea=hi,_t.W=hn),On||(Vr-=Sr),Vr>_t.o&&(Vr=_t.o),_t.F=null,_t.J=null,Tt.Fa!=null&&0<Tt.Fa.length&&Br<Vr&&(_t.J=Ni(Tt,_t,Br,Vr-Br),_t.F=Tt.mb,_t.F==null&&_t.F.length==0)){Mn=Er(Tt,3,"Could not decode alpha data.");break t}Br<_t.j&&(Sr=_t.j-Br,Br=_t.j,t(!(1&Sr)),_t.O+=Tt.R*Sr,_t.N+=Tt.B*(Sr>>1),_t.W+=Tt.B*(Sr>>1),_t.F!=null&&(_t.J+=_t.width*Sr)),Br<Vr&&(_t.O+=_t.v,_t.N+=_t.v>>1,_t.W+=_t.v>>1,_t.F!=null&&(_t.J+=_t.v),_t.ka=Br-_t.j,_t.U=_t.va-_t.v,_t.T=Vr-Br,Mn=_t.put(_t))}fr+1!=Tt.Ic||On||(n(Tt.sa,Tt.ta-Dt,fi,ni+16*Tt.R,Dt),n(Tt.qa,Tt.ra-kr,Ir,or+8*Tt.B,kr),n(Tt.Ha,Tt.Ia-kr,hi,hn+8*Tt.B,kr))}if(!Mn)return Er(_r,6,"Output aborted.")}return 1}(ke,qe)),qe.bc!=null&&qe.bc(qe),Ke&=1}return Ke?(ke.cb=0,Ke):0})(N,ie)||(B=N.a)}}else B=N.a}B==0&&me.Oa!=null&&me.Oa.fd&&(B=ua(me.ba))}me=B}ve=me!=0?null:11>ve?we.f.RGBA.eb:we.f.kb.y}else ve=null;return ve};var kl=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function d(R,T){for(var k="",C=0;C<4;C++)k+=String.fromCharCode(R[T++]);return k}function f(R,T){return R[T+0]|R[T+1]<<8}function v(R,T){return(R[T+0]|R[T+1]<<8|R[T+2]<<16)>>>0}function g(R,T){return(R[T+0]|R[T+1]<<8|R[T+2]<<16|R[T+3]<<24)>>>0}new u;var c=[0],y=[0],x=[],E=new u,S=e,b=function(R,T){var k={},C=0,q=!1,G=0,J=0;if(k.frames=[],!function(j,z){for(var Z=0;Z<4;Z++)if(j[z+Z]!="RIFF".charCodeAt(Z))return!0;return!1}(R,T)){for(g(R,T+=4),T+=8;T<R.length;){var ae=d(R,T),H=g(R,T+=4);T+=4;var V=H+(1&H);switch(ae){case"VP8 ":case"VP8L":k.frames[C]===void 0&&(k.frames[C]={}),(D=k.frames[C]).src_off=q?J:T-8,D.src_size=G+H+8,C++,q&&(q=!1,G=0,J=0);break;case"VP8X":(D=k.header={}).feature_flags=R[T];var Y=T+4;D.canvas_width=1+v(R,Y),Y+=3,D.canvas_height=1+v(R,Y),Y+=3;break;case"ALPH":q=!0,G=V+8,J=T-8;break;case"ANIM":(D=k.header).bgcolor=g(R,T),Y=T+4,D.loop_count=f(R,Y),Y+=2;break;case"ANMF":var U,D;(D=k.frames[C]={}).offset_x=2*v(R,T),T+=3,D.offset_y=2*v(R,T),T+=3,D.width=1+v(R,T),T+=3,D.height=1+v(R,T),T+=3,D.duration=v(R,T),T+=3,U=R[T++],D.dispose=1&U,D.blend=U>>1&1}ae!="ANMF"&&(T+=V)}return k}}(S,0);b.response=S,b.rgbaoutput=!0,b.dataurl=!1;var w=b.header?b.header:null,_=b.frames?b.frames:null;if(w){w.loop_counter=w.loop_count,c=[w.canvas_height],y=[w.canvas_width];for(var A=0;A<_.length&&_[A].blend!=0;A++);}var M=_[0],O=E.WebPDecodeRGBA(S,M.src_off,M.src_size,y,c);M.rgba=O,M.imgwidth=y[0],M.imgheight=c[0];for(var L=0;L<y[0]*c[0]*4;L++)x[L]=O[L];return this.width=y,this.height=c,this.data=x,this}(function(e){var t,r,n,i,a,l,o,u,d,f=function(j){return j=j||{},this.isStrokeTransparent=j.isStrokeTransparent||!1,this.strokeOpacity=j.strokeOpacity||1,this.strokeStyle=j.strokeStyle||"#000000",this.fillStyle=j.fillStyle||"#000000",this.isFillTransparent=j.isFillTransparent||!1,this.fillOpacity=j.fillOpacity||1,this.font=j.font||"10px sans-serif",this.textBaseline=j.textBaseline||"alphabetic",this.textAlign=j.textAlign||"left",this.lineWidth=j.lineWidth||1,this.lineJoin=j.lineJoin||"miter",this.lineCap=j.lineCap||"butt",this.path=j.path||[],this.transform=j.transform!==void 0?j.transform.clone():new u,this.globalCompositeOperation=j.globalCompositeOperation||"normal",this.globalAlpha=j.globalAlpha||1,this.clip_path=j.clip_path||[],this.currentPoint=j.currentPoint||new l,this.miterLimit=j.miterLimit||10,this.lastPoint=j.lastPoint||new l,this.lineDashOffset=j.lineDashOffset||0,this.lineDash=j.lineDash||[],this.margin=j.margin||[0,0,0,0],this.prevPageLastElemOffset=j.prevPageLastElemOffset||0,this.ignoreClearRect=typeof j.ignoreClearRect!="boolean"||j.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new v(this),t=this.internal.f2,r=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,a=this.internal.getVerticalCoordinate,l=this.internal.Point,o=this.internal.Rectangle,u=this.internal.Matrix,d=new f}]);var v=function(j){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var z=j;Object.defineProperty(this,"pdf",{get:function(){return z}});var Z=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return Z},set:function(Pe){Z=!!Pe}});var re=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return re},set:function(Pe){re=!!Pe}});var W=0;Object.defineProperty(this,"posX",{get:function(){return W},set:function(Pe){isNaN(Pe)||(W=Pe)}});var Q=0;Object.defineProperty(this,"posY",{get:function(){return Q},set:function(Pe){isNaN(Pe)||(Q=Pe)}}),Object.defineProperty(this,"margin",{get:function(){return d.margin},set:function(Pe){var de;typeof Pe=="number"?de=[Pe,Pe,Pe,Pe]:((de=new Array(4))[0]=Pe[0],de[1]=Pe.length>=2?Pe[1]:de[0],de[2]=Pe.length>=3?Pe[2]:de[0],de[3]=Pe.length>=4?Pe[3]:de[1]),d.margin=de}});var se=!1;Object.defineProperty(this,"autoPaging",{get:function(){return se},set:function(Pe){se=Pe}});var ue=0;Object.defineProperty(this,"lastBreak",{get:function(){return ue},set:function(Pe){ue=Pe}});var le=[];Object.defineProperty(this,"pageBreaks",{get:function(){return le},set:function(Pe){le=Pe}}),Object.defineProperty(this,"ctx",{get:function(){return d},set:function(Pe){Pe instanceof f&&(d=Pe)}}),Object.defineProperty(this,"path",{get:function(){return d.path},set:function(Pe){d.path=Pe}});var ye=[];Object.defineProperty(this,"ctxStack",{get:function(){return ye},set:function(Pe){ye=Pe}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(Pe){var de;de=g(Pe),this.ctx.fillStyle=de.style,this.ctx.isFillTransparent=de.a===0,this.ctx.fillOpacity=de.a,this.pdf.setFillColor(de.r,de.g,de.b,{a:de.a}),this.pdf.setTextColor(de.r,de.g,de.b,{a:de.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(Pe){var de=g(Pe);this.ctx.strokeStyle=de.style,this.ctx.isStrokeTransparent=de.a===0,this.ctx.strokeOpacity=de.a,de.a===0?this.pdf.setDrawColor(255,255,255):(de.a,this.pdf.setDrawColor(de.r,de.g,de.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(Pe){["butt","round","square"].indexOf(Pe)!==-1&&(this.ctx.lineCap=Pe,this.pdf.setLineCap(Pe))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(Pe){isNaN(Pe)||(this.ctx.lineWidth=Pe,this.pdf.setLineWidth(Pe))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(Pe){["bevel","round","miter"].indexOf(Pe)!==-1&&(this.ctx.lineJoin=Pe,this.pdf.setLineJoin(Pe))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(Pe){isNaN(Pe)||(this.ctx.miterLimit=Pe,this.pdf.setMiterLimit(Pe))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(Pe){this.ctx.textBaseline=Pe}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(Pe){["right","end","center","left","start"].indexOf(Pe)!==-1&&(this.ctx.textAlign=Pe)}});var Re=null,Me=null;Object.defineProperty(this,"fontFaces",{get:function(){return Me},set:function(Pe){Re=null,Me=Pe}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(Pe){var de;if(this.ctx.font=Pe,(de=/^\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(Pe))!==null){var Te=de[1];de[2];var Ae=de[3],be=de[4];de[5];var _e=de[6],xe=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(be)[2];be=Math.floor(xe==="px"?parseFloat(be)*this.pdf.internal.scaleFactor:xe==="em"?parseFloat(be)*this.pdf.getFontSize():parseFloat(be)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(be);var Le=function(ht){var vt,wr,cr=[],Pt=ht.trim();if(Pt==="")return vv;if(Pt in Sw)return[Sw[Pt]];for(;Pt!=="";){switch(wr=null,vt=(Pt=Aw(Pt)).charAt(0)){case'"':case"'":wr=ER(Pt.substring(1),vt);break;default:wr=AR(Pt)}if(wr===null||(cr.push(wr[0]),(Pt=Aw(wr[1]))!==""&&Pt.charAt(0)!==","))return vv;Pt=Pt.replace(/^,/,"")}return cr}(_e);if(this.fontFaces){var pe=function(ht,vt){if(Re===null){var wr=function(cr){var Pt=[];return Object.keys(cr).forEach(function($t){cr[$t].forEach(function($e){var ze=null;switch($e){case"bold":ze={family:$t,weight:"bold"};break;case"italic":ze={family:$t,style:"italic"};break;case"bolditalic":ze={family:$t,weight:"bold",style:"italic"};break;case"":case"normal":ze={family:$t}}ze!==null&&(ze.ref={name:$t,style:$e},Pt.push(ze))})}),Pt}(ht.getFontList());Re=function(cr){for(var Pt={},$t=0;$t<cr.length;++$t){var $e=gv(cr[$t]),ze=$e.family,kt=$e.stretch,St=$e.style,er=$e.weight;Pt[ze]=Pt[ze]||{},Pt[ze][kt]=Pt[ze][kt]||{},Pt[ze][kt][St]=Pt[ze][kt][St]||{},Pt[ze][kt][St][er]=$e}return Pt}(wr.concat(vt))}return Re}(this.pdf,this.fontFaces),Ce=Le.map(function(ht){return{family:ht,stretch:"normal",weight:Ae,style:Te}}),je=function(ht,vt,wr){for(var cr=(wr=wr||{}).defaultFontFamily||"times",Pt=Object.assign({},SR,wr.genericFontFamilies||{}),$t=null,$e=null,ze=0;ze<vt.length;++ze)if(Pt[($t=gv(vt[ze])).family]&&($t.family=Pt[$t.family]),ht.hasOwnProperty($t.family)){$e=ht[$t.family];break}if(!($e=$e||ht[cr]))throw new Error("Could not find a font-family for the rule '"+Ew($t)+"' and default family '"+cr+"'.");if($e=function(kt,St){if(St[kt])return St[kt];var er=Jv[kt],jt=er<=Jv.normal?-1:1,vr=xw(St,P7,er,jt);if(!vr)throw new Error("Could not find a matching font-stretch value for "+kt);return vr}($t.stretch,$e),$e=function(kt,St){if(St[kt])return St[kt];for(var er=A7[kt],jt=0;jt<er.length;++jt)if(St[er[jt]])return St[er[jt]];throw new Error("Could not find a matching font-style for "+kt)}($t.style,$e),!($e=function(kt,St){if(St[kt])return St[kt];if(kt===400&&St[500])return St[500];if(kt===500&&St[400])return St[400];var er=xR[kt],jt=xw(St,k7,er,kt<400?-1:1);if(!jt)throw new Error("Could not find a matching font-weight for value "+kt);return jt}($t.weight,$e)))throw new Error("Failed to resolve a font for the rule '"+Ew($t)+"'.");return $e}(pe,Ce);this.pdf.setFont(je.ref.name,je.ref.style)}else{var He="";(Ae==="bold"||parseInt(Ae,10)>=700||Te==="bold")&&(He="bold"),Te==="italic"&&(He+="italic"),He.length===0&&(He="normal");for(var st="",pt={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"},ct=0;ct<Le.length;ct++){if(this.pdf.internal.getFont(Le[ct],He,{noFallback:!0,disableWarning:!0})!==void 0){st=Le[ct];break}if(He==="bolditalic"&&this.pdf.internal.getFont(Le[ct],"bold",{noFallback:!0,disableWarning:!0})!==void 0)st=Le[ct],He="bold";else if(this.pdf.internal.getFont(Le[ct],"normal",{noFallback:!0,disableWarning:!0})!==void 0){st=Le[ct],He="normal";break}}if(st===""){for(var bt=0;bt<Le.length;bt++)if(pt[Le[bt]]){st=pt[Le[bt]];break}}st=st===""?"Times":st,this.pdf.setFont(st,He)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(Pe){this.ctx.globalCompositeOperation=Pe}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(Pe){this.ctx.globalAlpha=Pe}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(Pe){this.ctx.lineDashOffset=Pe,D.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(Pe){this.ctx.lineDash=Pe,D.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(Pe){this.ctx.ignoreClearRect=!!Pe}})};v.prototype.setLineDash=function(j){this.lineDash=j},v.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},v.prototype.fill=function(){_.call(this,"fill",!1)},v.prototype.stroke=function(){_.call(this,"stroke",!1)},v.prototype.beginPath=function(){this.path=[{type:"begin"}]},v.prototype.moveTo=function(j,z){if(isNaN(j)||isNaN(z))throw zn.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var Z=this.ctx.transform.applyToPoint(new l(j,z));this.path.push({type:"mt",x:Z.x,y:Z.y}),this.ctx.lastPoint=new l(j,z)},v.prototype.closePath=function(){var j=new l(0,0),z=0;for(z=this.path.length-1;z!==-1;z--)if(this.path[z].type==="begin"&&Sn(this.path[z+1])==="object"&&typeof this.path[z+1].x=="number"){j=new l(this.path[z+1].x,this.path[z+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new l(j.x,j.y)},v.prototype.lineTo=function(j,z){if(isNaN(j)||isNaN(z))throw zn.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var Z=this.ctx.transform.applyToPoint(new l(j,z));this.path.push({type:"lt",x:Z.x,y:Z.y}),this.ctx.lastPoint=new l(Z.x,Z.y)},v.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),_.call(this,null,!0)},v.prototype.quadraticCurveTo=function(j,z,Z,re){if(isNaN(Z)||isNaN(re)||isNaN(j)||isNaN(z))throw zn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var W=this.ctx.transform.applyToPoint(new l(Z,re)),Q=this.ctx.transform.applyToPoint(new l(j,z));this.path.push({type:"qct",x1:Q.x,y1:Q.y,x:W.x,y:W.y}),this.ctx.lastPoint=new l(W.x,W.y)},v.prototype.bezierCurveTo=function(j,z,Z,re,W,Q){if(isNaN(W)||isNaN(Q)||isNaN(j)||isNaN(z)||isNaN(Z)||isNaN(re))throw zn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var se=this.ctx.transform.applyToPoint(new l(W,Q)),ue=this.ctx.transform.applyToPoint(new l(j,z)),le=this.ctx.transform.applyToPoint(new l(Z,re));this.path.push({type:"bct",x1:ue.x,y1:ue.y,x2:le.x,y2:le.y,x:se.x,y:se.y}),this.ctx.lastPoint=new l(se.x,se.y)},v.prototype.arc=function(j,z,Z,re,W,Q){if(isNaN(j)||isNaN(z)||isNaN(Z)||isNaN(re)||isNaN(W))throw zn.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(Q=!!Q,!this.ctx.transform.isIdentity){var se=this.ctx.transform.applyToPoint(new l(j,z));j=se.x,z=se.y;var ue=this.ctx.transform.applyToPoint(new l(0,Z)),le=this.ctx.transform.applyToPoint(new l(0,0));Z=Math.sqrt(Math.pow(ue.x-le.x,2)+Math.pow(ue.y-le.y,2))}Math.abs(W-re)>=2*Math.PI&&(re=0,W=2*Math.PI),this.path.push({type:"arc",x:j,y:z,radius:Z,startAngle:re,endAngle:W,counterclockwise:Q})},v.prototype.arcTo=function(j,z,Z,re,W){throw new Error("arcTo not implemented.")},v.prototype.rect=function(j,z,Z,re){if(isNaN(j)||isNaN(z)||isNaN(Z)||isNaN(re))throw zn.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(j,z),this.lineTo(j+Z,z),this.lineTo(j+Z,z+re),this.lineTo(j,z+re),this.lineTo(j,z),this.lineTo(j+Z,z),this.lineTo(j,z)},v.prototype.fillRect=function(j,z,Z,re){if(isNaN(j)||isNaN(z)||isNaN(Z)||isNaN(re))throw zn.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!c.call(this)){var W={};this.lineCap!=="butt"&&(W.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(W.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(j,z,Z,re),this.fill(),W.hasOwnProperty("lineCap")&&(this.lineCap=W.lineCap),W.hasOwnProperty("lineJoin")&&(this.lineJoin=W.lineJoin)}},v.prototype.strokeRect=function(j,z,Z,re){if(isNaN(j)||isNaN(z)||isNaN(Z)||isNaN(re))throw zn.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");y.call(this)||(this.beginPath(),this.rect(j,z,Z,re),this.stroke())},v.prototype.clearRect=function(j,z,Z,re){if(isNaN(j)||isNaN(z)||isNaN(Z)||isNaN(re))throw zn.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(j,z,Z,re))},v.prototype.save=function(j){j=typeof j!="boolean"||j;for(var z=this.pdf.internal.getCurrentPageInfo().pageNumber,Z=0;Z<this.pdf.internal.getNumberOfPages();Z++)this.pdf.setPage(Z+1),this.pdf.internal.out("q");if(this.pdf.setPage(z),j){this.ctx.fontSize=this.pdf.internal.getFontSize();var re=new f(this.ctx);this.ctxStack.push(this.ctx),this.ctx=re}},v.prototype.restore=function(j){j=typeof j!="boolean"||j;for(var z=this.pdf.internal.getCurrentPageInfo().pageNumber,Z=0;Z<this.pdf.internal.getNumberOfPages();Z++)this.pdf.setPage(Z+1),this.pdf.internal.out("Q");this.pdf.setPage(z),j&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},v.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var g=function(j){var z,Z,re,W;if(j.isCanvasGradient===!0&&(j=j.getColor()),!j)return{r:0,g:0,b:0,a:0,style:j};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(j))z=0,Z=0,re=0,W=0;else{var Q=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(j);if(Q!==null)z=parseInt(Q[1]),Z=parseInt(Q[2]),re=parseInt(Q[3]),W=1;else if((Q=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(j))!==null)z=parseInt(Q[1]),Z=parseInt(Q[2]),re=parseInt(Q[3]),W=parseFloat(Q[4]);else{if(W=1,typeof j=="string"&&j.charAt(0)!=="#"){var se=new y7(j);j=se.ok?se.toHex():"#000000"}j.length===4?(z=j.substring(1,2),z+=z,Z=j.substring(2,3),Z+=Z,re=j.substring(3,4),re+=re):(z=j.substring(1,3),Z=j.substring(3,5),re=j.substring(5,7)),z=parseInt(z,16),Z=parseInt(Z,16),re=parseInt(re,16)}}return{r:z,g:Z,b:re,a:W,style:j}},c=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},y=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};v.prototype.fillText=function(j,z,Z,re){if(isNaN(z)||isNaN(Z)||typeof j!="string")throw zn.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(re=isNaN(re)?void 0:re,!c.call(this)){var W=V(this.ctx.transform.rotation),Q=this.ctx.transform.scaleX;C.call(this,{text:j,x:z,y:Z,scale:Q,angle:W,align:this.textAlign,maxWidth:re})}},v.prototype.strokeText=function(j,z,Z,re){if(isNaN(z)||isNaN(Z)||typeof j!="string")throw zn.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!y.call(this)){re=isNaN(re)?void 0:re;var W=V(this.ctx.transform.rotation),Q=this.ctx.transform.scaleX;C.call(this,{text:j,x:z,y:Z,scale:Q,renderingMode:"stroke",angle:W,align:this.textAlign,maxWidth:re})}},v.prototype.measureText=function(j){if(typeof j!="string")throw zn.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var z=this.pdf,Z=this.pdf.internal.scaleFactor,re=z.internal.getFontSize(),W=z.getStringUnitWidth(j)*re/z.internal.scaleFactor;return new function(Q){var se=(Q=Q||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return se}}),this}({width:W*=Math.round(96*Z/72*1e4)/1e4})},v.prototype.scale=function(j,z){if(isNaN(j)||isNaN(z))throw zn.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var Z=new u(j,0,0,z,0,0);this.ctx.transform=this.ctx.transform.multiply(Z)},v.prototype.rotate=function(j){if(isNaN(j))throw zn.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var z=new u(Math.cos(j),Math.sin(j),-Math.sin(j),Math.cos(j),0,0);this.ctx.transform=this.ctx.transform.multiply(z)},v.prototype.translate=function(j,z){if(isNaN(j)||isNaN(z))throw zn.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var Z=new u(1,0,0,1,j,z);this.ctx.transform=this.ctx.transform.multiply(Z)},v.prototype.transform=function(j,z,Z,re,W,Q){if(isNaN(j)||isNaN(z)||isNaN(Z)||isNaN(re)||isNaN(W)||isNaN(Q))throw zn.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var se=new u(j,z,Z,re,W,Q);this.ctx.transform=this.ctx.transform.multiply(se)},v.prototype.setTransform=function(j,z,Z,re,W,Q){j=isNaN(j)?1:j,z=isNaN(z)?0:z,Z=isNaN(Z)?0:Z,re=isNaN(re)?1:re,W=isNaN(W)?0:W,Q=isNaN(Q)?0:Q,this.ctx.transform=new u(j,z,Z,re,W,Q)};var x=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};v.prototype.drawImage=function(j,z,Z,re,W,Q,se,ue,le){var ye=this.pdf.getImageProperties(j),Re=1,Me=1,Pe=1,de=1;re!==void 0&&ue!==void 0&&(Pe=ue/re,de=le/W,Re=ye.width/re*ue/re,Me=ye.height/W*le/W),Q===void 0&&(Q=z,se=Z,z=0,Z=0),re!==void 0&&ue===void 0&&(ue=re,le=W),re===void 0&&ue===void 0&&(ue=ye.width,le=ye.height);for(var Te,Ae=this.ctx.transform.decompose(),be=V(Ae.rotate.shx),_e=new u,xe=(_e=(_e=(_e=_e.multiply(Ae.translate)).multiply(Ae.skew)).multiply(Ae.scale)).applyToRectangle(new o(Q-z*Pe,se-Z*de,re*Re,W*Me)),Le=E.call(this,xe),pe=[],Ce=0;Ce<Le.length;Ce+=1)pe.indexOf(Le[Ce])===-1&&pe.push(Le[Ce]);if(w(pe),this.autoPaging)for(var je=pe[0],He=pe[pe.length-1],st=je;st<He+1;st++){this.pdf.setPage(st);var pt=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],ct=st===1?this.posY+this.margin[0]:this.margin[0],bt=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ht=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],vt=st===1?0:bt+(st-2)*ht;if(this.ctx.clip_path.length!==0){var wr=this.path;Te=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(Te,this.posX+this.margin[3],-vt+ct+this.ctx.prevPageLastElemOffset),A.call(this,"fill",!0),this.path=wr}var cr=JSON.parse(JSON.stringify(xe));cr=b([cr],this.posX+this.margin[3],-vt+ct+this.ctx.prevPageLastElemOffset)[0];var Pt=(st>je||st<He)&&x.call(this);Pt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],pt,ht,null).clip().discardPath()),this.pdf.addImage(j,"JPEG",cr.x,cr.y,cr.w,cr.h,null,null,be),Pt&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(j,"JPEG",xe.x,xe.y,xe.w,xe.h,null,null,be)};var E=function(j,z,Z){var re=[];z=z||this.pdf.internal.pageSize.width,Z=Z||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var W=this.posY+this.ctx.prevPageLastElemOffset;switch(j.type){default:case"mt":case"lt":re.push(Math.floor((j.y+W)/Z)+1);break;case"arc":re.push(Math.floor((j.y+W-j.radius)/Z)+1),re.push(Math.floor((j.y+W+j.radius)/Z)+1);break;case"qct":var Q=Y(this.ctx.lastPoint.x,this.ctx.lastPoint.y,j.x1,j.y1,j.x,j.y);re.push(Math.floor((Q.y+W)/Z)+1),re.push(Math.floor((Q.y+Q.h+W)/Z)+1);break;case"bct":var se=U(this.ctx.lastPoint.x,this.ctx.lastPoint.y,j.x1,j.y1,j.x2,j.y2,j.x,j.y);re.push(Math.floor((se.y+W)/Z)+1),re.push(Math.floor((se.y+se.h+W)/Z)+1);break;case"rect":re.push(Math.floor((j.y+W)/Z)+1),re.push(Math.floor((j.y+j.h+W)/Z)+1)}for(var ue=0;ue<re.length;ue+=1)for(;this.pdf.internal.getNumberOfPages()<re[ue];)S.call(this);return re},S=function(){var j=this.fillStyle,z=this.strokeStyle,Z=this.font,re=this.lineCap,W=this.lineWidth,Q=this.lineJoin;this.pdf.addPage(),this.fillStyle=j,this.strokeStyle=z,this.font=Z,this.lineCap=re,this.lineWidth=W,this.lineJoin=Q},b=function(j,z,Z){for(var re=0;re<j.length;re++)switch(j[re].type){case"bct":j[re].x2+=z,j[re].y2+=Z;case"qct":j[re].x1+=z,j[re].y1+=Z;default:j[re].x+=z,j[re].y+=Z}return j},w=function(j){return j.sort(function(z,Z){return z-Z})},_=function(j,z){for(var Z,re,W=this.fillStyle,Q=this.strokeStyle,se=this.lineCap,ue=this.lineWidth,le=Math.abs(ue*this.ctx.transform.scaleX),ye=this.lineJoin,Re=JSON.parse(JSON.stringify(this.path)),Me=JSON.parse(JSON.stringify(this.path)),Pe=[],de=0;de<Me.length;de++)if(Me[de].x!==void 0)for(var Te=E.call(this,Me[de]),Ae=0;Ae<Te.length;Ae+=1)Pe.indexOf(Te[Ae])===-1&&Pe.push(Te[Ae]);for(var be=0;be<Pe.length;be++)for(;this.pdf.internal.getNumberOfPages()<Pe[be];)S.call(this);if(w(Pe),this.autoPaging)for(var _e=Pe[0],xe=Pe[Pe.length-1],Le=_e;Le<xe+1;Le++){this.pdf.setPage(Le),this.fillStyle=W,this.strokeStyle=Q,this.lineCap=se,this.lineWidth=le,this.lineJoin=ye;var pe=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ce=Le===1?this.posY+this.margin[0]:this.margin[0],je=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],He=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],st=Le===1?0:je+(Le-2)*He;if(this.ctx.clip_path.length!==0){var pt=this.path;Z=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(Z,this.posX+this.margin[3],-st+Ce+this.ctx.prevPageLastElemOffset),A.call(this,j,!0),this.path=pt}if(re=JSON.parse(JSON.stringify(Re)),this.path=b(re,this.posX+this.margin[3],-st+Ce+this.ctx.prevPageLastElemOffset),z===!1||Le===0){var ct=(Le>_e||Le<xe)&&x.call(this);ct&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],pe,He,null).clip().discardPath()),A.call(this,j,z),ct&&this.pdf.restoreGraphicsState()}this.lineWidth=ue}else this.lineWidth=le,A.call(this,j,z),this.lineWidth=ue;this.path=Re},A=function(j,z){if((j!=="stroke"||z||!y.call(this))&&(j==="stroke"||z||!c.call(this))){for(var Z,re,W=[],Q=this.path,se=0;se<Q.length;se++){var ue=Q[se];switch(ue.type){case"begin":W.push({begin:!0});break;case"close":W.push({close:!0});break;case"mt":W.push({start:ue,deltas:[],abs:[]});break;case"lt":var le=W.length;if(Q[se-1]&&!isNaN(Q[se-1].x)&&(Z=[ue.x-Q[se-1].x,ue.y-Q[se-1].y],le>0)){for(;le>=0;le--)if(W[le-1].close!==!0&&W[le-1].begin!==!0){W[le-1].deltas.push(Z),W[le-1].abs.push(ue);break}}break;case"bct":Z=[ue.x1-Q[se-1].x,ue.y1-Q[se-1].y,ue.x2-Q[se-1].x,ue.y2-Q[se-1].y,ue.x-Q[se-1].x,ue.y-Q[se-1].y],W[W.length-1].deltas.push(Z);break;case"qct":var ye=Q[se-1].x+2/3*(ue.x1-Q[se-1].x),Re=Q[se-1].y+2/3*(ue.y1-Q[se-1].y),Me=ue.x+2/3*(ue.x1-ue.x),Pe=ue.y+2/3*(ue.y1-ue.y),de=ue.x,Te=ue.y;Z=[ye-Q[se-1].x,Re-Q[se-1].y,Me-Q[se-1].x,Pe-Q[se-1].y,de-Q[se-1].x,Te-Q[se-1].y],W[W.length-1].deltas.push(Z);break;case"arc":W.push({deltas:[],abs:[],arc:!0}),Array.isArray(W[W.length-1].abs)&&W[W.length-1].abs.push(ue)}}re=z?null:j==="stroke"?"stroke":"fill";for(var Ae=!1,be=0;be<W.length;be++)if(W[be].arc)for(var _e=W[be].abs,xe=0;xe<_e.length;xe++){var Le=_e[xe];Le.type==="arc"?L.call(this,Le.x,Le.y,Le.radius,Le.startAngle,Le.endAngle,Le.counterclockwise,void 0,z,!Ae):q.call(this,Le.x,Le.y),Ae=!0}else if(W[be].close===!0)this.pdf.internal.out("h"),Ae=!1;else if(W[be].begin!==!0){var pe=W[be].start.x,Ce=W[be].start.y;G.call(this,W[be].deltas,pe,Ce),Ae=!0}re&&R.call(this,re),z&&T.call(this)}},M=function(j){var z=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,Z=z*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return j-Z;case"top":return j+z-Z;case"hanging":return j+z-2*Z;case"middle":return j+z/2-Z;default:return j}},O=function(j){return j+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};v.prototype.createLinearGradient=function(){var j=function(){};return j.colorStops=[],j.addColorStop=function(z,Z){this.colorStops.push([z,Z])},j.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},j.isCanvasGradient=!0,j},v.prototype.createPattern=function(){return this.createLinearGradient()},v.prototype.createRadialGradient=function(){return this.createLinearGradient()};var L=function(j,z,Z,re,W,Q,se,ue,le){for(var ye=ae.call(this,Z,re,W,Q),Re=0;Re<ye.length;Re++){var Me=ye[Re];Re===0&&(le?k.call(this,Me.x1+j,Me.y1+z):q.call(this,Me.x1+j,Me.y1+z)),J.call(this,j,z,Me.x2,Me.y2,Me.x3,Me.y3,Me.x4,Me.y4)}ue?T.call(this):R.call(this,se)},R=function(j){switch(j){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},T=function(){this.pdf.clip(),this.pdf.discardPath()},k=function(j,z){this.pdf.internal.out(r(j)+" "+n(z)+" m")},C=function(j){var z;switch(j.align){case"right":case"end":z="right";break;case"center":z="center";break;default:z="left"}var Z=this.pdf.getTextDimensions(j.text),re=M.call(this,j.y),W=O.call(this,re)-Z.h,Q=this.ctx.transform.applyToPoint(new l(j.x,re)),se=this.ctx.transform.decompose(),ue=new u;ue=(ue=(ue=ue.multiply(se.translate)).multiply(se.skew)).multiply(se.scale);for(var le,ye,Re,Me=this.ctx.transform.applyToRectangle(new o(j.x,re,Z.w,Z.h)),Pe=ue.applyToRectangle(new o(j.x,W,Z.w,Z.h)),de=E.call(this,Pe),Te=[],Ae=0;Ae<de.length;Ae+=1)Te.indexOf(de[Ae])===-1&&Te.push(de[Ae]);if(w(Te),this.autoPaging)for(var be=Te[0],_e=Te[Te.length-1],xe=be;xe<_e+1;xe++){this.pdf.setPage(xe);var Le=xe===1?this.posY+this.margin[0]:this.margin[0],pe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ce=this.pdf.internal.pageSize.height-this.margin[2],je=Ce-this.margin[0],He=this.pdf.internal.pageSize.width-this.margin[1],st=He-this.margin[3],pt=xe===1?0:pe+(xe-2)*je;if(this.ctx.clip_path.length!==0){var ct=this.path;le=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=b(le,this.posX+this.margin[3],-1*pt+Le),A.call(this,"fill",!0),this.path=ct}var bt=b([JSON.parse(JSON.stringify(Pe))],this.posX+this.margin[3],-pt+Le+this.ctx.prevPageLastElemOffset)[0];j.scale>=.01&&(ye=this.pdf.internal.getFontSize(),this.pdf.setFontSize(ye*j.scale),Re=this.lineWidth,this.lineWidth=Re*j.scale);var ht=this.autoPaging!=="text";if(ht||bt.y+bt.h<=Ce){if(ht||bt.y>=Le&&bt.x<=He){var vt=ht?j.text:this.pdf.splitTextToSize(j.text,j.maxWidth||He-bt.x)[0],wr=b([JSON.parse(JSON.stringify(Me))],this.posX+this.margin[3],-pt+Le+this.ctx.prevPageLastElemOffset)[0],cr=ht&&(xe>be||xe<_e)&&x.call(this);cr&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],st,je,null).clip().discardPath()),this.pdf.text(vt,wr.x,wr.y,{angle:j.angle,align:z,renderingMode:j.renderingMode}),cr&&this.pdf.restoreGraphicsState()}}else bt.y<Ce&&(this.ctx.prevPageLastElemOffset+=Ce-bt.y);j.scale>=.01&&(this.pdf.setFontSize(ye),this.lineWidth=Re)}else j.scale>=.01&&(ye=this.pdf.internal.getFontSize(),this.pdf.setFontSize(ye*j.scale),Re=this.lineWidth,this.lineWidth=Re*j.scale),this.pdf.text(j.text,Q.x+this.posX,Q.y+this.posY,{angle:j.angle,align:z,renderingMode:j.renderingMode,maxWidth:j.maxWidth}),j.scale>=.01&&(this.pdf.setFontSize(ye),this.lineWidth=Re)},q=function(j,z,Z,re){Z=Z||0,re=re||0,this.pdf.internal.out(r(j+Z)+" "+n(z+re)+" l")},G=function(j,z,Z){return this.pdf.lines(j,z,Z,null,null)},J=function(j,z,Z,re,W,Q,se,ue){this.pdf.internal.out([t(i(Z+j)),t(a(re+z)),t(i(W+j)),t(a(Q+z)),t(i(se+j)),t(a(ue+z)),"c"].join(" "))},ae=function(j,z,Z,re){for(var W=2*Math.PI,Q=Math.PI/2;z>Z;)z-=W;var se=Math.abs(Z-z);se<W&&re&&(se=W-se);for(var ue=[],le=re?-1:1,ye=z;se>1e-5;){var Re=ye+le*Math.min(se,Q);ue.push(H.call(this,j,ye,Re)),se-=Math.abs(Re-ye),ye=Re}return ue},H=function(j,z,Z){var re=(Z-z)/2,W=j*Math.cos(re),Q=j*Math.sin(re),se=W,ue=-Q,le=se*se+ue*ue,ye=le+se*W+ue*Q,Re=4/3*(Math.sqrt(2*le*ye)-ye)/(se*Q-ue*W),Me=se-Re*ue,Pe=ue+Re*se,de=Me,Te=-Pe,Ae=re+z,be=Math.cos(Ae),_e=Math.sin(Ae);return{x1:j*Math.cos(z),y1:j*Math.sin(z),x2:Me*be-Pe*_e,y2:Me*_e+Pe*be,x3:de*be-Te*_e,y3:de*_e+Te*be,x4:j*Math.cos(Z),y4:j*Math.sin(Z)}},V=function(j){return 180*j/Math.PI},Y=function(j,z,Z,re,W,Q){var se=j+.5*(Z-j),ue=z+.5*(re-z),le=W+.5*(Z-W),ye=Q+.5*(re-Q),Re=Math.min(j,W,se,le),Me=Math.max(j,W,se,le),Pe=Math.min(z,Q,ue,ye),de=Math.max(z,Q,ue,ye);return new o(Re,Pe,Me-Re,de-Pe)},U=function(j,z,Z,re,W,Q,se,ue){var le,ye,Re,Me,Pe,de,Te,Ae,be,_e,xe,Le,pe,Ce,je=Z-j,He=re-z,st=W-Z,pt=Q-re,ct=se-W,bt=ue-Q;for(ye=0;ye<41;ye++)be=(Te=(Re=j+(le=ye/40)*je)+le*((Pe=Z+le*st)-Re))+le*(Pe+le*(W+le*ct-Pe)-Te),_e=(Ae=(Me=z+le*He)+le*((de=re+le*pt)-Me))+le*(de+le*(Q+le*bt-de)-Ae),ye==0?(xe=be,Le=_e,pe=be,Ce=_e):(xe=Math.min(xe,be),Le=Math.min(Le,_e),pe=Math.max(pe,be),Ce=Math.max(Ce,_e));return new o(Math.round(xe),Math.round(Le),Math.round(pe-xe),Math.round(Ce-Le))},D=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var j,z,Z=(j=this.ctx.lineDash,z=this.ctx.lineDashOffset,JSON.stringify({lineDash:j,lineDashOffset:z}));this.prevLineDash!==Z&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=Z)}}})(Kt.API),function(e){var t=function(l){var o,u,d,f,v,g,c,y,x,E;for(u=[],d=0,f=(l+=o="\0\0\0\0".slice(l.length%4||4)).length;f>d;d+=4)(v=(l.charCodeAt(d)<<24)+(l.charCodeAt(d+1)<<16)+(l.charCodeAt(d+2)<<8)+l.charCodeAt(d+3))!==0?(g=(v=((v=((v=((v=(v-(E=v%85))/85)-(x=v%85))/85)-(y=v%85))/85)-(c=v%85))/85)%85,u.push(g+33,c+33,y+33,x+33,E+33)):u.push(122);return function(S,b){for(var w=b;w>0;w--)S.pop()}(u,o.length),String.fromCharCode.apply(String,u)+"~>"},r=function(l){var o,u,d,f,v,g=String,c="length",y=255,x="charCodeAt",E="slice",S="replace";for(l[E](-2),l=l[E](0,-2)[S](/\s/g,"")[S]("z","!!!!!"),d=[],f=0,v=(l+=o="uuuuu"[E](l[c]%5||5))[c];v>f;f+=5)u=52200625*(l[x](f)-33)+614125*(l[x](f+1)-33)+7225*(l[x](f+2)-33)+85*(l[x](f+3)-33)+(l[x](f+4)-33),d.push(y&u>>24,y&u>>16,y&u>>8,y&u);return function(b,w){for(var _=w;_>0;_--)b.pop()}(d,o[c]),g.fromCharCode.apply(g,d)},n=function(l){return l.split("").map(function(o){return("0"+o.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(l){var o=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((l=l.replace(/\s/g,"")).indexOf(">")!==-1&&(l=l.substr(0,l.indexOf(">"))),l.length%2&&(l+="0"),o.test(l)===!1)return"";for(var u="",d=0;d<l.length;d+=2)u+=String.fromCharCode("0x"+(l[d]+l[d+1]));return u},a=function(l){for(var o=new Uint8Array(l.length),u=l.length;u--;)o[u]=l.charCodeAt(u);return(o=$v(o)).reduce(function(d,f){return d+String.fromCharCode(f)},"")};e.processDataByFilters=function(l,o){var u=0,d=l||"",f=[];for(typeof(o=o||[])=="string"&&(o=[o]),u=0;u<o.length;u+=1)switch(o[u]){case"ASCII85Decode":case"/ASCII85Decode":d=r(d),f.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":d=t(d),f.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":d=i(d),f.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":d=n(d),f.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":d=a(d),f.push("/FlateDecode");break;default:throw new Error('The filter: "'+o[u]+'" is not implemented')}return{data:d,reverseChain:f.reverse().join(" ")}}}(Kt.API),function(e){e.loadFile=function(t,r,n){return function(i,a,l){a=a!==!1,l=typeof l=="function"?l:function(){};var o=void 0;try{o=function(u,d,f){var v=new XMLHttpRequest,g=0,c=function(y){var x=y.length,E=[],S=String.fromCharCode;for(g=0;g<x;g+=1)E.push(S(255&y.charCodeAt(g)));return E.join("")};if(v.open("GET",u,!d),v.overrideMimeType("text/plain; charset=x-user-defined"),d===!1&&(v.onload=function(){v.status===200?f(c(this.responseText)):f(void 0)}),v.send(null),d&&v.status===200)return c(v.responseText)}(i,a,l)}catch{}return o}(t,r,n)},e.loadImageFile=e.loadFile}(Kt.API),function(e){function t(){return(dr.html2canvas?Promise.resolve(dr.html2canvas):Z2(()=>import("./html2canvas.esm-BfxBtG_O.js"),[],import.meta.url)).catch(function(o){return Promise.reject(new Error("Could not load html2canvas: "+o))}).then(function(o){return o.default?o.default:o})}function r(){return(dr.DOMPurify?Promise.resolve(dr.DOMPurify):Z2(()=>import("./purify.es-CQJ0hv7W.js"),[],import.meta.url)).catch(function(o){return Promise.reject(new Error("Could not load dompurify: "+o))}).then(function(o){return o.default?o.default:o})}var n=function(o){var u=Sn(o);return u==="undefined"?"undefined":u==="string"||o instanceof String?"string":u==="number"||o instanceof Number?"number":u==="function"||o instanceof Function?"function":o&&o.constructor===Array?"array":o&&o.nodeType===1?"element":u==="object"?"object":"unknown"},i=function(o,u){var d=document.createElement(o);for(var f in u.className&&(d.className=u.className),u.innerHTML&&u.dompurify&&(d.innerHTML=u.dompurify.sanitize(u.innerHTML)),u.style)d.style[f]=u.style[f];return d},a=function o(u,d){for(var f=u.nodeType===3?document.createTextNode(u.nodeValue):u.cloneNode(!1),v=u.firstChild;v;v=v.nextSibling)d!==!0&&v.nodeType===1&&v.nodeName==="SCRIPT"||f.appendChild(o(v,d));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},l=function o(u){var d=Object.assign(o.convert(Promise.resolve()),JSON.parse(JSON.stringify(o.template))),f=o.convert(Promise.resolve(),d);return(f=f.setProgress(1,o,1,[o])).set(u)};(l.prototype=Object.create(Promise.prototype)).constructor=l,l.convert=function(o,u){return o.__proto__=u||l.prototype,o},l.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"}},l.prototype.from=function(o,u){return this.then(function(){switch(u=u||function(d){switch(n(d)){case"string":return"string";case"element":return d.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(o),u){case"string":return this.then(r).then(function(d){return this.set({src:i("div",{innerHTML:o,dompurify:d})})});case"element":return this.set({src:o});case"canvas":return this.set({canvas:o});case"img":return this.set({img:o});default:return this.error("Unknown source type.")}})},l.prototype.to=function(o){switch(o){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},l.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var o={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},u=a(this.prop.src,this.opt.html2canvas.javascriptEnabled);u.tagName==="BODY"&&(o.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:o}),this.prop.container.appendChild(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"})},l.prototype.toCanvas=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(t).then(function(u){var d=Object.assign({},this.opt.html2canvas);return delete d.onrendered,u(this.prop.container,d)}).then(function(u){(this.opt.html2canvas.onrendered||function(){})(u),this.prop.canvas=u,document.body.removeChild(this.prop.overlay)})},l.prototype.toContext2d=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(t).then(function(u){var d=this.opt.jsPDF,f=this.opt.fontFaces,v=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,g=Object.assign({async:!0,allowTaint:!0,scale:v,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete g.onrendered,d.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,d.context2d.posX=this.opt.x,d.context2d.posY=this.opt.y,d.context2d.margin=this.opt.margin,d.context2d.fontFaces=f,f)for(var c=0;c<f.length;++c){var y=f[c],x=y.src.find(function(E){return E.format==="truetype"});x&&d.addFont(x.url,y.ref.name,y.ref.style)}return g.windowHeight=g.windowHeight||0,g.windowHeight=g.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):g.windowHeight,d.context2d.save(!0),u(this.prop.container,g)}).then(function(u){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(u),this.prop.canvas=u,document.body.removeChild(this.prop.overlay)})},l.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var o=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=o})},l.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},l.prototype.output=function(o,u,d){return(d=d||"pdf").toLowerCase()==="img"||d.toLowerCase()==="image"?this.outputImg(o,u):this.outputPdf(o,u)},l.prototype.outputPdf=function(o,u){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(o,u)})},l.prototype.outputImg=function(o){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(o){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+o+'" is not supported.'}})},l.prototype.save=function(o){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(o?{filename:o}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},l.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},l.prototype.set=function(o){if(n(o)!=="object")return this;var u=Object.keys(o||{}).map(function(d){if(d in l.template.prop)return function(){this.prop[d]=o[d]};switch(d){case"margin":return this.setMargin.bind(this,o.margin);case"jsPDF":return function(){return this.opt.jsPDF=o.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,o.pageSize);default:return function(){this.opt[d]=o[d]}}},this);return this.then(function(){return this.thenList(u)})},l.prototype.get=function(o,u){return this.then(function(){var d=o in l.template.prop?this.prop[o]:this.opt[o];return u?u(d):d})},l.prototype.setMargin=function(o){return this.then(function(){switch(n(o)){case"number":o=[o,o,o,o];case"array":if(o.length===2&&(o=[o[0],o[1],o[0],o[1]]),o.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=o}).then(this.setPageSize)},l.prototype.setPageSize=function(o){function u(d,f){return Math.floor(d*f/72*96)}return this.then(function(){(o=o||Kt.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(o.inner={width:o.width-this.opt.margin[1]-this.opt.margin[3],height:o.height-this.opt.margin[0]-this.opt.margin[2]},o.inner.px={width:u(o.inner.width,o.k),height:u(o.inner.height,o.k)},o.inner.ratio=o.inner.height/o.inner.width),this.prop.pageSize=o})},l.prototype.setProgress=function(o,u,d,f){return o!=null&&(this.progress.val=o),u!=null&&(this.progress.state=u),d!=null&&(this.progress.n=d),f!=null&&(this.progress.stack=f),this.progress.ratio=this.progress.val/this.progress.state,this},l.prototype.updateProgress=function(o,u,d,f){return this.setProgress(o?this.progress.val+o:null,u||null,d?this.progress.n+d:null,f?this.progress.stack.concat(f):null)},l.prototype.then=function(o,u){var d=this;return this.thenCore(o,u,function(f,v){return d.updateProgress(null,null,1,[f]),Promise.prototype.then.call(this,function(g){return d.updateProgress(null,f),g}).then(f,v).then(function(g){return d.updateProgress(1),g})})},l.prototype.thenCore=function(o,u,d){d=d||Promise.prototype.then;var f=this;o&&(o=o.bind(f)),u&&(u=u.bind(f));var v=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?f:l.convert(Object.assign({},f),Promise.prototype),g=d.call(v,o,u);return l.convert(g,f.__proto__)},l.prototype.thenExternal=function(o,u){return Promise.prototype.then.call(this,o,u)},l.prototype.thenList=function(o){var u=this;return o.forEach(function(d){u=u.thenCore(d)}),u},l.prototype.catch=function(o){o&&(o=o.bind(this));var u=Promise.prototype.catch.call(this,o);return l.convert(u,this)},l.prototype.catchExternal=function(o){return Promise.prototype.catch.call(this,o)},l.prototype.error=function(o){return this.then(function(){throw new Error(o)})},l.prototype.using=l.prototype.set,l.prototype.saveAs=l.prototype.save,l.prototype.export=l.prototype.output,l.prototype.run=l.prototype.then,Kt.getPageSize=function(o,u,d){if(Sn(o)==="object"){var f=o;o=f.orientation,u=f.unit||u,d=f.format||d}u=u||"mm",d=d||"a4",o=(""+(o||"P")).toLowerCase();var v,g=(""+d).toLowerCase(),c={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(u){case"pt":v=1;break;case"mm":v=72/25.4;break;case"cm":v=72/2.54;break;case"in":v=72;break;case"px":v=.75;break;case"pc":case"em":v=12;break;case"ex":v=6;break;default:throw"Invalid unit: "+u}var y,x=0,E=0;if(c.hasOwnProperty(g))x=c[g][1]/v,E=c[g][0]/v;else try{x=d[1],E=d[0]}catch{throw new Error("Invalid format: "+d)}if(o==="p"||o==="portrait")o="p",E>x&&(y=E,E=x,x=y);else{if(o!=="l"&&o!=="landscape")throw"Invalid orientation: "+o;o="l",x>E&&(y=E,E=x,x=y)}return{width:E,height:x,unit:u,k:v,orientation:o}},e.html=function(o,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(gv):null;var d=new l(u);return u.worker?d:d.from(o).doCallback()}}(Kt.API),Kt.API.addJS=function(e){return kw=e,this.internal.events.subscribe("postPutResources",function(){y1=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(y1+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),Pw=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+kw+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){y1!==void 0&&Pw!==void 0&&this.internal.out("/Names <</JavaScript "+y1+" 0 R>>")}),this},function(e){var t;e.events.push(["postPutResources",function(){var r=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=r.outline.render().split(/\r\n/),a=0;a<i.length;a++){var l=i[a],o=n.exec(l);if(o!=null){var u=o[1];r.internal.newObjectDeferredBegin(u,!1)}r.internal.write(l)}if(this.outline.createNamedDestinations){var d=this.internal.pages.length,f=[];for(a=0;a<d;a++){var v=r.internal.newObject();f.push(v);var g=r.internal.getPageInfo(a+1);r.internal.write("<< /D["+g.objId+" 0 R /XYZ null null null]>> endobj")}var c=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"),t=r.internal.newObject(),r.internal.write("<< /Dests "+c+" 0 R"),r.internal.write(">>","endobj")}}]),e.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 "+t+" 0 R"))}]),e.events.push(["initialized",function(){var r=this;r.outline={createNamedDestinations:!1,root:{children:[]}},r.outline.add=function(n,i,a){var l={title:i,options:a,children:[]};return n==null&&(n=this.root),n.children.push(l),l},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 l=n.children[a];this.objStart(l),this.line("/Title "+this.makeString(l.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])),l.children.length>0&&(this.line("/First "+this.makeRef(l.children[0])),this.line("/Last "+this.makeRef(l.children[l.children.length-1])));var o=this.count=this.count_r({count:0},l);if(o>0&&this.line("/Count "+o),l.options&&l.options.pageNumber){var u=r.internal.getPageInfo(l.options.pageNumber);this.line("/Dest ["+u.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var d=0;d<n.children.length;d++)this.renderItems(n.children[d])},r.outline.line=function(n){this.ctx.val+=n+`\r
523
- `},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
524
- `+n.id+` 0 obj\r
525
- <<\r
526
- `},r.outline.objEnd=function(){this.ctx.val+=`>> \r
527
- endobj\r
528
- `},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}}])}(Kt.API),function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(r,n,i,a,l,o){var u,d=this.decode.DCT_DECODE,f=null;if(typeof r=="string"||this.__addimage__.isArrayBuffer(r)||this.__addimage__.isArrayBufferView(r)){switch(r=l||r,r=this.__addimage__.isArrayBuffer(r)?new Uint8Array(r):r,u=function(v){for(var g,c=256*v.charCodeAt(4)+v.charCodeAt(5),y=v.length,x={width:0,height:0,numcomponents:1},E=4;E<y;E+=2){if(E+=c,t.indexOf(v.charCodeAt(E+1))!==-1){g=256*v.charCodeAt(E+5)+v.charCodeAt(E+6),x={width:256*v.charCodeAt(E+7)+v.charCodeAt(E+8),height:g,numcomponents:v.charCodeAt(E+9)};break}c=256*v.charCodeAt(E+2)+v.charCodeAt(E+3)}return x}(r=this.__addimage__.isArrayBufferView(r)?this.__addimage__.arrayBufferToBinaryString(r):r),u.numcomponents){case 1:o=this.color_spaces.DEVICE_GRAY;break;case 4:o=this.color_spaces.DEVICE_CMYK;break;case 3:o=this.color_spaces.DEVICE_RGB}f={data:r,width:u.width,height:u.height,colorSpace:o,bitsPerComponent:8,filter:d,index:n,alias:i}}return f}}(Kt.API),Kt.API.processPNG=function(e,t,r,n){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var i,a=lR(e,{checkCrc:!0}),l=a.width,o=a.height,u=a.channels,d=a.palette,f=a.depth;i=d&&u===1?function(O){for(var L=O.width,R=O.height,T=O.data,k=O.palette,C=O.depth,q=!1,G=[],J=[],ae=void 0,H=!1,V=0,Y=0;Y<k.length;Y++){var U=L4(k[Y],4),D=U[0],j=U[1],z=U[2],Z=U[3];G.push(D,j,z),Z!=null&&(Z===0?(V++,J.length<1&&J.push(Y)):Z<255&&(H=!0))}if(H||V>1){q=!0,J=void 0;var re=L*R;ae=new Uint8Array(re);for(var W=new DataView(T.buffer),Q=0;Q<re;Q++){var se=mv(W,Q,C),ue=L4(k[se],4)[3];ae[Q]=ue}}return{colorSpace:"Indexed",colorsPerPixel:1,colorBytes:T,alphaBytes:ae,needSMask:q,palette:G,mask:J}}(a):u===2||u===4?function(O){for(var L=O.data,R=O.width,T=O.height,k=O.channels,C=O.depth,q=k===2?"DeviceGray":"DeviceRGB",G=k-1,J=R*T,ae=G,H=J*ae,V=1*J,Y=Math.ceil(H*C/8),U=Math.ceil(V*C/8),D=new Uint8Array(Y),j=new Uint8Array(U),z=new DataView(L.buffer),Z=new DataView(D.buffer),re=new DataView(j.buffer),W=!1,Q=0;Q<J;Q++){for(var se=Q*k,ue=0;ue<ae;ue++)Fw(Z,mv(z,se+ue,C),Q*ae+ue,C);var le=mv(z,se+ae,C);le<(1<<C)-1&&(W=!0),Fw(re,le,1*Q,C)}return{colorSpace:q,colorsPerPixel:G,colorBytes:D,alphaBytes:j,needSMask:W}}(a):function(O){var L=O.data,R=O.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:R,colorsPerPixel:R==="DeviceGray"?1:3,colorBytes:L instanceof Uint8Array?L:new Uint8Array(L.buffer),needSMask:!1}}(a);var v,g,c,y=i,x=y.colorSpace,E=y.colorsPerPixel,S=y.colorBytes,b=y.alphaBytes,w=y.needSMask,_=y.palette,A=y.mask,M=null;return n!==Kt.API.image_compression.NONE&&typeof $v=="function"?(M=function(O){var L;switch(O){case Kt.API.image_compression.FAST:L=11;break;case Kt.API.image_compression.MEDIUM:L=13;break;case Kt.API.image_compression.SLOW:L=14;break;default:L=12}return L}(n),v=this.decode.FLATE_DECODE,g="/Predictor ".concat(M," "),e=Lw(S,l*E,E,n),w&&(c=Lw(b,l,1,n))):(v=void 0,g="",e=S,w&&(c=b)),g+="/Colors ".concat(E," /BitsPerComponent ").concat(f," /Columns ").concat(l),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(c&&this.__addimage__.isArrayBuffer(c)||this.__addimage__.isArrayBufferView(c))&&(c=this.__addimage__.arrayBufferToBinaryString(c)),{alias:r,data:e,index:t,filter:v,decodeParameters:g,transparency:A,palette:_,sMask:c,predictor:M,width:l,height:o,bitsPerComponent:f,colorSpace:x}}},function(e){e.processGIF89A=function(t,r,n,i){var a=new CR(t),l=a.width,o=a.height,u=[];a.decodeAndBlitFrameRGBA(0,u);var d={data:u,width:l,height:o},f=new yv(100).encode(d,100);return e.processJPEG.call(this,f,r,n,i)},e.processGIF87A=e.processGIF89A}(Kt.API),Ml.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:i,green:n,blue:r,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Ml.prototype.parseBGR=function(){this.pos=this.offset;try{var e="bit"+this.bitPP,t=this.width*this.height*4;this.data=new Uint8Array(t),this[e]()}catch(r){zn.log("bit decode error:"+r)}},Ml.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),r=t%4;for(e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,i=0;i<t;i++)for(var a=this.datav.getUint8(this.pos++,!0),l=n*this.width*4+8*i*4,o=0;o<8&&8*i+o<this.width;o++){var u=this.palette[a>>7-o&1];this.data[l+4*o]=u.blue,this.data[l+4*o+1]=u.green,this.data[l+4*o+2]=u.red,this.data[l+4*o+3]=255}r!==0&&(this.pos+=4-r)}},Ml.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i<e;i++){var a=this.datav.getUint8(this.pos++,!0),l=n*this.width*4+2*i*4,o=a>>4,u=15&a,d=this.palette[o];if(this.data[l]=d.blue,this.data[l+1]=d.green,this.data[l+2]=d.red,this.data[l+3]=255,2*i+1>=this.width)break;d=this.palette[u],this.data[l+4]=d.blue,this.data[l+4+1]=d.green,this.data[l+4+2]=d.red,this.data[l+4+3]=255}t!==0&&(this.pos+=4-t)}},Ml.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var i=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+4*n;if(i<this.palette.length){var l=this.palette[i];this.data[a]=l.red,this.data[a+1]=l.green,this.data[a+2]=l.blue,this.data[a+3]=255}else this.data[a]=255,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}e!==0&&(this.pos+=4-e)}},Ml.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i<this.width;i++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var l=(a&t)/t*255|0,o=(a>>5&t)/t*255|0,u=(a>>10&t)/t*255|0,d=a>>15?255:0,f=n*this.width*4+4*i;this.data[f]=u,this.data[f+1]=o,this.data[f+2]=l,this.data[f+3]=d}this.pos+=e}},Ml.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),r=parseInt("111111",2),n=this.height-1;n>=0;n--){for(var i=this.bottom_up?n:this.height-1-n,a=0;a<this.width;a++){var l=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(l&t)/t*255|0,u=(l>>5&r)/r*255|0,d=(l>>11)/t*255|0,f=i*this.width*4+4*a;this.data[f]=d,this.data[f+1]=u,this.data[f+2]=o,this.data[f+3]=255}this.pos+=e}},Ml.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),l=t*this.width*4+4*r;this.data[l]=a,this.data[l+1]=i,this.data[l+2]=n,this.data[l+3]=255}this.pos+=this.width%4}},Ml.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),l=this.datav.getUint8(this.pos++,!0),o=t*this.width*4+4*r;this.data[o]=a,this.data[o+1]=i,this.data[o+2]=n,this.data[o+3]=l}},Ml.prototype.getData=function(){return this.data},function(e){e.processBMP=function(t,r,n,i){var a=new Ml(t,!1),l=a.width,o=a.height,u={data:a.getData(),width:l,height:o},d=new yv(100).encode(u,100);return e.processJPEG.call(this,d,r,n,i)}}(Kt.API),Dw.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(t,r,n,i){var a=new Dw(t),l=a.width,o=a.height,u={data:a.getData(),width:l,height:o},d=new yv(100).encode(u,100);return e.processJPEG.call(this,d,r,n,i)}}(Kt.API),Kt.API.processRGBA=function(e,t,r){for(var n=e.data,i=n.length,a=new Uint8Array(i/4*3),l=new Uint8Array(i/4),o=0,u=0,d=0;d<i;d+=4){var f=n[d],v=n[d+1],g=n[d+2],c=n[d+3];a[o++]=f,a[o++]=v,a[o++]=g,l[u++]=c}var y=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(l),data:y,index:t,alias:r,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},Kt.API.setLanguage=function(e){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]!==void 0&&(this.internal.languageSettings.languageCode=e,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},vh=Kt.API,b1=vh.getCharWidthsArray=function(e,t){var r,n,i=(t=t||{}).font||this.internal.getFont(),a=t.fontSize||this.internal.getFontSize(),l=t.charSpace||this.internal.getCharSpace(),o=t.widths?t.widths:i.metadata.Unicode.widths,u=o.fof?o.fof:1,d=t.kerning?t.kerning:i.metadata.Unicode.kerning,f=d.fof?d.fof:1,v=t.doKerning!==!1,g=0,c=e.length,y=0,x=o[0]||u,E=[];for(r=0;r<c;r++)n=e.charCodeAt(r),typeof i.metadata.widthOfString=="function"?E.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(n))+l*(1e3/a)||0)/1e3):(g=v&&Sn(d[n])==="object"&&!isNaN(parseInt(d[n][y],10))?d[n][y]/f:0,E.push((o[n]||x)/u+g)),y=n;return E},Ow=vh.getStringUnitWidth=function(e,t){var r=(t=t||{}).fontSize||this.internal.getFontSize(),n=t.font||this.internal.getFont(),i=t.charSpace||this.internal.getCharSpace();return vh.processArabic&&(e=vh.processArabic(e)),typeof n.metadata.widthOfString=="function"?n.metadata.widthOfString(e,r,i)/r:b1.apply(this,arguments).reduce(function(a,l){return a+l},0)},Cw=function(e,t,r,n){for(var i=[],a=0,l=e.length,o=0;a!==l&&o+t[a]<r;)o+=t[a],a++;i.push(e.slice(0,a));var u=a;for(o=0;a!==l;)o+t[a]>n&&(i.push(e.slice(u,a)),o=0,u=a),o+=t[a],a++;return u!==a&&i.push(e.slice(u,a)),i},Nw=function(e,t,r){r||(r={});var n,i,a,l,o,u,d,f=[],v=[f],g=r.textIndent||0,c=0,y=0,x=e.split(" "),E=b1.apply(this,[" ",r])[0];if(u=r.lineIndent===-1?x[0].length+2:r.lineIndent||0){var S=Array(u).join(" "),b=[];x.map(function(_){(_=_.split(/\s*\n/)).length>1?b=b.concat(_.map(function(A,M){return(M&&A.length?`
529
- `:"")+A})):b.push(_[0])}),x=b,u=Ow.apply(this,[S,r])}for(a=0,l=x.length;a<l;a++){var w=0;if(n=x[a],u&&n[0]==`
530
- `&&(n=n.substr(1),w=1),g+c+(y=(i=b1.apply(this,[n,r])).reduce(function(_,A){return _+A},0))>t||w){if(y>t){for(o=Cw.apply(this,[n,i,t-(g+c),t]),f.push(o.shift()),f=[o.pop()];o.length;)v.push([o.shift()]);y=i.slice(n.length-(f[0]?f[0].length:0)).reduce(function(_,A){return _+A},0)}else f=[n];v.push(f),g=y+u,c=E}else f.push(n),g+=c+y,c=E}return d=u?function(_,A){return(A?S:"")+_.join(" ")}:function(_){return _.join(" ")},v.map(d)},vh.splitTextToSize=function(e,t,r){var n,i=(r=r||{}).fontSize||this.internal.getFontSize(),a=(function(f){if(f.widths&&f.kerning)return{widths:f.widths,kerning:f.kerning};var v=this.internal.getFont(f.fontName,f.fontStyle),g="Unicode";return v.metadata[g]?{widths:v.metadata[g].widths||{0:1},kerning:v.metadata[g].kerning||{}}:{font:v.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,r);n=Array.isArray(e)?e:String(e).split(/\r?\n/);var l=1*this.internal.scaleFactor*t/i;a.textIndent=r.textIndent?1*r.textIndent*this.internal.scaleFactor/i:0,a.lineIndent=r.lineIndent;var o,u,d=[];for(o=0,u=n.length;o<u;o++)d=d.concat(Nw.apply(this,[n[o],l,a]));return d},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",r="klmnopqrstuvwxyz",n={},i={},a=0;a<16;a++)n[r[a]]=t[a],i[t[a]]=r[a];var l=function(g){return"0x"+parseInt(g,10).toString(16)},o=e.__fontmetrics__.compress=function(g){var c,y,x,E,S=["{"];for(var b in g){if(c=g[b],isNaN(parseInt(b,10))?y="'"+b+"'":(b=parseInt(b,10),y=(y=l(b).slice(2)).slice(0,-1)+i[y.slice(-1)]),typeof c=="number")c<0?(x=l(c).slice(3),E="-"):(x=l(c).slice(2),E=""),x=E+x.slice(0,-1)+i[x.slice(-1)];else{if(Sn(c)!=="object")throw new Error("Don't know what to do with value type "+Sn(c)+".");x=o(c)}S.push(y+x)}return S.push("}"),S.join("")},u=e.__fontmetrics__.uncompress=function(g){if(typeof g!="string")throw new Error("Invalid argument passed to uncompress.");for(var c,y,x,E,S={},b=1,w=S,_=[],A="",M="",O=g.length-1,L=1;L<O;L+=1)(E=g[L])=="'"?c?(x=c.join(""),c=void 0):c=[]:c?c.push(E):E=="{"?(_.push([w,x]),w={},x=void 0):E=="}"?((y=_.pop())[0][y[1]]=w,x=void 0,w=y[0]):E=="-"?b=-1:x===void 0?n.hasOwnProperty(E)?(A+=n[E],x=parseInt(A,16)*b,b=1,A=""):A+=E:n.hasOwnProperty(E)?(M+=n[E],w[x]=parseInt(M,16)*b,b=1,x=void 0,M=""):M+=E;return S},d={codePages:["WinAnsiEncoding"],WinAnsiEncoding:u("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},f={Unicode:{Courier:d,"Courier-Bold":d,"Courier-BoldOblique":d,"Courier-Oblique":d,Helvetica:d,"Helvetica-Bold":d,"Helvetica-BoldOblique":d,"Helvetica-Oblique":d,"Times-Roman":d,"Times-Bold":d,"Times-BoldItalic":d,"Times-Italic":d}},v={Unicode:{"Courier-Oblique":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":u("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":u("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":u("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:u("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:u("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":u("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:u("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":u("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":u("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":u("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(g){var c=g.font,y=v.Unicode[c.postScriptName];y&&(c.metadata.Unicode={},c.metadata.Unicode.widths=y.widths,c.metadata.Unicode.kerning=y.kerning);var x=f.Unicode[c.postScriptName];x&&(c.metadata.Unicode.encoding=x,c.encoding=x.codePages[0])}])}(Kt.API),function(e){var t=function(r){for(var n=r.length,i=new Uint8Array(n),a=0;a<n;a++)i[a]=r.charCodeAt(a);return i};e.API.events.push(["addFont",function(r){var n=void 0,i=r.font,a=r.instance;if(!i.isStandardFont){if(a===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(n=a.existsFileInVFS(i.postScriptName)===!1?a.loadFile(i.postScriptName):a.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(l,o){o=/^\x00\x01\x00\x00/.test(o)?t(o):t(N1(o)),l.metadata=e.API.TTFFont.open(o),l.metadata.Unicode=l.metadata.Unicode||{encoding:{},kerning:{},widths:[]},l.metadata.glyIdsUsed=[0]})(i,n)}}])}(Kt),Kt.API.addSvgAsImage=function(e,t,r,n,i,a,l,o){if(isNaN(t)||isNaN(r))throw zn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(n)||isNaN(i))throw zn.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 d=u.getContext("2d");d.fillStyle="#fff",d.fillRect(0,0,u.width,u.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},v=this;return(dr.canvg?Promise.resolve(dr.canvg):Z2(()=>import("./index.es-DAz2SQVw.js"),[],import.meta.url)).catch(function(g){return Promise.reject(new Error("Could not load canvg: "+g))}).then(function(g){return g.default?g.default:g}).then(function(g){return g.fromString(d,e,f)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(g){return g.render(f)}).then(function(){v.addImage(u.toDataURL("image/jpeg",1),t,r,n,i,l,o)})},Kt.API.putTotalPages=function(e){var t,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),r=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(t,r);return this},Kt.API.viewerPreferences=function(e,t){var r;e=e||{},t=t||!1;var n,i,a,l={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}},o=Object.keys(l),u=[],d=0,f=0,v=0;function g(y,x){var E,S=!1;for(E=0;E<y.length;E+=1)y[E]===x&&(S=!0);return S}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(l)),this.internal.viewerpreferences.isSubscribed=!1),r=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var c=o.length;for(v=0;v<c;v+=1)r[o[v]].value=r[o[v]].defaultValue,r[o[v]].explicitSet=!1}if(Sn(e)==="object"){for(i in e)if(a=e[i],g(o,i)&&a!==void 0){if(r[i].type==="boolean"&&typeof a=="boolean")r[i].value=a;else if(r[i].type==="name"&&g(r[i].valueSet,a))r[i].value=a;else if(r[i].type==="integer"&&Number.isInteger(a))r[i].value=a;else if(r[i].type==="array"){for(d=0;d<a.length;d+=1)if(n=!0,a[d].length===1&&typeof a[d][0]=="number")u.push(String(a[d]-1));else if(a[d].length>1){for(f=0;f<a[d].length;f+=1)typeof a[d][f]!="number"&&(n=!1);n===!0&&u.push([a[d][0]-1,a[d][1]-1].join(" "))}r[i].value="["+u.join(" ")+"]"}else r[i].value=r[i].defaultValue;r[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var y,x=[];for(y in r)r[y].explicitSet===!0&&(r[y].type==="name"?x.push("/"+y+" /"+r[y].value):x.push("/"+y+" "+r[y].value));x.length!==0&&this.internal.write(`/ViewerPreferences
531
- <<
532
- `+x.join(`
533
- `)+`
534
- >>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=r,this},function(e){var t=function(){var n='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',i=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),a=unescape(encodeURIComponent(n)),l=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),o=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),u=unescape(encodeURIComponent("</x:xmpmeta>")),d=a.length+l.length+o.length+i.length+u.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+d+" >>"),this.internal.write("stream"),this.internal.write(i+a+l+o+u),this.internal.write("endstream"),this.internal.write("endobj")},r=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};e.addMetadata=function(n,i){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:n,namespaceuri:i||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",r),this.internal.events.subscribe("postPutResources",t)),this}}(Kt.API),function(e){var t=e.API,r=t.pdfEscape16=function(a,l){for(var o,u=l.metadata.Unicode.widths,d=["","0","00","000","0000"],f=[""],v=0,g=a.length;v<g;++v){if(o=l.metadata.characterToGlyph(a.charCodeAt(v)),l.metadata.glyIdsUsed.push(o),l.metadata.toUnicode[o]=a.charCodeAt(v),u.indexOf(o)==-1&&(u.push(o),u.push([parseInt(l.metadata.widthOfGlyph(o),10)])),o=="0")return f.join("");o=o.toString(16),f.push(d[4-o.length],o)}return f.join("")},n=function(a){var l,o,u,d,f,v,g;for(f=`/CIDInit /ProcSet findresource begin
535
- 12 dict begin
536
- begincmap
537
- /CIDSystemInfo <<
538
- /Registry (Adobe)
539
- /Ordering (UCS)
540
- /Supplement 0
541
- >> def
542
- /CMapName /Adobe-Identity-UCS def
543
- /CMapType 2 def
544
- 1 begincodespacerange
545
- <0000><ffff>
546
- endcodespacerange`,u=[],v=0,g=(o=Object.keys(a).sort(function(c,y){return c-y})).length;v<g;v++)l=o[v],u.length>=100&&(f+=`
547
- `+u.length+` beginbfchar
548
- `+u.join(`
549
- `)+`
550
- endbfchar`,u=[]),a[l]!==void 0&&a[l]!==null&&typeof a[l].toString=="function"&&(d=("0000"+a[l].toString(16)).slice(-4),l=("0000"+(+l).toString(16)).slice(-4),u.push("<"+l+"><"+d+">"));return u.length&&(f+=`
551
- `+u.length+` beginbfchar
552
- `+u.join(`
553
- `)+`
554
- endbfchar
555
- `),f+`endcmap
556
- CMapName currentdict /CMap defineresource pop
557
- end
558
- end`};t.events.push(["putFont",function(a){(function(l){var o=l.font,u=l.out,d=l.newObject,f=l.putStream;if(o.metadata instanceof e.API.TTFFont&&o.encoding==="Identity-H"){for(var v=o.metadata.Unicode.widths,g=o.metadata.subset.encode(o.metadata.glyIdsUsed,1),c="",y=0;y<g.length;y++)c+=String.fromCharCode(g[y]);var x=d();f({data:c,addLength1:!0,objectId:x}),u("endobj");var E=d();f({data:n(o.metadata.toUnicode),addLength1:!0,objectId:E}),u("endobj");var S=d();u("<<"),u("/Type /FontDescriptor"),u("/FontName /"+bh(o.fontName)),u("/FontFile2 "+x+" 0 R"),u("/FontBBox "+e.API.PDFObject.convert(o.metadata.bbox)),u("/Flags "+o.metadata.flags),u("/StemV "+o.metadata.stemV),u("/ItalicAngle "+o.metadata.italicAngle),u("/Ascent "+o.metadata.ascender),u("/Descent "+o.metadata.decender),u("/CapHeight "+o.metadata.capHeight),u(">>"),u("endobj");var b=d();u("<<"),u("/Type /Font"),u("/BaseFont /"+bh(o.fontName)),u("/FontDescriptor "+S+" 0 R"),u("/W "+e.API.PDFObject.convert(v)),u("/CIDToGIDMap /Identity"),u("/DW 1000"),u("/Subtype /CIDFontType2"),u("/CIDSystemInfo"),u("<<"),u("/Supplement 0"),u("/Registry (Adobe)"),u("/Ordering ("+o.encoding+")"),u(">>"),u(">>"),u("endobj"),o.objectNumber=d(),u("<<"),u("/Type /Font"),u("/Subtype /Type0"),u("/ToUnicode "+E+" 0 R"),u("/BaseFont /"+bh(o.fontName)),u("/Encoding /"+o.encoding),u("/DescendantFonts ["+b+" 0 R]"),u(">>"),u("endobj"),o.isAlreadyPutted=!0}})(a)}]),t.events.push(["putFont",function(a){(function(l){var o=l.font,u=l.out,d=l.newObject,f=l.putStream;if(o.metadata instanceof e.API.TTFFont&&o.encoding==="WinAnsiEncoding"){for(var v=o.metadata.rawData,g="",c=0;c<v.length;c++)g+=String.fromCharCode(v[c]);var y=d();f({data:g,addLength1:!0,objectId:y}),u("endobj");var x=d();f({data:n(o.metadata.toUnicode),addLength1:!0,objectId:x}),u("endobj");var E=d();u("<<"),u("/Descent "+o.metadata.decender),u("/CapHeight "+o.metadata.capHeight),u("/StemV "+o.metadata.stemV),u("/Type /FontDescriptor"),u("/FontFile2 "+y+" 0 R"),u("/Flags 96"),u("/FontBBox "+e.API.PDFObject.convert(o.metadata.bbox)),u("/FontName /"+bh(o.fontName)),u("/ItalicAngle "+o.metadata.italicAngle),u("/Ascent "+o.metadata.ascender),u(">>"),u("endobj"),o.objectNumber=d();for(var S=0;S<o.metadata.hmtx.widths.length;S++)o.metadata.hmtx.widths[S]=parseInt(o.metadata.hmtx.widths[S]*(1e3/o.metadata.head.unitsPerEm));u("<</Subtype/TrueType/Type/Font/ToUnicode "+x+" 0 R/BaseFont/"+bh(o.fontName)+"/FontDescriptor "+E+" 0 R/Encoding/"+o.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(o.metadata.hmtx.widths)+">>"),u("endobj"),o.isAlreadyPutted=!0}})(a)}]);var i=function(a){var l,o=a.text||"",u=a.x,d=a.y,f=a.options||{},v=a.mutex||{},g=v.pdfEscape,c=v.activeFontKey,y=v.fonts,x=c,E="",S=0,b="",w=y[x].encoding;if(y[x].encoding!=="Identity-H")return{text:o,x:u,y:d,options:f,mutex:v};for(b=o,x=c,Array.isArray(o)&&(b=o[0]),S=0;S<b.length;S+=1)y[x].metadata.hasOwnProperty("cmap")&&(l=y[x].metadata.cmap.unicode.codeMap[b[S].charCodeAt(0)]),l||b[S].charCodeAt(0)<256&&y[x].metadata.hasOwnProperty("Unicode")?E+=b[S]:E+="";var _="";return parseInt(x.slice(1))<14||w==="WinAnsiEncoding"?_=g(E,x).split("").map(function(A){return A.charCodeAt(0).toString(16)}).join(""):w==="Identity-H"&&(_=r(E,y[x])),v.isHex=!0,{text:_,x:u,y:d,options:f,mutex:v}};t.events.push(["postProcessText",function(a){var l=a.text||"",o=[],u={text:l,x:a.x,y:a.y,options:a.options,mutex:a.mutex};if(Array.isArray(l)){var d=0;for(d=0;d<l.length;d+=1)Array.isArray(l[d])&&l[d].length===3?o.push([i(Object.assign({},u,{text:l[d][0]})).text,l[d][1],l[d][2]]):o.push(i(Object.assign({},u,{text:l[d]})).text);a.text=o}else a.text=i(Object.assign({},u,{text:l})).text}])}(Kt),function(e){var t=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(r){return t.call(this),this.internal.vFS[r]!==void 0},e.addFileToVFS=function(r,n){return t.call(this),this.internal.vFS[r]=n,this},e.getFileFromVFS=function(r){return t.call(this),this.internal.vFS[r]!==void 0?this.internal.vFS[r]:null}}(Kt.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(n){var i,a,l,o,u,d,f,v=t,g=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],c=[[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},x={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},E=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],S=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)$/),b=!1,w=0;this.__bidiEngine__={};var _=function(k){var C=k.charCodeAt(),q=C>>8,G=x[q];return G!==void 0?v[256*G+(255&C)]:q===252||q===253?"AL":S.test(q)?"L":q===8?"R":"N"},A=function(k){for(var C,q=0;q<k.length;q++){if((C=_(k.charAt(q)))==="L")return!1;if(C==="R")return!0}return!1},M=function(k,C,q,G){var J,ae,H,V,Y=C[G];switch(Y){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":b=!1;break;case"N":case"AN":break;case"EN":b&&(Y="AN");break;case"AL":b=!0,Y="R";break;case"WS":case"BN":Y="N";break;case"CS":G<1||G+1>=C.length||(J=q[G-1])!=="EN"&&J!=="AN"||(ae=C[G+1])!=="EN"&&ae!=="AN"?Y="N":b&&(ae="AN"),Y=ae===J?ae:"N";break;case"ES":Y=(J=G>0?q[G-1]:"B")==="EN"&&G+1<C.length&&C[G+1]==="EN"?"EN":"N";break;case"ET":if(G>0&&q[G-1]==="EN"){Y="EN";break}if(b){Y="N";break}for(H=G+1,V=C.length;H<V&&C[H]==="ET";)H++;Y=H<V&&C[H]==="EN"?"EN":"N";break;case"NSM":if(l&&!o){for(V=C.length,H=G+1;H<V&&C[H]==="NSM";)H++;if(H<V){var U=k[G],D=U>=1425&&U<=2303||U===64286;if(J=C[H],D&&(J==="R"||J==="AL")){Y="R";break}}}Y=G<1||(J=C[G-1])==="B"?"N":q[G-1];break;case"B":b=!1,i=!0,Y=w;break;case"S":a=!0,Y="N"}return Y},O=function(k,C,q){var G=k.split("");return q&&L(G,q,{hiLevel:w}),G.reverse(),C&&C.reverse(),G.join("")},L=function(k,C,q){var G,J,ae,H,V,Y=-1,U=k.length,D=0,j=[],z=w?c:g,Z=[];for(b=!1,i=!1,a=!1,J=0;J<U;J++)Z[J]=_(k[J]);for(ae=0;ae<U;ae++){if(V=D,j[ae]=M(k,Z,j,ae),G=240&(D=z[V][y[j[ae]]]),D&=15,C[ae]=H=z[D][5],G>0)if(G===16){for(J=Y;J<ae;J++)C[J]=1;Y=-1}else Y=-1;if(z[D][6])Y===-1&&(Y=ae);else if(Y>-1){for(J=Y;J<ae;J++)C[J]=H;Y=-1}Z[ae]==="B"&&(C[ae]=0),q.hiLevel|=H}a&&function(re,W,Q){for(var se=0;se<Q;se++)if(re[se]==="S"){W[se]=w;for(var ue=se-1;ue>=0&&re[ue]==="WS";ue--)W[ue]=w}}(Z,C,U)},R=function(k,C,q,G,J){if(!(J.hiLevel<k)){if(k===1&&w===1&&!i)return C.reverse(),void(q&&q.reverse());for(var ae,H,V,Y,U=C.length,D=0;D<U;){if(G[D]>=k){for(V=D+1;V<U&&G[V]>=k;)V++;for(Y=D,H=V-1;Y<H;Y++,H--)ae=C[Y],C[Y]=C[H],C[H]=ae,q&&(ae=q[Y],q[Y]=q[H],q[H]=ae);D=V}D++}}},T=function(k,C,q){var G=k.split(""),J={hiLevel:w};return q||(q=[]),L(G,q,J),function(ae,H,V){if(V.hiLevel!==0&&f)for(var Y,U=0;U<ae.length;U++)H[U]===1&&(Y=E.indexOf(ae[U]))>=0&&(ae[U]=E[Y+1])}(G,q,J),R(2,G,C,q,J),R(1,G,C,q,J),G.join("")};return this.__bidiEngine__.doBidiReorder=function(k,C,q){if(function(J,ae){if(ae)for(var H=0;H<J.length;H++)ae[H]=H;o===void 0&&(o=A(J)),d===void 0&&(d=A(J))}(k,C),l||!u||d)if(l&&u&&o^d)w=o?1:0,k=O(k,C,q);else if(!l&&u&&d)w=o?1:0,k=T(k,C,q),k=O(k,C);else if(!l||o||u||d){if(l&&!u&&o^d)k=O(k,C),o?(w=0,k=T(k,C,q)):(w=1,k=T(k,C,q),k=O(k,C));else if(l&&o&&!u&&d)w=1,k=T(k,C,q),k=O(k,C);else if(!l&&!u&&o^d){var G=f;o?(w=1,k=T(k,C,q),w=0,f=!1,k=T(k,C,q),f=G):(w=0,k=T(k,C,q),k=O(k,C),w=1,f=!1,k=T(k,C,q),f=G,k=O(k,C))}}else w=0,k=T(k,C,q);else w=o?1:0,k=T(k,C,q);return k},this.__bidiEngine__.setOptions=function(k){k&&(l=k.isInputVisual,u=k.isOutputVisual,o=k.isInputRtl,d=k.isOutputRtl,f=k.isSymmetricSwapping)},this.__bidiEngine__.setOptions(n),this.__bidiEngine__};var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],r=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(n){var i=n.text;n.x,n.y;var a=n.options||{};n.mutex,a.lang;var l=[];if(a.isInputVisual=typeof a.isInputVisual!="boolean"||a.isInputVisual,r.setOptions(a),Object.prototype.toString.call(i)==="[object Array]"){var o=0;for(l=[],o=0;o<i.length;o+=1)Object.prototype.toString.call(i[o])==="[object Array]"?l.push([r.doBidiReorder(i[o][0]),i[o][1],i[o][2]]):l.push([r.doBidiReorder(i[o])]);n.text=l}else n.text=r.doBidiReorder(i);r.setOptions({isInputVisual:!0})}])}(Kt),Kt.API.TTFFont=function(){function e(t){var r;if(this.rawData=t,r=this.contents=new nf(t),this.contents.pos=4,r.readString(4)==="ttcf")throw new Error("TTCF not supported.");r.pos=0,this.parse(),this.subset=new VR(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new NR(this.contents),this.head=new TR(this),this.name=new jR(this),this.cmap=new C7(this),this.toUnicode={},this.hhea=new RR(this),this.maxp=new DR(this),this.hmtx=new BR(this),this.post=new IR(this),this.os2=new MR(this),this.loca=new HR(this),this.glyf=new zR(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var t,r,n,i,a;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var l,o,u,d;for(d=[],l=0,o=(u=this.bbox).length;l<o;l++)t=u[l],d.push(Math.round(t*this.scaleFactor));return d}).call(this),this.stemV=0,this.post.exists?(n=255&(i=this.post.italic_angle),32768&(r=i>>16)&&(r=-(1+(65535^r))),this.italicAngle=+(r+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(a=this.familyClass)===1||a===2||a===3||a===4||a===5||a===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(t){var r;return((r=this.cmap.unicode)!=null?r.codeMap[t]:void 0)||0},e.prototype.widthOfGlyph=function(t){var r;return r=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*r},e.prototype.widthOfString=function(t,r,n){var i,a,l,o;for(l=0,a=0,o=(t=""+t).length;0<=o?a<o:a>o;a=0<=o?++a:--a)i=t.charCodeAt(a),l+=this.widthOfGlyph(this.characterToGlyph(i))+n*(1e3/r)||0;return l*(r/1e3)},e.prototype.lineHeight=function(t,r){var n;return r==null&&(r=!1),n=r?this.lineGap:0,(this.ascender+n-this.decender)/1e3*t},e}();var Hl,nf=function(){function e(t){this.data=t??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(t){return this.data[this.pos++]=t},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},e.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},e.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},e.prototype.readString=function(t){var r,n;for(n=[],r=0;0<=t?r<t:r>t;r=0<=t?++r:--r)n[r]=String.fromCharCode(this.readByte());return n.join("")},e.prototype.writeString=function(t){var r,n,i;for(i=[],r=0,n=t.length;0<=n?r<n:r>n;r=0<=n?++r:--r)i.push(this.writeByte(t.charCodeAt(r)));return i},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(t){return this.writeInt16(t)},e.prototype.readLongLong=function(){var t,r,n,i,a,l,o,u;return t=this.readByte(),r=this.readByte(),n=this.readByte(),i=this.readByte(),a=this.readByte(),l=this.readByte(),o=this.readByte(),u=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^r)+1099511627776*(255^n)+4294967296*(255^i)+16777216*(255^a)+65536*(255^l)+256*(255^o)+(255^u)+1):72057594037927940*t+281474976710656*r+1099511627776*n+4294967296*i+16777216*a+65536*l+256*o+u},e.prototype.writeLongLong=function(t){var r,n;return r=Math.floor(t/4294967296),n=4294967295&t,this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(t){return this.writeInt32(t)},e.prototype.read=function(t){var r,n;for(r=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)r.push(this.readByte());return r},e.prototype.write=function(t){var r,n,i,a;for(a=[],n=0,i=t.length;n<i;n++)r=t[n],a.push(this.writeByte(r));return a},e}(),NR=function(){var e;function t(r){var n,i,a;for(this.scalarType=r.readInt(),this.tableCount=r.readShort(),this.searchRange=r.readShort(),this.entrySelector=r.readShort(),this.rangeShift=r.readShort(),this.tables={},i=0,a=this.tableCount;0<=a?i<a:i>a;i=0<=a?++i:--i)n={tag:r.readString(4),checksum:r.readInt(),offset:r.readInt(),length:r.readInt()},this.tables[n.tag]=n}return t.prototype.encode=function(r){var n,i,a,l,o,u,d,f,v,g,c,y,x;for(x in c=Object.keys(r).length,u=Math.log(2),v=16*Math.floor(Math.log(c)/u),l=Math.floor(v/u),f=16*c-v,(i=new nf).writeInt(this.scalarType),i.writeShort(c),i.writeShort(v),i.writeShort(l),i.writeShort(f),a=16*c,d=i.pos+a,o=null,y=[],r)for(g=r[x],i.writeString(x),i.writeInt(e(g)),i.writeInt(d),i.writeInt(g.length),y=y.concat(g),x==="head"&&(o=d),d+=g.length;d%4;)y.push(0),d++;return i.write(y),n=2981146554-e(i.data),i.pos=o+8,i.writeUInt32(n),i.data},e=function(r){var n,i,a,l;for(r=N7.call(r);r.length%4;)r.push(0);for(a=new nf(r),i=0,n=0,l=r.length;n<l;n=n+=4)i+=a.readUInt32();return 4294967295&i},t}(),LR={}.hasOwnProperty,Tu=function(e,t){for(var r in t)LR.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e};Hl=function(){function e(t){var r;this.file=t,r=this.file.directory.tables[this.tag],this.exists=!!r,r&&(this.offset=r.offset,this.length=r.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var TR=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Tu(e,Hl),e.prototype.tag="head",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},e.prototype.encode=function(t){var r;return(r=new nf).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(t),r.writeShort(this.glyphDataFormat),r.data},e}(),Bw=function(){function e(t,r){var n,i,a,l,o,u,d,f,v,g,c,y,x,E,S,b,w;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=r+t.readInt(),v=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(u=0;u<256;++u)this.codeMap[u]=t.readByte();break;case 4:for(c=t.readUInt16(),g=c/2,t.pos+=6,a=function(){var _,A;for(A=[],u=_=0;0<=g?_<g:_>g;u=0<=g?++_:--_)A.push(t.readUInt16());return A}(),t.pos+=2,x=function(){var _,A;for(A=[],u=_=0;0<=g?_<g:_>g;u=0<=g?++_:--_)A.push(t.readUInt16());return A}(),d=function(){var _,A;for(A=[],u=_=0;0<=g?_<g:_>g;u=0<=g?++_:--_)A.push(t.readUInt16());return A}(),f=function(){var _,A;for(A=[],u=_=0;0<=g?_<g:_>g;u=0<=g?++_:--_)A.push(t.readUInt16());return A}(),i=(this.length-t.pos+this.offset)/2,o=function(){var _,A;for(A=[],u=_=0;0<=i?_<i:_>i;u=0<=i?++_:--_)A.push(t.readUInt16());return A}(),u=S=0,w=a.length;S<w;u=++S)for(E=a[u],n=b=y=x[u];y<=E?b<=E:b>=E;n=y<=E?++b:--b)f[u]===0?l=n+d[u]:(l=o[f[u]/2+(n-y)-(g-u)]||0)!==0&&(l+=d[u]),this.codeMap[n]=65535&l}t.pos=v}return e.encode=function(t,r){var n,i,a,l,o,u,d,f,v,g,c,y,x,E,S,b,w,_,A,M,O,L,R,T,k,C,q,G,J,ae,H,V,Y,U,D,j,z,Z,re,W,Q,se,ue,le,ye,Re;switch(G=new nf,l=Object.keys(t).sort(function(Me,Pe){return Me-Pe}),r){case"macroman":for(x=0,E=function(){var Me=[];for(y=0;y<256;++y)Me.push(0);return Me}(),b={0:0},a={},J=0,Y=l.length;J<Y;J++)b[ue=t[i=l[J]]]==null&&(b[ue]=++x),a[i]={old:t[i],new:b[t[i]]},E[i]=b[t[i]];return G.writeUInt16(1),G.writeUInt16(0),G.writeUInt32(12),G.writeUInt16(0),G.writeUInt16(262),G.writeUInt16(0),G.write(E),{charMap:a,subtable:G.data,maxGlyphID:x+1};case"unicode":for(C=[],v=[],w=0,b={},n={},S=d=null,ae=0,U=l.length;ae<U;ae++)b[A=t[i=l[ae]]]==null&&(b[A]=++w),n[i]={old:A,new:b[A]},o=b[A]-i,S!=null&&o===d||(S&&v.push(S),C.push(i),d=o),S=i;for(S&&v.push(S),v.push(65535),C.push(65535),T=2*(R=C.length),L=2*Math.pow(Math.log(R)/Math.LN2,2),g=Math.log(L/2)/Math.LN2,O=2*R-L,u=[],M=[],c=[],y=H=0,D=C.length;H<D;y=++H){if(k=C[y],f=v[y],k===65535){u.push(0),M.push(0);break}if(k-(q=n[k].new)>=32768)for(u.push(0),M.push(2*(c.length+R-y)),i=V=k;k<=f?V<=f:V>=f;i=k<=f?++V:--V)c.push(n[i].new);else u.push(q-k),M.push(0)}for(G.writeUInt16(3),G.writeUInt16(1),G.writeUInt32(12),G.writeUInt16(4),G.writeUInt16(16+8*R+2*c.length),G.writeUInt16(0),G.writeUInt16(T),G.writeUInt16(L),G.writeUInt16(g),G.writeUInt16(O),Q=0,j=v.length;Q<j;Q++)i=v[Q],G.writeUInt16(i);for(G.writeUInt16(0),se=0,z=C.length;se<z;se++)i=C[se],G.writeUInt16(i);for(le=0,Z=u.length;le<Z;le++)o=u[le],G.writeUInt16(o);for(ye=0,re=M.length;ye<re;ye++)_=M[ye],G.writeUInt16(_);for(Re=0,W=c.length;Re<W;Re++)x=c[Re],G.writeUInt16(x);return{charMap:n,subtable:G.data,maxGlyphID:w+1}}},e}(),C7=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Tu(e,Hl),e.prototype.tag="cmap",e.prototype.parse=function(t){var r,n,i;for(t.pos=this.offset,this.version=t.readUInt16(),i=t.readUInt16(),this.tables=[],this.unicode=null,n=0;0<=i?n<i:n>i;n=0<=i?++n:--n)r=new Bw(t,this.offset),this.tables.push(r),r.isUnicode&&this.unicode==null&&(this.unicode=r);return!0},e.encode=function(t,r){var n,i;return r==null&&(r="macroman"),n=Bw.encode(t,r),(i=new nf).writeUInt16(0),i.writeUInt16(1),n.table=i.data.concat(n.subtable),n},e}(),RR=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Tu(e,Hl),e.prototype.tag="hhea",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},e}(),MR=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Tu(e,Hl),e.prototype.tag="OS/2",e.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=function(){var r,n;for(n=[],r=0;r<10;++r)n.push(t.readByte());return n}(),this.charRange=function(){var r,n;for(n=[],r=0;r<4;++r)n.push(t.readInt());return n}(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=function(){var r,n;for(n=[],r=0;r<2;r=++r)n.push(t.readInt());return n}(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},e}(),IR=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Tu(e,Hl),e.prototype.tag="post",e.prototype.parse=function(t){var r,n,i;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:case 196608:break;case 131072:var a;for(n=t.readUInt16(),this.glyphNameIndex=[],a=0;0<=n?a<n:a>n;a=0<=n?++a:--a)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],i=[];t.pos<this.offset+this.length;)r=t.readByte(),i.push(this.names.push(t.readString(r)));return i;case 151552:return n=t.readUInt16(),this.offsets=t.read(n);case 262144:return this.map=(function(){var l,o,u;for(u=[],a=l=0,o=this.file.maxp.numGlyphs;0<=o?l<o:l>o;a=0<=o?++l:--l)u.push(t.readUInt32());return u}).call(this)}},e}(),FR=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},jR=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Tu(e,Hl),e.prototype.tag="name",e.prototype.parse=function(t){var r,n,i,a,l,o,u,d,f,v,g;for(t.pos=this.offset,t.readShort(),r=t.readShort(),o=t.readShort(),n=[],a=0;0<=r?a<r:a>r;a=0<=r?++a:--a)n.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+o+t.readShort()});for(u={},a=f=0,v=n.length;f<v;a=++f)i=n[a],t.pos=i.offset,d=t.readString(i.length),l=new FR(d,i),u[g=i.nameID]==null&&(u[g]=[]),u[i.nameID].push(l);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]},e}(),DR=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Tu(e,Hl),e.prototype.tag="maxp",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},e}(),BR=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Tu(e,Hl),e.prototype.tag="hmtx",e.prototype.parse=function(t){var r,n,i,a,l,o,u;for(t.pos=this.offset,this.metrics=[],r=0,o=this.file.hhea.numberOfMetrics;0<=o?r<o:r>o;r=0<=o?++r:--r)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var d,f;for(f=[],r=d=0;0<=i?d<i:d>i;r=0<=i?++d:--d)f.push(t.readInt16());return f}(),this.widths=(function(){var d,f,v,g;for(g=[],d=0,f=(v=this.metrics).length;d<f;d++)a=v[d],g.push(a.advance);return g}).call(this),n=this.widths[this.widths.length-1],u=[],r=l=0;0<=i?l<i:l>i;r=0<=i?++l:--l)u.push(this.widths.push(n));return u},e.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},e}(),N7=[].slice,zR=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Tu(e,Hl),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(t){var r,n,i,a,l,o,u,d,f,v;return t in this.cache?this.cache[t]:(a=this.file.loca,r=this.file.contents,n=a.indexOf(t),(i=a.lengthOf(t))===0?this.cache[t]=null:(r.pos=this.offset+n,l=(o=new nf(r.read(i))).readShort(),d=o.readShort(),v=o.readShort(),u=o.readShort(),f=o.readShort(),this.cache[t]=l===-1?new qR(o,d,v,u,f):new UR(o,l,d,v,u,f),this.cache[t]))},e.prototype.encode=function(t,r,n){var i,a,l,o,u;for(l=[],a=[],o=0,u=r.length;o<u;o++)i=t[r[o]],a.push(l.length),i&&(l=l.concat(i.encode(n)));return a.push(l.length),{table:l,offsets:a}},e}(),UR=function(){function e(t,r,n,i,a,l){this.raw=t,this.numberOfContours=r,this.xMin=n,this.yMin=i,this.xMax=a,this.yMax=l,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),qR=function(){function e(t,r,n,i,a){var l,o;for(this.raw=t,this.xMin=r,this.yMin=n,this.xMax=i,this.yMax=a,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],l=this.raw;o=l.readShort(),this.glyphOffsets.push(l.pos),this.glyphIDs.push(l.readUInt16()),32&o;)l.pos+=1&o?4:2,128&o?l.pos+=8:64&o?l.pos+=4:8&o&&(l.pos+=2)}return e.prototype.encode=function(){var t,r,n;for(r=new nf(N7.call(this.raw.data)),t=0,n=this.glyphIDs.length;t<n;++t)r.pos=this.glyphOffsets[t];return r.data},e}(),HR=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Tu(e,Hl),e.prototype.tag="loca",e.prototype.parse=function(t){var r,n;return t.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*t.readUInt16());return a}).call(this):(function(){var i,a;for(a=[],n=0,i=this.length;n<i;n+=4)a.push(t.readUInt32());return a}).call(this)},e.prototype.indexOf=function(t){return this.offsets[t]},e.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},e.prototype.encode=function(t,r){for(var n=new Uint32Array(this.offsets.length),i=0,a=0,l=0;l<n.length;++l)if(n[l]=i,a<r.length&&r[a]==l){++a,n[l]=i;var o=this.offsets[l],u=this.offsets[l+1]-o;u>0&&(i+=u)}for(var d=new Array(4*n.length),f=0;f<n.length;++f)d[4*f+3]=255&n[f],d[4*f+2]=(65280&n[f])>>8,d[4*f+1]=(16711680&n[f])>>16,d[4*f]=(4278190080&n[f])>>24;return d},e}(),VR=function(){function e(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var t,r,n,i,a;for(r in i=this.font.cmap.tables[0].codeMap,t={},a=this.subset)n=a[r],t[r]=i[n];return t},e.prototype.glyphsFor=function(t){var r,n,i,a,l,o,u;for(i={},l=0,o=t.length;l<o;l++)i[a=t[l]]=this.font.glyf.glyphFor(a);for(a in r=[],i)(n=i[a])!=null&&n.compound&&r.push.apply(r,n.glyphIDs);if(r.length>0)for(a in u=this.glyphsFor(r))n=u[a],i[a]=n;return i},e.prototype.encode=function(t,r){var n,i,a,l,o,u,d,f,v,g,c,y,x,E,S;for(i in n=C7.encode(this.generateCmap(),"unicode"),l=this.glyphsFor(t),c={0:0},S=n.charMap)c[(u=S[i]).old]=u.new;for(y in g=n.maxGlyphID,l)y in c||(c[y]=g++);return f=function(b){var w,_;for(w in _={},b)_[b[w]]=w;return _}(c),v=Object.keys(f).sort(function(b,w){return b-w}),x=function(){var b,w,_;for(_=[],b=0,w=v.length;b<w;b++)o=v[b],_.push(f[o]);return _}(),a=this.font.glyf.encode(l,x,c),d=this.font.loca.encode(a.offsets,x),E={cmap:this.font.cmap.raw(),glyf:a.table,loca:d,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(r)},this.font.os2.exists&&(E["OS/2"]=this.font.os2.raw()),this.font.directory.encode(E)},e}();Kt.API.PDFObject=function(){var e;function t(){}return e=function(r,n){return(Array(n+1).join("0")+r).slice(-n)},t.convert=function(r){var n,i,a,l;if(Array.isArray(r))return"["+function(){var o,u,d;for(d=[],o=0,u=r.length;o<u;o++)n=r[o],d.push(t.convert(n));return d}().join(" ")+"]";if(typeof r=="string")return"/"+r;if(r?.isString)return"("+r+")";if(r instanceof Date)return"(D:"+e(r.getUTCFullYear(),4)+e(r.getUTCMonth(),2)+e(r.getUTCDate(),2)+e(r.getUTCHours(),2)+e(r.getUTCMinutes(),2)+e(r.getUTCSeconds(),2)+"Z)";if({}.toString.call(r)==="[object Object]"){for(i in a=["<<"],r)l=r[i],a.push("/"+i+" "+t.convert(l));return a.push(">>"),a.join(`
559
- `)}return""+r},t}();window.jspdf={jsPDF:Kt};LA(!1);f8("change-font-size");const GR=new URLSearchParams(location.search).get("key"),L7=gN({key:GR});window.store=L7;window.config={addGlobalFont:DA,unstable_useHtmlTextRender:HA,unstable_setTextVerticalResizeEnabled:UA,unstable_setTextOverflow:f8,onLoadError:jA,setAssetLoadTimeout:RA,setFontLoadTimeout:MA,unstable_setTextSplitAllowed:GA};const $R=Uw.createRoot(document.getElementById("root"));$R.render(ce.createElement(eL,{visiblePagesOffset:0,renderOnlyActivePage:!0,store:L7,components:{PageControls:()=>null,Tooltip:()=>null}}));export{Sn as _,Ch as c,lc as g};